@alook/app 0.0.88 → 0.0.89
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/bundled/email-worker/index.js +32 -8
- package/bundled/email-worker/wrangler.toml +1 -0
- package/bundled/web/.open-next/.build/durable-objects/queue.js +5 -5
- package/bundled/web/.open-next/assets/BUILD_ID +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0~u7o_o2s1c04.js +1 -0
- package/bundled/web/.open-next/cache/{-kpnfm6PFlHuGmHkAST-N → KvfOhYs-NnvSDHtWvLueA}/_global-error.cache +1 -1
- package/bundled/web/.open-next/cache/{-kpnfm6PFlHuGmHkAST-N → KvfOhYs-NnvSDHtWvLueA}/_not-found.cache +1 -1
- package/bundled/web/.open-next/cache/{-kpnfm6PFlHuGmHkAST-N → KvfOhYs-NnvSDHtWvLueA}/privacy.cache +1 -1
- package/bundled/web/.open-next/cache/{-kpnfm6PFlHuGmHkAST-N → KvfOhYs-NnvSDHtWvLueA}/sitemap.xml.cache +1 -1
- package/bundled/web/.open-next/cloudflare/cache-assets-manifest.sql +1 -1
- package/bundled/web/.open-next/cloudflare/init.js +1 -1
- package/bundled/web/.open-next/dynamodb-provider/dynamodb-cache.json +1 -1
- package/bundled/web/.open-next/middleware/handler.mjs +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/BUILD_ID +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/build-manifest.json +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/prerender-manifest.json +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/activity/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/chat/[convId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/chat/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/email/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/files/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/meetings/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/new/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/calendar/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/flags/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/help/email-setup/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/home/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/issues/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/runtimes/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/settings/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/threads/[traceId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/threads/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/unread/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_components_issues_issue-sheet_tsx_02fma1.._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-build-manifest.js +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-manifest.json +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.json +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs.meta.json +29 -29
- package/bundled/web/.open-next/server-functions/default/src/web/index.mjs +3 -3
- package/bundled/ws-do/index.js +4 -0
- package/bundled/ws-do/wrangler.toml +1 -0
- package/package.json +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0yhw7i91nm01l.js +0 -1
- /package/bundled/web/.open-next/assets/_next/static/{-kpnfm6PFlHuGmHkAST-N → KvfOhYs-NnvSDHtWvLueA}/_buildManifest.js +0 -0
- /package/bundled/web/.open-next/assets/_next/static/{-kpnfm6PFlHuGmHkAST-N → KvfOhYs-NnvSDHtWvLueA}/_clientMiddlewareManifest.js +0 -0
- /package/bundled/web/.open-next/assets/_next/static/{-kpnfm6PFlHuGmHkAST-N → KvfOhYs-NnvSDHtWvLueA}/_ssgManifest.js +0 -0
- /package/bundled/web/.open-next/cache/{-kpnfm6PFlHuGmHkAST-N → KvfOhYs-NnvSDHtWvLueA}/robots.txt.cache +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[963744,540858,698824,207461,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(7455),e=a.i(732254),f=a.i(889624),g=a.i(25668),h=a.i(722393),i=a.i(647651);let j=(0,i.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);a.s(["ArrowUp",0,j],540858);var k=a.i(549931),l=a.i(307992),m=a.i(390759),n=a.i(858767),o=a.i(16831),p=a.i(113010),q=a.i(463295),r=a.i(26822),s=a.i(75118),t=a.i(921584);a.i(343563);var u=a.i(347788),v=a.i(588339);let w=(0,i.default)("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"}]]),x=new Set(["application/json","application/xml","application/javascript","application/typescript","application/x-yaml","application/toml","application/sql"]);function y(a){return!!(a.startsWith("text/")||x.has(a))}function z(a){return a.startsWith("text/html")}function A(a){return a.startsWith("image/")}function B(a){return y(a.content_type)||A(a.content_type)}function C(a,b,c){let d=new URLSearchParams({workspace_id:b});return c&&d.set("download","1"),`/api/artifacts/${a}/content?${d}`}function D({artifact:a,workspaceId:d}){let[e,f]=(0,c.useState)(null),[g,h]=(0,c.useState)(!1),i=C(a.id,d);if((0,c.useEffect)(()=>{y(a.content_type)&&!z(a.content_type)&&(h(!0),f(null),(0,v.getArtifactContent)(a.id,d).then(f).catch(()=>f("(failed to load content)")).finally(()=>h(!1)))},[a.id,a.content_type,d]),g)return(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(o.Loader2,{className:"size-5 animate-spin text-muted-foreground"})});if(A(a.content_type))return(0,b.jsx)("div",{className:"flex justify-center",children:(0,b.jsx)("img",{src:i,alt:a.filename,className:"max-w-full rounded-md"})});if(z(a.content_type))return(0,b.jsx)(E,{url:i,title:a.filename});if(y(a.content_type)){var j;return(j=a.filename,/\.md$/i.test(j))?(0,b.jsx)("div",{className:"markdown text-sm",children:(0,b.jsx)(u.Streamdown,{children:e??""})}):(0,b.jsx)("pre",{className:"whitespace-pre-wrap text-sm font-mono text-foreground",children:e})}return(0,b.jsxs)("div",{className:"flex flex-col items-center gap-3 py-8 text-center",children:[(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"This file type cannot be previewed."}),(0,b.jsxs)("a",{href:C(a.id,d,!0),download:a.filename,className:"inline-flex items-center gap-1.5 rounded-md border border-input bg-background px-3 py-1.5 text-sm font-medium hover:bg-accent hover:text-accent-foreground transition-colors",children:[(0,b.jsx)(w,{className:"size-3.5"}),"Download"]})]})}function E({url:a,title:c}){return(0,b.jsx)("iframe",{src:a,sandbox:"allow-same-origin",className:"w-full h-full rounded-b-xl overflow-hidden",style:{border:"none",display:"block"},title:c})}a.s(["ArtifactContentRenderer",0,D,"computeArtifactVersions",0,function(a){let b=new Map;for(let c of a){let a=b.get(c.filename)||[];a.push(c),b.set(c.filename,a)}let c=new Map,d=new Set;for(let[a,e]of b)e.sort((a,b)=>a.created_at.localeCompare(b.created_at)),e.length>1&&d.add(a),e.forEach((a,b)=>c.set(a.id,b+1));return{versionMap:c,duplicateFilenames:d}},"getArtifactUrl",0,C,"isHtmlType",0,z,"isPreviewable",0,B],698824);var F=a.i(510698),G=a.i(321932);function H(a){return a<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`}a.s(["ArtifactSheet",0,function({open:a,onOpenChange:f,artifacts:g,workspaceId:h,initialArtifact:i=null,versionMap:j,duplicateFilenames:k}){let[l,m]=(0,c.useState)(null),[n,o]=(0,c.useState)(448),p=(0,c.useRef)(!1);(0,c.useEffect)(()=>{a&&i&&m(i)},[a,i]);let q=a=>{f(a),a||setTimeout(()=>m(null),300)},r=(0,c.useCallback)(a=>{a.preventDefault(),p.current=!0,a.target.setPointerCapture(a.pointerId)},[]),t=(0,c.useCallback)(a=>{p.current&&o(Math.min(.8*window.innerWidth,Math.max(320,window.innerWidth-a.clientX)))},[]),u=(0,c.useCallback)(()=>{p.current=!1},[]);return(0,b.jsx)(d.Sheet,{open:a,onOpenChange:q,children:(0,b.jsxs)(d.SheetContent,{side:"right",showCloseButton:!1,style:{width:`min(${n}px, 100vw)`,maxWidth:"none"},className:"data-[side=right]:sm:inset-y-2 data-[side=right]:sm:right-2 data-[side=right]:sm:h-auto data-[side=right]:sm:rounded-xl data-[side=right]:sm:border",children:[(0,b.jsx)("div",{onPointerDown:r,onPointerMove:t,onPointerUp:u,className:"hidden sm:block absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize z-10 hover:bg-primary/20 active:bg-primary/30 transition-colors rounded-l-xl"}),l?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.SheetHeader,{children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.Button,{variant:"ghost",size:"icon-sm",className:"shrink-0 sm:hidden",onClick:()=>{g.length>1?m(null):q(!1)},children:(0,b.jsx)(G.ArrowLeft,{className:"size-4"})}),(0,b.jsxs)(d.SheetTitle,{className:"truncate flex-1",children:[l.filename,k.has(l.filename)&&(0,b.jsxs)("span",{className:"ml-1.5 text-xs text-muted-foreground bg-muted rounded-full px-1.5 py-0.5 font-normal",children:["v",j.get(l.id)??1]})]}),(0,b.jsx)(e.Button,{variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>window.open(C(l.id,h,!0),"_blank"),children:(0,b.jsx)(w,{className:"size-4"})})]})}),(0,b.jsx)(d.SheetBody,{className:(0,s.cn)("thin-scrollbar",z(l.content_type)&&"p-0! overflow-hidden!"),children:(0,b.jsx)(D,{artifact:l,workspaceId:h})})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.SheetHeader,{children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.Button,{variant:"ghost",size:"icon-sm",className:"shrink-0 sm:hidden",onClick:()=>q(!1),children:(0,b.jsx)(G.ArrowLeft,{className:"size-4"})}),(0,b.jsx)(d.SheetTitle,{className:"flex-1",children:"Artifacts"})]})}),(0,b.jsx)(d.SheetBody,{className:"thin-scrollbar",children:0===g.length?(0,b.jsx)("p",{className:"text-sm text-muted-foreground py-8 text-center",children:"No artifacts uploaded yet."}):(0,b.jsx)("div",{className:"space-y-1",children:g.map(a=>(0,b.jsxs)("button",{onClick:()=>m(a),className:"flex items-center gap-3 w-full rounded-lg px-3 py-2.5 text-left hover:bg-muted/50 transition-colors",children:[(0,b.jsx)(F.FileText,{className:"size-4 shrink-0 text-muted-foreground"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("p",{className:"text-sm font-medium truncate",children:[a.filename,k.has(a.filename)&&(0,b.jsxs)("span",{className:"ml-1.5 text-xs text-muted-foreground bg-muted rounded-full px-1.5 py-0.5 font-normal",children:["v",j.get(a.id)??1]})]}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:[H(a.size)," · ",new Date(a.created_at).toLocaleString()]})]})]},a.id))})})]})]})})},"formatSize",0,H],207461),a.i(974936);var I=a.i(988024);a.i(735132);var J=a.i(325848),K=a.i(22902);let L="h-7 border-0 bg-transparent px-1.5 text-xs text-foreground hover:bg-accent transition-colors -ml-1.5",M=(0,s.cn)(L,"rounded-md outline-none focus-visible:bg-accent focus-visible:ring-0 appearance-none pr-6"),N=["todo","in_progress","review","done"];function O({agent:a,size:c=24}){let d=(0,J.parseAvatarUrl)(a?.avatar_url);return d?(0,b.jsx)(J.AvatarRenderer,{config:d,size:c,className:"shrink-0 rounded-full"}):(0,b.jsx)("span",{className:"flex shrink-0 items-center justify-center rounded-full border border-border bg-muted text-[11px] font-medium text-muted-foreground",style:{width:c,height:c},children:(a?.name??"?").slice(0,1).toUpperCase()})}function P({agent:a,size:c=24}){let d=a.email_handle?`${a.email_handle}@alook.ai`:"";return(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,b.jsx)(O,{agent:a,size:c}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[(0,b.jsx)("div",{className:"truncate text-xs font-medium",children:a.name}),d?(0,b.jsx)("div",{className:"truncate text-[11px] text-muted-foreground",children:d}):null]})]})}function Q({icon:a,children:c}){return(0,b.jsxs)("div",{className:"group flex items-center gap-2",children:[(0,b.jsx)("span",{className:"inline-flex size-6 shrink-0 items-center justify-center text-muted-foreground",children:a}),(0,b.jsx)("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:c})]})}function R({message:a}){return"event"===a.role?(0,b.jsx)("div",{className:"rounded-md border bg-muted/50 text-muted-foreground text-xs px-3 py-2",children:a.content}):(0,b.jsxs)("div",{className:"rounded-lg border border-border/60 bg-background/55 p-3",children:[(0,b.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{className:"capitalize",children:a.role}),(0,b.jsx)("span",{children:new Date(a.created_at).toLocaleString()})]}),(0,b.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-none text-sm wrap-break-word",children:(0,b.jsx)(u.Streamdown,{children:a.content})})]})}function S({comment:a,agents:c}){let d="agent"===a.author_type?c.find(b=>b.id===a.author_id)?.name??"Agent":"You";return(0,b.jsxs)("div",{className:"rounded-lg border border-border/60 bg-background p-3",children:[(0,b.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-medium",children:d}),(0,b.jsx)("span",{children:new Date(a.created_at).toLocaleString()})]}),(0,b.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-none text-sm wrap-break-word",children:(0,b.jsx)(u.Streamdown,{children:a.content})})]})}function T({artifacts:a,workspaceId:c,onArtifactClick:d}){if(0===a.length)return null;let e="flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-accent";return(0,b.jsx)("div",{className:"space-y-1",children:a.map(a=>{let f=d&&B(a),g=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(m.File,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.filename}),(0,b.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:H(a.size)})]});return f?(0,b.jsx)("button",{type:"button",onClick:()=>d(a),className:(0,s.cn)(e,"w-full text-left"),children:g},a.id):(0,b.jsx)("a",{href:C(a.id,c,!0),target:"_blank",rel:"noopener noreferrer",className:e,children:g},a.id)})})}a.s(["IssueSheet",0,function({open:a,onOpenChange:i,agents:m,issue:u,detail:w,detailLoading:x,activeTask:y,traceTasks:z,submitting:A,defaultAgentId:B,slug:C,workspaceId:D,width:E=448,onWidthChange:F,draft:G,onDraftChange:H,onCreate:J,onUpdate:U,onStatusChange:V,onCommented:W,onDispatched:X,onArtifactClick:Y}){let Z,$,_=u?"detail":"create",[aa,ab]=(0,c.useState)(""),[ac,ad]=(0,c.useState)(""),[ae,af]=(0,c.useState)(B??""),[ag,ah]=(0,c.useState)(!1),[ai,aj]=(0,c.useState)(""),[ak,al]=(0,c.useState)(!1),[am,an]=(0,c.useState)(null),[ao,ap]=(0,c.useState)(!1),aq=(0,c.useRef)(null),ar=(0,c.useRef)(null),as=(0,c.useRef)(null),at=(0,c.useRef)(!1),au=y&&!["completed","failed","cancelled","superseded"].includes(y.status),av=z?.some(a=>["queued","dispatched","running"].includes(a.status))??!1;(0,c.useEffect)(()=>{a&&(u?(ab(u.title),ad(u.description??"")):(ab(G?.title??""),ad(G?.description??""),af(G?.agentId||B||"")))},[a,u?.id]),(0,c.useEffect)(()=>{"create"===_&&a&&H?.({title:aa,description:ac,agentId:ae})},[aa,ac,ae,_,a]),(0,c.useEffect)(()=>{as.current&&(as.current.scrollTop=as.current.scrollHeight)},[w?.messages?.length,w?.comments?.length,z?.length]);let aw=(0,c.useRef)(null),ax=(0,c.useRef)(U);(0,c.useEffect)(()=>{ax.current=U},[U]);let ay=(0,c.useRef)(aa);(0,c.useEffect)(()=>{ay.current=aa},[aa]);let az=(0,c.useRef)(ac);(0,c.useEffect)(()=>{az.current=ac},[ac]);let aA=(0,c.useRef)(u);(0,c.useEffect)(()=>{aA.current=u},[u]);let aB=(0,c.useCallback)(()=>{aw.current&&clearTimeout(aw.current),aw.current=null;let a=aA.current;if(!a)return;let b=ay.current!==a.title,c=az.current!==(a.description??"");if(!b&&!c||!ay.current.trim())return;let d={};b&&(d.title=ay.current.trim()),c&&(d.description=az.current.trim()),ax.current?.(a.id,d)},[]);(0,c.useEffect)(()=>{if("detail"!==_||!u||!a)return;let b=aa!==u.title,c=ac!==(u.description??"");if((b||c)&&aa.trim())return aw.current&&clearTimeout(aw.current),aw.current=setTimeout(aB,500),()=>{aw.current&&clearTimeout(aw.current)}},[aa,ac,_,u,a,aB]);let aC=(0,c.useRef)(a);(0,c.useEffect)(()=>{aC.current&&!a&&"detail"===_&&aB(),aC.current=a},[a,_,aB]);let aD=(0,c.useCallback)(a=>{let b=a??aq.current;b&&(b.style.height="auto",b.style.height=`${b.scrollHeight}px`)},[]);(0,c.useEffect)(()=>{requestAnimationFrame(()=>aD())},[aa,aD]);let aE=(0,c.useCallback)(a=>{a.preventDefault(),at.current=!0,a.target.setPointerCapture(a.pointerId)},[]),aF=(0,c.useCallback)(a=>{if(!at.current)return;let b=Math.min(.8*window.innerWidth,Math.max(320,window.innerWidth-a.clientX));F?.(b)},[F]),aG=(0,c.useCallback)(()=>{at.current=!1},[]),aH=async()=>{aa.trim()&&!A&&await J?.({agent_id:ae||void 0,title:aa.trim(),description:ac.trim()})},aI=async()=>{if(ai.trim()&&!ak&&u){al(!0);try{if(!(await fetch(`/api/issues/${u.id}/comments?workspace_id=${D}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:ai.trim()})})).ok)throw Error("Failed to send comment");aj(""),W?.()}catch{t.toast.error("Failed to send comment")}finally{al(!1)}}},aJ=(0,c.useRef)(null),aK=(0,c.useCallback)(a=>{"Enter"===a.key&&a.shiftKey&&"create"===_&&(aJ.current&&aJ.current.contains(a.target)||(a.preventDefault(),a.stopPropagation(),aH()))},[_,aa,ac,ae,A]),aL="detail"===_&&u?.status==="todo",aM=m.find(a=>a.id===ae)??null,aN=u?.agent_id?m.find(a=>a.id===u.agent_id)??null:null,[aO,aP]=(0,c.useState)("issue");(0,c.useEffect)(()=>{aP("issue")},[u?.id,_]);let aQ=(0,b.jsx)(b.Fragment,{children:x?(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)(g.Skeleton,{className:"h-12"}),(0,b.jsx)(g.Skeleton,{className:"h-8"}),(0,b.jsx)(g.Skeleton,{className:"h-12"})]}):0!==($=[...(w?.messages??[]).filter(a=>"event"===a.role).map(a=>({kind:"event",id:a.id,created_at:a.created_at,data:a})),...(w?.comments??[]).map(a=>({kind:"comment",id:a.id,created_at:a.created_at,data:a}))].sort((a,b)=>new Date(a.created_at).getTime()-new Date(b.created_at).getTime())).length||au?(0,b.jsxs)("div",{className:"relative pl-4",children:[(0,b.jsx)("div",{className:"absolute left-[4.5px] top-2 bottom-2 w-px bg-border"}),(0,b.jsxs)("div",{className:"space-y-3",children:[$.map(a=>(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("div",{className:"absolute -left-4 top-2.5 size-2.5 rounded-full border-2 border-background bg-muted-foreground/40"}),"event"===a.kind?(0,b.jsx)(R,{message:a.data}):(0,b.jsx)(S,{comment:a.data,agents:m})]},a.id)),(au||av)&&((Z=z?.filter(a=>["queued","dispatched","running"].includes(a.status)))&&Z.length>0?Z.map(a=>{let c="running"===a.status;return(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("div",{className:(0,s.cn)("absolute -left-4 top-2.5 size-2.5 rounded-full border-2 border-background",c?"bg-emerald-500 animate-pulse":"bg-muted-foreground/40")}),(0,b.jsx)("div",{className:(0,s.cn)("rounded-md border px-3 py-2.5",c?"border-emerald-500/30 bg-emerald-500/10":"border-border/60 bg-muted/30"),children:(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[a.agent&&(0,b.jsx)(O,{agent:{avatar_url:a.agent.avatarUrl,name:a.agent.name},size:16}),(0,b.jsxs)("span",{className:c?"text-emerald-600 dark:text-emerald-400":"text-muted-foreground",children:[a.agent?.name??"Agent"," ",c?"is working":"— queued"]})]})})]},a.id)}):(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("div",{className:"absolute -left-4 top-2.5 size-2.5 rounded-full border-2 border-background bg-emerald-500 animate-pulse"}),(0,b.jsx)("div",{className:"rounded-md border border-emerald-500/30 bg-emerald-500/10 px-3 py-2.5",children:(0,b.jsx)("div",{className:"flex items-center gap-2 text-xs text-emerald-600 dark:text-emerald-400",children:"Working"})})]}))]})]}):(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:"No activity yet."})}),aR="detail"!==_||!u||aL||au||(0,I.isTerminalIssueStatus)(u.status)?null:(0,b.jsxs)("div",{className:"flex flex-col rounded-xl border bg-background/60 transition-colors duration-200 focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50",children:[(0,b.jsx)("textarea",{ref:aJ,placeholder:"Leave a comment...",value:ai,onChange:a=>aj(a.target.value),className:"w-full resize-none bg-transparent px-3.5 py-2.5 text-sm leading-relaxed outline-none placeholder:text-muted-foreground field-sizing-content min-h-15 max-h-32 thin-scrollbar overflow-y-auto",onKeyDown:a=>{"Enter"===a.key&&a.shiftKey&&(a.preventDefault(),aI())}}),(0,b.jsxs)("div",{className:"flex items-center justify-between px-2.5 pb-2 pt-0.5",children:[(0,b.jsx)("kbd",{className:"text-[11px] text-muted-foreground/50 font-sans select-none",children:"⇧↵"}),(0,b.jsx)(e.Button,{size:"icon-sm",onClick:aI,disabled:!ai.trim()||ak,className:(0,s.cn)("rounded-lg transition-opacity duration-200",!ai.trim()&&!ak&&"opacity-40"),children:ak?(0,b.jsx)(o.Loader2,{className:"size-3.5 animate-spin"}):(0,b.jsx)(j,{className:"size-3.5"})})]})]}),aS=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"shrink-0 px-2 sm:px-3 pt-5 pb-1",children:(0,b.jsx)("textarea",{ref:a=>{aq.current=a,aD(a)},value:aa,onChange:a=>{ab(a.target.value),aD(a.target)},onKeyDown:a=>{if("Enter"===a.key&&!a.shiftKey){a.preventDefault();let b=ar.current?.querySelector('[contenteditable="true"]');b?.focus()}},placeholder:"create"===_?"New issue":"Untitled",autoFocus:"create"===_,rows:1,className:"w-full resize-none overflow-hidden rounded-none border-0 bg-transparent px-0 py-1 font-news text-2xl md:text-3xl font-medium leading-[1.2] tracking-tight shadow-none outline-none focus-visible:border-0 focus-visible:ring-0 focus-visible:ring-offset-0 placeholder:text-muted-foreground/40 placeholder:font-normal"})}),(0,b.jsxs)("div",{className:"shrink-0 space-y-1.5 px-2 sm:px-3 py-2",children:[(0,b.jsx)(Q,{icon:(0,b.jsx)(q.User,{className:"size-3.5"}),children:"create"===_||aL?(0,b.jsxs)(h.Popover,{open:ag,onOpenChange:ah,children:[(0,b.jsx)(h.PopoverTrigger,{render:(0,b.jsx)("button",{type:"button",disabled:A||ao,className:(0,s.cn)(L,"flex items-center gap-1.5 rounded-md")}),children:aM?(0,b.jsx)("span",{className:"truncate",children:aM.name}):(0,b.jsx)("span",{className:"text-muted-foreground/70",children:"Unassigned"})}),(0,b.jsxs)(h.PopoverContent,{align:"start",className:"max-h-64 w-72 overflow-y-auto thin-scrollbar p-1",children:[!aL&&(0,b.jsxs)("button",{type:"button",onClick:()=>{af(""),ah(!1)},className:"flex w-full items-center justify-between gap-2 rounded-md px-2 py-2 text-left text-sm transition-colors hover:bg-accent hover:text-accent-foreground",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"None (unassigned)"}),ae?null:(0,b.jsx)(k.Check,{className:"size-3.5 shrink-0"})]}),m.map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>{aL?an(a):af(a.id),ah(!1)},className:"flex w-full items-center justify-between gap-2 rounded-md px-2 py-2 text-left text-sm transition-colors hover:bg-accent hover:text-accent-foreground",children:[(0,b.jsx)(P,{agent:a,size:18}),ae===a.id?(0,b.jsx)(k.Check,{className:"size-3.5 shrink-0"}):null]},a.id))]})]}):(0,b.jsx)("span",{className:"text-xs truncate",children:aN?aN.name:(0,b.jsx)("span",{className:"text-muted-foreground/70",children:"Unassigned"})})}),"detail"===_&&u&&(0,b.jsx)(Q,{icon:(0,b.jsx)(l.CircleDot,{className:"size-3.5"}),children:(0,b.jsx)("select",{value:u.status,onChange:a=>{var b;return b=a.target.value,void(u&&b!==u.status&&V?.(u.id,b))},className:M,children:(aL?["todo","done"]:N).map(a=>(0,b.jsx)("option",{value:a,children:"done"===a?"Complete":a.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())},a))})}),"detail"===_&&u?.agent_id&&u?.conversation_id&&(0,b.jsx)(Q,{icon:(0,b.jsx)(p.MessageSquare,{className:"size-3.5"}),children:(0,b.jsx)(r.default,{href:`/w/${C}/agents/${u.agent_id}?conv=${u.conversation_id}${u.latest_task_id?`&task=${u.latest_task_id}`:""}`,className:(0,s.cn)(L,"inline-flex items-center rounded-md"),children:"Chat"})}),"detail"===_&&w?.traceId&&(0,b.jsx)(Q,{icon:(0,b.jsx)(n.GitBranch,{className:"size-3.5"}),children:(0,b.jsx)(r.default,{href:`/w/${C}/threads/${w.traceId}`,className:(0,s.cn)(L,"inline-flex items-center rounded-md"),children:"Thread"})})]}),(0,b.jsx)("div",{className:(0,s.cn)("px-2 sm:px-3 py-2 flex-1 min-h-0 overflow-y-auto thin-scrollbar"),ref:ar,children:(0,b.jsx)(f.MarkdownEditor,{value:ac,onChange:ad,placeholder:"Describe the issue...",minHeight:"create"===_?"10rem":"4rem",variant:"seamless",contentType:"markdown",agents:m},u?.id??"new")}),"detail"===_&&w?.artifacts&&w.artifacts.length>0&&(0,b.jsx)("div",{className:"shrink-0 px-2 sm:px-3 py-2",children:(0,b.jsx)(T,{artifacts:w.artifacts,workspaceId:D,onArtifactClick:Y})})]});return(0,b.jsxs)(d.Sheet,{open:a,onOpenChange:i,children:[(0,b.jsxs)(d.SheetContent,{side:"right",showCloseButton:!1,className:"data-[side=right]:sm:inset-y-2 data-[side=right]:sm:right-2 data-[side=right]:sm:h-auto data-[side=right]:sm:rounded-xl data-[side=right]:sm:border overflow-visible",style:{width:`min(${E}px, 100vw)`,maxWidth:"none"},children:[(0,b.jsx)("div",{onPointerDown:aE,onPointerMove:aF,onPointerUp:aG,onLostPointerCapture:aG,className:"hidden sm:block absolute -left-px top-0 bottom-0 w-1.5 cursor-col-resize z-10 hover:bg-primary/20 active:bg-primary/30 transition-colors rounded-l-xl"}),"detail"===_&&!aL&&(0,b.jsxs)("div",{className:"hidden lg:flex absolute right-full top-0 bottom-0 mr-2 w-90 flex-col rounded-xl border bg-background shadow-lg overflow-hidden",children:[(0,b.jsx)("div",{className:"shrink-0 flex items-center border-b px-4 py-2.5",children:(0,b.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Activity"})}),(0,b.jsx)("div",{ref:as,className:"flex-1 min-h-0 overflow-y-auto thin-scrollbar px-4 py-4 space-y-3",children:aQ}),aR&&(0,b.jsx)("div",{className:"shrink-0 border-t px-4 py-3",children:aR})]}),(0,b.jsx)(d.SheetTitle,{className:"sr-only",children:"create"===_?"New Issue":u?.title??"Issue"}),(0,b.jsxs)("div",{className:"flex flex-1 min-h-0 flex-col",onKeyDownCapture:aK,children:["detail"===_&&!aL&&(0,b.jsxs)("div",{className:"shrink-0 flex items-center gap-1 border-b px-2 py-1.5 lg:hidden",children:[(0,b.jsx)("button",{type:"button",onClick:()=>aP("issue"),className:(0,s.cn)("rounded-md px-2.5 py-1 text-xs font-medium transition-colors","issue"===aO?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"),children:"Issue"}),(0,b.jsx)("button",{type:"button",onClick:()=>aP("activity"),className:(0,s.cn)("rounded-md px-2.5 py-1 text-xs font-medium transition-colors","activity"===aO?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"),children:"Activity"})]}),(0,b.jsxs)(d.SheetBody,{className:"flex flex-col gap-0 p-0 overflow-hidden",children:[(0,b.jsx)("div",{className:(0,s.cn)("flex flex-col flex-1 min-h-0","detail"===_&&"activity"===aO&&"hidden lg:flex"),children:aS}),"detail"===_&&!aL&&"activity"===aO&&(0,b.jsxs)("div",{className:"flex flex-col flex-1 min-h-0 lg:hidden",children:[(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto thin-scrollbar px-3 py-4 space-y-3",children:aQ}),aR&&(0,b.jsx)("div",{className:"shrink-0 border-t px-3 py-3",children:aR})]})]}),"create"===_&&(0,b.jsxs)(d.SheetFooter,{children:[(0,b.jsx)(e.Button,{variant:"outline",size:"sm",onClick:()=>i(!1),disabled:A,children:"Cancel"}),(0,b.jsxs)(e.Button,{size:"sm",onClick:aH,disabled:!aa.trim()||A,children:[A&&(0,b.jsx)(o.Loader2,{className:"mr-1.5 size-3.5 animate-spin"}),(0,b.jsxs)("kbd",{className:"mr-1 hidden sm:inline-flex items-center gap-0.5 font-sans font-medium leading-none opacity-60",children:[(0,b.jsx)("span",{children:"⇧"}),(0,b.jsx)("span",{children:"+"}),(0,b.jsx)("span",{children:"⏎"})]}),"Create"]})]})]})]}),(0,b.jsx)(K.ConfirmDialog,{open:!!am,onOpenChange:a=>{a||an(null)},title:"Run issue?",description:`This issue will be assigned to ${am?.name??"the agent"} and start running immediately.`,confirmLabel:"Run",loadingLabel:"Running...",confirmVariant:"default",loading:ao,onConfirm:async()=>{if(am&&u){ap(!0);try{await (0,v.updateIssue)(D,u.id,{agent_id:am.id}),an(null),X?.(u.id)}catch(a){t.toast.error(a instanceof Error?a.message:"Failed to dispatch issue"),an(null)}finally{ap(!1)}}}})]})}],963744)}];
|
|
1
|
+
module.exports=[963744,540858,698824,207461,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(7455),e=a.i(732254),f=a.i(889624),g=a.i(25668),h=a.i(722393),i=a.i(647651);let j=(0,i.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);a.s(["ArrowUp",0,j],540858);var k=a.i(549931),l=a.i(307992),m=a.i(390759),n=a.i(858767),o=a.i(16831),p=a.i(113010),q=a.i(463295),r=a.i(73270),s=a.i(26822),t=a.i(75118),u=a.i(921584);a.i(343563);var v=a.i(347788),w=a.i(588339);let x=(0,i.default)("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"}]]),y=new Set(["application/json","application/xml","application/javascript","application/typescript","application/x-yaml","application/toml","application/sql"]);function z(a){return!!(a.startsWith("text/")||y.has(a))}function A(a){return a.startsWith("text/html")}function B(a){return a.startsWith("image/")}function C(a){return z(a.content_type)||B(a.content_type)}function D(a,b,c){let d=new URLSearchParams({workspace_id:b});return c&&d.set("download","1"),`/api/artifacts/${a}/content?${d}`}function E({artifact:a,workspaceId:d}){let[e,f]=(0,c.useState)(null),[g,h]=(0,c.useState)(!1),i=D(a.id,d);if((0,c.useEffect)(()=>{z(a.content_type)&&!A(a.content_type)&&(h(!0),f(null),(0,w.getArtifactContent)(a.id,d).then(f).catch(()=>f("(failed to load content)")).finally(()=>h(!1)))},[a.id,a.content_type,d]),g)return(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(o.Loader2,{className:"size-5 animate-spin text-muted-foreground"})});if(B(a.content_type))return(0,b.jsx)("div",{className:"flex justify-center",children:(0,b.jsx)("img",{src:i,alt:a.filename,className:"max-w-full rounded-md"})});if(A(a.content_type))return(0,b.jsx)(F,{url:i,title:a.filename});if(z(a.content_type)){var j;return(j=a.filename,/\.md$/i.test(j))?(0,b.jsx)("div",{className:"markdown text-sm",children:(0,b.jsx)(v.Streamdown,{children:e??""})}):(0,b.jsx)("pre",{className:"whitespace-pre-wrap text-sm font-mono text-foreground",children:e})}return(0,b.jsxs)("div",{className:"flex flex-col items-center gap-3 py-8 text-center",children:[(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"This file type cannot be previewed."}),(0,b.jsxs)("a",{href:D(a.id,d,!0),download:a.filename,className:"inline-flex items-center gap-1.5 rounded-md border border-input bg-background px-3 py-1.5 text-sm font-medium hover:bg-accent hover:text-accent-foreground transition-colors",children:[(0,b.jsx)(x,{className:"size-3.5"}),"Download"]})]})}function F({url:a,title:c}){return(0,b.jsx)("iframe",{src:a,sandbox:"allow-same-origin",className:"w-full h-full rounded-b-xl overflow-hidden",style:{border:"none",display:"block"},title:c})}a.s(["ArtifactContentRenderer",0,E,"computeArtifactVersions",0,function(a){let b=new Map;for(let c of a){let a=b.get(c.filename)||[];a.push(c),b.set(c.filename,a)}let c=new Map,d=new Set;for(let[a,e]of b)e.sort((a,b)=>a.created_at.localeCompare(b.created_at)),e.length>1&&d.add(a),e.forEach((a,b)=>c.set(a.id,b+1));return{versionMap:c,duplicateFilenames:d}},"getArtifactUrl",0,D,"isHtmlType",0,A,"isPreviewable",0,C],698824);var G=a.i(510698),H=a.i(321932);function I(a){return a<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`}a.s(["ArtifactSheet",0,function({open:a,onOpenChange:f,artifacts:g,workspaceId:h,initialArtifact:i=null,versionMap:j,duplicateFilenames:k}){let[l,m]=(0,c.useState)(null),[n,o]=(0,c.useState)(448),p=(0,c.useRef)(!1);(0,c.useEffect)(()=>{a&&i&&m(i)},[a,i]);let q=a=>{f(a),a||setTimeout(()=>m(null),300)},r=(0,c.useCallback)(a=>{a.preventDefault(),p.current=!0,a.target.setPointerCapture(a.pointerId)},[]),s=(0,c.useCallback)(a=>{p.current&&o(Math.min(.8*window.innerWidth,Math.max(320,window.innerWidth-a.clientX)))},[]),u=(0,c.useCallback)(()=>{p.current=!1},[]);return(0,b.jsx)(d.Sheet,{open:a,onOpenChange:q,children:(0,b.jsxs)(d.SheetContent,{side:"right",showCloseButton:!1,style:{width:`min(${n}px, 100vw)`,maxWidth:"none"},className:"data-[side=right]:sm:inset-y-2 data-[side=right]:sm:right-2 data-[side=right]:sm:h-auto data-[side=right]:sm:rounded-xl data-[side=right]:sm:border",children:[(0,b.jsx)("div",{onPointerDown:r,onPointerMove:s,onPointerUp:u,className:"hidden sm:block absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize z-10 hover:bg-primary/20 active:bg-primary/30 transition-colors rounded-l-xl"}),l?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.SheetHeader,{children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.Button,{variant:"ghost",size:"icon-sm",className:"shrink-0 sm:hidden",onClick:()=>{g.length>1?m(null):q(!1)},children:(0,b.jsx)(H.ArrowLeft,{className:"size-4"})}),(0,b.jsxs)(d.SheetTitle,{className:"truncate flex-1",children:[l.filename,k.has(l.filename)&&(0,b.jsxs)("span",{className:"ml-1.5 text-xs text-muted-foreground bg-muted rounded-full px-1.5 py-0.5 font-normal",children:["v",j.get(l.id)??1]})]}),(0,b.jsx)(e.Button,{variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>window.open(D(l.id,h,!0),"_blank"),children:(0,b.jsx)(x,{className:"size-4"})})]})}),(0,b.jsx)(d.SheetBody,{className:(0,t.cn)("thin-scrollbar",A(l.content_type)&&"p-0! overflow-hidden!"),children:(0,b.jsx)(E,{artifact:l,workspaceId:h})})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.SheetHeader,{children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.Button,{variant:"ghost",size:"icon-sm",className:"shrink-0 sm:hidden",onClick:()=>q(!1),children:(0,b.jsx)(H.ArrowLeft,{className:"size-4"})}),(0,b.jsx)(d.SheetTitle,{className:"flex-1",children:"Artifacts"})]})}),(0,b.jsx)(d.SheetBody,{className:"thin-scrollbar",children:0===g.length?(0,b.jsx)("p",{className:"text-sm text-muted-foreground py-8 text-center",children:"No artifacts uploaded yet."}):(0,b.jsx)("div",{className:"space-y-1",children:g.map(a=>(0,b.jsxs)("button",{onClick:()=>m(a),className:"flex items-center gap-3 w-full rounded-lg px-3 py-2.5 text-left hover:bg-muted/50 transition-colors",children:[(0,b.jsx)(G.FileText,{className:"size-4 shrink-0 text-muted-foreground"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("p",{className:"text-sm font-medium truncate",children:[a.filename,k.has(a.filename)&&(0,b.jsxs)("span",{className:"ml-1.5 text-xs text-muted-foreground bg-muted rounded-full px-1.5 py-0.5 font-normal",children:["v",j.get(a.id)??1]})]}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:[I(a.size)," · ",new Date(a.created_at).toLocaleString()]})]})]},a.id))})})]})]})})},"formatSize",0,I],207461),a.i(974936);var J=a.i(988024);a.i(735132);var K=a.i(325848),L=a.i(22902);let M="h-7 border-0 bg-transparent px-1.5 text-xs text-foreground hover:bg-accent transition-colors -ml-1.5",N=(0,t.cn)(M,"rounded-md outline-none focus-visible:bg-accent focus-visible:ring-0 appearance-none pr-6"),O=["todo","in_progress","review","done"];function P({agent:a,size:c=24}){let d=(0,K.parseAvatarUrl)(a?.avatar_url);return d?(0,b.jsx)(K.AvatarRenderer,{config:d,size:c,className:"shrink-0 rounded-full"}):(0,b.jsx)("span",{className:"flex shrink-0 items-center justify-center rounded-full border border-border bg-muted text-[11px] font-medium text-muted-foreground",style:{width:c,height:c},children:(a?.name??"?").slice(0,1).toUpperCase()})}function Q({agent:a,size:c=24}){let d=a.email_handle?`${a.email_handle}@alook.ai`:"";return(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,b.jsx)(P,{agent:a,size:c}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[(0,b.jsx)("div",{className:"truncate text-xs font-medium",children:a.name}),d?(0,b.jsx)("div",{className:"truncate text-[11px] text-muted-foreground",children:d}):null]})]})}function R({icon:a,children:c}){return(0,b.jsxs)("div",{className:"group flex items-center gap-2",children:[(0,b.jsx)("span",{className:"inline-flex size-6 shrink-0 items-center justify-center text-muted-foreground",children:a}),(0,b.jsx)("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:c})]})}function S({message:a}){return"event"===a.role?(0,b.jsx)("div",{className:"rounded-md border bg-muted/50 text-muted-foreground text-xs px-3 py-2",children:a.content}):(0,b.jsxs)("div",{className:"rounded-lg border border-border/60 bg-background/55 p-3",children:[(0,b.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{className:"capitalize",children:a.role}),(0,b.jsx)("span",{children:new Date(a.created_at).toLocaleString()})]}),(0,b.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-none text-sm wrap-break-word",children:(0,b.jsx)(v.Streamdown,{children:a.content})})]})}function T({comment:a,agents:c}){let d="agent"===a.author_type?c.find(b=>b.id===a.author_id)?.name??"Agent":"You";return(0,b.jsxs)("div",{className:"rounded-lg border border-border/60 bg-background p-3",children:[(0,b.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-medium",children:d}),(0,b.jsx)("span",{children:new Date(a.created_at).toLocaleString()})]}),(0,b.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-none text-sm wrap-break-word",children:(0,b.jsx)(v.Streamdown,{children:a.content})})]})}function U({artifacts:a,workspaceId:c,onArtifactClick:d}){if(0===a.length)return null;let e="flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-accent";return(0,b.jsx)("div",{className:"space-y-1",children:a.map(a=>{let f=d&&C(a),g=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(m.File,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.filename}),(0,b.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:I(a.size)})]});return f?(0,b.jsx)("button",{type:"button",onClick:()=>d(a),className:(0,t.cn)(e,"w-full text-left"),children:g},a.id):(0,b.jsx)("a",{href:D(a.id,c,!0),target:"_blank",rel:"noopener noreferrer",className:e,children:g},a.id)})})}a.s(["IssueSheet",0,function({open:a,onOpenChange:i,agents:m,issue:v,detail:x,detailLoading:y,activeTask:z,traceTasks:A,submitting:B,defaultAgentId:C,slug:D,workspaceId:E,width:F=448,onWidthChange:G,draft:H,onDraftChange:I,onCreate:K,onUpdate:V,onStatusChange:W,onCommented:X,onDispatched:Y,onArtifactClick:Z}){let $,_,aa=v?"detail":"create",[ab,ac]=(0,c.useState)(""),[ad,ae]=(0,c.useState)(""),[af,ag]=(0,c.useState)(C??""),[ah,ai]=(0,c.useState)(!1),[aj,ak]=(0,c.useState)(""),[al,am]=(0,c.useState)(!1),[an,ao]=(0,c.useState)(null),[ap,aq]=(0,c.useState)(!1),ar=(0,c.useRef)(null),as=(0,c.useRef)(null),at=(0,c.useRef)(null),au=(0,c.useRef)(!1),av=z&&!["completed","failed","cancelled","superseded"].includes(z.status),aw=A?.some(a=>["queued","dispatched","running"].includes(a.status))??!1;(0,c.useEffect)(()=>{a&&(v?(ac(v.title),ae(v.description??"")):(ac(H?.title??""),ae(H?.description??""),ag(H?.agentId||C||"")))},[a,v?.id]),(0,c.useEffect)(()=>{"create"===aa&&a&&I?.({title:ab,description:ad,agentId:af})},[ab,ad,af,aa,a]),(0,c.useEffect)(()=>{at.current&&(at.current.scrollTop=at.current.scrollHeight)},[x?.messages?.length,x?.comments?.length,A?.length]);let ax=(0,c.useRef)(null),ay=(0,c.useRef)(V);(0,c.useEffect)(()=>{ay.current=V},[V]);let az=(0,c.useRef)(ab);(0,c.useEffect)(()=>{az.current=ab},[ab]);let aA=(0,c.useRef)(ad);(0,c.useEffect)(()=>{aA.current=ad},[ad]);let aB=(0,c.useRef)(v);(0,c.useEffect)(()=>{aB.current=v},[v]);let aC=(0,c.useCallback)(()=>{ax.current&&clearTimeout(ax.current),ax.current=null;let a=aB.current;if(!a)return;let b=az.current!==a.title,c=aA.current!==(a.description??"");if(!b&&!c||!az.current.trim())return;let d={};b&&(d.title=az.current.trim()),c&&(d.description=aA.current.trim()),ay.current?.(a.id,d)},[]);(0,c.useEffect)(()=>{if("detail"!==aa||!v||!a)return;let b=ab!==v.title,c=ad!==(v.description??"");if((b||c)&&ab.trim())return ax.current&&clearTimeout(ax.current),ax.current=setTimeout(aC,500),()=>{ax.current&&clearTimeout(ax.current)}},[ab,ad,aa,v,a,aC]);let aD=(0,c.useRef)(a);(0,c.useEffect)(()=>{aD.current&&!a&&"detail"===aa&&aC(),aD.current=a},[a,aa,aC]);let aE=(0,c.useCallback)(a=>{let b=a??ar.current;b&&(b.style.height="auto",b.style.height=`${b.scrollHeight}px`)},[]);(0,c.useEffect)(()=>{requestAnimationFrame(()=>aE())},[ab,aE]);let aF=(0,c.useCallback)(a=>{a.preventDefault(),au.current=!0,a.target.setPointerCapture(a.pointerId)},[]),aG=(0,c.useCallback)(a=>{if(!au.current)return;let b=Math.min(.8*window.innerWidth,Math.max(320,window.innerWidth-a.clientX));G?.(b)},[G]),aH=(0,c.useCallback)(()=>{au.current=!1},[]),aI=async()=>{ab.trim()&&!B&&await K?.({agent_id:af||void 0,title:ab.trim(),description:ad.trim()})},aJ=async()=>{if(aj.trim()&&!al&&v){am(!0);try{if(!(await fetch(`/api/issues/${v.id}/comments?workspace_id=${E}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:aj.trim()})})).ok)throw Error("Failed to send comment");ak(""),X?.()}catch{u.toast.error("Failed to send comment")}finally{am(!1)}}},aK=(0,c.useRef)(null),aL=(0,c.useCallback)(a=>{"Enter"===a.key&&a.shiftKey&&"create"===aa&&(aK.current&&aK.current.contains(a.target)||(a.preventDefault(),a.stopPropagation(),aI()))},[aa,ab,ad,af,B]),aM="detail"===aa&&v?.status==="todo",aN=m.find(a=>a.id===af)??null,aO=v?.agent_id?m.find(a=>a.id===v.agent_id)??null:null,[aP,aQ]=(0,c.useState)("issue");(0,c.useEffect)(()=>{aQ("issue")},[v?.id,aa]);let aR=(0,b.jsx)(b.Fragment,{children:y?(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)(g.Skeleton,{className:"h-12"}),(0,b.jsx)(g.Skeleton,{className:"h-8"}),(0,b.jsx)(g.Skeleton,{className:"h-12"})]}):0!==(_=[...(x?.messages??[]).filter(a=>"event"===a.role).map(a=>({kind:"event",id:a.id,created_at:a.created_at,data:a})),...(x?.comments??[]).map(a=>({kind:"comment",id:a.id,created_at:a.created_at,data:a}))].sort((a,b)=>new Date(a.created_at).getTime()-new Date(b.created_at).getTime())).length||av?(0,b.jsxs)("div",{className:"relative pl-4",children:[(0,b.jsx)("div",{className:"absolute left-[4.5px] top-2 bottom-2 w-px bg-border"}),(0,b.jsxs)("div",{className:"space-y-3",children:[_.map(a=>(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("div",{className:"absolute -left-4 top-2.5 size-2.5 rounded-full border-2 border-background bg-muted-foreground/40"}),"event"===a.kind?(0,b.jsx)(S,{message:a.data}):(0,b.jsx)(T,{comment:a.data,agents:m})]},a.id)),(av||aw)&&(($=A?.filter(a=>["queued","dispatched","running"].includes(a.status)))&&$.length>0?$.map(a=>{let c="running"===a.status;return(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("div",{className:(0,t.cn)("absolute -left-4 top-2.5 size-2.5 rounded-full border-2 border-background",c?"bg-emerald-500 animate-pulse":"bg-muted-foreground/40")}),(0,b.jsx)("div",{className:(0,t.cn)("rounded-md border px-3 py-2.5",c?"border-emerald-500/30 bg-emerald-500/10":"border-border/60 bg-muted/30"),children:(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[a.agent&&(0,b.jsx)(P,{agent:{avatar_url:a.agent.avatarUrl,name:a.agent.name},size:16}),(0,b.jsxs)("span",{className:c?"text-emerald-600 dark:text-emerald-400":"text-muted-foreground",children:[a.agent?.name??"Agent"," ",c?"is working":"— queued"]})]})})]},a.id)}):(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("div",{className:"absolute -left-4 top-2.5 size-2.5 rounded-full border-2 border-background bg-emerald-500 animate-pulse"}),(0,b.jsx)("div",{className:"rounded-md border border-emerald-500/30 bg-emerald-500/10 px-3 py-2.5",children:(0,b.jsx)("div",{className:"flex items-center gap-2 text-xs text-emerald-600 dark:text-emerald-400",children:"Working"})})]}))]})]}):(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:"No activity yet."})}),aS="detail"!==aa||!v||aM||av||(0,J.isTerminalIssueStatus)(v.status)?null:(0,b.jsxs)("div",{className:"flex flex-col rounded-xl border bg-background/60 transition-colors duration-200 focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50",children:[(0,b.jsx)("textarea",{ref:aK,placeholder:"Leave a comment...",value:aj,onChange:a=>ak(a.target.value),className:"w-full resize-none bg-transparent px-3.5 py-2.5 text-sm leading-relaxed outline-none placeholder:text-muted-foreground field-sizing-content min-h-15 max-h-32 thin-scrollbar overflow-y-auto",onKeyDown:a=>{"Enter"===a.key&&a.shiftKey&&(a.preventDefault(),aJ())}}),(0,b.jsxs)("div",{className:"flex items-center justify-between px-2.5 pb-2 pt-0.5",children:[(0,b.jsx)("kbd",{className:"text-[11px] text-muted-foreground/50 font-sans select-none",children:"⇧↵"}),(0,b.jsx)(e.Button,{size:"icon-sm",onClick:aJ,disabled:!aj.trim()||al,className:(0,t.cn)("rounded-lg transition-opacity duration-200",!aj.trim()&&!al&&"opacity-40"),children:al?(0,b.jsx)(o.Loader2,{className:"size-3.5 animate-spin"}):(0,b.jsx)(j,{className:"size-3.5"})})]})]}),aT=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"shrink-0 px-2 sm:px-3 pt-5 pb-1",children:(0,b.jsx)("textarea",{ref:a=>{ar.current=a,aE(a)},value:ab,onChange:a=>{ac(a.target.value),aE(a.target)},onKeyDown:a=>{if("Enter"===a.key&&!a.shiftKey){a.preventDefault();let b=as.current?.querySelector('[contenteditable="true"]');b?.focus()}},placeholder:"create"===aa?"New issue":"Untitled",autoFocus:"create"===aa,rows:1,className:"w-full resize-none overflow-hidden rounded-none border-0 bg-transparent px-0 py-1 font-news text-2xl md:text-3xl font-medium leading-[1.2] tracking-tight shadow-none outline-none focus-visible:border-0 focus-visible:ring-0 focus-visible:ring-offset-0 placeholder:text-muted-foreground/40 placeholder:font-normal"})}),(0,b.jsxs)("div",{className:"shrink-0 space-y-1.5 px-2 sm:px-3 py-2",children:[(0,b.jsx)(R,{icon:(0,b.jsx)(q.User,{className:"size-3.5"}),children:"create"===aa||aM?(0,b.jsxs)(h.Popover,{open:ah,onOpenChange:ai,children:[(0,b.jsx)(h.PopoverTrigger,{render:(0,b.jsx)("button",{type:"button",disabled:B||ap,className:(0,t.cn)(M,"flex items-center gap-1.5 rounded-md")}),children:aN?(0,b.jsx)("span",{className:"truncate",children:aN.name}):(0,b.jsx)("span",{className:"text-muted-foreground/70",children:"Unassigned"})}),(0,b.jsxs)(h.PopoverContent,{align:"start",className:"max-h-64 w-72 overflow-y-auto thin-scrollbar p-1",children:[!aM&&(0,b.jsxs)("button",{type:"button",onClick:()=>{ag(""),ai(!1)},className:"flex w-full items-center justify-between gap-2 rounded-md px-2 py-2 text-left text-sm transition-colors hover:bg-accent hover:text-accent-foreground",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"None (unassigned)"}),af?null:(0,b.jsx)(k.Check,{className:"size-3.5 shrink-0"})]}),m.map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>{aM?ao(a):ag(a.id),ai(!1)},className:"flex w-full items-center justify-between gap-2 rounded-md px-2 py-2 text-left text-sm transition-colors hover:bg-accent hover:text-accent-foreground",children:[(0,b.jsx)(Q,{agent:a,size:18}),af===a.id?(0,b.jsx)(k.Check,{className:"size-3.5 shrink-0"}):null]},a.id))]})]}):(0,b.jsx)("span",{className:"text-xs truncate",children:aO?aO.name:(0,b.jsx)("span",{className:"text-muted-foreground/70",children:"Unassigned"})})}),"detail"===aa&&v&&(0,b.jsx)(R,{icon:(0,b.jsx)(l.CircleDot,{className:"size-3.5"}),children:(0,b.jsx)("select",{value:v.status,onChange:a=>{var b;return b=a.target.value,void(v&&b!==v.status&&W?.(v.id,b))},className:N,children:(aM?["todo","done"]:O).map(a=>(0,b.jsx)("option",{value:a,children:"done"===a?"Complete":a.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())},a))})}),"detail"===aa&&v?.agent_id&&v?.conversation_id&&(0,b.jsx)(R,{icon:(0,b.jsx)(p.MessageSquare,{className:"size-3.5"}),children:(0,b.jsx)(s.default,{href:`/w/${D}/agents/${v.agent_id}?conv=${v.conversation_id}${v.latest_task_id?`&task=${v.latest_task_id}`:""}`,className:(0,t.cn)(M,"inline-flex items-center rounded-md"),children:"Chat"})}),"detail"===aa&&x?.traceId&&(0,b.jsx)(R,{icon:(0,b.jsx)(n.GitBranch,{className:"size-3.5"}),children:(0,b.jsx)(s.default,{href:`/w/${D}/threads/${x.traceId}`,className:(0,t.cn)(M,"inline-flex items-center rounded-md"),children:"Thread"})})]}),(0,b.jsx)("div",{className:(0,t.cn)("px-2 sm:px-3 py-2 flex-1 min-h-0 overflow-y-auto thin-scrollbar"),ref:as,children:(0,b.jsx)(f.MarkdownEditor,{value:ad,onChange:ae,placeholder:"Describe the issue...",minHeight:"create"===aa?"10rem":"4rem",variant:"seamless",contentType:"markdown",agents:m},v?.id??"new")}),"detail"===aa&&x?.artifacts&&x.artifacts.length>0&&(0,b.jsx)("div",{className:"shrink-0 px-2 sm:px-3 py-2",children:(0,b.jsx)(U,{artifacts:x.artifacts,workspaceId:E,onArtifactClick:Z})})]});return(0,b.jsxs)(d.Sheet,{open:a,onOpenChange:i,children:[(0,b.jsxs)(d.SheetContent,{side:"right",showCloseButton:!1,className:"data-[side=right]:sm:inset-y-2 data-[side=right]:sm:right-2 data-[side=right]:sm:h-auto data-[side=right]:sm:rounded-xl data-[side=right]:sm:border overflow-visible",style:{width:`min(${F}px, 100vw)`,maxWidth:"none"},children:[(0,b.jsx)("div",{onPointerDown:aF,onPointerMove:aG,onPointerUp:aH,onLostPointerCapture:aH,className:"hidden sm:block absolute -left-px top-0 bottom-0 w-1.5 cursor-col-resize z-10 hover:bg-primary/20 active:bg-primary/30 transition-colors rounded-l-xl"}),(0,b.jsxs)(d.SheetClose,{render:(0,b.jsx)(e.Button,{variant:"ghost",size:"icon-sm"}),className:"absolute top-3 right-3 z-10 sm:hidden",children:[(0,b.jsx)(r.XIcon,{}),(0,b.jsx)("span",{className:"sr-only",children:"Close"})]}),"detail"===aa&&!aM&&(0,b.jsxs)("div",{className:"hidden lg:flex absolute right-full top-0 bottom-0 mr-2 w-90 flex-col rounded-xl border bg-background shadow-lg overflow-hidden",children:[(0,b.jsx)("div",{className:"shrink-0 flex items-center border-b px-4 py-2.5",children:(0,b.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Activity"})}),(0,b.jsx)("div",{ref:at,className:"flex-1 min-h-0 overflow-y-auto thin-scrollbar px-4 py-4 space-y-3",children:aR}),aS&&(0,b.jsx)("div",{className:"shrink-0 border-t px-4 py-3",children:aS})]}),(0,b.jsx)(d.SheetTitle,{className:"sr-only",children:"create"===aa?"New Issue":v?.title??"Issue"}),(0,b.jsxs)("div",{className:"flex flex-1 min-h-0 flex-col",onKeyDownCapture:aL,children:["detail"===aa&&!aM&&(0,b.jsxs)("div",{className:"shrink-0 flex items-center gap-1 border-b px-2 py-1.5 lg:hidden",children:[(0,b.jsx)("button",{type:"button",onClick:()=>aQ("issue"),className:(0,t.cn)("rounded-md px-2.5 py-1 text-xs font-medium transition-colors","issue"===aP?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"),children:"Issue"}),(0,b.jsx)("button",{type:"button",onClick:()=>aQ("activity"),className:(0,t.cn)("rounded-md px-2.5 py-1 text-xs font-medium transition-colors","activity"===aP?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"),children:"Activity"})]}),(0,b.jsxs)(d.SheetBody,{className:"flex flex-col gap-0 p-0 overflow-hidden",children:[(0,b.jsx)("div",{className:(0,t.cn)("flex flex-col flex-1 min-h-0","detail"===aa&&"activity"===aP&&"hidden lg:flex"),children:aT}),"detail"===aa&&!aM&&"activity"===aP&&(0,b.jsxs)("div",{className:"flex flex-col flex-1 min-h-0 lg:hidden",children:[(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto thin-scrollbar px-3 py-4 space-y-3",children:aR}),aS&&(0,b.jsx)("div",{className:"shrink-0 border-t px-3 py-3",children:aS})]})]}),"create"===aa&&(0,b.jsxs)(d.SheetFooter,{children:[(0,b.jsx)(e.Button,{variant:"outline",size:"sm",onClick:()=>i(!1),disabled:B,children:"Cancel"}),(0,b.jsxs)(e.Button,{size:"sm",onClick:aI,disabled:!ab.trim()||B,children:[B&&(0,b.jsx)(o.Loader2,{className:"mr-1.5 size-3.5 animate-spin"}),(0,b.jsxs)("kbd",{className:"mr-1 hidden sm:inline-flex items-center gap-0.5 font-sans font-medium leading-none opacity-60",children:[(0,b.jsx)("span",{children:"⇧"}),(0,b.jsx)("span",{children:"+"}),(0,b.jsx)("span",{children:"⏎"})]}),"Create"]})]})]})]}),(0,b.jsx)(L.ConfirmDialog,{open:!!an,onOpenChange:a=>{a||ao(null)},title:"Run issue?",description:`This issue will be assigned to ${an?.name??"the agent"} and start running immediately.`,confirmLabel:"Run",loadingLabel:"Running...",confirmVariant:"default",loading:ap,onConfirm:async()=>{if(an&&v){aq(!0);try{await (0,w.updateIssue)(E,v.id,{agent_id:an.id}),ao(null),Y?.(v.id)}catch(a){u.toast.error(a instanceof Error?a.message:"Failed to dispatch issue"),ao(null)}finally{aq(!1)}}}})]})}],963744)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_web_src_components_issues_issue-sheet_tsx_02fma1.._.js.map
|
|
@@ -7,9 +7,9 @@ globalThis.__BUILD_MANIFEST = {
|
|
|
7
7
|
"static/chunks/03~yq9q893hmn.js"
|
|
8
8
|
],
|
|
9
9
|
"lowPriorityFiles": [
|
|
10
|
-
"static
|
|
11
|
-
"static
|
|
12
|
-
"static
|
|
10
|
+
"static/KvfOhYs-NnvSDHtWvLueA/_buildManifest.js",
|
|
11
|
+
"static/KvfOhYs-NnvSDHtWvLueA/_ssgManifest.js",
|
|
12
|
+
"static/KvfOhYs-NnvSDHtWvLueA/_clientMiddlewareManifest.js"
|
|
13
13
|
],
|
|
14
14
|
"rootMainFiles": [
|
|
15
15
|
"static/chunks/0fus_woghk6f3.js",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"wasm": [],
|
|
26
26
|
"assets": [],
|
|
27
27
|
"env": {
|
|
28
|
-
"__NEXT_BUILD_ID": "-
|
|
29
|
-
"NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "
|
|
30
|
-
"__NEXT_PREVIEW_MODE_ID": "
|
|
31
|
-
"__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "
|
|
32
|
-
"__NEXT_PREVIEW_MODE_SIGNING_KEY": "
|
|
28
|
+
"__NEXT_BUILD_ID": "KvfOhYs-NnvSDHtWvLueA",
|
|
29
|
+
"NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "WcKh/xbXJ20NiFLD9EU/HxoQTNjj64WpOPOT1QFER9U=",
|
|
30
|
+
"__NEXT_PREVIEW_MODE_ID": "2848e245073b340ae4e72569e98dc5df",
|
|
31
|
+
"__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "dfadc2efead930235f301a2da0560f7b85616e3d63d63c04c60dda766fbe980d",
|
|
32
|
+
"__NEXT_PREVIEW_MODE_SIGNING_KEY": "a6ba3900462fc883bf0e61065aa01c9ab3cea20079f914062c06811a4f39184d"
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"
|
|
1
|
+
self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"WcKh/xbXJ20NiFLD9EU/HxoQTNjj64WpOPOT1QFER9U=\"\n}"
|