@alook/app 0.0.141 → 0.0.143
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/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/1ixdcdkpnwt_p.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{15gpqusfs36cs.js → 1kj_n-cbedl8a.js} +2 -2
- package/bundled/web/.open-next/assets/_next/static/chunks/{0eayyb8dzeuqj.js → 1lwe0daem0j5h.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{2jgr6hdohnj5b.js → 2p8ty_tin77ze.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{348z6y6iea4gl.js → 2s1nfdub5g-vr.js} +3 -3
- package/bundled/web/.open-next/assets/_next/static/chunks/35szcmuxsgm0x.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{2_5gjqjt8nmq2.js → 3yhuzg7vtzfp5.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{14mgvrpz4ar3j.js → 41hz62d13-2ps.js} +1 -1
- package/bundled/web/.open-next/cache/{n67RZ-dHYbiPuCBj-CPEs → 9TliiRuyS2VWuTgYBLJbH}/_global-error.cache +1 -1
- package/bundled/web/.open-next/cache/{n67RZ-dHYbiPuCBj-CPEs → 9TliiRuyS2VWuTgYBLJbH}/_not-found.cache +1 -1
- package/bundled/web/.open-next/cache/{n67RZ-dHYbiPuCBj-CPEs → 9TliiRuyS2VWuTgYBLJbH}/device.cache +1 -1
- package/bundled/web/.open-next/cache/{n67RZ-dHYbiPuCBj-CPEs → 9TliiRuyS2VWuTgYBLJbH}/privacy.cache +1 -1
- package/bundled/web/.open-next/cache/{n67RZ-dHYbiPuCBj-CPEs → 9TliiRuyS2VWuTgYBLJbH}/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 +4 -4
- 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/required-server-files.json +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/invite/[token]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/studio/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/[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]/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]/traces/[traceId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/traces/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/app/page/react-loadable-manifest.json +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__01-4zmn._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0bye0tx._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0gkkbf4._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0jrrtm1._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0xdps2u._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__1-ug-mf._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__12fz1lr._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__134-7z_._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__155l597._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__18lolj4._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__1cbaprg._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__1jq8zws._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__1l-2x7f._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__1pmcw25._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__1rfzkgk._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__1w9__7q._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__20s9whj._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_03i6uql._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0591v0o._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_08gc1s_._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0lcu68p._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0m_ehw8._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0p79t7w._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0r2vuif._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0tzvy_s._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_13jq647._.js +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_18v5918._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_1aztsqf._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_1d18okt._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_1i4egv6._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_1iaevpj._.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_1kt_xdj._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_1njwvhs._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/src_1j5rtq8._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0qgcnj5._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1wqw0ro._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_agents_[id]_layout_tsx_0ysqmgw._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_lib_api_ts_1ffelwp._.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 +34 -34
- package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs.meta.json +101 -101
- package/bundled/web/.open-next/server-functions/default/src/web/index.mjs +4 -4
- package/bundled/web/custom-worker.ts +16 -1
- package/package.json +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/2c9n34tpjgbko.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/447gx8byleobi.js +0 -1
- /package/bundled/web/.open-next/assets/_next/static/{n67RZ-dHYbiPuCBj-CPEs → 9TliiRuyS2VWuTgYBLJbH}/_buildManifest.js +0 -0
- /package/bundled/web/.open-next/assets/_next/static/{n67RZ-dHYbiPuCBj-CPEs → 9TliiRuyS2VWuTgYBLJbH}/_clientMiddlewareManifest.js +0 -0
- /package/bundled/web/.open-next/assets/_next/static/{n67RZ-dHYbiPuCBj-CPEs → 9TliiRuyS2VWuTgYBLJbH}/_ssgManifest.js +0 -0
- /package/bundled/web/.open-next/cache/{n67RZ-dHYbiPuCBj-CPEs → 9TliiRuyS2VWuTgYBLJbH}/robots.txt.cache +0 -0
|
@@ -156,7 +156,7 @@ var DOQueueHandler = class extends DurableObject {
|
|
|
156
156
|
method: "HEAD",
|
|
157
157
|
headers: {
|
|
158
158
|
// This is defined during build
|
|
159
|
-
"x-prerender-revalidate": "
|
|
159
|
+
"x-prerender-revalidate": "c2fdf758fc6f2203d18e05f31783beff",
|
|
160
160
|
"x-isr": "1"
|
|
161
161
|
},
|
|
162
162
|
// This one is kind of problematic, it will always show the wall time of the revalidation to `this.revalidationTimeout`
|
|
@@ -180,7 +180,7 @@ var DOQueueHandler = class extends DurableObject {
|
|
|
180
180
|
"INSERT OR REPLACE INTO sync (id, lastSuccess, buildId) VALUES (?, unixepoch(), ?)",
|
|
181
181
|
// We cannot use the deduplication id because it's not unique per route - every time a route is revalidated, the deduplication id is different.
|
|
182
182
|
`${host}${url}`,
|
|
183
|
-
"
|
|
183
|
+
"9TliiRuyS2VWuTgYBLJbH"
|
|
184
184
|
);
|
|
185
185
|
}
|
|
186
186
|
this.routeInFailedState.delete(msg.MessageDeduplicationId);
|
|
@@ -232,7 +232,7 @@ var DOQueueHandler = class extends DurableObject {
|
|
|
232
232
|
}
|
|
233
233
|
this.routeInFailedState.set(msg.MessageDeduplicationId, updatedFailedState);
|
|
234
234
|
if (!this.disableSQLite) {
|
|
235
|
-
this.sql.exec("INSERT OR REPLACE INTO failed_state (id, data, buildId) VALUES (?, ?, ?)", msg.MessageDeduplicationId, JSON.stringify(updatedFailedState), "
|
|
235
|
+
this.sql.exec("INSERT OR REPLACE INTO failed_state (id, data, buildId) VALUES (?, ?, ?)", msg.MessageDeduplicationId, JSON.stringify(updatedFailedState), "9TliiRuyS2VWuTgYBLJbH");
|
|
236
236
|
}
|
|
237
237
|
await this.addAlarm();
|
|
238
238
|
}
|
|
@@ -256,8 +256,8 @@ var DOQueueHandler = class extends DurableObject {
|
|
|
256
256
|
return;
|
|
257
257
|
this.sql.exec("CREATE TABLE IF NOT EXISTS failed_state (id TEXT PRIMARY KEY, data TEXT, buildId TEXT)");
|
|
258
258
|
this.sql.exec("CREATE TABLE IF NOT EXISTS sync (id TEXT PRIMARY KEY, lastSuccess INTEGER, buildId TEXT)");
|
|
259
|
-
this.sql.exec("DELETE FROM failed_state WHERE buildId != ?", "
|
|
260
|
-
this.sql.exec("DELETE FROM sync WHERE buildId != ?", "
|
|
259
|
+
this.sql.exec("DELETE FROM failed_state WHERE buildId != ?", "9TliiRuyS2VWuTgYBLJbH");
|
|
260
|
+
this.sql.exec("DELETE FROM sync WHERE buildId != ?", "9TliiRuyS2VWuTgYBLJbH");
|
|
261
261
|
const failedStateCursor = this.sql.exec("SELECT * FROM failed_state");
|
|
262
262
|
for (const row of failedStateCursor) {
|
|
263
263
|
this.routeInFailedState.set(row.id, JSON.parse(row.data));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
9TliiRuyS2VWuTgYBLJbH
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,945074,e=>{"use strict";let t=(0,e.i(419412).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",0,t],945074)},642342,e=>{"use strict";var t=e.i(811374),n=e.i(511043);let i=(0,e.i(613349).isLocalMode)(),r=Number(t.default.env.NEXT_PUBLIC_WS_DO_PORT)||8789,a=Number(t.default.env.NEXT_PUBLIC_WS_RECONNECT_DELAY_MS)||1e3,s=Number(t.default.env.NEXT_PUBLIC_WS_RECONNECT_MAX_DELAY_MS)||3e4;e.s(["useUserWs",0,function(e,t){let o=(0,n.useRef)(null),l=(0,n.useRef)(a),u=(0,n.useRef)(e),c=(0,n.useRef)(t?.onReconnect),d=(0,n.useRef)(null),f=(0,n.useRef)(!1),p=(0,n.useRef)(0),m=(0,n.useRef)(null),g=(0,n.useRef)(null);(0,n.useEffect)(()=>{u.current=e},[e]),(0,n.useEffect)(()=>{c.current=t?.onReconnect},[t?.onReconnect]);let h=(0,n.useRef)(null),$=(0,n.useCallback)(()=>{let e=Math.min(l.current,s);l.current=Math.min(2*e,s),d.current=setTimeout(()=>{h.current?.()},e+500*Math.random())},[]),b=(0,n.useCallback)(async()=>{let e,t,n,s=r;try{let n=await fetch("/api/ws/token");if(!n.ok){console.warn("[ws] token fetch failed:",n.status),$();return}let i=await n.json();e=i.userId,t=i.token,i.wsPort&&(s=i.wsPort)}catch(e){console.warn("[ws] token fetch error:",e),$();return}let d=i?`ws://localhost:${s}/?userId=${e}`:`${location.origin.replace("http","ws")}/api/ws/user?userId=${e}`;try{n=new WebSocket(d)}catch(e){console.warn("[ws] WebSocket creation failed:",e),$();return}o.current=n,n.onopen=()=>{l.current=a,n.send(JSON.stringify({type:"auth",token:t})),f.current&&c.current?.(),f.current=!0,p.current=Date.now(),m.current=setInterval(()=>{n.readyState===WebSocket.OPEN&&n.send("ping")},25e3),g.current=setInterval(()=>{Date.now()-p.current>3e4&&n.close()},5e3)},n.onmessage=e=>{p.current=Date.now();try{let t=JSON.parse(e.data);if("auth.ok"===t.type)return void n.send(JSON.stringify({type:"check_daemon_status"}));u.current(t)}catch{}},n.onerror=()=>{},n.onclose=()=>{n===o.current&&(m.current&&(clearInterval(m.current),m.current=null),g.current&&(clearInterval(g.current),g.current=null),$())}},[$]);return(0,n.useEffect)(()=>{h.current=b},[b]),(0,n.useEffect)(()=>(b(),()=>{null!==d.current&&(clearTimeout(d.current),d.current=null),m.current&&(clearInterval(m.current),m.current=null),g.current&&(clearInterval(g.current),g.current=null);let e=o.current;o.current=null,e?.close()}),[b]),{send:(0,n.useCallback)(e=>{let t=o.current;t&&t.readyState===WebSocket.OPEN&&t.send(JSON.stringify(e))},[])}}])},439769,e=>{"use strict";var t=e.i(811374);let n=`@${t.default.env.ALOOK_DOMAIN||"alook.ai"}`,i=/^[a-zA-Z0-9-]{3,}$/,r=new Set(["no-reply","noreply","admin","support","help","info","postmaster","abuse","security","mailer-daemon","root","webmaster","hostmaster","system","alook"]);e.s(["isValidHandle",0,function(e){return i.test(e)&&!r.has(e.toLowerCase())},"parseEmailHandle",0,function(e){return e.endsWith(n)?e.slice(0,-n.length):""},"toAlookAddress",0,function(e){return`${e}${n}`}])},126942,(e,t,n)=>{t.exports=e.r(871628)},222862,636557,e=>{"use strict";var t=e.i(811374);class n extends Error{status;details;constructor(e,t,n){super(e),this.name="ApiError",this.status=t,this.details=n}get isNetworkError(){return 0===this.status}get isRateLimit(){return 429===this.status}get isUnauthorized(){return 401===this.status}}function i(e,t){return"validation error"===e&&t?.length?function(e){let[t,...n]=e.split(":"),i=n.join(":").trim();if(!i)return e;let r=t.trim(),a=r.trim().replace(/[_-]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()),s=i.replace(/^required$/i,"is required"),o=s.toLowerCase().replace(/[_-]+/g," "),l=r.toLowerCase().replace(/[_-]+/g," ");return l&&o.startsWith(`${l} `)&&(s=s.slice(r.length).trimStart()),a?`${a} ${s}`:s}(t[0]):e}async function r(e,t){let r;try{r=await fetch(""+e,{...t,credentials:"include",headers:{"Content-Type":"application/json",...t?.headers}})}catch(e){if(e instanceof TypeError)throw new n("Unable to connect — check your network",0);throw e}if(401===r.status)throw window.location.href="/sign-in",new n("Unauthorized",401);if(!r.ok){let e,t;try{let n=await r.json();e=n.error,t=n.details}catch{}if(429===r.status)throw new n("Please wait a moment before trying again",429);if(r.status>=500)throw new n(i(e,t)||"Something went wrong — please try again",r.status,t);throw new n(i(e,t)||"Something went wrong",r.status,t)}if(204!==r.status)return r.json()}function a(e,t){let n=new URLSearchParams({workspace_id:e,...t});return`?${n.toString()}`}e.s(["ApiError",0,n],636557),parseInt(t.default.env.NEXT_PUBLIC_MOCK_NETWORK_DELAY_MS||"300",10);let s=async(e,t,i,s,o)=>{let l;if(!s||0===s.length)return r(`/api/conversations/${e}/messages${a(i)}`,{method:"POST",body:JSON.stringify({content:t,...o?{metadata:o}:{}})});let u=new FormData;for(let e of(u.append("content",t),o&&u.append("metadata",JSON.stringify(o)),s))u.append("file",e.file);for(let e=0;e<s.length;e++){let t=s[e].thumbnailBlob;t&&u.append(`thumbnail:${e}`,t,"thumbnail.jpg")}try{l=await fetch(`/api/conversations/${e}/messages${a(i)}`,{method:"POST",credentials:"include",body:u})}catch(e){if(e instanceof TypeError)throw new n("Unable to connect — check your network",0);throw e}if(401===l.status)throw window.location.href="/sign-in",new n("Unauthorized",401);if(!l.ok){let e,t;try{let n=await l.json();e=n.error,t=n.details}catch{}if(429===l.status)throw new n("Please wait a moment before trying again",429);if(l.status>=500)throw new n(e||"Something went wrong — please try again",l.status,t);throw new n(e||"Something went wrong",l.status,t)}return l.json()},o=async(e,t)=>{let n=new URLSearchParams({workspace_id:t}),i=await fetch(`/api/email/${e}/body?${n}`,{credentials:"include"});if(!i.ok)return{content:"(body not available)",isHtml:!1};let r=i.headers.get("Content-Type")??"";return{content:await i.text(),isHtml:r.includes("text/html")}},l=async(e,t)=>{let i=new FormData;i.append("file",e);let r=await fetch(`/api/email/upload${a(t)}`,{method:"POST",credentials:"include",body:i});if(!r.ok)throw new n(await r.text().catch(()=>"Upload failed"),r.status);return r.json()},u=async(e,t)=>{let i;if(!t.files||0===t.files.length)return r(`/api/issues${a(e)}`,{method:"POST",body:JSON.stringify({agent_id:t.agent_id,title:t.title,description:t.description})});let s=new FormData;for(let e of(t.agent_id&&s.append("agent_id",t.agent_id),s.append("title",t.title),s.append("description",t.description??""),t.files))s.append("file",e);try{i=await fetch(`/api/issues${a(e)}`,{method:"POST",credentials:"include",body:s})}catch(e){if(e instanceof TypeError)throw new n("Unable to connect — check your network",0);throw e}if(401===i.status)throw window.location.href="/sign-in",new n("Unauthorized",401);if(!i.ok){let e,t;try{let n=await i.json();e=n.error,t=n.details}catch{}if(429===i.status)throw new n("Please wait a moment before trying again",429);if(i.status>=500)throw new n(e||"Something went wrong — please try again",i.status,t);throw new n(e||"Something went wrong",i.status,t)}return i.json()},c=async(e,t)=>{let n=new URLSearchParams({workspace_id:t}),i=await fetch(`/api/artifacts/${e}/content?${n}`,{credentials:"include"});return i.ok?i.text():"(content not available)"};e.s(["acceptInvite",0,e=>r(`/api/invite/${e}`,{method:"POST"}),"addWhitelistEmail",0,(e,t,n)=>r(`/api/agents/${e}/whitelist${a(n)}`,{method:"POST",body:JSON.stringify({email:t})}),"approveMeeting",0,(e,t,n)=>r(`/api/agents/${e}/meetings/${t}/approve${a(n)}`,{method:"POST"}),"cancelActiveTask",0,(e,t)=>r(`/api/conversations/${e}/active-task${a(t)}`,{method:"DELETE"}),"chatInit",0,(e,t,n)=>r(`/api/agents/${e}/chat-init${a(t)}`,{method:"POST",body:JSON.stringify({...n?{channel:n}:{}})}),"checkFreshness",0,(e,t)=>{let n={};return e.conversationId&&(n.conversation_id=e.conversationId),e.agentId&&(n.agent_id=e.agentId),e.channel&&(n.channel=e.channel),r(`/api/conversations/check-fresh${a(t,n)}`)},"conversationInit",0,(e,t,n)=>{let i={};return n?.newestMessageId&&(i.newest_message_id=n.newestMessageId),n?.messageCount&&(i.message_count=String(n.messageCount)),r(`/api/conversations/${e}/init${a(t,i)}`)},"createAgent",0,(e,t)=>r(`/api/agents${a(t)}`,{method:"POST",body:JSON.stringify(e)}),"createAgentLink",0,(e,t)=>r(`/api/agent-links${a(t)}`,{method:"POST",body:JSON.stringify(e)}),"createCalendarEvent",0,(e,t)=>r(`/api/calendar${a(t)}`,{method:"POST",body:JSON.stringify(e)}),"createChannelApi",0,(e,t)=>r(`/api/channels${a(e)}`,{method:"POST",body:JSON.stringify({name:t})}),"createConversation",0,(e,t,n)=>r(`/api/conversations${a(t)}`,{method:"POST",body:JSON.stringify({agent_id:e,...n?{channel:n}:{}})}),"createEmailAccount",0,(e,t,n)=>r(`/api/agents/${e}/email-accounts${a(n)}`,{method:"POST",body:JSON.stringify(t)}),"createInvite",0,e=>r(`/api/workspaces/${e}/invites${a(e)}`,{method:"POST"}),"createIssue",0,u,"createMachineToken",0,(e,t)=>r(`/api/machine-tokens${t?a(t):""}`,{method:"POST",body:JSON.stringify({name:e||"default"})}),"createMeeting",0,(e,t,n)=>r(`/api/agents/${e}/meetings${a(t)}`,{method:"POST",body:JSON.stringify(n)}),"createThread",0,(e,t,n,i)=>r(`/api/conversations/${e}/threads${a(i)}`,{method:"POST",body:JSON.stringify({parent_message_id:t,content:n})}),"deleteAgent",0,(e,t)=>r(`/api/agents/${e}${a(t)}`,{method:"DELETE"}),"deleteAgentLink",0,(e,t)=>r(`/api/agent-links/${e}${a(t)}`,{method:"DELETE"}),"deleteCalendarEvent",0,(e,t,n)=>r(`/api/calendar/${e}${a(t)}`,{method:"DELETE",...n&&n.scope?{headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}:{}}),"deleteChannelApi",0,(e,t)=>r(`/api/channels/${e}${a(t)}`,{method:"DELETE"}),"deleteEmail",0,(e,t)=>r(`/api/email/${e}${a(t)}`,{method:"DELETE"}),"deleteEmailAccount",0,(e,t,n)=>r(`/api/agents/${e}/email-accounts/${t}${a(n)}`,{method:"DELETE"}),"deleteIssue",0,(e,t)=>r(`/api/issues/${t}${a(e)}`,{method:"DELETE"}),"deleteMachine",0,(e,t)=>r(`/api/runtimes/machine${a(t,{daemon_id:e})}`,{method:"DELETE"}),"deleteMeeting",0,(e,t,n)=>r(`/api/agents/${e}/meetings/${t}${a(n)}`,{method:"DELETE"}),"deleteWorkspace",0,(e,t)=>r(`/api/workspaces/${e}${a(e)}`,{method:"DELETE",body:JSON.stringify({confirm_name:t})}),"fetchLatestCliVersion",0,()=>r("/api/cli/latest-version"),"fetchModelOptions",0,()=>r("/api/config/model-options"),"flagMessage",0,(e,t)=>r(`/api/flags${a(e)}`,{method:"POST",body:JSON.stringify({messageId:t})}),"getActiveTask",0,(e,t)=>r(`/api/conversations/${e}/active-task${a(t)}`),"getAgent",0,(e,t)=>r(`/api/agents/${e}${a(t)}`),"getAgentSkills",0,(e,t)=>r(`/api/agents/${e}/skills${a(t)}`),"getArtifactContent",0,c,"getCalendarEvent",0,(e,t)=>r(`/api/calendar/${e}${a(t)}`),"getEmail",0,(e,t)=>r(`/api/email/${e}${a(t)}`),"getEmailBody",0,o,"getEmailThread",0,(e,t)=>r(`/api/email/${e}/thread${a(t)}`),"getFlaggedCount",0,e=>r(`/api/flags/count${a(e)}`),"getInboxCount",0,(e,t)=>{let n={};return t?.types?.length&&(n.types=t.types.join(",")),r(`/api/inbox/count${a(e,n)}`)},"getInviteInfo",0,e=>r(`/api/invite/${e}`),"getIssue",0,(e,t)=>r(`/api/issues/${t}${a(e)}`),"getMemberMe",0,e=>r(`/api/members/me${a(e)}`),"getMinCliVersion",0,()=>r("/api/config/min-version"),"getTask",0,(e,t)=>r(`/api/tasks/${e}${a(t)}`),"getTaskMessages",0,(e,t,n)=>r(`/api/tasks/${e}/messages${a(t,n?{since:String(n)}:void 0)}`),"getThreadSummaries",0,(e,t)=>r(`/api/conversations/${e}/threads${a(t)}`),"getTrace",0,(e,t)=>r(`/api/traces/${e}${a(t)}`),"getWorkspaceOverview",0,e=>r(`/api/workspaces/${e}/overview${a(e)}`),"grantAgentAccess",0,(e,t,n)=>r(`/api/agents/${t}/access${a(e)}`,{method:"POST",body:JSON.stringify({user_id:n})}),"listAgentAccess",0,(e,t)=>r(`/api/agents/${t}/access${a(e)}`),"listAgentActiveTaskCounts",0,e=>r(`/api/agents/active-task-counts${a(e)}`),"listAgentActivity",0,(e,t,n)=>{let i={};return n?.limit&&(i.limit=String(n.limit)),n?.before&&(i.before=n.before),n?.beforeId&&(i.before_id=n.beforeId),n?.status&&(i.status=n.status),n?.type&&(i.type=n.type),r(`/api/agents/${e}/activity${a(t,i)}`)},"listAgentLinks",0,e=>r(`/api/agent-links${a(e)}`),"listAgentPins",0,e=>r(`/api/agents/pins${a(e)}`),"listAgents",0,e=>r(`/api/agents${a(e)}`),"listArtifacts",0,(e,t)=>r(`/api/artifacts${a(t,{conversation_id:e})}`),"listCalendarEvents",0,(e,t)=>{let n={};return t?.agentId&&(n.agentId=t.agentId),t?.from&&(n.from=t.from),t?.to&&(n.to=t.to),r(`/api/calendar${a(e,n)}`)},"listChannels",0,e=>r(`/api/channels${a(e)}`),"listEmailAccounts",0,(e,t)=>r(`/api/agents/${e}/email-accounts${a(t)}`),"listEmails",0,(e,t,n,i)=>r(`/api/email${a(t,{agentId:e,...n?{folder:n}:{},...i?{address:i}:{}})}`),"listFlaggedItems",0,(e,t)=>{let n={};return t?.limit&&(n.limit=String(t.limit)),t?.before&&(n.before=t.before),r(`/api/flags${a(e,n)}`)},"listFlaggedMessageIds",0,(e,t)=>r(`/api/flags${a(e,{conversation_id:t,ids_only:"true"})}`),"listInboxItems",0,(e,t)=>{let n={};return t?.limit&&(n.limit=String(t.limit)),t?.before&&(n.before=t.before),t?.types?.length&&(n.types=t.types.join(",")),r(`/api/inbox${a(e,n)}`)},"listInvites",0,e=>r(`/api/workspaces/${e}/invites${a(e)}`),"listIssues",0,(e,t)=>{let n={};return t?.agentId&&(n.agentId=t.agentId),t?.status&&(n.status=t.status),t?.terminal!==void 0&&(n.terminal=String(t.terminal)),r(`/api/issues${a(e,n)}`)},"listMeetings",0,(e,t)=>r(`/api/agents/${e}/meetings${a(t)}`),"listMembers",0,e=>r(`/api/workspaces/${e}/members${a(e)}`),"listMessages",0,(e,t,n)=>{let i={};return n?.limit&&(i.limit=String(n.limit)),n?.before&&(i.before=n.before),n?.beforeId&&(i.before_id=n.beforeId),r(`/api/conversations/${e}/messages${a(t,i)}`)},"listMessagesAroundTask",0,(e,t,n)=>r(`/api/conversations/${e}/messages${a(t,{around_task:n})}`),"listPreviousConversations",0,(e,t,n)=>{let i={exclude:n.exclude,before:n.before};return n.channel&&(i.channel=n.channel),n.limit&&(i.limit=String(n.limit)),r(`/api/agents/${e}/conversations${a(t,i)}`)},"listRuntimes",0,e=>r(`/api/runtimes${a(e)}`),"listTraces",0,(e,t)=>{let n={};return t?.limit&&(n.limit=String(t.limit)),t?.before&&(n.before=t.before),t?.status&&(n.status=t.status),t?.multiAgent&&(n.multiAgent="true"),t?.agentId&&(n.agentId=t.agentId),t?.channel&&(n.channel=t.channel),r(`/api/traces${a(e,n)}`)},"listWhitelist",0,(e,t)=>r(`/api/agents/${e}/whitelist${a(t)}`),"listWorkspaceActiveTasks",0,e=>r(`/api/agents/active-tasks${a(e)}`),"listWorkspaces",0,()=>r("/api/workspaces"),"markAllInboxRead",0,e=>r(`/api/inbox/read-all${a(e)}`,{method:"POST"}),"markInboxRead",0,(e,t)=>r(`/api/inbox/read${a(t)}`,{method:"POST",body:JSON.stringify({conversationId:e})}),"pinAgent",0,(e,t)=>r(`/api/agents/${t}/pin${a(e)}`,{method:"POST"}),"removeMember",0,(e,t)=>r(`/api/workspaces/${e}/members/${t}${a(e)}`,{method:"DELETE"}),"removeWhitelistEmail",0,(e,t,n)=>r(`/api/agents/${e}/whitelist/${t}${a(n)}`,{method:"DELETE"}),"renameChannelApi",0,(e,t,n)=>r(`/api/channels/${e}${a(t)}`,{method:"PATCH",body:JSON.stringify({name:n})}),"reorderAgentPins",0,(e,t)=>r(`/api/agents/pins/reorder${a(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"reorderChannelsApi",0,(e,t)=>r(`/api/channels/reorder${a(e)}`,{method:"PUT",body:JSON.stringify({ordered_channel_ids:t})}),"reorderUnpinnedAgents",0,(e,t)=>r(`/api/agents/sidebar/reorder${a(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"requestWorkspaceBrowse",0,(e,t,n,i)=>r(`/api/agents/${e}/workspace/browse${a(t)}`,{method:"POST",body:JSON.stringify({request_type:n,path:i})}),"retryTask",0,(e,t)=>r(`/api/tasks/${e}/retry${a(t)}`,{method:"POST"}),"revokeAgentAccess",0,(e,t,n,i=!1)=>r(`/api/agents/${t}/access/${n}${a(e)}${i?"&remove_whitelist=true":""}`,{method:"DELETE"}),"revokeInvite",0,(e,t)=>r(`/api/workspaces/${e}/invites/${t}${a(e)}`,{method:"DELETE"}),"sendEmail",0,(e,t,n,i,s,o,l,u)=>r(`/api/email/send${a(s)}`,{method:"POST",body:JSON.stringify({agentId:e,to:t,subject:n,htmlBody:i,attachments:o,...l,customAccountId:u})}),"sendMessage",0,s,"stopMeeting",0,(e,t,n)=>r(`/api/agents/${e}/meetings/${t}/stop${a(n)}`,{method:"POST"}),"syncEmailAccount",0,(e,t,n)=>r(`/api/agents/${e}/email-accounts/${t}/sync${a(n)}`,{method:"POST"}),"triggerRuntimeRescan",0,(e,t)=>r(`/api/runtimes/${e}/rescan${a(t)}`,{method:"POST"}),"triggerRuntimeUpdate",0,(e,t)=>r(`/api/runtimes/${e}/update${a(t)}`,{method:"POST"}),"trustEmail",0,(e,t)=>r(`/api/email/${e}/trust${a(t)}`,{method:"POST"}),"unflagMessage",0,(e,t)=>r(`/api/flags/${t}${a(e)}`,{method:"DELETE"}),"unpinAgent",0,(e,t)=>r(`/api/agents/${t}/pin${a(e)}`,{method:"DELETE"}),"updateAgent",0,(e,t,n)=>r(`/api/agents/${e}${a(n)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateAgentLink",0,(e,t,n)=>r(`/api/agent-links/${e}${a(n)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateCalendarEvent",0,(e,t,n)=>r(`/api/calendar/${e}${a(n)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateEmailStatus",0,(e,t,n)=>r(`/api/email/${e}${a(t)}`,{method:"PATCH",body:JSON.stringify({status:n})}),"updateIssue",0,(e,t,n)=>r(`/api/issues/${t}${a(e)}`,{method:"PATCH",body:JSON.stringify(n)}),"updateMemberMe",0,(e,t)=>r(`/api/members/me${a(e)}`,{method:"PATCH",body:JSON.stringify({global_instruction:t})}),"updateWorkspace",0,(e,t)=>r(`/api/workspaces/${e}${a(e)}`,{method:"PATCH",body:JSON.stringify(t)}),"uploadEmailAttachment",0,l],222862)},452691,e=>{"use strict";let t=(0,e.i(419412).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",0,t])},392511,e=>{"use strict";var t=e.i(511043);e.s(["useControlled",0,function({controlled:e,default:n,name:i,state:r="value"}){let{current:a}=t.useRef(void 0!==e),[s,o]=t.useState(n),l=t.useCallback(e=>{a||o(e)},[]);return[a?e:s,l]}])},241836,909578,e=>{"use strict";e.i(811374);var t,n=e.i(154680),i=e.i(511043),r=e.i(959947);let a=((t={}).disabled="data-disabled",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t),s={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},o={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},l={disabled:!1,...o};e.s(["DEFAULT_FIELD_ROOT_STATE",0,l,"DEFAULT_FIELD_STATE_ATTRIBUTES",0,o,"DEFAULT_VALIDITY_STATE",0,s,"fieldValidityMapping",0,{valid:e=>null===e?null:e?{[a.valid]:""}:{[a.invalid]:""}}],909578);let u={invalid:void 0,name:void 0,validityData:{state:s,errors:[],error:"",value:"",initialValue:null},setValidityData:r.NOOP,disabled:void 0,touched:o.touched,setTouched:r.NOOP,dirty:o.dirty,setDirty:r.NOOP,filled:o.filled,setFilled:r.NOOP,focused:o.focused,setFocused:r.NOOP,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:l,markedDirtyRef:{current:!1},registerFieldControl:r.NOOP,validation:{getValidationProps:(e=r.EMPTY_OBJECT)=>e,getInputValidationProps:(e=r.EMPTY_OBJECT)=>e,inputRef:{current:null},commit:async()=>{}}},c=i.createContext(u);e.s(["FieldRootContext",0,c,"useFieldRootContext",0,function(e=!0){let t=i.useContext(c);if(t.setValidityData===r.NOOP&&!e)throw Error((0,n.default)(28));return t}],241836)},65756,e=>{"use strict";var t=e.i(511043),n=e.i(990966),i=e.i(241836);e.s(["useRegisterFieldControl",0,function(e,r,a,s,o=!0){let{registerFieldControl:l}=(0,i.useFieldRootContext)(),u=t.useRef(null);u.current||(u.current=Symbol()),(0,n.useIsoLayoutEffect)(()=>{let t=u.current;if(t&&o)return l(t,{controlRef:e,getValue:s,id:r,value:a}),()=>{l(t,void 0)}},[e,o,s,r,l,a])}])},988072,e=>{"use strict";var t=e.i(511043),n=e.i(959947);let i=t.createContext({controlId:void 0,registerControlId:n.NOOP,labelId:void 0,setLabelId:n.NOOP,messageIds:[],setMessageIds:n.NOOP,getDescriptionProps:e=>e});e.s(["LabelableContext",0,i,"useLabelableContext",0,function(){return t.useContext(i)}])},865306,e=>{"use strict";var t=e.i(511043),n=e.i(990966),i=e.i(298604),r=e.i(826918),a=e.i(92615),s=e.i(959947),o=e.i(962795),l=e.i(988072);e.s(["useLabelableId",0,function(e={}){let{id:u,implicit:c=!1,controlRef:d}=e,{controlId:f,registerControlId:p}=(0,l.useLabelableContext)(),m=(0,o.useBaseUiId)(u),g=c?f:void 0,h=(0,r.useRefWithInit)(()=>Symbol("labelable-control")),$=t.useRef(!1),b=t.useRef(null!=u),y=(0,i.useStableCallback)(()=>{$.current&&p!==s.NOOP&&($.current=!1,p(h.current,void 0))});return(0,n.useIsoLayoutEffect)(()=>{let e;if(p!==s.NOOP){if(c){let t=d?.current;e=(0,a.isElement)(t)&&null!=t.closest("label")?u??null:g??m}else if(null!=u)b.current=!0,e=u;else{if(!b.current)return void y();e=m}if(void 0===e)return void y();$.current=!0,p(h.current,e)}},[u,d,g,p,c,m,h,y]),t.useEffect(()=>y,[y]),f??m}])},251923,e=>{"use strict";var t=e.i(511043),n=e.i(959947);let i=t.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:n.NOOP,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});e.s(["useFormContext",0,function(){return t.useContext(i)}])},585248,e=>{"use strict";var t=e.i(92615),n=e.i(236432),i=e.i(298604),r=e.i(168879),a=e.i(990966),s=e.i(962795),o=e.i(988072);e.s(["useLabel",0,function(e={}){let l,{id:u,fallbackControlId:c,native:d=!1,setLabelId:f,focusControl:p}=e,{controlId:m,setLabelId:g}=(0,o.useLabelableContext)(),h=(0,i.useStableCallback)(e=>{g(e),f?.(e)}),$=(l=(0,s.useBaseUiId)(u),(0,a.useIsoLayoutEffect)(()=>(h(l),()=>{h(void 0)}),[l,h]),l),b=m??c;function y(e){let i=(0,r.getTarget)(e.nativeEvent);i?.closest("button,input,select,textarea")||(!e.defaultPrevented&&e.detail>1&&e.preventDefault(),d||function(e){if(p)return p(e,b);if(!b)return;let i=(0,n.ownerDocument)(e.currentTarget).getElementById(b);(0,t.isHTMLElement)(i)&&i.focus({focusVisible:!0})}(e))}return d?{id:$,htmlFor:b??void 0,onMouseDown:y}:{id:$,onClick:y,onPointerDown(e){e.preventDefault()}}}],585248)},386102,e=>{"use strict";var t=e.i(511043),n=e.i(695681);let i=t.forwardRef(function(e,t){let{className:i,render:r,orientation:a="horizontal",style:s,...o}=e;return(0,n.useRenderElement)("div",e,{state:{orientation:a},ref:t,props:[{role:"separator","aria-orientation":a},o]})});e.s(["Separator",0,i])},991065,e=>{"use strict";var t=e.i(511043);let n=t.createContext(void 0),i={disableStyleElements:!1};e.s(["useCSPContext",0,function(){return t.useContext(n)??i}])},392662,e=>{"use strict";var t=e.i(511043);let n=t.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});e.s(["CompositeListContext",0,n,"useCompositeListContext",0,function(){return t.useContext(n)}])},814378,e=>{"use strict";var t=e.i(511043),n=e.i(826918),i=e.i(298604),r=e.i(990966),a=e.i(392662),s=e.i(653772);function o(){return new Map}function l(){return new Set}function u(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}e.s(["CompositeList",0,function(e){let{children:c,elementsRef:d,labelsRef:f,onMapChange:p}=e,m=(0,i.useStableCallback)(p),g=t.useRef(0),h=(0,n.useRefWithInit)(l).current,$=(0,n.useRefWithInit)(o).current,[b,y]=t.useState(0),E=t.useRef(b),v=(0,i.useStableCallback)((e,t)=>{$.set(e,t??null),E.current+=1,y(E.current)}),w=(0,i.useStableCallback)(e=>{$.delete(e),E.current+=1,y(E.current)}),O=t.useMemo(()=>{let e=new Map;return Array.from($.keys()).filter(e=>e.isConnected).sort(u).forEach((t,n)=>{let i=$.get(t)??{};e.set(t,{...i,index:n})}),e},[$,b]);(0,r.useIsoLayoutEffect)(()=>{if("function"!=typeof MutationObserver||0===O.size)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),0===t.size&&(E.current+=1,y(E.current))});return O.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[O]),(0,r.useIsoLayoutEffect)(()=>{E.current===b&&(d.current.length!==O.size&&(d.current.length=O.size),f&&f.current.length!==O.size&&(f.current.length=O.size),g.current=O.size),m(O)},[m,O,d,f,b]),(0,r.useIsoLayoutEffect)(()=>()=>{d.current=[]},[d]),(0,r.useIsoLayoutEffect)(()=>()=>{f&&(f.current=[])},[f]);let S=(0,i.useStableCallback)(e=>(h.add(e),()=>{h.delete(e)}));(0,r.useIsoLayoutEffect)(()=>{h.forEach(e=>e(O))},[h,O]);let T=t.useMemo(()=>({register:v,unregister:w,subscribeMapChange:S,elementsRef:d,labelsRef:f,nextIndexRef:g}),[v,w,S,d,f,g]);return(0,s.jsx)(a.CompositeListContext.Provider,{value:T,children:c})}])},657614,e=>{"use strict";var t,n=e.i(511043),i=e.i(990966),r=e.i(392662);let a=((t={})[t.None=0]="None",t[t.GuessFromOrder=1]="GuessFromOrder",t);e.s(["IndexGuessBehavior",0,a,"useCompositeListItem",0,function(e={}){let{label:t,metadata:s,textRef:o,indexGuessBehavior:l,index:u}=e,{register:c,unregister:d,subscribeMapChange:f,elementsRef:p,labelsRef:m,nextIndexRef:g}=(0,r.useCompositeListContext)(),h=n.useRef(-1),[$,b]=n.useState(u??(l===a.GuessFromOrder?()=>{if(-1===h.current){let e=g.current;g.current+=1,h.current=e}return h.current}:-1)),y=n.useRef(null),E=n.useCallback(e=>{if(y.current=e,-1!==$&&null!==e&&(p.current[$]=e,m)){let n=void 0!==t;m.current[$]=n?t:o?.current?.textContent??e.textContent}},[$,p,m,t,o]);return(0,i.useIsoLayoutEffect)(()=>{if(null!=u)return;let e=y.current;if(e)return c(e,s),()=>{d(e)}},[u,c,d,s]),(0,i.useIsoLayoutEffect)(()=>{if(null==u)return f(e=>{let t=y.current?e.get(y.current)?.index:null;null!=t&&b(t)})},[u,f,b]),n.useMemo(()=>({ref:E,index:$}),[$,E])}])},26349,e=>{"use strict";var t=e.i(452691);e.s(["CheckIcon",()=>t.default])},485322,e=>{"use strict";let t=(0,e.i(419412).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["default",0,t])},490159,422987,e=>{"use strict";function t(e,n=Number.MIN_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER){return Math.max(n,Math.min(e,i))}e.s(["clamp",0,t],422987),e.s(["SCROLL_EDGE_TOLERANCE_PX",0,1,"getMaxScrollOffset",0,function(e,t){return Math.max(0,e-t)},"normalizeScrollOffset",0,function(e,n){if(n<=0)return 0;let i=t(e,0,n),r=n-i,a=i<=1,s=r<=1;return a&&s?i<=r?0:n:a?0:s?n:i}],490159)},358719,e=>{"use strict";var t=e.i(653772);let n="base-ui-disable-scrollbar";e.s(["styleDisableScrollbar",0,{className:n,getElement:e=>(0,t.jsx)("style",{nonce:e,href:n,precedence:"base-ui:low",children:`.${n}{scrollbar-width:none}.${n}::-webkit-scrollbar{display:none}`})}])}]);
|
package/bundled/web/.open-next/assets/_next/static/chunks/{15gpqusfs36cs.js → 1kj_n-cbedl8a.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,275351,e=>{"use strict";let t,a,r,n,i=(e,t)=>t.some(t=>e instanceof t),s=new WeakMap,o=new WeakMap,l=new WeakMap,c={get(e,t,a){if(e instanceof IDBTransaction){if("done"===t)return s.get(e);if("store"===t)return a.objectStoreNames[1]?void 0:a.objectStore(a.objectStoreNames[0])}return d(e[t])},set:(e,t,a)=>(e[t]=a,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function d(e){if(e instanceof IDBRequest){let t;return t=new Promise((t,a)=>{let r=()=>{e.removeEventListener("success",n),e.removeEventListener("error",i)},n=()=>{t(d(e.result)),r()},i=()=>{a(e.error),r()};e.addEventListener("success",n),e.addEventListener("error",i)}),l.set(t,e),t}if(o.has(e))return o.get(e);let t=function(e){if("function"==typeof e)return(n||(n=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(u(this),t),d(this.request)}:function(...t){return d(e.apply(u(this),t))};return(e instanceof IDBTransaction&&function(e){if(s.has(e))return;let t=new Promise((t,a)=>{let r=()=>{e.removeEventListener("complete",n),e.removeEventListener("error",i),e.removeEventListener("abort",i)},n=()=>{t(),r()},i=()=>{a(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",n),e.addEventListener("error",i),e.addEventListener("abort",i)});s.set(e,t)}(e),i(e,r||(r=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(e,c):e}(e);return t!==e&&(o.set(e,t),l.set(t,e)),t}let u=e=>l.get(e),p=["get","getKey","getAll","getAllKeys","count"],m=["put","add","delete","clear"],f=new Map;function g(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(f.get(t))return f.get(t);let a=t.replace(/FromIndex$/,""),r=t!==a,n=m.includes(a);if(!(a in(r?IDBIndex:IDBObjectStore).prototype)||!(n||p.includes(a)))return;let i=async function(e,...t){let i=this.transaction(e,n?"readwrite":"readonly"),s=i.store;return r&&(s=s.index(t.shift())),(await Promise.all([s[a](...t),n&&i.done]))[0]};return f.set(t,i),i}c={...t=c,get:(e,a,r)=>g(e,a)||t.get(e,a,r),has:(e,a)=>!!g(e,a)||t.has(e,a)};let h=["continue","continuePrimaryKey","advance"],y={},b=new WeakMap,w=new WeakMap,v={get(e,t){if(!h.includes(t))return e[t];let a=y[t];return a||(a=y[t]=function(...e){b.set(this,w.get(this)[t](...e))}),a}};async function*$(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;let a=new Proxy(t,v);for(w.set(a,t),l.set(a,u(t));t;)yield a,t=await (b.get(a)||t.continue()),b.delete(a)}function k(e,t){return t===Symbol.asyncIterator&&i(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&i(e,[IDBIndex,IDBObjectStore])}c={...a=c,get:(e,t,r)=>k(e,t)?$:a.get(e,t,r),has:(e,t)=>k(e,t)||a.has(e,t)};let x=null,S=null;function E(e){return"u"<typeof indexedDB?null:x&&S===e?x:(S=e,x=function(e,{blocked:t,upgrade:a,blocking:r,terminated:n}={}){let i=indexedDB.open(e,4),s=d(i);return a&&i.addEventListener("upgradeneeded",e=>{a(d(i.result),e.oldVersion,e.newVersion,d(i.transaction),e)}),t&&i.addEventListener("blocked",e=>t(e.oldVersion,e.newVersion,e)),s.then(e=>{n&&e.addEventListener("close",()=>n()),r&&e.addEventListener("versionchange",e=>r(e.oldVersion,e.newVersion,e))}).catch(()=>{}),s}(`alook-chat-cache-${e}`,{upgrade(e,t){if(t<1){let t=e.createObjectStore("messages",{keyPath:["conversation_id","id"]});t.createIndex("by-conversation","conversation_id",{unique:!1}),t.createIndex("by-created",["conversation_id","created_at"],{unique:!1}),e.createObjectStore("cache_meta",{keyPath:"conversation_id"})}t<3&&e.createObjectStore("last_open",{keyPath:"key"}).createIndex("by-conversation","conversation_id",{unique:!1}),t<4&&e.createObjectStore("conv_extras",{keyPath:"conversation_id"})}}))}function _(e){return e?E(e):x}async function C(e,t){let a=_(t);if(!a)return null;try{let t=await a,r=await t.getAllFromIndex("messages","by-conversation",e);if(0===r.length)return null;let n=r.filter(e=>!e.id.startsWith("temp-"));n.sort((e,t)=>{let a=e.created_at.localeCompare(t.created_at);return 0!==a?a:e.id.localeCompare(t.id)});let i=await t.get("cache_meta",e);return i&&await t.put("cache_meta",{...i,lastAccessedAt:Date.now()}),n}catch{return null}}async function T(e,t,a,r,n){let i=_(n);if(!i)return null;try{let n=await i,s=await n.get("cache_meta",e);if(!s)return null;let o=IDBKeyRange.bound([e,""],[e,t],!1,!1),l=(await n.getAllFromIndex("messages","by-created",o)).filter(e=>!e.id.startsWith("temp-")&&(e.created_at!==t||!(e.id>=a)));l.sort((e,t)=>{let a=t.created_at.localeCompare(e.created_at);return 0!==a?a:t.id.localeCompare(e.id)});let c=l.slice(0,r);if(c.length<r&&s.hasMore)return null;return await n.put("cache_meta",{...s,lastAccessedAt:Date.now()}),{messages:c.reverse(),hasMore:l.length>r||s.hasMore}}catch{return null}}async function I(e,t,a,r,n){let i=_(r);if(i)try{let r=await i,s=t.filter(e=>!e.id.startsWith("temp-"));if(0===s.length)return;let o=r.transaction(["messages","cache_meta"],"readwrite"),l=o.objectStore("messages"),c=o.objectStore("cache_meta");for(let e of s)await l.put(e);let d=await l.index("by-conversation").getAllKeys(e),u=Date.now(),p=s.reduce((e,t)=>e.created_at>t.created_at?e:t),m=await c.get(e),f=a??m?.hasMore??!0,g=m?.newestMessageId&&m.newestMessageId!==p.id?await (async()=>{let t=await l.get([e,m.newestMessageId]);return t&&t.created_at>p.created_at?t.id:p.id})():p.id,h={conversation_id:e,lastFetchedAt:u,lastAccessedAt:u,messageCount:d.length,newestMessageId:g,hasMore:f,serverMessageCount:n??m?.serverMessageCount??0};await c.put(h),await o.done,L().catch(()=>{})}catch{}}async function j(e,t,a){let r=_(a);if(r&&!t.id.startsWith("temp-"))try{let a=await r,n=await a.get("cache_meta",e);if(!n)return;let i=await a.get("messages",[e,t.id]);await a.put("messages",t),await a.put("cache_meta",{...n,lastAccessedAt:Date.now(),messageCount:i?n.messageCount:n.messageCount+1,newestMessageId:t.id})}catch{}}async function M(e,t){let a=_(t);if(!a)return null;try{let t=await a;return await t.get("cache_meta",e)??null}catch{return null}}function P(e,t){return`${e}::${null==t?"":t}`}async function A(e,t,a){let r=_(a);if(!r)return null;try{let a=await r;return await a.get("last_open",P(e,t))??null}catch{return null}}async function N(e,t,a,r){let n=_(r);if(n)try{let r=await n;await r.put("last_open",{key:P(e,t),conversation_id:a.conversation_id,newestMessageId:a.newestMessageId,serverMessageCount:a.serverMessageCount,updatedAt:Date.now()})}catch{}}async function O(e,t){let a=_(t);if(!a)return null;try{let t=await a;return await t.get("conv_extras",e)??null}catch{return null}}async function D(e,t,a){let r=_(a);if(r)try{let a=await r;await a.put("conv_extras",{conversation_id:e,...t,updatedAt:Date.now()})}catch{}}async function L(e=50){let t=_();if(t)try{let a=await t,r=await a.getAll("cache_meta");if(r.length<=e)return;r.sort((e,t)=>e.lastAccessedAt-t.lastAccessedAt);let n=r.slice(0,r.length-e),i=a.transaction(["messages","cache_meta","last_open","conv_extras"],"readwrite"),s=i.objectStore("messages"),o=i.objectStore("cache_meta"),l=i.objectStore("last_open"),c=i.objectStore("conv_extras");for(let e of n){for(let t of(await s.index("by-conversation").getAllKeys(e.conversation_id)))await s.delete(t);for(let t of(await o.delete(e.conversation_id),await l.index("by-conversation").getAllKeys(e.conversation_id)))await l.delete(t);await c.delete(e.conversation_id)}await i.done}catch{}}async function B(){if("u">typeof indexedDB)try{x&&((await x).close(),x=null),S&&(await R(`alook-chat-cache-${S}`),S=null)}catch{}}async function R(e){return new Promise((t,a)=>{let r=indexedDB.deleteDatabase(e);r.onsuccess=()=>t(),r.onerror=()=>a(r.error),r.onblocked=()=>t()})}e.s(["appendCachedMessage",0,j,"clearAllCache",0,B,"getCacheMeta",0,M,"getCachedMessages",0,C,"getCachedMessagesBefore",0,T,"getConvExtras",0,O,"getLastOpenConversation",0,A,"mergeCachedMessages",0,I,"openCacheDB",0,E,"setConvExtras",0,D,"setLastOpenConversation",0,N],275351)},345262,e=>{"use strict";let t=(0,e.i(419412).default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);e.s(["ArrowUpRight",0,t],345262)},500324,e=>{"use strict";var t=e.i(653772),a=e.i(511043);let r=(0,a.createContext)(null);e.s(["WorkspaceProvider",0,function({workspaceId:e,slug:n,children:i}){return(0,a.useEffect)(()=>{try{localStorage.setItem("lastWorkspace",n)}catch{}},[n]),(0,t.jsx)(r.Provider,{value:{workspaceId:e,slug:n},children:i})},"useWorkspace",0,function(){let e=(0,a.useContext)(r);if(!e)throw Error("useWorkspace must be used within WorkspaceProvider");return e}])},126942,(e,t,a)=>{t.exports=e.r(871628)},222862,636557,e=>{"use strict";var t=e.i(811374);class a extends Error{status;details;constructor(e,t,a){super(e),this.name="ApiError",this.status=t,this.details=a}get isNetworkError(){return 0===this.status}get isRateLimit(){return 429===this.status}get isUnauthorized(){return 401===this.status}}function r(e,t){return"validation error"===e&&t?.length?function(e){let[t,...a]=e.split(":"),r=a.join(":").trim();if(!r)return e;let n=t.trim(),i=n.trim().replace(/[_-]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()),s=r.replace(/^required$/i,"is required"),o=s.toLowerCase().replace(/[_-]+/g," "),l=n.toLowerCase().replace(/[_-]+/g," ");return l&&o.startsWith(`${l} `)&&(s=s.slice(n.length).trimStart()),i?`${i} ${s}`:s}(t[0]):e}async function n(e,t){let n;try{n=await fetch(""+e,{...t,credentials:"include",headers:{"Content-Type":"application/json",...t?.headers}})}catch(e){if(e instanceof TypeError)throw new a("Unable to connect — check your network",0);throw e}if(401===n.status)throw window.location.href="/sign-in",new a("Unauthorized",401);if(!n.ok){let e,t;try{let a=await n.json();e=a.error,t=a.details}catch{}if(429===n.status)throw new a("Please wait a moment before trying again",429);if(n.status>=500)throw new a(r(e,t)||"Something went wrong — please try again",n.status,t);throw new a(r(e,t)||"Something went wrong",n.status,t)}if(204!==n.status)return n.json()}function i(e,t){let a=new URLSearchParams({workspace_id:e,...t});return`?${a.toString()}`}e.s(["ApiError",0,a],636557),parseInt(t.default.env.NEXT_PUBLIC_MOCK_NETWORK_DELAY_MS||"300",10);let s=async(e,t,r,s,o)=>{let l;if(!s||0===s.length)return n(`/api/conversations/${e}/messages${i(r)}`,{method:"POST",body:JSON.stringify({content:t,...o?{metadata:o}:{}})});let c=new FormData;for(let e of(c.append("content",t),o&&c.append("metadata",JSON.stringify(o)),s))c.append("file",e.file);for(let e=0;e<s.length;e++){let t=s[e].thumbnailBlob;t&&c.append(`thumbnail:${e}`,t,"thumbnail.jpg")}try{l=await fetch(`/api/conversations/${e}/messages${i(r)}`,{method:"POST",credentials:"include",body:c})}catch(e){if(e instanceof TypeError)throw new a("Unable to connect — check your network",0);throw e}if(401===l.status)throw window.location.href="/sign-in",new a("Unauthorized",401);if(!l.ok){let e,t;try{let a=await l.json();e=a.error,t=a.details}catch{}if(429===l.status)throw new a("Please wait a moment before trying again",429);if(l.status>=500)throw new a(e||"Something went wrong — please try again",l.status,t);throw new a(e||"Something went wrong",l.status,t)}return l.json()},o=async(e,t)=>{let a=new URLSearchParams({workspace_id:t}),r=await fetch(`/api/email/${e}/body?${a}`,{credentials:"include"});if(!r.ok)return{content:"(body not available)",isHtml:!1};let n=r.headers.get("Content-Type")??"";return{content:await r.text(),isHtml:n.includes("text/html")}},l=async(e,t)=>{let r=new FormData;r.append("file",e);let n=await fetch(`/api/email/upload${i(t)}`,{method:"POST",credentials:"include",body:r});if(!n.ok)throw new a(await n.text().catch(()=>"Upload failed"),n.status);return n.json()},c=async(e,t)=>{let r;if(!t.files||0===t.files.length)return n(`/api/issues${i(e)}`,{method:"POST",body:JSON.stringify({agent_id:t.agent_id,title:t.title,description:t.description})});let s=new FormData;for(let e of(t.agent_id&&s.append("agent_id",t.agent_id),s.append("title",t.title),s.append("description",t.description??""),t.files))s.append("file",e);try{r=await fetch(`/api/issues${i(e)}`,{method:"POST",credentials:"include",body:s})}catch(e){if(e instanceof TypeError)throw new a("Unable to connect — check your network",0);throw e}if(401===r.status)throw window.location.href="/sign-in",new a("Unauthorized",401);if(!r.ok){let e,t;try{let a=await r.json();e=a.error,t=a.details}catch{}if(429===r.status)throw new a("Please wait a moment before trying again",429);if(r.status>=500)throw new a(e||"Something went wrong — please try again",r.status,t);throw new a(e||"Something went wrong",r.status,t)}return r.json()},d=async(e,t)=>{let a=new URLSearchParams({workspace_id:t}),r=await fetch(`/api/artifacts/${e}/content?${a}`,{credentials:"include"});return r.ok?r.text():"(content not available)"};e.s(["acceptInvite",0,e=>n(`/api/invite/${e}`,{method:"POST"}),"addWhitelistEmail",0,(e,t,a)=>n(`/api/agents/${e}/whitelist${i(a)}`,{method:"POST",body:JSON.stringify({email:t})}),"approveMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings/${t}/approve${i(a)}`,{method:"POST"}),"cancelActiveTask",0,(e,t)=>n(`/api/conversations/${e}/active-task${i(t)}`,{method:"DELETE"}),"chatInit",0,(e,t,a)=>n(`/api/agents/${e}/chat-init${i(t)}`,{method:"POST",body:JSON.stringify({...a?{channel:a}:{}})}),"checkFreshness",0,(e,t)=>{let a={};return e.conversationId&&(a.conversation_id=e.conversationId),e.agentId&&(a.agent_id=e.agentId),e.channel&&(a.channel=e.channel),n(`/api/conversations/check-fresh${i(t,a)}`)},"conversationInit",0,(e,t,a)=>{let r={};return a?.newestMessageId&&(r.newest_message_id=a.newestMessageId),a?.messageCount&&(r.message_count=String(a.messageCount)),n(`/api/conversations/${e}/init${i(t,r)}`)},"createAgent",0,(e,t)=>n(`/api/agents${i(t)}`,{method:"POST",body:JSON.stringify(e)}),"createAgentLink",0,(e,t)=>n(`/api/agent-links${i(t)}`,{method:"POST",body:JSON.stringify(e)}),"createCalendarEvent",0,(e,t)=>n(`/api/calendar${i(t)}`,{method:"POST",body:JSON.stringify(e)}),"createChannelApi",0,(e,t)=>n(`/api/channels${i(e)}`,{method:"POST",body:JSON.stringify({name:t})}),"createConversation",0,(e,t,a)=>n(`/api/conversations${i(t)}`,{method:"POST",body:JSON.stringify({agent_id:e,...a?{channel:a}:{}})}),"createEmailAccount",0,(e,t,a)=>n(`/api/agents/${e}/email-accounts${i(a)}`,{method:"POST",body:JSON.stringify(t)}),"createInvite",0,e=>n(`/api/workspaces/${e}/invites${i(e)}`,{method:"POST"}),"createIssue",0,c,"createMachineToken",0,(e,t)=>n(`/api/machine-tokens${t?i(t):""}`,{method:"POST",body:JSON.stringify({name:e||"default"})}),"createMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings${i(t)}`,{method:"POST",body:JSON.stringify(a)}),"createThread",0,(e,t,a,r)=>n(`/api/conversations/${e}/threads${i(r)}`,{method:"POST",body:JSON.stringify({parent_message_id:t,content:a})}),"deleteAgent",0,(e,t)=>n(`/api/agents/${e}${i(t)}`,{method:"DELETE"}),"deleteAgentLink",0,(e,t)=>n(`/api/agent-links/${e}${i(t)}`,{method:"DELETE"}),"deleteCalendarEvent",0,(e,t,a)=>n(`/api/calendar/${e}${i(t)}`,{method:"DELETE",...a&&a.scope?{headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}:{}}),"deleteChannelApi",0,(e,t)=>n(`/api/channels/${e}${i(t)}`,{method:"DELETE"}),"deleteEmail",0,(e,t)=>n(`/api/email/${e}${i(t)}`,{method:"DELETE"}),"deleteEmailAccount",0,(e,t,a)=>n(`/api/agents/${e}/email-accounts/${t}${i(a)}`,{method:"DELETE"}),"deleteIssue",0,(e,t)=>n(`/api/issues/${t}${i(e)}`,{method:"DELETE"}),"deleteMachine",0,(e,t)=>n(`/api/runtimes/machine${i(t,{daemon_id:e})}`,{method:"DELETE"}),"deleteMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings/${t}${i(a)}`,{method:"DELETE"}),"deleteWorkspace",0,(e,t)=>n(`/api/workspaces/${e}${i(e)}`,{method:"DELETE",body:JSON.stringify({confirm_name:t})}),"fetchLatestCliVersion",0,()=>n("/api/cli/latest-version"),"fetchModelOptions",0,()=>n("/api/config/model-options"),"flagMessage",0,(e,t)=>n(`/api/flags${i(e)}`,{method:"POST",body:JSON.stringify({messageId:t})}),"getActiveTask",0,(e,t)=>n(`/api/conversations/${e}/active-task${i(t)}`),"getAgentSkills",0,(e,t)=>n(`/api/agents/${e}/skills${i(t)}`),"getArtifactContent",0,d,"getCalendarEvent",0,(e,t)=>n(`/api/calendar/${e}${i(t)}`),"getEmail",0,(e,t)=>n(`/api/email/${e}${i(t)}`),"getEmailBody",0,o,"getEmailThread",0,(e,t)=>n(`/api/email/${e}/thread${i(t)}`),"getFlaggedCount",0,e=>n(`/api/flags/count${i(e)}`),"getInboxCount",0,(e,t)=>{let a={};return t?.types?.length&&(a.types=t.types.join(",")),n(`/api/inbox/count${i(e,a)}`)},"getInviteInfo",0,e=>n(`/api/invite/${e}`),"getIssue",0,(e,t)=>n(`/api/issues/${t}${i(e)}`),"getMemberMe",0,e=>n(`/api/members/me${i(e)}`),"getMinCliVersion",0,()=>n("/api/config/min-version"),"getTask",0,(e,t)=>n(`/api/tasks/${e}${i(t)}`),"getTaskMessages",0,(e,t,a)=>n(`/api/tasks/${e}/messages${i(t,a?{since:String(a)}:void 0)}`),"getThreadSummaries",0,(e,t)=>n(`/api/conversations/${e}/threads${i(t)}`),"getTrace",0,(e,t)=>n(`/api/traces/${e}${i(t)}`),"getWorkspaceOverview",0,e=>n(`/api/workspaces/${e}/overview${i(e)}`),"grantAgentAccess",0,(e,t,a)=>n(`/api/agents/${t}/access${i(e)}`,{method:"POST",body:JSON.stringify({user_id:a})}),"listAgentAccess",0,(e,t)=>n(`/api/agents/${t}/access${i(e)}`),"listAgentActiveTaskCounts",0,e=>n(`/api/agents/active-task-counts${i(e)}`),"listAgentActivity",0,(e,t,a)=>{let r={};return a?.limit&&(r.limit=String(a.limit)),a?.before&&(r.before=a.before),a?.beforeId&&(r.before_id=a.beforeId),a?.status&&(r.status=a.status),a?.type&&(r.type=a.type),n(`/api/agents/${e}/activity${i(t,r)}`)},"listAgentLinks",0,e=>n(`/api/agent-links${i(e)}`),"listAgentPins",0,e=>n(`/api/agents/pins${i(e)}`),"listAgents",0,e=>n(`/api/agents${i(e)}`),"listArtifacts",0,(e,t)=>n(`/api/artifacts${i(t,{conversation_id:e})}`),"listCalendarEvents",0,(e,t)=>{let a={};return t?.agentId&&(a.agentId=t.agentId),t?.from&&(a.from=t.from),t?.to&&(a.to=t.to),n(`/api/calendar${i(e,a)}`)},"listChannels",0,e=>n(`/api/channels${i(e)}`),"listEmailAccounts",0,(e,t)=>n(`/api/agents/${e}/email-accounts${i(t)}`),"listEmails",0,(e,t,a,r)=>n(`/api/email${i(t,{agentId:e,...a?{folder:a}:{},...r?{address:r}:{}})}`),"listFlaggedItems",0,(e,t)=>{let a={};return t?.limit&&(a.limit=String(t.limit)),t?.before&&(a.before=t.before),n(`/api/flags${i(e,a)}`)},"listFlaggedMessageIds",0,(e,t)=>n(`/api/flags${i(e,{conversation_id:t,ids_only:"true"})}`),"listInboxItems",0,(e,t)=>{let a={};return t?.limit&&(a.limit=String(t.limit)),t?.before&&(a.before=t.before),t?.types?.length&&(a.types=t.types.join(",")),n(`/api/inbox${i(e,a)}`)},"listInvites",0,e=>n(`/api/workspaces/${e}/invites${i(e)}`),"listIssues",0,(e,t)=>{let a={};return t?.agentId&&(a.agentId=t.agentId),t?.status&&(a.status=t.status),t?.terminal!==void 0&&(a.terminal=String(t.terminal)),n(`/api/issues${i(e,a)}`)},"listMeetings",0,(e,t)=>n(`/api/agents/${e}/meetings${i(t)}`),"listMembers",0,e=>n(`/api/workspaces/${e}/members${i(e)}`),"listMessages",0,(e,t,a)=>{let r={};return a?.limit&&(r.limit=String(a.limit)),a?.before&&(r.before=a.before),a?.beforeId&&(r.before_id=a.beforeId),n(`/api/conversations/${e}/messages${i(t,r)}`)},"listMessagesAroundTask",0,(e,t,a)=>n(`/api/conversations/${e}/messages${i(t,{around_task:a})}`),"listPreviousConversations",0,(e,t,a)=>{let r={exclude:a.exclude,before:a.before};return a.channel&&(r.channel=a.channel),a.limit&&(r.limit=String(a.limit)),n(`/api/agents/${e}/conversations${i(t,r)}`)},"listRuntimes",0,e=>n(`/api/runtimes${i(e)}`),"listTraces",0,(e,t)=>{let a={};return t?.limit&&(a.limit=String(t.limit)),t?.before&&(a.before=t.before),t?.status&&(a.status=t.status),t?.multiAgent&&(a.multiAgent="true"),t?.agentId&&(a.agentId=t.agentId),t?.channel&&(a.channel=t.channel),n(`/api/traces${i(e,a)}`)},"listWhitelist",0,(e,t)=>n(`/api/agents/${e}/whitelist${i(t)}`),"listWorkspaceActiveTasks",0,e=>n(`/api/agents/active-tasks${i(e)}`),"listWorkspaces",0,()=>n("/api/workspaces"),"markAllInboxRead",0,e=>n(`/api/inbox/read-all${i(e)}`,{method:"POST"}),"markInboxRead",0,(e,t)=>n(`/api/inbox/read${i(t)}`,{method:"POST",body:JSON.stringify({conversationId:e})}),"pinAgent",0,(e,t)=>n(`/api/agents/${t}/pin${i(e)}`,{method:"POST"}),"removeMember",0,(e,t)=>n(`/api/workspaces/${e}/members/${t}${i(e)}`,{method:"DELETE"}),"removeWhitelistEmail",0,(e,t,a)=>n(`/api/agents/${e}/whitelist/${t}${i(a)}`,{method:"DELETE"}),"renameChannelApi",0,(e,t,a)=>n(`/api/channels/${e}${i(t)}`,{method:"PATCH",body:JSON.stringify({name:a})}),"reorderAgentPins",0,(e,t)=>n(`/api/agents/pins/reorder${i(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"reorderChannelsApi",0,(e,t)=>n(`/api/channels/reorder${i(e)}`,{method:"PUT",body:JSON.stringify({ordered_channel_ids:t})}),"reorderUnpinnedAgents",0,(e,t)=>n(`/api/agents/sidebar/reorder${i(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"requestWorkspaceBrowse",0,(e,t,a,r)=>n(`/api/agents/${e}/workspace/browse${i(t)}`,{method:"POST",body:JSON.stringify({request_type:a,path:r})}),"retryTask",0,(e,t)=>n(`/api/tasks/${e}/retry${i(t)}`,{method:"POST"}),"revokeAgentAccess",0,(e,t,a,r=!1)=>n(`/api/agents/${t}/access/${a}${i(e)}${r?"&remove_whitelist=true":""}`,{method:"DELETE"}),"revokeInvite",0,(e,t)=>n(`/api/workspaces/${e}/invites/${t}${i(e)}`,{method:"DELETE"}),"sendEmail",0,(e,t,a,r,s,o,l,c)=>n(`/api/email/send${i(s)}`,{method:"POST",body:JSON.stringify({agentId:e,to:t,subject:a,htmlBody:r,attachments:o,...l,customAccountId:c})}),"sendMessage",0,s,"stopMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings/${t}/stop${i(a)}`,{method:"POST"}),"syncEmailAccount",0,(e,t,a)=>n(`/api/agents/${e}/email-accounts/${t}/sync${i(a)}`,{method:"POST"}),"triggerRuntimeRescan",0,(e,t)=>n(`/api/runtimes/${e}/rescan${i(t)}`,{method:"POST"}),"triggerRuntimeUpdate",0,(e,t)=>n(`/api/runtimes/${e}/update${i(t)}`,{method:"POST"}),"trustEmail",0,(e,t)=>n(`/api/email/${e}/trust${i(t)}`,{method:"POST"}),"unflagMessage",0,(e,t)=>n(`/api/flags/${t}${i(e)}`,{method:"DELETE"}),"unpinAgent",0,(e,t)=>n(`/api/agents/${t}/pin${i(e)}`,{method:"DELETE"}),"updateAgent",0,(e,t,a)=>n(`/api/agents/${e}${i(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateAgentLink",0,(e,t,a)=>n(`/api/agent-links/${e}${i(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateCalendarEvent",0,(e,t,a)=>n(`/api/calendar/${e}${i(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateEmailStatus",0,(e,t,a)=>n(`/api/email/${e}${i(t)}`,{method:"PATCH",body:JSON.stringify({status:a})}),"updateIssue",0,(e,t,a)=>n(`/api/issues/${t}${i(e)}`,{method:"PATCH",body:JSON.stringify(a)}),"updateMemberMe",0,(e,t)=>n(`/api/members/me${i(e)}`,{method:"PATCH",body:JSON.stringify({global_instruction:t})}),"updateWorkspace",0,(e,t)=>n(`/api/workspaces/${e}${i(e)}`,{method:"PATCH",body:JSON.stringify(t)}),"uploadEmailAttachment",0,l],222862)},728886,e=>{"use strict";var t=e.i(653772),a=e.i(613349);e.s(["Skeleton",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"skeleton",className:(0,a.cn)("animate-pulse rounded-md bg-muted",e),...r})}])},896210,e=>{"use strict";let t=(0,e.i(419412).default)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);e.s(["Mail",0,t],896210)},330746,e=>{"use strict";let t=(0,e.i(419412).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],330746)},966662,940931,e=>{"use strict";let t=(0,e.i(419412).default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["Paperclip",0,t],966662);var a=e.i(653772),r=e.i(511043),n=e.i(111114);let i=`
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,275351,e=>{"use strict";let t,a,r,n,i=(e,t)=>t.some(t=>e instanceof t),s=new WeakMap,o=new WeakMap,l=new WeakMap,c={get(e,t,a){if(e instanceof IDBTransaction){if("done"===t)return s.get(e);if("store"===t)return a.objectStoreNames[1]?void 0:a.objectStore(a.objectStoreNames[0])}return d(e[t])},set:(e,t,a)=>(e[t]=a,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function d(e){if(e instanceof IDBRequest){let t;return t=new Promise((t,a)=>{let r=()=>{e.removeEventListener("success",n),e.removeEventListener("error",i)},n=()=>{t(d(e.result)),r()},i=()=>{a(e.error),r()};e.addEventListener("success",n),e.addEventListener("error",i)}),l.set(t,e),t}if(o.has(e))return o.get(e);let t=function(e){if("function"==typeof e)return(n||(n=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(u(this),t),d(this.request)}:function(...t){return d(e.apply(u(this),t))};return(e instanceof IDBTransaction&&function(e){if(s.has(e))return;let t=new Promise((t,a)=>{let r=()=>{e.removeEventListener("complete",n),e.removeEventListener("error",i),e.removeEventListener("abort",i)},n=()=>{t(),r()},i=()=>{a(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",n),e.addEventListener("error",i),e.addEventListener("abort",i)});s.set(e,t)}(e),i(e,r||(r=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(e,c):e}(e);return t!==e&&(o.set(e,t),l.set(t,e)),t}let u=e=>l.get(e),p=["get","getKey","getAll","getAllKeys","count"],m=["put","add","delete","clear"],g=new Map;function f(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(g.get(t))return g.get(t);let a=t.replace(/FromIndex$/,""),r=t!==a,n=m.includes(a);if(!(a in(r?IDBIndex:IDBObjectStore).prototype)||!(n||p.includes(a)))return;let i=async function(e,...t){let i=this.transaction(e,n?"readwrite":"readonly"),s=i.store;return r&&(s=s.index(t.shift())),(await Promise.all([s[a](...t),n&&i.done]))[0]};return g.set(t,i),i}c={...t=c,get:(e,a,r)=>f(e,a)||t.get(e,a,r),has:(e,a)=>!!f(e,a)||t.has(e,a)};let h=["continue","continuePrimaryKey","advance"],y={},b=new WeakMap,w=new WeakMap,v={get(e,t){if(!h.includes(t))return e[t];let a=y[t];return a||(a=y[t]=function(...e){b.set(this,w.get(this)[t](...e))}),a}};async function*$(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;let a=new Proxy(t,v);for(w.set(a,t),l.set(a,u(t));t;)yield a,t=await (b.get(a)||t.continue()),b.delete(a)}function k(e,t){return t===Symbol.asyncIterator&&i(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&i(e,[IDBIndex,IDBObjectStore])}c={...a=c,get:(e,t,r)=>k(e,t)?$:a.get(e,t,r),has:(e,t)=>k(e,t)||a.has(e,t)};let x=null,S=null;function E(e){return"u"<typeof indexedDB?null:x&&S===e?x:(S=e,x=function(e,{blocked:t,upgrade:a,blocking:r,terminated:n}={}){let i=indexedDB.open(e,4),s=d(i);return a&&i.addEventListener("upgradeneeded",e=>{a(d(i.result),e.oldVersion,e.newVersion,d(i.transaction),e)}),t&&i.addEventListener("blocked",e=>t(e.oldVersion,e.newVersion,e)),s.then(e=>{n&&e.addEventListener("close",()=>n()),r&&e.addEventListener("versionchange",e=>r(e.oldVersion,e.newVersion,e))}).catch(()=>{}),s}(`alook-chat-cache-${e}`,{upgrade(e,t){if(t<1){let t=e.createObjectStore("messages",{keyPath:["conversation_id","id"]});t.createIndex("by-conversation","conversation_id",{unique:!1}),t.createIndex("by-created",["conversation_id","created_at"],{unique:!1}),e.createObjectStore("cache_meta",{keyPath:"conversation_id"})}t<3&&e.createObjectStore("last_open",{keyPath:"key"}).createIndex("by-conversation","conversation_id",{unique:!1}),t<4&&e.createObjectStore("conv_extras",{keyPath:"conversation_id"})}}))}function _(e){return e?E(e):x}async function C(e,t){let a=_(t);if(!a)return null;try{let t=await a,r=await t.getAllFromIndex("messages","by-conversation",e);if(0===r.length)return null;let n=r.filter(e=>!e.id.startsWith("temp-"));n.sort((e,t)=>{let a=e.created_at.localeCompare(t.created_at);return 0!==a?a:e.id.localeCompare(t.id)});let i=await t.get("cache_meta",e);return i&&await t.put("cache_meta",{...i,lastAccessedAt:Date.now()}),n}catch{return null}}async function T(e,t,a,r,n){let i=_(n);if(!i)return null;try{let n=await i,s=await n.get("cache_meta",e);if(!s)return null;let o=IDBKeyRange.bound([e,""],[e,t],!1,!1),l=(await n.getAllFromIndex("messages","by-created",o)).filter(e=>!e.id.startsWith("temp-")&&(e.created_at!==t||!(e.id>=a)));l.sort((e,t)=>{let a=t.created_at.localeCompare(e.created_at);return 0!==a?a:t.id.localeCompare(e.id)});let c=l.slice(0,r);if(c.length<r&&s.hasMore)return null;return await n.put("cache_meta",{...s,lastAccessedAt:Date.now()}),{messages:c.reverse(),hasMore:l.length>r||s.hasMore}}catch{return null}}async function I(e,t,a,r,n){let i=_(r);if(i)try{let r=await i,s=t.filter(e=>!e.id.startsWith("temp-"));if(0===s.length)return;let o=r.transaction(["messages","cache_meta"],"readwrite"),l=o.objectStore("messages"),c=o.objectStore("cache_meta");for(let e of s)await l.put(e);let d=await l.index("by-conversation").getAllKeys(e),u=Date.now(),p=s.reduce((e,t)=>e.created_at>t.created_at?e:t),m=await c.get(e),g=a??m?.hasMore??!0,f=m?.newestMessageId&&m.newestMessageId!==p.id?await (async()=>{let t=await l.get([e,m.newestMessageId]);return t&&t.created_at>p.created_at?t.id:p.id})():p.id,h={conversation_id:e,lastFetchedAt:u,lastAccessedAt:u,messageCount:d.length,newestMessageId:f,hasMore:g,serverMessageCount:n??m?.serverMessageCount??0};await c.put(h),await o.done,L().catch(()=>{})}catch{}}async function j(e,t,a){let r=_(a);if(r&&!t.id.startsWith("temp-"))try{let a=await r,n=await a.get("cache_meta",e);if(!n)return;let i=await a.get("messages",[e,t.id]);await a.put("messages",t),await a.put("cache_meta",{...n,lastAccessedAt:Date.now(),messageCount:i?n.messageCount:n.messageCount+1,newestMessageId:t.id})}catch{}}async function M(e,t){let a=_(t);if(!a)return null;try{let t=await a;return await t.get("cache_meta",e)??null}catch{return null}}function A(e,t){return`${e}::${null==t?"":t}`}async function P(e,t,a){let r=_(a);if(!r)return null;try{let a=await r;return await a.get("last_open",A(e,t))??null}catch{return null}}async function N(e,t,a,r){let n=_(r);if(n)try{let r=await n;await r.put("last_open",{key:A(e,t),conversation_id:a.conversation_id,newestMessageId:a.newestMessageId,serverMessageCount:a.serverMessageCount,updatedAt:Date.now()})}catch{}}async function O(e,t){let a=_(t);if(!a)return null;try{let t=await a;return await t.get("conv_extras",e)??null}catch{return null}}async function D(e,t,a){let r=_(a);if(r)try{let a=await r;await a.put("conv_extras",{conversation_id:e,...t,updatedAt:Date.now()})}catch{}}async function L(e=50){let t=_();if(t)try{let a=await t,r=await a.getAll("cache_meta");if(r.length<=e)return;r.sort((e,t)=>e.lastAccessedAt-t.lastAccessedAt);let n=r.slice(0,r.length-e),i=a.transaction(["messages","cache_meta","last_open","conv_extras"],"readwrite"),s=i.objectStore("messages"),o=i.objectStore("cache_meta"),l=i.objectStore("last_open"),c=i.objectStore("conv_extras");for(let e of n){for(let t of(await s.index("by-conversation").getAllKeys(e.conversation_id)))await s.delete(t);for(let t of(await o.delete(e.conversation_id),await l.index("by-conversation").getAllKeys(e.conversation_id)))await l.delete(t);await c.delete(e.conversation_id)}await i.done}catch{}}async function B(){if("u">typeof indexedDB)try{x&&((await x).close(),x=null),S&&(await R(`alook-chat-cache-${S}`),S=null)}catch{}}async function R(e){return new Promise((t,a)=>{let r=indexedDB.deleteDatabase(e);r.onsuccess=()=>t(),r.onerror=()=>a(r.error),r.onblocked=()=>t()})}e.s(["appendCachedMessage",0,j,"clearAllCache",0,B,"getCacheMeta",0,M,"getCachedMessages",0,C,"getCachedMessagesBefore",0,T,"getConvExtras",0,O,"getLastOpenConversation",0,P,"mergeCachedMessages",0,I,"openCacheDB",0,E,"setConvExtras",0,D,"setLastOpenConversation",0,N],275351)},345262,e=>{"use strict";let t=(0,e.i(419412).default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);e.s(["ArrowUpRight",0,t],345262)},500324,e=>{"use strict";var t=e.i(653772),a=e.i(511043);let r=(0,a.createContext)(null);e.s(["WorkspaceProvider",0,function({workspaceId:e,slug:n,children:i}){return(0,a.useEffect)(()=>{try{localStorage.setItem("lastWorkspace",n)}catch{}},[n]),(0,t.jsx)(r.Provider,{value:{workspaceId:e,slug:n},children:i})},"useWorkspace",0,function(){let e=(0,a.useContext)(r);if(!e)throw Error("useWorkspace must be used within WorkspaceProvider");return e}])},126942,(e,t,a)=>{t.exports=e.r(871628)},222862,636557,e=>{"use strict";var t=e.i(811374);class a extends Error{status;details;constructor(e,t,a){super(e),this.name="ApiError",this.status=t,this.details=a}get isNetworkError(){return 0===this.status}get isRateLimit(){return 429===this.status}get isUnauthorized(){return 401===this.status}}function r(e,t){return"validation error"===e&&t?.length?function(e){let[t,...a]=e.split(":"),r=a.join(":").trim();if(!r)return e;let n=t.trim(),i=n.trim().replace(/[_-]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()),s=r.replace(/^required$/i,"is required"),o=s.toLowerCase().replace(/[_-]+/g," "),l=n.toLowerCase().replace(/[_-]+/g," ");return l&&o.startsWith(`${l} `)&&(s=s.slice(n.length).trimStart()),i?`${i} ${s}`:s}(t[0]):e}async function n(e,t){let n;try{n=await fetch(""+e,{...t,credentials:"include",headers:{"Content-Type":"application/json",...t?.headers}})}catch(e){if(e instanceof TypeError)throw new a("Unable to connect — check your network",0);throw e}if(401===n.status)throw window.location.href="/sign-in",new a("Unauthorized",401);if(!n.ok){let e,t;try{let a=await n.json();e=a.error,t=a.details}catch{}if(429===n.status)throw new a("Please wait a moment before trying again",429);if(n.status>=500)throw new a(r(e,t)||"Something went wrong — please try again",n.status,t);throw new a(r(e,t)||"Something went wrong",n.status,t)}if(204!==n.status)return n.json()}function i(e,t){let a=new URLSearchParams({workspace_id:e,...t});return`?${a.toString()}`}e.s(["ApiError",0,a],636557),parseInt(t.default.env.NEXT_PUBLIC_MOCK_NETWORK_DELAY_MS||"300",10);let s=async(e,t,r,s,o)=>{let l;if(!s||0===s.length)return n(`/api/conversations/${e}/messages${i(r)}`,{method:"POST",body:JSON.stringify({content:t,...o?{metadata:o}:{}})});let c=new FormData;for(let e of(c.append("content",t),o&&c.append("metadata",JSON.stringify(o)),s))c.append("file",e.file);for(let e=0;e<s.length;e++){let t=s[e].thumbnailBlob;t&&c.append(`thumbnail:${e}`,t,"thumbnail.jpg")}try{l=await fetch(`/api/conversations/${e}/messages${i(r)}`,{method:"POST",credentials:"include",body:c})}catch(e){if(e instanceof TypeError)throw new a("Unable to connect — check your network",0);throw e}if(401===l.status)throw window.location.href="/sign-in",new a("Unauthorized",401);if(!l.ok){let e,t;try{let a=await l.json();e=a.error,t=a.details}catch{}if(429===l.status)throw new a("Please wait a moment before trying again",429);if(l.status>=500)throw new a(e||"Something went wrong — please try again",l.status,t);throw new a(e||"Something went wrong",l.status,t)}return l.json()},o=async(e,t)=>{let a=new URLSearchParams({workspace_id:t}),r=await fetch(`/api/email/${e}/body?${a}`,{credentials:"include"});if(!r.ok)return{content:"(body not available)",isHtml:!1};let n=r.headers.get("Content-Type")??"";return{content:await r.text(),isHtml:n.includes("text/html")}},l=async(e,t)=>{let r=new FormData;r.append("file",e);let n=await fetch(`/api/email/upload${i(t)}`,{method:"POST",credentials:"include",body:r});if(!n.ok)throw new a(await n.text().catch(()=>"Upload failed"),n.status);return n.json()},c=async(e,t)=>{let r;if(!t.files||0===t.files.length)return n(`/api/issues${i(e)}`,{method:"POST",body:JSON.stringify({agent_id:t.agent_id,title:t.title,description:t.description})});let s=new FormData;for(let e of(t.agent_id&&s.append("agent_id",t.agent_id),s.append("title",t.title),s.append("description",t.description??""),t.files))s.append("file",e);try{r=await fetch(`/api/issues${i(e)}`,{method:"POST",credentials:"include",body:s})}catch(e){if(e instanceof TypeError)throw new a("Unable to connect — check your network",0);throw e}if(401===r.status)throw window.location.href="/sign-in",new a("Unauthorized",401);if(!r.ok){let e,t;try{let a=await r.json();e=a.error,t=a.details}catch{}if(429===r.status)throw new a("Please wait a moment before trying again",429);if(r.status>=500)throw new a(e||"Something went wrong — please try again",r.status,t);throw new a(e||"Something went wrong",r.status,t)}return r.json()},d=async(e,t)=>{let a=new URLSearchParams({workspace_id:t}),r=await fetch(`/api/artifacts/${e}/content?${a}`,{credentials:"include"});return r.ok?r.text():"(content not available)"};e.s(["acceptInvite",0,e=>n(`/api/invite/${e}`,{method:"POST"}),"addWhitelistEmail",0,(e,t,a)=>n(`/api/agents/${e}/whitelist${i(a)}`,{method:"POST",body:JSON.stringify({email:t})}),"approveMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings/${t}/approve${i(a)}`,{method:"POST"}),"cancelActiveTask",0,(e,t)=>n(`/api/conversations/${e}/active-task${i(t)}`,{method:"DELETE"}),"chatInit",0,(e,t,a)=>n(`/api/agents/${e}/chat-init${i(t)}`,{method:"POST",body:JSON.stringify({...a?{channel:a}:{}})}),"checkFreshness",0,(e,t)=>{let a={};return e.conversationId&&(a.conversation_id=e.conversationId),e.agentId&&(a.agent_id=e.agentId),e.channel&&(a.channel=e.channel),n(`/api/conversations/check-fresh${i(t,a)}`)},"conversationInit",0,(e,t,a)=>{let r={};return a?.newestMessageId&&(r.newest_message_id=a.newestMessageId),a?.messageCount&&(r.message_count=String(a.messageCount)),n(`/api/conversations/${e}/init${i(t,r)}`)},"createAgent",0,(e,t)=>n(`/api/agents${i(t)}`,{method:"POST",body:JSON.stringify(e)}),"createAgentLink",0,(e,t)=>n(`/api/agent-links${i(t)}`,{method:"POST",body:JSON.stringify(e)}),"createCalendarEvent",0,(e,t)=>n(`/api/calendar${i(t)}`,{method:"POST",body:JSON.stringify(e)}),"createChannelApi",0,(e,t)=>n(`/api/channels${i(e)}`,{method:"POST",body:JSON.stringify({name:t})}),"createConversation",0,(e,t,a)=>n(`/api/conversations${i(t)}`,{method:"POST",body:JSON.stringify({agent_id:e,...a?{channel:a}:{}})}),"createEmailAccount",0,(e,t,a)=>n(`/api/agents/${e}/email-accounts${i(a)}`,{method:"POST",body:JSON.stringify(t)}),"createInvite",0,e=>n(`/api/workspaces/${e}/invites${i(e)}`,{method:"POST"}),"createIssue",0,c,"createMachineToken",0,(e,t)=>n(`/api/machine-tokens${t?i(t):""}`,{method:"POST",body:JSON.stringify({name:e||"default"})}),"createMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings${i(t)}`,{method:"POST",body:JSON.stringify(a)}),"createThread",0,(e,t,a,r)=>n(`/api/conversations/${e}/threads${i(r)}`,{method:"POST",body:JSON.stringify({parent_message_id:t,content:a})}),"deleteAgent",0,(e,t)=>n(`/api/agents/${e}${i(t)}`,{method:"DELETE"}),"deleteAgentLink",0,(e,t)=>n(`/api/agent-links/${e}${i(t)}`,{method:"DELETE"}),"deleteCalendarEvent",0,(e,t,a)=>n(`/api/calendar/${e}${i(t)}`,{method:"DELETE",...a&&a.scope?{headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}:{}}),"deleteChannelApi",0,(e,t)=>n(`/api/channels/${e}${i(t)}`,{method:"DELETE"}),"deleteEmail",0,(e,t)=>n(`/api/email/${e}${i(t)}`,{method:"DELETE"}),"deleteEmailAccount",0,(e,t,a)=>n(`/api/agents/${e}/email-accounts/${t}${i(a)}`,{method:"DELETE"}),"deleteIssue",0,(e,t)=>n(`/api/issues/${t}${i(e)}`,{method:"DELETE"}),"deleteMachine",0,(e,t)=>n(`/api/runtimes/machine${i(t,{daemon_id:e})}`,{method:"DELETE"}),"deleteMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings/${t}${i(a)}`,{method:"DELETE"}),"deleteWorkspace",0,(e,t)=>n(`/api/workspaces/${e}${i(e)}`,{method:"DELETE",body:JSON.stringify({confirm_name:t})}),"fetchLatestCliVersion",0,()=>n("/api/cli/latest-version"),"fetchModelOptions",0,()=>n("/api/config/model-options"),"flagMessage",0,(e,t)=>n(`/api/flags${i(e)}`,{method:"POST",body:JSON.stringify({messageId:t})}),"getActiveTask",0,(e,t)=>n(`/api/conversations/${e}/active-task${i(t)}`),"getAgent",0,(e,t)=>n(`/api/agents/${e}${i(t)}`),"getAgentSkills",0,(e,t)=>n(`/api/agents/${e}/skills${i(t)}`),"getArtifactContent",0,d,"getCalendarEvent",0,(e,t)=>n(`/api/calendar/${e}${i(t)}`),"getEmail",0,(e,t)=>n(`/api/email/${e}${i(t)}`),"getEmailBody",0,o,"getEmailThread",0,(e,t)=>n(`/api/email/${e}/thread${i(t)}`),"getFlaggedCount",0,e=>n(`/api/flags/count${i(e)}`),"getInboxCount",0,(e,t)=>{let a={};return t?.types?.length&&(a.types=t.types.join(",")),n(`/api/inbox/count${i(e,a)}`)},"getInviteInfo",0,e=>n(`/api/invite/${e}`),"getIssue",0,(e,t)=>n(`/api/issues/${t}${i(e)}`),"getMemberMe",0,e=>n(`/api/members/me${i(e)}`),"getMinCliVersion",0,()=>n("/api/config/min-version"),"getTask",0,(e,t)=>n(`/api/tasks/${e}${i(t)}`),"getTaskMessages",0,(e,t,a)=>n(`/api/tasks/${e}/messages${i(t,a?{since:String(a)}:void 0)}`),"getThreadSummaries",0,(e,t)=>n(`/api/conversations/${e}/threads${i(t)}`),"getTrace",0,(e,t)=>n(`/api/traces/${e}${i(t)}`),"getWorkspaceOverview",0,e=>n(`/api/workspaces/${e}/overview${i(e)}`),"grantAgentAccess",0,(e,t,a)=>n(`/api/agents/${t}/access${i(e)}`,{method:"POST",body:JSON.stringify({user_id:a})}),"listAgentAccess",0,(e,t)=>n(`/api/agents/${t}/access${i(e)}`),"listAgentActiveTaskCounts",0,e=>n(`/api/agents/active-task-counts${i(e)}`),"listAgentActivity",0,(e,t,a)=>{let r={};return a?.limit&&(r.limit=String(a.limit)),a?.before&&(r.before=a.before),a?.beforeId&&(r.before_id=a.beforeId),a?.status&&(r.status=a.status),a?.type&&(r.type=a.type),n(`/api/agents/${e}/activity${i(t,r)}`)},"listAgentLinks",0,e=>n(`/api/agent-links${i(e)}`),"listAgentPins",0,e=>n(`/api/agents/pins${i(e)}`),"listAgents",0,e=>n(`/api/agents${i(e)}`),"listArtifacts",0,(e,t)=>n(`/api/artifacts${i(t,{conversation_id:e})}`),"listCalendarEvents",0,(e,t)=>{let a={};return t?.agentId&&(a.agentId=t.agentId),t?.from&&(a.from=t.from),t?.to&&(a.to=t.to),n(`/api/calendar${i(e,a)}`)},"listChannels",0,e=>n(`/api/channels${i(e)}`),"listEmailAccounts",0,(e,t)=>n(`/api/agents/${e}/email-accounts${i(t)}`),"listEmails",0,(e,t,a,r)=>n(`/api/email${i(t,{agentId:e,...a?{folder:a}:{},...r?{address:r}:{}})}`),"listFlaggedItems",0,(e,t)=>{let a={};return t?.limit&&(a.limit=String(t.limit)),t?.before&&(a.before=t.before),n(`/api/flags${i(e,a)}`)},"listFlaggedMessageIds",0,(e,t)=>n(`/api/flags${i(e,{conversation_id:t,ids_only:"true"})}`),"listInboxItems",0,(e,t)=>{let a={};return t?.limit&&(a.limit=String(t.limit)),t?.before&&(a.before=t.before),t?.types?.length&&(a.types=t.types.join(",")),n(`/api/inbox${i(e,a)}`)},"listInvites",0,e=>n(`/api/workspaces/${e}/invites${i(e)}`),"listIssues",0,(e,t)=>{let a={};return t?.agentId&&(a.agentId=t.agentId),t?.status&&(a.status=t.status),t?.terminal!==void 0&&(a.terminal=String(t.terminal)),n(`/api/issues${i(e,a)}`)},"listMeetings",0,(e,t)=>n(`/api/agents/${e}/meetings${i(t)}`),"listMembers",0,e=>n(`/api/workspaces/${e}/members${i(e)}`),"listMessages",0,(e,t,a)=>{let r={};return a?.limit&&(r.limit=String(a.limit)),a?.before&&(r.before=a.before),a?.beforeId&&(r.before_id=a.beforeId),n(`/api/conversations/${e}/messages${i(t,r)}`)},"listMessagesAroundTask",0,(e,t,a)=>n(`/api/conversations/${e}/messages${i(t,{around_task:a})}`),"listPreviousConversations",0,(e,t,a)=>{let r={exclude:a.exclude,before:a.before};return a.channel&&(r.channel=a.channel),a.limit&&(r.limit=String(a.limit)),n(`/api/agents/${e}/conversations${i(t,r)}`)},"listRuntimes",0,e=>n(`/api/runtimes${i(e)}`),"listTraces",0,(e,t)=>{let a={};return t?.limit&&(a.limit=String(t.limit)),t?.before&&(a.before=t.before),t?.status&&(a.status=t.status),t?.multiAgent&&(a.multiAgent="true"),t?.agentId&&(a.agentId=t.agentId),t?.channel&&(a.channel=t.channel),n(`/api/traces${i(e,a)}`)},"listWhitelist",0,(e,t)=>n(`/api/agents/${e}/whitelist${i(t)}`),"listWorkspaceActiveTasks",0,e=>n(`/api/agents/active-tasks${i(e)}`),"listWorkspaces",0,()=>n("/api/workspaces"),"markAllInboxRead",0,e=>n(`/api/inbox/read-all${i(e)}`,{method:"POST"}),"markInboxRead",0,(e,t)=>n(`/api/inbox/read${i(t)}`,{method:"POST",body:JSON.stringify({conversationId:e})}),"pinAgent",0,(e,t)=>n(`/api/agents/${t}/pin${i(e)}`,{method:"POST"}),"removeMember",0,(e,t)=>n(`/api/workspaces/${e}/members/${t}${i(e)}`,{method:"DELETE"}),"removeWhitelistEmail",0,(e,t,a)=>n(`/api/agents/${e}/whitelist/${t}${i(a)}`,{method:"DELETE"}),"renameChannelApi",0,(e,t,a)=>n(`/api/channels/${e}${i(t)}`,{method:"PATCH",body:JSON.stringify({name:a})}),"reorderAgentPins",0,(e,t)=>n(`/api/agents/pins/reorder${i(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"reorderChannelsApi",0,(e,t)=>n(`/api/channels/reorder${i(e)}`,{method:"PUT",body:JSON.stringify({ordered_channel_ids:t})}),"reorderUnpinnedAgents",0,(e,t)=>n(`/api/agents/sidebar/reorder${i(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"requestWorkspaceBrowse",0,(e,t,a,r)=>n(`/api/agents/${e}/workspace/browse${i(t)}`,{method:"POST",body:JSON.stringify({request_type:a,path:r})}),"retryTask",0,(e,t)=>n(`/api/tasks/${e}/retry${i(t)}`,{method:"POST"}),"revokeAgentAccess",0,(e,t,a,r=!1)=>n(`/api/agents/${t}/access/${a}${i(e)}${r?"&remove_whitelist=true":""}`,{method:"DELETE"}),"revokeInvite",0,(e,t)=>n(`/api/workspaces/${e}/invites/${t}${i(e)}`,{method:"DELETE"}),"sendEmail",0,(e,t,a,r,s,o,l,c)=>n(`/api/email/send${i(s)}`,{method:"POST",body:JSON.stringify({agentId:e,to:t,subject:a,htmlBody:r,attachments:o,...l,customAccountId:c})}),"sendMessage",0,s,"stopMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings/${t}/stop${i(a)}`,{method:"POST"}),"syncEmailAccount",0,(e,t,a)=>n(`/api/agents/${e}/email-accounts/${t}/sync${i(a)}`,{method:"POST"}),"triggerRuntimeRescan",0,(e,t)=>n(`/api/runtimes/${e}/rescan${i(t)}`,{method:"POST"}),"triggerRuntimeUpdate",0,(e,t)=>n(`/api/runtimes/${e}/update${i(t)}`,{method:"POST"}),"trustEmail",0,(e,t)=>n(`/api/email/${e}/trust${i(t)}`,{method:"POST"}),"unflagMessage",0,(e,t)=>n(`/api/flags/${t}${i(e)}`,{method:"DELETE"}),"unpinAgent",0,(e,t)=>n(`/api/agents/${t}/pin${i(e)}`,{method:"DELETE"}),"updateAgent",0,(e,t,a)=>n(`/api/agents/${e}${i(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateAgentLink",0,(e,t,a)=>n(`/api/agent-links/${e}${i(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateCalendarEvent",0,(e,t,a)=>n(`/api/calendar/${e}${i(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateEmailStatus",0,(e,t,a)=>n(`/api/email/${e}${i(t)}`,{method:"PATCH",body:JSON.stringify({status:a})}),"updateIssue",0,(e,t,a)=>n(`/api/issues/${t}${i(e)}`,{method:"PATCH",body:JSON.stringify(a)}),"updateMemberMe",0,(e,t)=>n(`/api/members/me${i(e)}`,{method:"PATCH",body:JSON.stringify({global_instruction:t})}),"updateWorkspace",0,(e,t)=>n(`/api/workspaces/${e}${i(e)}`,{method:"PATCH",body:JSON.stringify(t)}),"uploadEmailAttachment",0,l],222862)},728886,e=>{"use strict";var t=e.i(653772),a=e.i(613349);e.s(["Skeleton",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"skeleton",className:(0,a.cn)("animate-pulse rounded-md bg-muted",e),...r})}])},896210,e=>{"use strict";let t=(0,e.i(419412).default)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);e.s(["Mail",0,t],896210)},330746,e=>{"use strict";let t=(0,e.i(419412).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],330746)},966662,940931,e=>{"use strict";let t=(0,e.i(419412).default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["Paperclip",0,t],966662);var a=e.i(653772),r=e.i(511043),n=e.i(111114);let i=`
|
|
2
2
|
html, body {
|
|
3
3
|
overflow: hidden;
|
|
4
4
|
}
|
|
@@ -60,4 +60,4 @@
|
|
|
60
60
|
<style>${i}${p?o:s}</style>
|
|
61
61
|
</head>
|
|
62
62
|
<body>${e}</body>
|
|
63
|
-
</html>`;let r=()=>{let e=t.contentDocument;if(!e)return;let r=()=>{let t=e.documentElement.scrollHeight;t>0&&u(t)};r(),(a=new ResizeObserver(r)).observe(e.documentElement)};return t.addEventListener("load",r),()=>{t.removeEventListener("load",r),a?.disconnect()}},[e,p]),(0,a.jsx)("iframe",{ref:l,sandbox:"allow-same-origin",className:t,style:{width:"100%",height:`${d}px`,border:"none",display:"block"},title:"Email content"})}],940931)},355753,e=>{"use strict";let t=(0,e.i(419412).default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);e.s(["default",0,t])},481282,731316,657587,385745,e=>{"use strict";var t=e.i(127677),a=(0,e.i(995292).default)(Object.keys,Object),r=Object.prototype.hasOwnProperty;let n=function(e){if(!(0,t.default)(e))return a(e);var n=[];for(var i in Object(e))r.call(e,i)&&"constructor"!=i&&n.push(i);return n};e.s(["default",0,n],731316);var i=e.i(130636),s=e.i(659173),o=(0,i.default)(s.default,"DataView"),l=e.i(121200),c=(0,i.default)(s.default,"Promise"),d=(0,i.default)(s.default,"Set");e.s(["default",0,d],657587);var u=(0,i.default)(s.default,"WeakMap"),p=e.i(706462),m=e.i(882148),f="[object Map]",g="[object Promise]",h="[object Set]",y="[object WeakMap]",b="[object DataView]",w=(0,m.default)(o),v=(0,m.default)(l.default),$=(0,m.default)(c),k=(0,m.default)(d),x=(0,m.default)(u),S=p.default;(o&&S(new o(new ArrayBuffer(1)))!=b||l.default&&S(new l.default)!=f||c&&S(c.resolve())!=g||d&&S(new d)!=h||u&&S(new u)!=y)&&(S=function(e){var t=(0,p.default)(e),a="[object Object]"==t?e.constructor:void 0,r=a?(0,m.default)(a):"";if(r)switch(r){case w:return b;case v:return f;case $:return g;case k:return h;case x:return y}return t});let E=S;e.s(["default",0,E],385745);var _=e.i(530194),C=e.i(764843),T=e.i(750244),I=e.i(330772),j=e.i(400745),M=Object.prototype.hasOwnProperty;e.s(["default",0,function(e){if(null==e)return!0;if((0,T.default)(e)&&((0,C.default)(e)||"string"==typeof e||"function"==typeof e.splice||(0,I.default)(e)||(0,j.default)(e)||(0,_.default)(e)))return!e.length;var a=E(e);if("[object Map]"==a||"[object Set]"==a)return!e.size;if((0,t.default)(e))return!n(e).length;for(var r in e)if(M.call(e,r))return!1;return!0}],481282)},505494,e=>{"use strict";var t=e.i(752872),a=e.i(351359);e.i(991577);var r=e.i(692423),n=(0,a.__name)(e=>{let{securityLevel:a}=(0,t.getConfig2)(),n=(0,r.select)("body");if("sandbox"===a){let t=(0,r.select)(`#i${e}`),a=t.node()?.contentDocument??document;n=(0,r.select)(a.body)}return n.select(`#${e}`)},"selectSvgElement");e.s(["selectSvgElement",0,n])},489368,e=>{"use strict";var t=e.i(102198),a=e.i(103274),r=e.i(595995),n=e.i(752872),i=e.i(351359),s={common:n.common_default,getConfig:n.getConfig,insertCluster:a.insertCluster,insertEdge:t.insertEdge,insertEdgeLabel:t.insertEdgeLabel,insertMarkers:t.markers_default,insertNode:a.insertNode,interpolateToCurve:r.interpolateToCurve,labelHelper:a.labelHelper,log:i.log,positionEdgeLabel:t.positionEdgeLabel},o={},l=(0,i.__name)(e=>{for(let t of e)o[t.name]=t},"registerLayoutLoaders");(0,i.__name)(()=>{l([{name:"dagre",loader:(0,i.__name)(async()=>await e.A(274989),"loader")},{name:"cose-bilkent",loader:(0,i.__name)(async()=>await e.A(619639),"loader")}])},"registerDefaultLayoutLoaders")();var c=(0,i.__name)(async(e,t)=>{if(!(e.layoutAlgorithm in o))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let a=t.domId||t.id;t.domId=`${e.diagramId}-${a}`}let a=o[e.layoutAlgorithm],r=await a.loader(),{theme:n,themeVariables:i}=e.config,{useGradient:l,gradientStart:c,gradientStop:d}=i,u=t.attr("id");if(t.append("defs").append("filter").attr("id",`${u}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${n?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${u}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${n?.includes("dark")?"#FFFFFF":"#000000"}`),l){let e=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");e.append("svg:stop").attr("offset","0%").attr("stop-color",c).attr("stop-opacity",1),e.append("svg:stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}return r.render(e,t,s,{algorithm:a.algorithm})},"render"),d=(0,i.__name)((e="",{fallback:t="dagre"}={})=>{if(e in o)return e;if(t in o)return i.log.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm");e.s(["getRegisteredLayoutAlgorithm",0,d,"registerLayoutLoaders",0,l,"render",0,c])},967723,e=>{"use strict";let t=(0,e.i(419412).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],967723)},492451,e=>{"use strict";let t=(0,e.i(419412).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["File",0,t],492451)},80137,e=>{"use strict";let t=(0,e.i(419412).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["FileText",0,t],80137)},68322,522281,e=>{"use strict";var t=e.i(566710);e.s([],68322),e.s(["Streamdown",()=>t.C],522281)},288329,e=>{"use strict";var t=e.i(653772),a=e.i(511043),r=e.i(613349);e.s(["SheetResizeHandle",0,function({onPointerDown:e,onPointerMove:a,onPointerUp:n,className:i,withHandle:s=!0}){return(0,t.jsx)("div",{onPointerDown:e,onPointerMove:a,onPointerUp:n,onLostPointerCapture:n,className:(0,r.cn)("hidden sm:flex absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize z-10 items-center justify-center hover:bg-primary/10 active:bg-primary/20 transition-colors rounded-l-xl",i),children:s&&(0,t.jsx)("div",{className:"h-6 w-1 rounded-lg bg-border"})})},"useSheetResize",0,function({defaultWidth:e=480,minWidth:t=320,maxWidthRatio:r=.8}={}){let[n,i]=(0,a.useState)(e),s=(0,a.useRef)(!1),o=(0,a.useCallback)(e=>{e.preventDefault(),e.target.setPointerCapture(e.pointerId),s.current=!0},[]);return{width:n,onPointerDown:o,onPointerMove:(0,a.useCallback)(e=>{s.current&&i(Math.min(window.innerWidth*r,Math.max(t,window.innerWidth-e.clientX)))},[t,r]),onPointerUp:(0,a.useCallback)(e=>{s.current=!1,e.target.releasePointerCapture(e.pointerId)},[])}}])},998771,e=>{"use strict";let t=(0,e.i(419412).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",0,t],998771)},758956,e=>{"use strict";let t=(0,e.i(419412).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,t],758956)},51724,e=>{"use strict";let t=(0,e.i(419412).default)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);e.s(["CircleDot",0,t],51724)},131890,e=>{"use strict";let t=(0,e.i(419412).default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);e.s(["ArrowUp",0,t],131890)},450463,e=>{"use strict";e.s(["relativeTime",0,function(e){let t=new Date(e);if(isNaN(t.getTime()))return"";let a=Math.floor((new Date().getTime()-t.getTime())/6e4);if(a<1)return"just now";if(a<60)return`${a}m ago`;let r=Math.floor(a/60);if(r<24)return`${r}h ago`;let n=Math.floor(r/24);return n<7?`${n}d ago`:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}])},465368,648632,e=>{"use strict";var t=e.i(653772),a=e.i(511043),r=e.i(450463);e.i(400175);var n=e.i(819748),i=e.i(126366),s=e.i(496673),o=e.i(758956),l=e.i(332680);function c(e,{delay:t=450,moveThreshold:r=10}={}){let n=a.useRef(null),i=a.useRef(null),s=a.useRef(!1),o=a.useRef(e);a.useEffect(()=>{o.current=e});let l=a.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null),i.current=null},[]),d=a.useCallback(e=>{"mouse"!==e.pointerType&&(l(),s.current=!1,i.current={x:e.clientX,y:e.clientY},n.current=setTimeout(()=>{s.current=!0,i.current=null,n.current=null,o.current()},t))},[l,t]),u=a.useCallback(e=>{let t=i.current;if(!t)return;let a=Math.abs(e.clientX-t.x),n=Math.abs(e.clientY-t.y);(a>r||n>r)&&l()},[l,r]),p=a.useCallback(e=>{s.current&&(e.preventDefault(),e.stopPropagation(),s.current=!1)},[]);return a.useEffect(()=>l,[l]),{onPointerDown:d,onPointerMove:u,onPointerUp:l,onPointerCancel:l,onPointerLeave:l,onClick:p}}e.s(["useLongPress",0,c],648632),e.s(["EmailCard",0,function({subject:e,address:d,direction:u,onClick:p,timestamp:m,isInternal:f,internalHandle:g,targetConvId:h,targetAgentId:y,agents:b,onAgentChatOpen:w,touchAction:v}){let[$,k]=(0,a.useState)(null),[x,S]=(0,a.useState)(!1),[E,_]=(0,a.useState)(!1),C=c(()=>{v&&_(!0)}),T=(0,a.useCallback)(()=>{if(!f||x)return;S(!0);let e=b?.find(e=>e.email_handle===g);e&&k({name:e.name,avatarConfig:(0,i.parseAvatarUrl)(e.avatar_url)})},[f,x,b,g]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",onClick:e=>{v&&C.onClick&&(C.onClick(e),e.defaultPrevented)||p?.()},disabled:!p,onPointerEnter:T,...v?{onPointerDown:C.onPointerDown,onPointerMove:C.onPointerMove,onPointerUp:C.onPointerUp,onPointerCancel:C.onPointerCancel,onPointerLeave:C.onPointerLeave}:{},className:`card-grain w-104 max-w-full rounded-(--radius) border border-(--border) bg-(--paper) text-left flex flex-col cursor-pointer [transition:translate_.2s_cubic-bezier(.2,.8,.2,1),box-shadow_.2s_ease] hover:-translate-y-0.5 [box-shadow:var(--e1)] hover:[box-shadow:var(--e2)] ${f&&h?"overflow-visible group/ecard relative hover:z-20":"overflow-hidden"}`,children:[(0,t.jsx)("span",{className:"h-2.5 relative block",children:(0,t.jsx)("svg",{viewBox:"0 0 100 10",preserveAspectRatio:"none",className:"absolute inset-0 w-full h-full",children:(0,t.jsx)("path",{d:"M8,-1 L50,9 L92,-1",stroke:"var(--te)",strokeWidth:"2.5",opacity:"0.4",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"})})}),(0,t.jsxs)("span",{className:"p-3 flex flex-col",children:[(0,t.jsxs)("span",{className:"flex items-start gap-1 mb-1",children:[(0,t.jsxs)("span",{className:"text-[0.72rem] text-(--muted-foreground) flex-1 min-w-0 whitespace-nowrap overflow-hidden text-ellipsis",children:["inbound"===u?"from ":"to ",d]}),(0,t.jsxs)("span",{className:"shrink-0 flex flex-col items-end gap-0.5",children:[m&&(0,t.jsx)("span",{className:"text-[0.62rem] font-mono text-muted-foreground/65",children:(0,r.relativeTime)(m)}),(0,t.jsx)("span",{className:"text-[0.5rem] font-bold uppercase tracking-wider text-(--te) px-1 py-0.5 rounded-[3px] border-[1.5px] border-(--te) opacity-45 -rotate-3",children:"inbound"===u?"Inbound":"Sent"})]})]}),(0,t.jsx)("span",{className:"text-[0.95rem] font-semibold tracking-[-0.01em] leading-[1.35] line-clamp-2",children:e})]}),f&&$&&h&&(0,t.jsx)("span",{className:"absolute -bottom-2.5 left-1/2 -translate-x-1/2 translate-y-1 opacity-0 group-hover/ecard:opacity-100 group-hover/ecard:translate-y-0 transition-all duration-200 ease-out pointer-events-none group-hover/ecard:pointer-events-auto z-10",children:(0,t.jsxs)("span",{role:"button",tabIndex:0,onClick:e=>{e.stopPropagation(),h&&y&&w?.(y,h)},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.stopPropagation(),h&&y&&w?.(y,h))},className:"flex items-center gap-1.5 py-0.5 pl-0.5 pr-2 bg-(--paper) border border-(--border) rounded-full shadow-md hover:bg-(--secondary) cursor-pointer whitespace-nowrap",children:[$.avatarConfig&&(0,t.jsx)(n.AnimatedAvatar,{config:$.avatarConfig,size:20,isHovered:!1,className:"rounded-full"}),(0,t.jsx)("span",{className:"text-[0.62rem] font-semibold opacity-80",children:$.name}),(0,t.jsx)(s.ChevronRight,{className:"w-2.5 h-2.5 text-muted-foreground/45 -ml-0.5"})]})})]}),v&&(0,t.jsx)(l.Sheet,{open:E,onOpenChange:_,children:(0,t.jsx)(l.SheetContent,{side:"bottom",showCloseButton:!1,className:"rounded-t-2xl p-2",children:(0,t.jsx)("div",{className:"flex flex-col",children:(0,t.jsxs)("button",{type:"button",onClick:()=>{v.onClick(),_(!1)},className:"flex items-center gap-3 rounded-lg px-3 py-3 text-left text-[0.95rem] active:bg-muted text-foreground",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:(0,t.jsx)(o.MessageSquare,{className:"w-5 h-5"})}),v.label]})})})})]})}],465368)},754902,855351,157349,e=>{"use strict";var t=e.i(653772),a=e.i(613349);let r={single:"rounded-[1.05rem]",first:"rounded-[1.05rem] rounded-br-[0.35rem]",middle:"rounded-[1.05rem] rounded-tr-[0.35rem] rounded-br-[0.35rem]",last:"rounded-[1.05rem] rounded-tr-[0.35rem]"},n={single:"rounded-[1.05rem]",first:"rounded-[1.05rem] rounded-bl-[0.35rem]",middle:"rounded-[1.05rem] rounded-tl-[0.35rem] rounded-bl-[0.35rem]",last:"rounded-[1.05rem] rounded-tl-[0.35rem]"};function i(){return(0,t.jsxs)("span",{className:"inline-flex items-center gap-0.5","aria-hidden":!0,children:[(0,t.jsx)("span",{className:"size-1 rounded-full bg-muted-foreground/60 motion-safe:animate-[typing-dot_1.2s_ease-in-out_infinite]"}),(0,t.jsx)("span",{className:"size-1 rounded-full bg-muted-foreground/60 motion-safe:animate-[typing-dot_1.2s_ease-in-out_0.2s_infinite]"}),(0,t.jsx)("span",{className:"size-1 rounded-full bg-muted-foreground/60 motion-safe:animate-[typing-dot_1.2s_ease-in-out_0.4s_infinite]"})]})}e.s(["MessageBubble",0,function({variant:e,position:i,children:s,className:o,...l}){let c="user"===e?r[i]:n[i];return(0,t.jsx)("div",{className:(0,a.cn)("px-3 py-1.5 text-base",c,"user"===e?"bg-primary text-primary-foreground":"bg-muted text-foreground",o),...l,children:s})}],754902),e.s(["AVATAR_SIZE",0,30,"MessageCluster",0,function({avatar:e,name:r,children:n,position:i,className:s}){let o="first"===i||"solo"===i;return(0,t.jsxs)("div",{className:(0,a.cn)("flex justify-start items-start gap-2 min-w-0",s),children:[(0,t.jsx)("div",{className:(0,a.cn)("w-[30px]","shrink-0"),"aria-hidden":!o,children:o&&e}),(0,t.jsxs)("div",{className:"min-w-0 max-w-[86%] flex flex-col items-start gap-0.5",children:[o&&(0,t.jsx)("span",{className:"text-[0.85rem] font-semibold text-foreground leading-[1.15] pt-0.5 mb-1",children:r}),n]})]})}],855351),e.s(["PresenceLine",0,function({agentFirstName:e,taskStatus:r}){let n="running"===r?"typing":"queued"===r||"dispatched"===r?"reading":"idle";return(0,t.jsx)("div",{className:"h-5 px-1 mb-2 flex items-center","aria-live":"polite",children:(0,t.jsx)("span",{className:(0,a.cn)("inline-flex items-center gap-1.5 text-sm text-muted-foreground","idle"!==n&&"motion-safe:animate-[fade-up_200ms_ease-out_both]"),children:"idle"!==n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"reading"===n?`${e} is reading`:`${e} is typing`}),(0,t.jsx)(i,{})]})},n)})}],157349)},899746,e=>{"use strict";let t="browser-notification-enabled",a="browser-notification-events",r=["completed","failed"],n={completed:"Task Completed",failed:"Task Failed"};function i(){return"Notification"in window}function s(){return"true"===localStorage.getItem(t)}function o(){try{let e=localStorage.getItem(a);if(e)return JSON.parse(e)}catch{}return[...r]}async function l(){return!!i()&&("granted"===Notification.permission||"denied"!==Notification.permission&&"granted"===await Notification.requestPermission())}e.s(["NOTIFICATION_EVENTS",0,r,"NOTIFICATION_EVENT_LABELS",0,n,"getNotificationEnabled",0,s,"getNotificationEvents",0,o,"isNotificationSupported",0,i,"requestNotificationPermission",0,l,"sendTaskNotification",0,function(e,t,a){if(!i()||"granted"!==Notification.permission||!s()||!o().includes(e))return;let r=n[e]??`Task ${e}`;new Notification(t?`${t} — ${r}`:r,{body:a??"",icon:"/alook.svg"})},"setNotificationEnabled",0,function(e){localStorage.setItem(t,String(e))},"setNotificationEvents",0,function(e){localStorage.setItem(a,JSON.stringify(e))}])},875494,685835,e=>{"use strict";var t=e.i(653772),a=e.i(511043),r=e.i(222862),n=e.i(355578),i=e.i(500324),s=e.i(899746);let o="inbox-filter-types",l=["user_dm_message","calendar_event","email_notification"],c=["user_dm_message"],d=["user_dm_message"];function u(){try{let e=localStorage.getItem(o);if(!e)return c;let t=JSON.parse(e).filter(e=>l.includes(e));if(0===t.length)return c;for(let e of d)t.includes(e)||t.unshift(e);return t}catch{return c}}e.s(["INBOX_FILTER_LABELS",0,{user_dm_message:"DM",calendar_event:"Calendar",email_notification:"Email"},"INBOX_FILTER_TYPES",0,l,"MANDATORY_INBOX_TYPES",0,d,"getInboxFilterTypes",0,u,"setInboxFilterTypes",0,function(e){let t=[...e];for(let e of d)t.includes(e)||t.unshift(e);localStorage.setItem(o,JSON.stringify(t))}],685835);let p=(0,a.createContext)(null),m={count:0,notificationToken:0,refresh:()=>{},decrement:()=>{}};e.s(["InboxCountProvider",0,function({children:e}){let{workspaceId:o}=(0,i.useWorkspace)(),{subscribeWs:l,agents:c}=(0,n.useAgentContext)(),[d,m]=(0,a.useState)(0),[f,g]=(0,a.useState)(0),h=(0,a.useRef)(null),y=(0,a.useRef)(null),b=(0,a.useRef)(c);(0,a.useEffect)(()=>{b.current=c});let w=(0,a.useCallback)(()=>{let e=u();(0,r.getInboxCount)(o,{types:e}).then(e=>{let t=h.current;if(h.current=e.count,m(e.count),null!==t&&e.count>t){g(e=>e+1);let e=y.current?b.current.find(e=>e.id===y.current):void 0;(0,s.sendTaskNotification)("completed",e?.name)}y.current=null}).catch(()=>{})},[o]),v=(0,a.useCallback)(()=>{m(e=>Math.max(0,e-1))},[]);return(0,a.useEffect)(()=>{w()},[w]),(0,a.useEffect)(()=>l(e=>{"task.updated"===e.type&&("completed"===e.status||"failed"===e.status)&&(y.current=e.agentId,w())}),[l,w]),(0,a.useEffect)(()=>{let e=setInterval(w,6e4);return()=>clearInterval(e)},[w]),(0,t.jsx)(p.Provider,{value:{count:d,notificationToken:f,refresh:w,decrement:v},children:e})},"useInboxCount",0,function(){return(0,a.useContext)(p)??m}],875494)},353155,e=>{"use strict";var t=e.i(452691);e.s(["Check",()=>t.default])},813141,e=>{"use strict";let t=(0,e.i(419412).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,t],813141)},393153,e=>{"use strict";var t=e.i(653772),a=e.i(779646),r=e.i(186339);e.s(["ConfirmDialog",0,function({open:e,onOpenChange:n,title:i,description:s,confirmLabel:o="Remove",loadingLabel:l,confirmVariant:c="destructive",loading:d=!1,onConfirm:u}){return(0,t.jsx)(a.Dialog,{open:e,onOpenChange:n,children:(0,t.jsxs)(a.DialogContent,{showCloseButton:!1,children:[(0,t.jsxs)(a.DialogHeader,{children:[(0,t.jsx)(a.DialogTitle,{children:i}),(0,t.jsx)(a.DialogDescription,{children:s})]}),(0,t.jsxs)(a.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",size:"sm",onClick:()=>n(!1),disabled:d,children:"Cancel"}),(0,t.jsx)(r.Button,{variant:c,size:"sm",onClick:u,disabled:d,children:d?l??`${o}...`:o})]})]})})}])},82970,e=>{"use strict";let t=(0,e.i(419412).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["AlertCircle",0,t],82970)},294518,e=>{"use strict";let t=(0,e.i(419412).default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,t],294518)},267007,e=>{"use strict";let t=(0,e.i(419412).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",0,t],267007)},41793,e=>{"use strict";let t=(0,e.i(419412).default)("calendar-days",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);e.s(["CalendarDays",0,t],41793)},896315,219658,e=>{"use strict";var t=e.i(419412);let a=(0,t.default)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);e.s(["RotateCw",0,a],896315);var r=e.i(653772),n=e.i(511043),i=e.i(186339),s=e.i(329686);let o=(0,t.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var l=e.i(613349);e.s(["ScrollToBottomButton",0,function({scrollRef:e,threshold:t=100}){let[a,c]=(0,n.useState)(!1),d=(0,n.useCallback)(()=>{let a=e.current;if(!a)return;let r=a.scrollHeight-a.scrollTop-a.clientHeight<t;c(a.scrollHeight>a.clientHeight&&!r)},[e,t]);return(0,n.useEffect)(()=>{let t=e.current;if(!t)return;t.addEventListener("scroll",d,{passive:!0}),d();let a=new ResizeObserver(d);return a.observe(t),()=>{t.removeEventListener("scroll",d),a.disconnect()}},[e,d]),(0,r.jsx)("div",{className:(0,l.cn)("absolute bottom-1 left-1/2 -translate-x-1/2 z-10 transition-all duration-200 ease-out",a?"opacity-100 translate-y-0":"opacity-0 translate-y-2 pointer-events-none"),children:(0,r.jsxs)(s.Tooltip,{children:[(0,r.jsx)(s.TooltipTrigger,{render:(0,r.jsx)(i.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{let t=e.current;t&&t.scrollTo({top:t.scrollHeight,behavior:"smooth"})},className:"rounded-full bg-background/80 backdrop-blur-sm border shadow-sm hover:bg-background"}),children:(0,r.jsx)(o,{})}),(0,r.jsx)(s.TooltipContent,{side:"top",children:"Scroll to bottom"})]})})}],219658)}]);
|
|
63
|
+
</html>`;let r=()=>{let e=t.contentDocument;if(!e)return;let r=()=>{let t=e.documentElement.scrollHeight;t>0&&u(t)};r(),(a=new ResizeObserver(r)).observe(e.documentElement)};return t.addEventListener("load",r),()=>{t.removeEventListener("load",r),a?.disconnect()}},[e,p]),(0,a.jsx)("iframe",{ref:l,sandbox:"allow-same-origin",className:t,style:{width:"100%",height:`${d}px`,border:"none",display:"block"},title:"Email content"})}],940931)},355753,e=>{"use strict";let t=(0,e.i(419412).default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);e.s(["default",0,t])},481282,731316,657587,385745,e=>{"use strict";var t=e.i(127677),a=(0,e.i(995292).default)(Object.keys,Object),r=Object.prototype.hasOwnProperty;let n=function(e){if(!(0,t.default)(e))return a(e);var n=[];for(var i in Object(e))r.call(e,i)&&"constructor"!=i&&n.push(i);return n};e.s(["default",0,n],731316);var i=e.i(130636),s=e.i(659173),o=(0,i.default)(s.default,"DataView"),l=e.i(121200),c=(0,i.default)(s.default,"Promise"),d=(0,i.default)(s.default,"Set");e.s(["default",0,d],657587);var u=(0,i.default)(s.default,"WeakMap"),p=e.i(706462),m=e.i(882148),g="[object Map]",f="[object Promise]",h="[object Set]",y="[object WeakMap]",b="[object DataView]",w=(0,m.default)(o),v=(0,m.default)(l.default),$=(0,m.default)(c),k=(0,m.default)(d),x=(0,m.default)(u),S=p.default;(o&&S(new o(new ArrayBuffer(1)))!=b||l.default&&S(new l.default)!=g||c&&S(c.resolve())!=f||d&&S(new d)!=h||u&&S(new u)!=y)&&(S=function(e){var t=(0,p.default)(e),a="[object Object]"==t?e.constructor:void 0,r=a?(0,m.default)(a):"";if(r)switch(r){case w:return b;case v:return g;case $:return f;case k:return h;case x:return y}return t});let E=S;e.s(["default",0,E],385745);var _=e.i(530194),C=e.i(764843),T=e.i(750244),I=e.i(330772),j=e.i(400745),M=Object.prototype.hasOwnProperty;e.s(["default",0,function(e){if(null==e)return!0;if((0,T.default)(e)&&((0,C.default)(e)||"string"==typeof e||"function"==typeof e.splice||(0,I.default)(e)||(0,j.default)(e)||(0,_.default)(e)))return!e.length;var a=E(e);if("[object Map]"==a||"[object Set]"==a)return!e.size;if((0,t.default)(e))return!n(e).length;for(var r in e)if(M.call(e,r))return!1;return!0}],481282)},505494,e=>{"use strict";var t=e.i(752872),a=e.i(351359);e.i(991577);var r=e.i(692423),n=(0,a.__name)(e=>{let{securityLevel:a}=(0,t.getConfig2)(),n=(0,r.select)("body");if("sandbox"===a){let t=(0,r.select)(`#i${e}`),a=t.node()?.contentDocument??document;n=(0,r.select)(a.body)}return n.select(`#${e}`)},"selectSvgElement");e.s(["selectSvgElement",0,n])},489368,e=>{"use strict";var t=e.i(102198),a=e.i(103274),r=e.i(595995),n=e.i(752872),i=e.i(351359),s={common:n.common_default,getConfig:n.getConfig,insertCluster:a.insertCluster,insertEdge:t.insertEdge,insertEdgeLabel:t.insertEdgeLabel,insertMarkers:t.markers_default,insertNode:a.insertNode,interpolateToCurve:r.interpolateToCurve,labelHelper:a.labelHelper,log:i.log,positionEdgeLabel:t.positionEdgeLabel},o={},l=(0,i.__name)(e=>{for(let t of e)o[t.name]=t},"registerLayoutLoaders");(0,i.__name)(()=>{l([{name:"dagre",loader:(0,i.__name)(async()=>await e.A(274989),"loader")},{name:"cose-bilkent",loader:(0,i.__name)(async()=>await e.A(619639),"loader")}])},"registerDefaultLayoutLoaders")();var c=(0,i.__name)(async(e,t)=>{if(!(e.layoutAlgorithm in o))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let a=t.domId||t.id;t.domId=`${e.diagramId}-${a}`}let a=o[e.layoutAlgorithm],r=await a.loader(),{theme:n,themeVariables:i}=e.config,{useGradient:l,gradientStart:c,gradientStop:d}=i,u=t.attr("id");if(t.append("defs").append("filter").attr("id",`${u}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${n?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${u}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${n?.includes("dark")?"#FFFFFF":"#000000"}`),l){let e=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");e.append("svg:stop").attr("offset","0%").attr("stop-color",c).attr("stop-opacity",1),e.append("svg:stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}return r.render(e,t,s,{algorithm:a.algorithm})},"render"),d=(0,i.__name)((e="",{fallback:t="dagre"}={})=>{if(e in o)return e;if(t in o)return i.log.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm");e.s(["getRegisteredLayoutAlgorithm",0,d,"registerLayoutLoaders",0,l,"render",0,c])},967723,e=>{"use strict";let t=(0,e.i(419412).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],967723)},492451,e=>{"use strict";let t=(0,e.i(419412).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["File",0,t],492451)},80137,e=>{"use strict";let t=(0,e.i(419412).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["FileText",0,t],80137)},68322,522281,e=>{"use strict";var t=e.i(566710);e.s([],68322),e.s(["Streamdown",()=>t.C],522281)},288329,e=>{"use strict";var t=e.i(653772),a=e.i(511043),r=e.i(613349);e.s(["SheetResizeHandle",0,function({onPointerDown:e,onPointerMove:a,onPointerUp:n,className:i,withHandle:s=!0}){return(0,t.jsx)("div",{onPointerDown:e,onPointerMove:a,onPointerUp:n,onLostPointerCapture:n,className:(0,r.cn)("hidden sm:flex absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize z-10 items-center justify-center hover:bg-primary/10 active:bg-primary/20 transition-colors rounded-l-xl",i),children:s&&(0,t.jsx)("div",{className:"h-6 w-1 rounded-lg bg-border"})})},"useSheetResize",0,function({defaultWidth:e=480,minWidth:t=320,maxWidthRatio:r=.8}={}){let[n,i]=(0,a.useState)(e),s=(0,a.useRef)(!1),o=(0,a.useCallback)(e=>{e.preventDefault(),e.target.setPointerCapture(e.pointerId),s.current=!0},[]);return{width:n,onPointerDown:o,onPointerMove:(0,a.useCallback)(e=>{s.current&&i(Math.min(window.innerWidth*r,Math.max(t,window.innerWidth-e.clientX)))},[t,r]),onPointerUp:(0,a.useCallback)(e=>{s.current=!1,e.target.releasePointerCapture(e.pointerId)},[])}}])},998771,e=>{"use strict";let t=(0,e.i(419412).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",0,t],998771)},758956,e=>{"use strict";let t=(0,e.i(419412).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,t],758956)},51724,e=>{"use strict";let t=(0,e.i(419412).default)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);e.s(["CircleDot",0,t],51724)},131890,e=>{"use strict";let t=(0,e.i(419412).default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);e.s(["ArrowUp",0,t],131890)},450463,e=>{"use strict";e.s(["relativeTime",0,function(e){let t=new Date(e);if(isNaN(t.getTime()))return"";let a=Math.floor((new Date().getTime()-t.getTime())/6e4);if(a<1)return"just now";if(a<60)return`${a}m ago`;let r=Math.floor(a/60);if(r<24)return`${r}h ago`;let n=Math.floor(r/24);return n<7?`${n}d ago`:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}])},465368,648632,e=>{"use strict";var t=e.i(653772),a=e.i(511043),r=e.i(450463);e.i(400175);var n=e.i(819748),i=e.i(126366),s=e.i(496673),o=e.i(758956),l=e.i(332680);function c(e,{delay:t=450,moveThreshold:r=10}={}){let n=a.useRef(null),i=a.useRef(null),s=a.useRef(!1),o=a.useRef(e);a.useEffect(()=>{o.current=e});let l=a.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null),i.current=null},[]),d=a.useCallback(e=>{"mouse"!==e.pointerType&&(l(),s.current=!1,i.current={x:e.clientX,y:e.clientY},n.current=setTimeout(()=>{s.current=!0,i.current=null,n.current=null,o.current()},t))},[l,t]),u=a.useCallback(e=>{let t=i.current;if(!t)return;let a=Math.abs(e.clientX-t.x),n=Math.abs(e.clientY-t.y);(a>r||n>r)&&l()},[l,r]),p=a.useCallback(e=>{s.current&&(e.preventDefault(),e.stopPropagation(),s.current=!1)},[]);return a.useEffect(()=>l,[l]),{onPointerDown:d,onPointerMove:u,onPointerUp:l,onPointerCancel:l,onPointerLeave:l,onClick:p}}e.s(["useLongPress",0,c],648632),e.s(["EmailCard",0,function({subject:e,address:d,direction:u,onClick:p,timestamp:m,isInternal:g,internalHandle:f,targetConvId:h,targetAgentId:y,agents:b,onAgentChatOpen:w,touchAction:v}){let[$,k]=(0,a.useState)(null),[x,S]=(0,a.useState)(!1),[E,_]=(0,a.useState)(!1),C=c(()=>{v&&_(!0)}),T=(0,a.useCallback)(()=>{if(!g||x)return;S(!0);let e=b?.find(e=>e.email_handle===f);e&&k({name:e.name,avatarConfig:(0,i.parseAvatarUrl)(e.avatar_url)})},[g,x,b,f]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",onClick:e=>{v&&C.onClick&&(C.onClick(e),e.defaultPrevented)||p?.()},disabled:!p,onPointerEnter:T,...v?{onPointerDown:C.onPointerDown,onPointerMove:C.onPointerMove,onPointerUp:C.onPointerUp,onPointerCancel:C.onPointerCancel,onPointerLeave:C.onPointerLeave}:{},className:`card-grain w-104 max-w-full rounded-(--radius) border border-(--border) bg-(--paper) text-left flex flex-col cursor-pointer [transition:translate_.2s_cubic-bezier(.2,.8,.2,1),box-shadow_.2s_ease] hover:-translate-y-0.5 [box-shadow:var(--e1)] hover:[box-shadow:var(--e2)] ${g&&h?"overflow-visible group/ecard relative hover:z-20":"overflow-hidden"}`,children:[(0,t.jsx)("span",{className:"h-2.5 relative block",children:(0,t.jsx)("svg",{viewBox:"0 0 100 10",preserveAspectRatio:"none",className:"absolute inset-0 w-full h-full",children:(0,t.jsx)("path",{d:"M8,-1 L50,9 L92,-1",stroke:"var(--te)",strokeWidth:"2.5",opacity:"0.4",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"})})}),(0,t.jsxs)("span",{className:"p-3 flex flex-col",children:[(0,t.jsxs)("span",{className:"flex items-start gap-1 mb-1",children:[(0,t.jsxs)("span",{className:"text-[0.72rem] text-(--muted-foreground) flex-1 min-w-0 whitespace-nowrap overflow-hidden text-ellipsis",children:["inbound"===u?"from ":"to ",d]}),(0,t.jsxs)("span",{className:"shrink-0 flex flex-col items-end gap-0.5",children:[m&&(0,t.jsx)("span",{className:"text-[0.62rem] font-mono text-muted-foreground/65",children:(0,r.relativeTime)(m)}),(0,t.jsx)("span",{className:"text-[0.5rem] font-bold uppercase tracking-wider text-(--te) px-1 py-0.5 rounded-[3px] border-[1.5px] border-(--te) opacity-45 -rotate-3",children:"inbound"===u?"Inbound":"Sent"})]})]}),(0,t.jsx)("span",{className:"text-[0.95rem] font-semibold tracking-[-0.01em] leading-[1.35] line-clamp-2",children:e})]}),g&&$&&h&&(0,t.jsx)("span",{className:"absolute -bottom-2.5 left-1/2 -translate-x-1/2 translate-y-1 opacity-0 group-hover/ecard:opacity-100 group-hover/ecard:translate-y-0 transition-all duration-200 ease-out pointer-events-none group-hover/ecard:pointer-events-auto z-10",children:(0,t.jsxs)("span",{role:"button",tabIndex:0,onClick:e=>{e.stopPropagation(),h&&y&&w?.(y,h)},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.stopPropagation(),h&&y&&w?.(y,h))},className:"flex items-center gap-1.5 py-0.5 pl-0.5 pr-2 bg-(--paper) border border-(--border) rounded-full shadow-md hover:bg-(--secondary) cursor-pointer whitespace-nowrap",children:[$.avatarConfig&&(0,t.jsx)(n.AnimatedAvatar,{config:$.avatarConfig,size:20,isHovered:!1,className:"rounded-full"}),(0,t.jsx)("span",{className:"text-[0.62rem] font-semibold opacity-80",children:$.name}),(0,t.jsx)(s.ChevronRight,{className:"w-2.5 h-2.5 text-muted-foreground/45 -ml-0.5"})]})})]}),v&&(0,t.jsx)(l.Sheet,{open:E,onOpenChange:_,children:(0,t.jsx)(l.SheetContent,{side:"bottom",showCloseButton:!1,className:"rounded-t-2xl p-2",children:(0,t.jsx)("div",{className:"flex flex-col",children:(0,t.jsxs)("button",{type:"button",onClick:()=>{v.onClick(),_(!1)},className:"flex items-center gap-3 rounded-lg px-3 py-3 text-left text-[0.95rem] active:bg-muted text-foreground",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:(0,t.jsx)(o.MessageSquare,{className:"w-5 h-5"})}),v.label]})})})})]})}],465368)},754902,855351,157349,e=>{"use strict";var t=e.i(653772),a=e.i(613349);let r={single:"rounded-[1.05rem]",first:"rounded-[1.05rem] rounded-br-[0.35rem]",middle:"rounded-[1.05rem] rounded-tr-[0.35rem] rounded-br-[0.35rem]",last:"rounded-[1.05rem] rounded-tr-[0.35rem]"},n={single:"rounded-[1.05rem]",first:"rounded-[1.05rem] rounded-bl-[0.35rem]",middle:"rounded-[1.05rem] rounded-tl-[0.35rem] rounded-bl-[0.35rem]",last:"rounded-[1.05rem] rounded-tl-[0.35rem]"};function i(){return(0,t.jsxs)("span",{className:"inline-flex items-center gap-0.5","aria-hidden":!0,children:[(0,t.jsx)("span",{className:"size-1 rounded-full bg-muted-foreground/60 motion-safe:animate-[typing-dot_1.2s_ease-in-out_infinite]"}),(0,t.jsx)("span",{className:"size-1 rounded-full bg-muted-foreground/60 motion-safe:animate-[typing-dot_1.2s_ease-in-out_0.2s_infinite]"}),(0,t.jsx)("span",{className:"size-1 rounded-full bg-muted-foreground/60 motion-safe:animate-[typing-dot_1.2s_ease-in-out_0.4s_infinite]"})]})}e.s(["MessageBubble",0,function({variant:e,position:i,children:s,className:o,...l}){let c="user"===e?r[i]:n[i];return(0,t.jsx)("div",{className:(0,a.cn)("px-3 py-1.5 text-base",c,"user"===e?"bg-primary text-primary-foreground":"bg-muted text-foreground",o),...l,children:s})}],754902),e.s(["AVATAR_SIZE",0,30,"MessageCluster",0,function({avatar:e,name:r,children:n,position:i,className:s}){let o="first"===i||"solo"===i;return(0,t.jsxs)("div",{className:(0,a.cn)("flex justify-start items-start gap-2 min-w-0",s),children:[(0,t.jsx)("div",{className:(0,a.cn)("w-[30px]","shrink-0"),"aria-hidden":!o,children:o&&e}),(0,t.jsxs)("div",{className:"min-w-0 max-w-[86%] flex flex-col items-start gap-0.5",children:[o&&(0,t.jsx)("span",{className:"text-[0.85rem] font-semibold text-foreground leading-[1.15] pt-0.5 mb-1",children:r}),n]})]})}],855351),e.s(["PresenceLine",0,function({agentFirstName:e,taskStatus:r}){let n="running"===r?"typing":"queued"===r||"dispatched"===r?"reading":"idle";return(0,t.jsx)("div",{className:"h-5 px-1 mb-2 flex items-center","aria-live":"polite",children:(0,t.jsx)("span",{className:(0,a.cn)("inline-flex items-center gap-1.5 text-sm text-muted-foreground","idle"!==n&&"motion-safe:animate-[fade-up_200ms_ease-out_both]"),children:"idle"!==n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"reading"===n?`${e} is reading`:`${e} is typing`}),(0,t.jsx)(i,{})]})},n)})}],157349)},899746,e=>{"use strict";let t="browser-notification-enabled",a="browser-notification-events",r=["completed","failed"],n={completed:"Task Completed",failed:"Task Failed"};function i(){return"Notification"in window}function s(){return"true"===localStorage.getItem(t)}function o(){try{let e=localStorage.getItem(a);if(e)return JSON.parse(e)}catch{}return[...r]}async function l(){return!!i()&&("granted"===Notification.permission||"denied"!==Notification.permission&&"granted"===await Notification.requestPermission())}e.s(["NOTIFICATION_EVENTS",0,r,"NOTIFICATION_EVENT_LABELS",0,n,"getNotificationEnabled",0,s,"getNotificationEvents",0,o,"isNotificationSupported",0,i,"requestNotificationPermission",0,l,"sendTaskNotification",0,function(e,t,a){if(!i()||"granted"!==Notification.permission||!s()||!o().includes(e))return;let r=n[e]??`Task ${e}`;new Notification(t?`${t} — ${r}`:r,{body:a??"",icon:"/alook.svg"})},"setNotificationEnabled",0,function(e){localStorage.setItem(t,String(e))},"setNotificationEvents",0,function(e){localStorage.setItem(a,JSON.stringify(e))}])},875494,685835,e=>{"use strict";var t=e.i(653772),a=e.i(511043),r=e.i(222862),n=e.i(355578),i=e.i(500324),s=e.i(899746);let o="inbox-filter-types",l=["user_dm_message","calendar_event","email_notification"],c=["user_dm_message"],d=["user_dm_message"];function u(){try{let e=localStorage.getItem(o);if(!e)return c;let t=JSON.parse(e).filter(e=>l.includes(e));if(0===t.length)return c;for(let e of d)t.includes(e)||t.unshift(e);return t}catch{return c}}e.s(["INBOX_FILTER_LABELS",0,{user_dm_message:"DM",calendar_event:"Calendar",email_notification:"Email"},"INBOX_FILTER_TYPES",0,l,"MANDATORY_INBOX_TYPES",0,d,"getInboxFilterTypes",0,u,"setInboxFilterTypes",0,function(e){let t=[...e];for(let e of d)t.includes(e)||t.unshift(e);localStorage.setItem(o,JSON.stringify(t))}],685835);let p=(0,a.createContext)(null),m={count:0,notificationToken:0,refresh:()=>{},decrement:()=>{}};e.s(["InboxCountProvider",0,function({children:e}){let{workspaceId:o}=(0,i.useWorkspace)(),{subscribeWs:l,agents:c}=(0,n.useAgentContext)(),[d,m]=(0,a.useState)(0),[g,f]=(0,a.useState)(0),h=(0,a.useRef)(null),y=(0,a.useRef)(null),b=(0,a.useRef)(c);(0,a.useEffect)(()=>{b.current=c});let w=(0,a.useCallback)(()=>{let e=u();(0,r.getInboxCount)(o,{types:e}).then(e=>{let t=h.current;if(h.current=e.count,m(e.count),null!==t&&e.count>t){f(e=>e+1);let e=y.current?b.current.find(e=>e.id===y.current):void 0;(0,s.sendTaskNotification)("completed",e?.name)}y.current=null}).catch(()=>{})},[o]),v=(0,a.useCallback)(()=>{m(e=>Math.max(0,e-1))},[]);return(0,a.useEffect)(()=>{w()},[w]),(0,a.useEffect)(()=>l(e=>{"task.updated"===e.type&&("completed"===e.status||"failed"===e.status)&&(y.current=e.agentId,w())}),[l,w]),(0,a.useEffect)(()=>{let e=setInterval(w,6e4);return()=>clearInterval(e)},[w]),(0,t.jsx)(p.Provider,{value:{count:d,notificationToken:g,refresh:w,decrement:v},children:e})},"useInboxCount",0,function(){return(0,a.useContext)(p)??m}],875494)},353155,e=>{"use strict";var t=e.i(452691);e.s(["Check",()=>t.default])},813141,e=>{"use strict";let t=(0,e.i(419412).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,t],813141)},393153,e=>{"use strict";var t=e.i(653772),a=e.i(779646),r=e.i(186339);e.s(["ConfirmDialog",0,function({open:e,onOpenChange:n,title:i,description:s,confirmLabel:o="Remove",loadingLabel:l,confirmVariant:c="destructive",loading:d=!1,onConfirm:u}){return(0,t.jsx)(a.Dialog,{open:e,onOpenChange:n,children:(0,t.jsxs)(a.DialogContent,{showCloseButton:!1,children:[(0,t.jsxs)(a.DialogHeader,{children:[(0,t.jsx)(a.DialogTitle,{children:i}),(0,t.jsx)(a.DialogDescription,{children:s})]}),(0,t.jsxs)(a.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",size:"sm",onClick:()=>n(!1),disabled:d,children:"Cancel"}),(0,t.jsx)(r.Button,{variant:c,size:"sm",onClick:u,disabled:d,children:d?l??`${o}...`:o})]})]})})}])},82970,e=>{"use strict";let t=(0,e.i(419412).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["AlertCircle",0,t],82970)},294518,e=>{"use strict";let t=(0,e.i(419412).default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,t],294518)},267007,e=>{"use strict";let t=(0,e.i(419412).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",0,t],267007)},41793,e=>{"use strict";let t=(0,e.i(419412).default)("calendar-days",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);e.s(["CalendarDays",0,t],41793)},896315,219658,e=>{"use strict";var t=e.i(419412);let a=(0,t.default)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);e.s(["RotateCw",0,a],896315);var r=e.i(653772),n=e.i(511043),i=e.i(186339),s=e.i(329686);let o=(0,t.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var l=e.i(613349);e.s(["ScrollToBottomButton",0,function({scrollRef:e,threshold:t=100}){let[a,c]=(0,n.useState)(!1),d=(0,n.useCallback)(()=>{let a=e.current;if(!a)return;let r=a.scrollHeight-a.scrollTop-a.clientHeight<t;c(a.scrollHeight>a.clientHeight&&!r)},[e,t]);return(0,n.useEffect)(()=>{let t=e.current;if(!t)return;t.addEventListener("scroll",d,{passive:!0}),d();let a=new ResizeObserver(d);return a.observe(t),()=>{t.removeEventListener("scroll",d),a.disconnect()}},[e,d]),(0,r.jsx)("div",{className:(0,l.cn)("absolute bottom-1 left-1/2 -translate-x-1/2 z-10 transition-all duration-200 ease-out",a?"opacity-100 translate-y-0":"opacity-0 translate-y-2 pointer-events-none"),children:(0,r.jsxs)(s.Tooltip,{children:[(0,r.jsx)(s.TooltipTrigger,{render:(0,r.jsx)(i.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{let t=e.current;t&&t.scrollTo({top:t.scrollHeight,behavior:"smooth"})},className:"rounded-full bg-background/80 backdrop-blur-sm border shadow-sm hover:bg-background"}),children:(0,r.jsx)(o,{})}),(0,r.jsx)(s.TooltipContent,{side:"top",children:"Scroll to bottom"})]})})}],219658)}]);
|
package/bundled/web/.open-next/assets/_next/static/chunks/{0eayyb8dzeuqj.js → 1lwe0daem0j5h.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,879486,384265,e=>{"use strict";e.i(811374);var t=e.i(511043),a=e.i(92615),i=e.i(298604),n=e.i(990966),s=e.i(372252),r=e.i(154680);let o=t.createContext(void 0);function d(e=!1){let a=t.useContext(o);if(void 0===a&&!e)throw Error((0,r.default)(16));return a}function l(e){return(0,a.isHTMLElement)(e)&&"BUTTON"===e.tagName}e.s(["CompositeRootContext",0,o,"useCompositeRootContext",0,d],384265),e.s(["useButton",0,function(e={}){let{disabled:a=!1,focusableWhenDisabled:r,tabIndex:o=0,native:c=!0,composite:u}=e,p=t.useRef(null),g=d(!0),m=u??void 0!==g,{props:h}=function(e){let{focusableWhenDisabled:a,disabled:i,composite:n=!1,tabIndex:s=0,isNativeButton:r}=e,o=n&&!1!==a,d=n&&!1===a;return{props:t.useMemo(()=>{let e={onKeyDown(e){i&&a&&"Tab"!==e.key&&e.preventDefault()}};return n||(e.tabIndex=s,!r&&i&&(e.tabIndex=a?s:-1)),(r&&(a||o)||!r&&i)&&(e["aria-disabled"]=i),r&&(!a||d)&&(e.disabled=i),e},[n,i,a,o,d,r,s])}}({focusableWhenDisabled:r,disabled:a,composite:m,tabIndex:o,isNativeButton:c}),f=t.useCallback(()=>{let e=p.current;l(e)&&m&&a&&void 0===h.disabled&&e.disabled&&(e.disabled=!1)},[a,h.disabled,m]);return(0,n.useIsoLayoutEffect)(f,[f]),{getButtonProps:t.useCallback((e={})=>{let{onClick:t,onMouseDown:i,onKeyUp:n,onKeyDown:r,onPointerDown:o,...d}=e;return(0,s.mergeProps)({onClick(e){a?e.preventDefault():t?.(e)},onMouseDown(e){a||i?.(e)},onKeyDown(e){var i;if(a||((0,s.makeEventPreventable)(e),r?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,o=e.currentTarget,d=l(o),u=!c&&(i=o,!!(i?.tagName==="A"&&i?.href)),p=n&&(c?d:!u),g="Enter"===e.key,h=" "===e.key,f=o.getAttribute("role"),$=f?.startsWith("menuitem")||"option"===f||"gridcell"===f;if(n&&m&&h){if(e.defaultPrevented&&$)return;e.preventDefault(),u||c&&d?(o.click(),e.preventBaseUIHandler()):p&&(t?.(e),e.preventBaseUIHandler());return}p&&(!c&&(h||g)&&e.preventDefault(),!c&&g&&t?.(e))},onKeyUp(e){a||(((0,s.makeEventPreventable)(e),n?.(e),e.target===e.currentTarget&&c&&m&&l(e.currentTarget)&&" "===e.key)?e.preventDefault():!e.baseUIHandlerPrevented&&(e.target!==e.currentTarget||c||m||" "!==e.key||t?.(e)))},onPointerDown(e){a?e.preventDefault():o?.(e)}},c?{type:"button"}:{role:"button"},h,d)},[a,h,m,c]),buttonRef:(0,i.useStableCallback)(e=>{p.current=e,f()})}}],879486)},294237,e=>{"use strict";var t=e.i(7284);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,i=t.clsx;e.s(["cva",0,(e,t)=>n=>{var s;if((null==t?void 0:t.variants)==null)return i(e,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:r,defaultVariants:o}=t,d=Object.keys(r).map(e=>{let t=null==n?void 0:n[e],i=null==o?void 0:o[e];if(null===t)return null;let s=a(t)||a(i);return r[e][s]}),l=n&&Object.entries(n).reduce((e,t)=>{let[a,i]=t;return void 0===i||(e[a]=i),e},{});return i(e,d,null==t||null==(s=t.compoundVariants)?void 0:s.reduce((e,t)=>{let{class:a,className:i,...n}=t;return Object.entries(n).every(e=>{let[t,a]=e;return Array.isArray(a)?a.includes({...o,...l}[t]):({...o,...l})[t]===a})?[...e,a,i]:e},[]),null==n?void 0:n.class,null==n?void 0:n.className)}])},186339,e=>{"use strict";var t=e.i(653772);e.i(811374);var a=e.i(511043),i=e.i(879486),n=e.i(695681);let s=a.forwardRef(function(e,t){let{render:a,className:s,disabled:r=!1,focusableWhenDisabled:o=!1,nativeButton:d=!0,style:l,...c}=e,{getButtonProps:u,buttonRef:p}=(0,i.useButton)({disabled:r,focusableWhenDisabled:o,native:d});return(0,n.useRenderElement)("button",e,{state:{disabled:r},ref:[t,p],props:[c,u]})});var r=e.i(294237),o=e.i(613349);let d=(0,r.cva)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});e.s(["Button",0,function({className:e,variant:a="default",size:i="default",...n}){return(0,t.jsx)(s,{"data-slot":"button",className:(0,o.cn)(d({variant:a,size:i,className:e})),...n})},"buttonVariants",0,d],186339)},126942,(e,t,a)=>{t.exports=e.r(871628)},222862,636557,e=>{"use strict";var t=e.i(811374);class a extends Error{status;details;constructor(e,t,a){super(e),this.name="ApiError",this.status=t,this.details=a}get isNetworkError(){return 0===this.status}get isRateLimit(){return 429===this.status}get isUnauthorized(){return 401===this.status}}function i(e,t){return"validation error"===e&&t?.length?function(e){let[t,...a]=e.split(":"),i=a.join(":").trim();if(!i)return e;let n=t.trim(),s=n.trim().replace(/[_-]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()),r=i.replace(/^required$/i,"is required"),o=r.toLowerCase().replace(/[_-]+/g," "),d=n.toLowerCase().replace(/[_-]+/g," ");return d&&o.startsWith(`${d} `)&&(r=r.slice(n.length).trimStart()),s?`${s} ${r}`:r}(t[0]):e}async function n(e,t){let n;try{n=await fetch(""+e,{...t,credentials:"include",headers:{"Content-Type":"application/json",...t?.headers}})}catch(e){if(e instanceof TypeError)throw new a("Unable to connect — check your network",0);throw e}if(401===n.status)throw window.location.href="/sign-in",new a("Unauthorized",401);if(!n.ok){let e,t;try{let a=await n.json();e=a.error,t=a.details}catch{}if(429===n.status)throw new a("Please wait a moment before trying again",429);if(n.status>=500)throw new a(i(e,t)||"Something went wrong — please try again",n.status,t);throw new a(i(e,t)||"Something went wrong",n.status,t)}if(204!==n.status)return n.json()}function s(e,t){let a=new URLSearchParams({workspace_id:e,...t});return`?${a.toString()}`}e.s(["ApiError",0,a],636557),parseInt(t.default.env.NEXT_PUBLIC_MOCK_NETWORK_DELAY_MS||"300",10);let r=async(e,t,i,r,o)=>{let d;if(!r||0===r.length)return n(`/api/conversations/${e}/messages${s(i)}`,{method:"POST",body:JSON.stringify({content:t,...o?{metadata:o}:{}})});let l=new FormData;for(let e of(l.append("content",t),o&&l.append("metadata",JSON.stringify(o)),r))l.append("file",e.file);for(let e=0;e<r.length;e++){let t=r[e].thumbnailBlob;t&&l.append(`thumbnail:${e}`,t,"thumbnail.jpg")}try{d=await fetch(`/api/conversations/${e}/messages${s(i)}`,{method:"POST",credentials:"include",body:l})}catch(e){if(e instanceof TypeError)throw new a("Unable to connect — check your network",0);throw e}if(401===d.status)throw window.location.href="/sign-in",new a("Unauthorized",401);if(!d.ok){let e,t;try{let a=await d.json();e=a.error,t=a.details}catch{}if(429===d.status)throw new a("Please wait a moment before trying again",429);if(d.status>=500)throw new a(e||"Something went wrong — please try again",d.status,t);throw new a(e||"Something went wrong",d.status,t)}return d.json()},o=async(e,t)=>{let a=new URLSearchParams({workspace_id:t}),i=await fetch(`/api/email/${e}/body?${a}`,{credentials:"include"});if(!i.ok)return{content:"(body not available)",isHtml:!1};let n=i.headers.get("Content-Type")??"";return{content:await i.text(),isHtml:n.includes("text/html")}},d=async(e,t)=>{let i=new FormData;i.append("file",e);let n=await fetch(`/api/email/upload${s(t)}`,{method:"POST",credentials:"include",body:i});if(!n.ok)throw new a(await n.text().catch(()=>"Upload failed"),n.status);return n.json()},l=async(e,t)=>{let i;if(!t.files||0===t.files.length)return n(`/api/issues${s(e)}`,{method:"POST",body:JSON.stringify({agent_id:t.agent_id,title:t.title,description:t.description})});let r=new FormData;for(let e of(t.agent_id&&r.append("agent_id",t.agent_id),r.append("title",t.title),r.append("description",t.description??""),t.files))r.append("file",e);try{i=await fetch(`/api/issues${s(e)}`,{method:"POST",credentials:"include",body:r})}catch(e){if(e instanceof TypeError)throw new a("Unable to connect — check your network",0);throw e}if(401===i.status)throw window.location.href="/sign-in",new a("Unauthorized",401);if(!i.ok){let e,t;try{let a=await i.json();e=a.error,t=a.details}catch{}if(429===i.status)throw new a("Please wait a moment before trying again",429);if(i.status>=500)throw new a(e||"Something went wrong — please try again",i.status,t);throw new a(e||"Something went wrong",i.status,t)}return i.json()},c=async(e,t)=>{let a=new URLSearchParams({workspace_id:t}),i=await fetch(`/api/artifacts/${e}/content?${a}`,{credentials:"include"});return i.ok?i.text():"(content not available)"};e.s(["acceptInvite",0,e=>n(`/api/invite/${e}`,{method:"POST"}),"addWhitelistEmail",0,(e,t,a)=>n(`/api/agents/${e}/whitelist${s(a)}`,{method:"POST",body:JSON.stringify({email:t})}),"approveMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings/${t}/approve${s(a)}`,{method:"POST"}),"cancelActiveTask",0,(e,t)=>n(`/api/conversations/${e}/active-task${s(t)}`,{method:"DELETE"}),"chatInit",0,(e,t,a)=>n(`/api/agents/${e}/chat-init${s(t)}`,{method:"POST",body:JSON.stringify({...a?{channel:a}:{}})}),"checkFreshness",0,(e,t)=>{let a={};return e.conversationId&&(a.conversation_id=e.conversationId),e.agentId&&(a.agent_id=e.agentId),e.channel&&(a.channel=e.channel),n(`/api/conversations/check-fresh${s(t,a)}`)},"conversationInit",0,(e,t,a)=>{let i={};return a?.newestMessageId&&(i.newest_message_id=a.newestMessageId),a?.messageCount&&(i.message_count=String(a.messageCount)),n(`/api/conversations/${e}/init${s(t,i)}`)},"createAgent",0,(e,t)=>n(`/api/agents${s(t)}`,{method:"POST",body:JSON.stringify(e)}),"createAgentLink",0,(e,t)=>n(`/api/agent-links${s(t)}`,{method:"POST",body:JSON.stringify(e)}),"createCalendarEvent",0,(e,t)=>n(`/api/calendar${s(t)}`,{method:"POST",body:JSON.stringify(e)}),"createChannelApi",0,(e,t)=>n(`/api/channels${s(e)}`,{method:"POST",body:JSON.stringify({name:t})}),"createConversation",0,(e,t,a)=>n(`/api/conversations${s(t)}`,{method:"POST",body:JSON.stringify({agent_id:e,...a?{channel:a}:{}})}),"createEmailAccount",0,(e,t,a)=>n(`/api/agents/${e}/email-accounts${s(a)}`,{method:"POST",body:JSON.stringify(t)}),"createInvite",0,e=>n(`/api/workspaces/${e}/invites${s(e)}`,{method:"POST"}),"createIssue",0,l,"createMachineToken",0,(e,t)=>n(`/api/machine-tokens${t?s(t):""}`,{method:"POST",body:JSON.stringify({name:e||"default"})}),"createMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings${s(t)}`,{method:"POST",body:JSON.stringify(a)}),"createThread",0,(e,t,a,i)=>n(`/api/conversations/${e}/threads${s(i)}`,{method:"POST",body:JSON.stringify({parent_message_id:t,content:a})}),"deleteAgent",0,(e,t)=>n(`/api/agents/${e}${s(t)}`,{method:"DELETE"}),"deleteAgentLink",0,(e,t)=>n(`/api/agent-links/${e}${s(t)}`,{method:"DELETE"}),"deleteCalendarEvent",0,(e,t,a)=>n(`/api/calendar/${e}${s(t)}`,{method:"DELETE",...a&&a.scope?{headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}:{}}),"deleteChannelApi",0,(e,t)=>n(`/api/channels/${e}${s(t)}`,{method:"DELETE"}),"deleteEmail",0,(e,t)=>n(`/api/email/${e}${s(t)}`,{method:"DELETE"}),"deleteEmailAccount",0,(e,t,a)=>n(`/api/agents/${e}/email-accounts/${t}${s(a)}`,{method:"DELETE"}),"deleteIssue",0,(e,t)=>n(`/api/issues/${t}${s(e)}`,{method:"DELETE"}),"deleteMachine",0,(e,t)=>n(`/api/runtimes/machine${s(t,{daemon_id:e})}`,{method:"DELETE"}),"deleteMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings/${t}${s(a)}`,{method:"DELETE"}),"deleteWorkspace",0,(e,t)=>n(`/api/workspaces/${e}${s(e)}`,{method:"DELETE",body:JSON.stringify({confirm_name:t})}),"fetchLatestCliVersion",0,()=>n("/api/cli/latest-version"),"fetchModelOptions",0,()=>n("/api/config/model-options"),"flagMessage",0,(e,t)=>n(`/api/flags${s(e)}`,{method:"POST",body:JSON.stringify({messageId:t})}),"getActiveTask",0,(e,t)=>n(`/api/conversations/${e}/active-task${s(t)}`),"getAgentSkills",0,(e,t)=>n(`/api/agents/${e}/skills${s(t)}`),"getArtifactContent",0,c,"getCalendarEvent",0,(e,t)=>n(`/api/calendar/${e}${s(t)}`),"getEmail",0,(e,t)=>n(`/api/email/${e}${s(t)}`),"getEmailBody",0,o,"getEmailThread",0,(e,t)=>n(`/api/email/${e}/thread${s(t)}`),"getFlaggedCount",0,e=>n(`/api/flags/count${s(e)}`),"getInboxCount",0,(e,t)=>{let a={};return t?.types?.length&&(a.types=t.types.join(",")),n(`/api/inbox/count${s(e,a)}`)},"getInviteInfo",0,e=>n(`/api/invite/${e}`),"getIssue",0,(e,t)=>n(`/api/issues/${t}${s(e)}`),"getMemberMe",0,e=>n(`/api/members/me${s(e)}`),"getMinCliVersion",0,()=>n("/api/config/min-version"),"getTask",0,(e,t)=>n(`/api/tasks/${e}${s(t)}`),"getTaskMessages",0,(e,t,a)=>n(`/api/tasks/${e}/messages${s(t,a?{since:String(a)}:void 0)}`),"getThreadSummaries",0,(e,t)=>n(`/api/conversations/${e}/threads${s(t)}`),"getTrace",0,(e,t)=>n(`/api/traces/${e}${s(t)}`),"getWorkspaceOverview",0,e=>n(`/api/workspaces/${e}/overview${s(e)}`),"grantAgentAccess",0,(e,t,a)=>n(`/api/agents/${t}/access${s(e)}`,{method:"POST",body:JSON.stringify({user_id:a})}),"listAgentAccess",0,(e,t)=>n(`/api/agents/${t}/access${s(e)}`),"listAgentActiveTaskCounts",0,e=>n(`/api/agents/active-task-counts${s(e)}`),"listAgentActivity",0,(e,t,a)=>{let i={};return a?.limit&&(i.limit=String(a.limit)),a?.before&&(i.before=a.before),a?.beforeId&&(i.before_id=a.beforeId),a?.status&&(i.status=a.status),a?.type&&(i.type=a.type),n(`/api/agents/${e}/activity${s(t,i)}`)},"listAgentLinks",0,e=>n(`/api/agent-links${s(e)}`),"listAgentPins",0,e=>n(`/api/agents/pins${s(e)}`),"listAgents",0,e=>n(`/api/agents${s(e)}`),"listArtifacts",0,(e,t)=>n(`/api/artifacts${s(t,{conversation_id:e})}`),"listCalendarEvents",0,(e,t)=>{let a={};return t?.agentId&&(a.agentId=t.agentId),t?.from&&(a.from=t.from),t?.to&&(a.to=t.to),n(`/api/calendar${s(e,a)}`)},"listChannels",0,e=>n(`/api/channels${s(e)}`),"listEmailAccounts",0,(e,t)=>n(`/api/agents/${e}/email-accounts${s(t)}`),"listEmails",0,(e,t,a,i)=>n(`/api/email${s(t,{agentId:e,...a?{folder:a}:{},...i?{address:i}:{}})}`),"listFlaggedItems",0,(e,t)=>{let a={};return t?.limit&&(a.limit=String(t.limit)),t?.before&&(a.before=t.before),n(`/api/flags${s(e,a)}`)},"listFlaggedMessageIds",0,(e,t)=>n(`/api/flags${s(e,{conversation_id:t,ids_only:"true"})}`),"listInboxItems",0,(e,t)=>{let a={};return t?.limit&&(a.limit=String(t.limit)),t?.before&&(a.before=t.before),t?.types?.length&&(a.types=t.types.join(",")),n(`/api/inbox${s(e,a)}`)},"listInvites",0,e=>n(`/api/workspaces/${e}/invites${s(e)}`),"listIssues",0,(e,t)=>{let a={};return t?.agentId&&(a.agentId=t.agentId),t?.status&&(a.status=t.status),t?.terminal!==void 0&&(a.terminal=String(t.terminal)),n(`/api/issues${s(e,a)}`)},"listMeetings",0,(e,t)=>n(`/api/agents/${e}/meetings${s(t)}`),"listMembers",0,e=>n(`/api/workspaces/${e}/members${s(e)}`),"listMessages",0,(e,t,a)=>{let i={};return a?.limit&&(i.limit=String(a.limit)),a?.before&&(i.before=a.before),a?.beforeId&&(i.before_id=a.beforeId),n(`/api/conversations/${e}/messages${s(t,i)}`)},"listMessagesAroundTask",0,(e,t,a)=>n(`/api/conversations/${e}/messages${s(t,{around_task:a})}`),"listPreviousConversations",0,(e,t,a)=>{let i={exclude:a.exclude,before:a.before};return a.channel&&(i.channel=a.channel),a.limit&&(i.limit=String(a.limit)),n(`/api/agents/${e}/conversations${s(t,i)}`)},"listRuntimes",0,e=>n(`/api/runtimes${s(e)}`),"listTraces",0,(e,t)=>{let a={};return t?.limit&&(a.limit=String(t.limit)),t?.before&&(a.before=t.before),t?.status&&(a.status=t.status),t?.multiAgent&&(a.multiAgent="true"),t?.agentId&&(a.agentId=t.agentId),t?.channel&&(a.channel=t.channel),n(`/api/traces${s(e,a)}`)},"listWhitelist",0,(e,t)=>n(`/api/agents/${e}/whitelist${s(t)}`),"listWorkspaceActiveTasks",0,e=>n(`/api/agents/active-tasks${s(e)}`),"listWorkspaces",0,()=>n("/api/workspaces"),"markAllInboxRead",0,e=>n(`/api/inbox/read-all${s(e)}`,{method:"POST"}),"markInboxRead",0,(e,t)=>n(`/api/inbox/read${s(t)}`,{method:"POST",body:JSON.stringify({conversationId:e})}),"pinAgent",0,(e,t)=>n(`/api/agents/${t}/pin${s(e)}`,{method:"POST"}),"removeMember",0,(e,t)=>n(`/api/workspaces/${e}/members/${t}${s(e)}`,{method:"DELETE"}),"removeWhitelistEmail",0,(e,t,a)=>n(`/api/agents/${e}/whitelist/${t}${s(a)}`,{method:"DELETE"}),"renameChannelApi",0,(e,t,a)=>n(`/api/channels/${e}${s(t)}`,{method:"PATCH",body:JSON.stringify({name:a})}),"reorderAgentPins",0,(e,t)=>n(`/api/agents/pins/reorder${s(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"reorderChannelsApi",0,(e,t)=>n(`/api/channels/reorder${s(e)}`,{method:"PUT",body:JSON.stringify({ordered_channel_ids:t})}),"reorderUnpinnedAgents",0,(e,t)=>n(`/api/agents/sidebar/reorder${s(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"requestWorkspaceBrowse",0,(e,t,a,i)=>n(`/api/agents/${e}/workspace/browse${s(t)}`,{method:"POST",body:JSON.stringify({request_type:a,path:i})}),"retryTask",0,(e,t)=>n(`/api/tasks/${e}/retry${s(t)}`,{method:"POST"}),"revokeAgentAccess",0,(e,t,a,i=!1)=>n(`/api/agents/${t}/access/${a}${s(e)}${i?"&remove_whitelist=true":""}`,{method:"DELETE"}),"revokeInvite",0,(e,t)=>n(`/api/workspaces/${e}/invites/${t}${s(e)}`,{method:"DELETE"}),"sendEmail",0,(e,t,a,i,r,o,d,l)=>n(`/api/email/send${s(r)}`,{method:"POST",body:JSON.stringify({agentId:e,to:t,subject:a,htmlBody:i,attachments:o,...d,customAccountId:l})}),"sendMessage",0,r,"stopMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings/${t}/stop${s(a)}`,{method:"POST"}),"syncEmailAccount",0,(e,t,a)=>n(`/api/agents/${e}/email-accounts/${t}/sync${s(a)}`,{method:"POST"}),"triggerRuntimeRescan",0,(e,t)=>n(`/api/runtimes/${e}/rescan${s(t)}`,{method:"POST"}),"triggerRuntimeUpdate",0,(e,t)=>n(`/api/runtimes/${e}/update${s(t)}`,{method:"POST"}),"trustEmail",0,(e,t)=>n(`/api/email/${e}/trust${s(t)}`,{method:"POST"}),"unflagMessage",0,(e,t)=>n(`/api/flags/${t}${s(e)}`,{method:"DELETE"}),"unpinAgent",0,(e,t)=>n(`/api/agents/${t}/pin${s(e)}`,{method:"DELETE"}),"updateAgent",0,(e,t,a)=>n(`/api/agents/${e}${s(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateAgentLink",0,(e,t,a)=>n(`/api/agent-links/${e}${s(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateCalendarEvent",0,(e,t,a)=>n(`/api/calendar/${e}${s(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateEmailStatus",0,(e,t,a)=>n(`/api/email/${e}${s(t)}`,{method:"PATCH",body:JSON.stringify({status:a})}),"updateIssue",0,(e,t,a)=>n(`/api/issues/${t}${s(e)}`,{method:"PATCH",body:JSON.stringify(a)}),"updateMemberMe",0,(e,t)=>n(`/api/members/me${s(e)}`,{method:"PATCH",body:JSON.stringify({global_instruction:t})}),"updateWorkspace",0,(e,t)=>n(`/api/workspaces/${e}${s(e)}`,{method:"PATCH",body:JSON.stringify(t)}),"uploadEmailAttachment",0,d],222862)},728886,e=>{"use strict";var t=e.i(653772),a=e.i(613349);e.s(["Skeleton",0,function({className:e,...i}){return(0,t.jsx)("div",{"data-slot":"skeleton",className:(0,a.cn)("animate-pulse rounded-md bg-muted",e),...i})}])},29437,e=>{"use strict";var t=e.i(653772),a=e.i(511043),i=e.i(126942),n=e.i(516266),s=e.i(222862),r=e.i(205189),o=e.i(186339),d=e.i(728886);e.s(["default",0,function(){let{token:e}=(0,i.useParams)(),l=(0,i.useRouter)(),[c,u]=(0,a.useState)("loading"),[p,g]=(0,a.useState)(null),[m,h]=(0,a.useState)("");(0,a.useEffect)(()=>{e&&(0,s.getInviteInfo)(e).then(e=>{g(e),u("ready")}).catch(e=>{h(e instanceof Error?e.message:"Invalid or expired invite link"),u("error")})},[e]);let f=async()=>{if(e){u("accepting");try{let t=await (0,s.acceptInvite)(e);(0,r.trackInviteAccepted)({workspace_id:t.workspace_id??""}),u("done"),n.toast.success(`Joined ${p?.workspace_name??"workspace"}`),l.replace(`/w/${t.workspace_slug}/home`)}catch(e){h(e instanceof Error?e.message:"Failed to join workspace"),u("error")}}};return(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center p-6",children:(0,t.jsxs)("div",{className:"w-full max-w-sm space-y-6 text-center",children:["loading"===c&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(d.Skeleton,{className:"h-6 w-48 mx-auto"}),(0,t.jsx)(d.Skeleton,{className:"h-4 w-64 mx-auto"}),(0,t.jsx)(d.Skeleton,{className:"h-9 w-32 mx-auto"})]}),"ready"===c&&p&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("h1",{className:"text-xl font-semibold",children:"You've been invited"}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:[p.invited_by," invited you to join"]})]}),(0,t.jsxs)("div",{className:"rounded-md border border-border/50 px-4 py-3 text-left space-y-0.5",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:p.workspace_name}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Workspace"})]}),(0,t.jsx)(o.Button,{className:"w-full",onClick:f,children:"Join Workspace"})]}),"accepting"===c&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(d.Skeleton,{className:"h-6 w-48 mx-auto"}),(0,t.jsx)(d.Skeleton,{className:"h-4 w-64 mx-auto"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Joining workspace…"})]}),"error"===c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("h1",{className:"text-xl font-semibold",children:"Invite unavailable"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m})]}),(0,t.jsx)(o.Button,{variant:"outline",onClick:()=>l.replace("/workspaces"),children:"Go to workspaces"})]})]})})}])}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,879486,384265,e=>{"use strict";e.i(811374);var t=e.i(511043),a=e.i(92615),i=e.i(298604),n=e.i(990966),s=e.i(372252),r=e.i(154680);let o=t.createContext(void 0);function d(e=!1){let a=t.useContext(o);if(void 0===a&&!e)throw Error((0,r.default)(16));return a}function l(e){return(0,a.isHTMLElement)(e)&&"BUTTON"===e.tagName}e.s(["CompositeRootContext",0,o,"useCompositeRootContext",0,d],384265),e.s(["useButton",0,function(e={}){let{disabled:a=!1,focusableWhenDisabled:r,tabIndex:o=0,native:c=!0,composite:u}=e,p=t.useRef(null),g=d(!0),m=u??void 0!==g,{props:h}=function(e){let{focusableWhenDisabled:a,disabled:i,composite:n=!1,tabIndex:s=0,isNativeButton:r}=e,o=n&&!1!==a,d=n&&!1===a;return{props:t.useMemo(()=>{let e={onKeyDown(e){i&&a&&"Tab"!==e.key&&e.preventDefault()}};return n||(e.tabIndex=s,!r&&i&&(e.tabIndex=a?s:-1)),(r&&(a||o)||!r&&i)&&(e["aria-disabled"]=i),r&&(!a||d)&&(e.disabled=i),e},[n,i,a,o,d,r,s])}}({focusableWhenDisabled:r,disabled:a,composite:m,tabIndex:o,isNativeButton:c}),f=t.useCallback(()=>{let e=p.current;l(e)&&m&&a&&void 0===h.disabled&&e.disabled&&(e.disabled=!1)},[a,h.disabled,m]);return(0,n.useIsoLayoutEffect)(f,[f]),{getButtonProps:t.useCallback((e={})=>{let{onClick:t,onMouseDown:i,onKeyUp:n,onKeyDown:r,onPointerDown:o,...d}=e;return(0,s.mergeProps)({onClick(e){a?e.preventDefault():t?.(e)},onMouseDown(e){a||i?.(e)},onKeyDown(e){var i;if(a||((0,s.makeEventPreventable)(e),r?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,o=e.currentTarget,d=l(o),u=!c&&(i=o,!!(i?.tagName==="A"&&i?.href)),p=n&&(c?d:!u),g="Enter"===e.key,h=" "===e.key,f=o.getAttribute("role"),$=f?.startsWith("menuitem")||"option"===f||"gridcell"===f;if(n&&m&&h){if(e.defaultPrevented&&$)return;e.preventDefault(),u||c&&d?(o.click(),e.preventBaseUIHandler()):p&&(t?.(e),e.preventBaseUIHandler());return}p&&(!c&&(h||g)&&e.preventDefault(),!c&&g&&t?.(e))},onKeyUp(e){a||(((0,s.makeEventPreventable)(e),n?.(e),e.target===e.currentTarget&&c&&m&&l(e.currentTarget)&&" "===e.key)?e.preventDefault():!e.baseUIHandlerPrevented&&(e.target!==e.currentTarget||c||m||" "!==e.key||t?.(e)))},onPointerDown(e){a?e.preventDefault():o?.(e)}},c?{type:"button"}:{role:"button"},h,d)},[a,h,m,c]),buttonRef:(0,i.useStableCallback)(e=>{p.current=e,f()})}}],879486)},294237,e=>{"use strict";var t=e.i(7284);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,i=t.clsx;e.s(["cva",0,(e,t)=>n=>{var s;if((null==t?void 0:t.variants)==null)return i(e,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:r,defaultVariants:o}=t,d=Object.keys(r).map(e=>{let t=null==n?void 0:n[e],i=null==o?void 0:o[e];if(null===t)return null;let s=a(t)||a(i);return r[e][s]}),l=n&&Object.entries(n).reduce((e,t)=>{let[a,i]=t;return void 0===i||(e[a]=i),e},{});return i(e,d,null==t||null==(s=t.compoundVariants)?void 0:s.reduce((e,t)=>{let{class:a,className:i,...n}=t;return Object.entries(n).every(e=>{let[t,a]=e;return Array.isArray(a)?a.includes({...o,...l}[t]):({...o,...l})[t]===a})?[...e,a,i]:e},[]),null==n?void 0:n.class,null==n?void 0:n.className)}])},186339,e=>{"use strict";var t=e.i(653772);e.i(811374);var a=e.i(511043),i=e.i(879486),n=e.i(695681);let s=a.forwardRef(function(e,t){let{render:a,className:s,disabled:r=!1,focusableWhenDisabled:o=!1,nativeButton:d=!0,style:l,...c}=e,{getButtonProps:u,buttonRef:p}=(0,i.useButton)({disabled:r,focusableWhenDisabled:o,native:d});return(0,n.useRenderElement)("button",e,{state:{disabled:r},ref:[t,p],props:[c,u]})});var r=e.i(294237),o=e.i(613349);let d=(0,r.cva)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});e.s(["Button",0,function({className:e,variant:a="default",size:i="default",...n}){return(0,t.jsx)(s,{"data-slot":"button",className:(0,o.cn)(d({variant:a,size:i,className:e})),...n})},"buttonVariants",0,d],186339)},126942,(e,t,a)=>{t.exports=e.r(871628)},222862,636557,e=>{"use strict";var t=e.i(811374);class a extends Error{status;details;constructor(e,t,a){super(e),this.name="ApiError",this.status=t,this.details=a}get isNetworkError(){return 0===this.status}get isRateLimit(){return 429===this.status}get isUnauthorized(){return 401===this.status}}function i(e,t){return"validation error"===e&&t?.length?function(e){let[t,...a]=e.split(":"),i=a.join(":").trim();if(!i)return e;let n=t.trim(),s=n.trim().replace(/[_-]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()),r=i.replace(/^required$/i,"is required"),o=r.toLowerCase().replace(/[_-]+/g," "),d=n.toLowerCase().replace(/[_-]+/g," ");return d&&o.startsWith(`${d} `)&&(r=r.slice(n.length).trimStart()),s?`${s} ${r}`:r}(t[0]):e}async function n(e,t){let n;try{n=await fetch(""+e,{...t,credentials:"include",headers:{"Content-Type":"application/json",...t?.headers}})}catch(e){if(e instanceof TypeError)throw new a("Unable to connect — check your network",0);throw e}if(401===n.status)throw window.location.href="/sign-in",new a("Unauthorized",401);if(!n.ok){let e,t;try{let a=await n.json();e=a.error,t=a.details}catch{}if(429===n.status)throw new a("Please wait a moment before trying again",429);if(n.status>=500)throw new a(i(e,t)||"Something went wrong — please try again",n.status,t);throw new a(i(e,t)||"Something went wrong",n.status,t)}if(204!==n.status)return n.json()}function s(e,t){let a=new URLSearchParams({workspace_id:e,...t});return`?${a.toString()}`}e.s(["ApiError",0,a],636557),parseInt(t.default.env.NEXT_PUBLIC_MOCK_NETWORK_DELAY_MS||"300",10);let r=async(e,t,i,r,o)=>{let d;if(!r||0===r.length)return n(`/api/conversations/${e}/messages${s(i)}`,{method:"POST",body:JSON.stringify({content:t,...o?{metadata:o}:{}})});let l=new FormData;for(let e of(l.append("content",t),o&&l.append("metadata",JSON.stringify(o)),r))l.append("file",e.file);for(let e=0;e<r.length;e++){let t=r[e].thumbnailBlob;t&&l.append(`thumbnail:${e}`,t,"thumbnail.jpg")}try{d=await fetch(`/api/conversations/${e}/messages${s(i)}`,{method:"POST",credentials:"include",body:l})}catch(e){if(e instanceof TypeError)throw new a("Unable to connect — check your network",0);throw e}if(401===d.status)throw window.location.href="/sign-in",new a("Unauthorized",401);if(!d.ok){let e,t;try{let a=await d.json();e=a.error,t=a.details}catch{}if(429===d.status)throw new a("Please wait a moment before trying again",429);if(d.status>=500)throw new a(e||"Something went wrong — please try again",d.status,t);throw new a(e||"Something went wrong",d.status,t)}return d.json()},o=async(e,t)=>{let a=new URLSearchParams({workspace_id:t}),i=await fetch(`/api/email/${e}/body?${a}`,{credentials:"include"});if(!i.ok)return{content:"(body not available)",isHtml:!1};let n=i.headers.get("Content-Type")??"";return{content:await i.text(),isHtml:n.includes("text/html")}},d=async(e,t)=>{let i=new FormData;i.append("file",e);let n=await fetch(`/api/email/upload${s(t)}`,{method:"POST",credentials:"include",body:i});if(!n.ok)throw new a(await n.text().catch(()=>"Upload failed"),n.status);return n.json()},l=async(e,t)=>{let i;if(!t.files||0===t.files.length)return n(`/api/issues${s(e)}`,{method:"POST",body:JSON.stringify({agent_id:t.agent_id,title:t.title,description:t.description})});let r=new FormData;for(let e of(t.agent_id&&r.append("agent_id",t.agent_id),r.append("title",t.title),r.append("description",t.description??""),t.files))r.append("file",e);try{i=await fetch(`/api/issues${s(e)}`,{method:"POST",credentials:"include",body:r})}catch(e){if(e instanceof TypeError)throw new a("Unable to connect — check your network",0);throw e}if(401===i.status)throw window.location.href="/sign-in",new a("Unauthorized",401);if(!i.ok){let e,t;try{let a=await i.json();e=a.error,t=a.details}catch{}if(429===i.status)throw new a("Please wait a moment before trying again",429);if(i.status>=500)throw new a(e||"Something went wrong — please try again",i.status,t);throw new a(e||"Something went wrong",i.status,t)}return i.json()},c=async(e,t)=>{let a=new URLSearchParams({workspace_id:t}),i=await fetch(`/api/artifacts/${e}/content?${a}`,{credentials:"include"});return i.ok?i.text():"(content not available)"};e.s(["acceptInvite",0,e=>n(`/api/invite/${e}`,{method:"POST"}),"addWhitelistEmail",0,(e,t,a)=>n(`/api/agents/${e}/whitelist${s(a)}`,{method:"POST",body:JSON.stringify({email:t})}),"approveMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings/${t}/approve${s(a)}`,{method:"POST"}),"cancelActiveTask",0,(e,t)=>n(`/api/conversations/${e}/active-task${s(t)}`,{method:"DELETE"}),"chatInit",0,(e,t,a)=>n(`/api/agents/${e}/chat-init${s(t)}`,{method:"POST",body:JSON.stringify({...a?{channel:a}:{}})}),"checkFreshness",0,(e,t)=>{let a={};return e.conversationId&&(a.conversation_id=e.conversationId),e.agentId&&(a.agent_id=e.agentId),e.channel&&(a.channel=e.channel),n(`/api/conversations/check-fresh${s(t,a)}`)},"conversationInit",0,(e,t,a)=>{let i={};return a?.newestMessageId&&(i.newest_message_id=a.newestMessageId),a?.messageCount&&(i.message_count=String(a.messageCount)),n(`/api/conversations/${e}/init${s(t,i)}`)},"createAgent",0,(e,t)=>n(`/api/agents${s(t)}`,{method:"POST",body:JSON.stringify(e)}),"createAgentLink",0,(e,t)=>n(`/api/agent-links${s(t)}`,{method:"POST",body:JSON.stringify(e)}),"createCalendarEvent",0,(e,t)=>n(`/api/calendar${s(t)}`,{method:"POST",body:JSON.stringify(e)}),"createChannelApi",0,(e,t)=>n(`/api/channels${s(e)}`,{method:"POST",body:JSON.stringify({name:t})}),"createConversation",0,(e,t,a)=>n(`/api/conversations${s(t)}`,{method:"POST",body:JSON.stringify({agent_id:e,...a?{channel:a}:{}})}),"createEmailAccount",0,(e,t,a)=>n(`/api/agents/${e}/email-accounts${s(a)}`,{method:"POST",body:JSON.stringify(t)}),"createInvite",0,e=>n(`/api/workspaces/${e}/invites${s(e)}`,{method:"POST"}),"createIssue",0,l,"createMachineToken",0,(e,t)=>n(`/api/machine-tokens${t?s(t):""}`,{method:"POST",body:JSON.stringify({name:e||"default"})}),"createMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings${s(t)}`,{method:"POST",body:JSON.stringify(a)}),"createThread",0,(e,t,a,i)=>n(`/api/conversations/${e}/threads${s(i)}`,{method:"POST",body:JSON.stringify({parent_message_id:t,content:a})}),"deleteAgent",0,(e,t)=>n(`/api/agents/${e}${s(t)}`,{method:"DELETE"}),"deleteAgentLink",0,(e,t)=>n(`/api/agent-links/${e}${s(t)}`,{method:"DELETE"}),"deleteCalendarEvent",0,(e,t,a)=>n(`/api/calendar/${e}${s(t)}`,{method:"DELETE",...a&&a.scope?{headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}:{}}),"deleteChannelApi",0,(e,t)=>n(`/api/channels/${e}${s(t)}`,{method:"DELETE"}),"deleteEmail",0,(e,t)=>n(`/api/email/${e}${s(t)}`,{method:"DELETE"}),"deleteEmailAccount",0,(e,t,a)=>n(`/api/agents/${e}/email-accounts/${t}${s(a)}`,{method:"DELETE"}),"deleteIssue",0,(e,t)=>n(`/api/issues/${t}${s(e)}`,{method:"DELETE"}),"deleteMachine",0,(e,t)=>n(`/api/runtimes/machine${s(t,{daemon_id:e})}`,{method:"DELETE"}),"deleteMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings/${t}${s(a)}`,{method:"DELETE"}),"deleteWorkspace",0,(e,t)=>n(`/api/workspaces/${e}${s(e)}`,{method:"DELETE",body:JSON.stringify({confirm_name:t})}),"fetchLatestCliVersion",0,()=>n("/api/cli/latest-version"),"fetchModelOptions",0,()=>n("/api/config/model-options"),"flagMessage",0,(e,t)=>n(`/api/flags${s(e)}`,{method:"POST",body:JSON.stringify({messageId:t})}),"getActiveTask",0,(e,t)=>n(`/api/conversations/${e}/active-task${s(t)}`),"getAgent",0,(e,t)=>n(`/api/agents/${e}${s(t)}`),"getAgentSkills",0,(e,t)=>n(`/api/agents/${e}/skills${s(t)}`),"getArtifactContent",0,c,"getCalendarEvent",0,(e,t)=>n(`/api/calendar/${e}${s(t)}`),"getEmail",0,(e,t)=>n(`/api/email/${e}${s(t)}`),"getEmailBody",0,o,"getEmailThread",0,(e,t)=>n(`/api/email/${e}/thread${s(t)}`),"getFlaggedCount",0,e=>n(`/api/flags/count${s(e)}`),"getInboxCount",0,(e,t)=>{let a={};return t?.types?.length&&(a.types=t.types.join(",")),n(`/api/inbox/count${s(e,a)}`)},"getInviteInfo",0,e=>n(`/api/invite/${e}`),"getIssue",0,(e,t)=>n(`/api/issues/${t}${s(e)}`),"getMemberMe",0,e=>n(`/api/members/me${s(e)}`),"getMinCliVersion",0,()=>n("/api/config/min-version"),"getTask",0,(e,t)=>n(`/api/tasks/${e}${s(t)}`),"getTaskMessages",0,(e,t,a)=>n(`/api/tasks/${e}/messages${s(t,a?{since:String(a)}:void 0)}`),"getThreadSummaries",0,(e,t)=>n(`/api/conversations/${e}/threads${s(t)}`),"getTrace",0,(e,t)=>n(`/api/traces/${e}${s(t)}`),"getWorkspaceOverview",0,e=>n(`/api/workspaces/${e}/overview${s(e)}`),"grantAgentAccess",0,(e,t,a)=>n(`/api/agents/${t}/access${s(e)}`,{method:"POST",body:JSON.stringify({user_id:a})}),"listAgentAccess",0,(e,t)=>n(`/api/agents/${t}/access${s(e)}`),"listAgentActiveTaskCounts",0,e=>n(`/api/agents/active-task-counts${s(e)}`),"listAgentActivity",0,(e,t,a)=>{let i={};return a?.limit&&(i.limit=String(a.limit)),a?.before&&(i.before=a.before),a?.beforeId&&(i.before_id=a.beforeId),a?.status&&(i.status=a.status),a?.type&&(i.type=a.type),n(`/api/agents/${e}/activity${s(t,i)}`)},"listAgentLinks",0,e=>n(`/api/agent-links${s(e)}`),"listAgentPins",0,e=>n(`/api/agents/pins${s(e)}`),"listAgents",0,e=>n(`/api/agents${s(e)}`),"listArtifacts",0,(e,t)=>n(`/api/artifacts${s(t,{conversation_id:e})}`),"listCalendarEvents",0,(e,t)=>{let a={};return t?.agentId&&(a.agentId=t.agentId),t?.from&&(a.from=t.from),t?.to&&(a.to=t.to),n(`/api/calendar${s(e,a)}`)},"listChannels",0,e=>n(`/api/channels${s(e)}`),"listEmailAccounts",0,(e,t)=>n(`/api/agents/${e}/email-accounts${s(t)}`),"listEmails",0,(e,t,a,i)=>n(`/api/email${s(t,{agentId:e,...a?{folder:a}:{},...i?{address:i}:{}})}`),"listFlaggedItems",0,(e,t)=>{let a={};return t?.limit&&(a.limit=String(t.limit)),t?.before&&(a.before=t.before),n(`/api/flags${s(e,a)}`)},"listFlaggedMessageIds",0,(e,t)=>n(`/api/flags${s(e,{conversation_id:t,ids_only:"true"})}`),"listInboxItems",0,(e,t)=>{let a={};return t?.limit&&(a.limit=String(t.limit)),t?.before&&(a.before=t.before),t?.types?.length&&(a.types=t.types.join(",")),n(`/api/inbox${s(e,a)}`)},"listInvites",0,e=>n(`/api/workspaces/${e}/invites${s(e)}`),"listIssues",0,(e,t)=>{let a={};return t?.agentId&&(a.agentId=t.agentId),t?.status&&(a.status=t.status),t?.terminal!==void 0&&(a.terminal=String(t.terminal)),n(`/api/issues${s(e,a)}`)},"listMeetings",0,(e,t)=>n(`/api/agents/${e}/meetings${s(t)}`),"listMembers",0,e=>n(`/api/workspaces/${e}/members${s(e)}`),"listMessages",0,(e,t,a)=>{let i={};return a?.limit&&(i.limit=String(a.limit)),a?.before&&(i.before=a.before),a?.beforeId&&(i.before_id=a.beforeId),n(`/api/conversations/${e}/messages${s(t,i)}`)},"listMessagesAroundTask",0,(e,t,a)=>n(`/api/conversations/${e}/messages${s(t,{around_task:a})}`),"listPreviousConversations",0,(e,t,a)=>{let i={exclude:a.exclude,before:a.before};return a.channel&&(i.channel=a.channel),a.limit&&(i.limit=String(a.limit)),n(`/api/agents/${e}/conversations${s(t,i)}`)},"listRuntimes",0,e=>n(`/api/runtimes${s(e)}`),"listTraces",0,(e,t)=>{let a={};return t?.limit&&(a.limit=String(t.limit)),t?.before&&(a.before=t.before),t?.status&&(a.status=t.status),t?.multiAgent&&(a.multiAgent="true"),t?.agentId&&(a.agentId=t.agentId),t?.channel&&(a.channel=t.channel),n(`/api/traces${s(e,a)}`)},"listWhitelist",0,(e,t)=>n(`/api/agents/${e}/whitelist${s(t)}`),"listWorkspaceActiveTasks",0,e=>n(`/api/agents/active-tasks${s(e)}`),"listWorkspaces",0,()=>n("/api/workspaces"),"markAllInboxRead",0,e=>n(`/api/inbox/read-all${s(e)}`,{method:"POST"}),"markInboxRead",0,(e,t)=>n(`/api/inbox/read${s(t)}`,{method:"POST",body:JSON.stringify({conversationId:e})}),"pinAgent",0,(e,t)=>n(`/api/agents/${t}/pin${s(e)}`,{method:"POST"}),"removeMember",0,(e,t)=>n(`/api/workspaces/${e}/members/${t}${s(e)}`,{method:"DELETE"}),"removeWhitelistEmail",0,(e,t,a)=>n(`/api/agents/${e}/whitelist/${t}${s(a)}`,{method:"DELETE"}),"renameChannelApi",0,(e,t,a)=>n(`/api/channels/${e}${s(t)}`,{method:"PATCH",body:JSON.stringify({name:a})}),"reorderAgentPins",0,(e,t)=>n(`/api/agents/pins/reorder${s(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"reorderChannelsApi",0,(e,t)=>n(`/api/channels/reorder${s(e)}`,{method:"PUT",body:JSON.stringify({ordered_channel_ids:t})}),"reorderUnpinnedAgents",0,(e,t)=>n(`/api/agents/sidebar/reorder${s(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"requestWorkspaceBrowse",0,(e,t,a,i)=>n(`/api/agents/${e}/workspace/browse${s(t)}`,{method:"POST",body:JSON.stringify({request_type:a,path:i})}),"retryTask",0,(e,t)=>n(`/api/tasks/${e}/retry${s(t)}`,{method:"POST"}),"revokeAgentAccess",0,(e,t,a,i=!1)=>n(`/api/agents/${t}/access/${a}${s(e)}${i?"&remove_whitelist=true":""}`,{method:"DELETE"}),"revokeInvite",0,(e,t)=>n(`/api/workspaces/${e}/invites/${t}${s(e)}`,{method:"DELETE"}),"sendEmail",0,(e,t,a,i,r,o,d,l)=>n(`/api/email/send${s(r)}`,{method:"POST",body:JSON.stringify({agentId:e,to:t,subject:a,htmlBody:i,attachments:o,...d,customAccountId:l})}),"sendMessage",0,r,"stopMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings/${t}/stop${s(a)}`,{method:"POST"}),"syncEmailAccount",0,(e,t,a)=>n(`/api/agents/${e}/email-accounts/${t}/sync${s(a)}`,{method:"POST"}),"triggerRuntimeRescan",0,(e,t)=>n(`/api/runtimes/${e}/rescan${s(t)}`,{method:"POST"}),"triggerRuntimeUpdate",0,(e,t)=>n(`/api/runtimes/${e}/update${s(t)}`,{method:"POST"}),"trustEmail",0,(e,t)=>n(`/api/email/${e}/trust${s(t)}`,{method:"POST"}),"unflagMessage",0,(e,t)=>n(`/api/flags/${t}${s(e)}`,{method:"DELETE"}),"unpinAgent",0,(e,t)=>n(`/api/agents/${t}/pin${s(e)}`,{method:"DELETE"}),"updateAgent",0,(e,t,a)=>n(`/api/agents/${e}${s(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateAgentLink",0,(e,t,a)=>n(`/api/agent-links/${e}${s(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateCalendarEvent",0,(e,t,a)=>n(`/api/calendar/${e}${s(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateEmailStatus",0,(e,t,a)=>n(`/api/email/${e}${s(t)}`,{method:"PATCH",body:JSON.stringify({status:a})}),"updateIssue",0,(e,t,a)=>n(`/api/issues/${t}${s(e)}`,{method:"PATCH",body:JSON.stringify(a)}),"updateMemberMe",0,(e,t)=>n(`/api/members/me${s(e)}`,{method:"PATCH",body:JSON.stringify({global_instruction:t})}),"updateWorkspace",0,(e,t)=>n(`/api/workspaces/${e}${s(e)}`,{method:"PATCH",body:JSON.stringify(t)}),"uploadEmailAttachment",0,d],222862)},728886,e=>{"use strict";var t=e.i(653772),a=e.i(613349);e.s(["Skeleton",0,function({className:e,...i}){return(0,t.jsx)("div",{"data-slot":"skeleton",className:(0,a.cn)("animate-pulse rounded-md bg-muted",e),...i})}])},29437,e=>{"use strict";var t=e.i(653772),a=e.i(511043),i=e.i(126942),n=e.i(516266),s=e.i(222862),r=e.i(205189),o=e.i(186339),d=e.i(728886);e.s(["default",0,function(){let{token:e}=(0,i.useParams)(),l=(0,i.useRouter)(),[c,u]=(0,a.useState)("loading"),[p,g]=(0,a.useState)(null),[m,h]=(0,a.useState)("");(0,a.useEffect)(()=>{e&&(0,s.getInviteInfo)(e).then(e=>{g(e),u("ready")}).catch(e=>{h(e instanceof Error?e.message:"Invalid or expired invite link"),u("error")})},[e]);let f=async()=>{if(e){u("accepting");try{let t=await (0,s.acceptInvite)(e);(0,r.trackInviteAccepted)({workspace_id:t.workspace_id??""}),u("done"),n.toast.success(`Joined ${p?.workspace_name??"workspace"}`),l.replace(`/w/${t.workspace_slug}/home`)}catch(e){h(e instanceof Error?e.message:"Failed to join workspace"),u("error")}}};return(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center p-6",children:(0,t.jsxs)("div",{className:"w-full max-w-sm space-y-6 text-center",children:["loading"===c&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(d.Skeleton,{className:"h-6 w-48 mx-auto"}),(0,t.jsx)(d.Skeleton,{className:"h-4 w-64 mx-auto"}),(0,t.jsx)(d.Skeleton,{className:"h-9 w-32 mx-auto"})]}),"ready"===c&&p&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("h1",{className:"text-xl font-semibold",children:"You've been invited"}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:[p.invited_by," invited you to join"]})]}),(0,t.jsxs)("div",{className:"rounded-md border border-border/50 px-4 py-3 text-left space-y-0.5",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:p.workspace_name}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Workspace"})]}),(0,t.jsx)(o.Button,{className:"w-full",onClick:f,children:"Join Workspace"})]}),"accepting"===c&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(d.Skeleton,{className:"h-6 w-48 mx-auto"}),(0,t.jsx)(d.Skeleton,{className:"h-4 w-64 mx-auto"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Joining workspace…"})]}),"error"===c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("h1",{className:"text-xl font-semibold",children:"Invite unavailable"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m})]}),(0,t.jsx)(o.Button,{variant:"outline",onClick:()=>l.replace("/workspaces"),children:"Go to workspaces"})]})]})})}])}]);
|