@alook/app 0.0.99 → 0.0.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/email-worker/index.js +18 -6
- package/bundled/web/.open-next/.build/durable-objects/queue.js +5 -5
- package/bundled/web/.open-next/assets/BUILD_ID +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{0-grycx2tn0o4.js → 0.9oyh86wn1fd.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0.wmvlzzu_8e0.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{0tvembqw.e82g.js → 01yvpio9kzobl.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/04-19vra169mj.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{16_j-kl72ldc4.js → 07ju9-jia-17m.js} +2 -2
- package/bundled/web/.open-next/assets/_next/static/chunks/0ecg50a33jlsr.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0hyshwdxcbwbq.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{0dhez0ocwb1sn.js → 0r775oyts5ozc.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{07mm2xbk2l5.8.js → 0rt6~o9u6663h.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{0fuk9p58--.z9.js → 0uayv05d6mntr.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0x2fen2lqx6j3.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/10rvnbe-gw6a7.js +3 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/10ux4o4nkn.sj.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/171xnnpyz4y3d.css +1 -0
- package/bundled/web/.open-next/cache/{GDrv2wl3f0uavEhQh6kAN → P6QBCMByXCOFPEUBvhHF6}/_global-error.cache +1 -1
- package/bundled/web/.open-next/cache/{GDrv2wl3f0uavEhQh6kAN → P6QBCMByXCOFPEUBvhHF6}/_not-found.cache +1 -1
- package/bundled/web/.open-next/cache/{GDrv2wl3f0uavEhQh6kAN → P6QBCMByXCOFPEUBvhHF6}/privacy.cache +1 -1
- package/bundled/web/.open-next/cache/{GDrv2wl3f0uavEhQh6kAN → P6QBCMByXCOFPEUBvhHF6}/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 +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/BUILD_ID +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/build-manifest.json +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/prerender-manifest.json +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/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]/runtimes/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/settings/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/threads/[traceId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/threads/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/unread/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/workspaces/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(auth)/sign-in/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/_not-found/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/app/privacy/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/templates/[id]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/templates/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__11hxiyn._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[turbopack]_runtime.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0i4u2y-._.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0iw.~u_._.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0j3ag~p._.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0j_~vur._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0mk4o2l._.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0ow_nxn._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0s~hhx-._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{[root-of-the-server]__0r7fdlr._.js → [root-of-the-server]__05g0phj._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__07of89~._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[turbopack]_runtime.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_02.xen~._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0.q_x36._.js → _06a692f._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0_.06ux._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0a8f3fa._.js → _0c-ma68._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0u~xh2v._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0xhx.5_._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0wtsjmd._.js → _0~twhbc._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_12yhe5_._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_13__3im._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_0stugv_._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_0~23g-y._.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_calendar_page_tsx_01geiyd._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_components_home_home-page_tsx_0to84tv._.js +1 -37
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_lib_api_ts_0uf2r1p._.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 +55 -91
- package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs.meta.json +123 -123
- package/bundled/web/.open-next/server-functions/default/src/web/index.mjs +3 -3
- package/bundled/web/migrations/0034_agent_skill_daemon_id.sql +9 -0
- package/bundled/web/wrangler.toml +1 -1
- package/bundled/ws-do/index.js +18 -6
- package/dist/cli/index.js +193 -233
- package/dist/cli/session-runner.js +17 -4
- package/dist/index.js +43 -19
- package/package.json +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/01mduafj8.t03.js +0 -37
- package/bundled/web/.open-next/assets/_next/static/chunks/051._099hez6h.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/09m73_4eia.5a.css +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/09tp3dnnhv6a0.js +0 -3
- package/bundled/web/.open-next/assets/_next/static/chunks/0aw17s_pfw2u1.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0slwbsjlzqxt6.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0svwh_nhh5rxk.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/14byu.0wtroj8.js +0 -1
- /package/bundled/web/.open-next/assets/_next/static/{GDrv2wl3f0uavEhQh6kAN → P6QBCMByXCOFPEUBvhHF6}/_buildManifest.js +0 -0
- /package/bundled/web/.open-next/assets/_next/static/{GDrv2wl3f0uavEhQh6kAN → P6QBCMByXCOFPEUBvhHF6}/_clientMiddlewareManifest.js +0 -0
- /package/bundled/web/.open-next/assets/_next/static/{GDrv2wl3f0uavEhQh6kAN → P6QBCMByXCOFPEUBvhHF6}/_ssgManifest.js +0 -0
- /package/bundled/web/.open-next/cache/{GDrv2wl3f0uavEhQh6kAN → P6QBCMByXCOFPEUBvhHF6}/robots.txt.cache +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,222862,636557,e=>{"use strict";class t 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 n(e,t){return"validation error"===e&&t?.length?function(e){let[t,...n]=e.split(":"),r=n.join(":").trim();if(!r)return e;let o=t.trim(),i=o.trim().replace(/[_-]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()),a=r.replace(/^required$/i,"is required"),s=a.toLowerCase().replace(/[_-]+/g," "),l=o.toLowerCase().replace(/[_-]+/g," ");return l&&s.startsWith(`${l} `)&&(a=a.slice(o.length).trimStart()),i?`${i} ${a}`:a}(t[0]):e}async function r(e,r){let o;try{o=await fetch(""+e,{...r,credentials:"include",headers:{"Content-Type":"application/json",...r?.headers}})}catch(e){if(e instanceof TypeError)throw new t("Unable to connect — check your network",0);throw e}if(401===o.status)throw window.location.href="/sign-in",new t("Unauthorized",401);if(!o.ok){let e,r;try{let t=await o.json();e=t.error,r=t.details}catch{}if(429===o.status)throw new t("Please wait a moment before trying again",429);if(o.status>=500)throw new t(n(e,r)||"Something went wrong — please try again",o.status,r);throw new t(n(e,r)||"Something went wrong",o.status,r)}if(204!==o.status)return o.json()}function o(e,t){let n=new URLSearchParams({workspace_id:e,...t});return`?${n.toString()}`}e.s(["ApiError",0,t],636557);let i=async(e,n,i,a)=>{let s;if(!a||0===a.length)return r(`/api/conversations/${e}/messages${o(i)}`,{method:"POST",body:JSON.stringify({content:n})});let l=new FormData;for(let e of(l.append("content",n),a))l.append("file",e);try{s=await fetch(`/api/conversations/${e}/messages${o(i)}`,{method:"POST",credentials:"include",body:l})}catch(e){if(e instanceof TypeError)throw new t("Unable to connect — check your network",0);throw e}if(401===s.status)throw window.location.href="/sign-in",new t("Unauthorized",401);if(!s.ok){let e,n;try{let t=await s.json();e=t.error,n=t.details}catch{}if(429===s.status)throw new t("Please wait a moment before trying again",429);if(s.status>=500)throw new t(e||"Something went wrong — please try again",s.status,n);throw new t(e||"Something went wrong",s.status,n)}return s.json()},a=async(e,n,i,a)=>{let s;if(!a||0===a.length)return r(`/api/conversations/${e}/buffered-messages${o(i)}`,{method:"POST",body:JSON.stringify({content:n})});let l=new FormData;for(let e of(l.append("content",n),a))l.append("file",e);try{s=await fetch(`/api/conversations/${e}/buffered-messages${o(i)}`,{method:"POST",credentials:"include",body:l})}catch(e){if(e instanceof TypeError)throw new t("Unable to connect — check your network",0);throw e}if(401===s.status)throw window.location.href="/sign-in",new t("Unauthorized",401);if(!s.ok){let e,n;try{let t=await s.json();e=t.error,n=t.details}catch{}if(429===s.status)throw new t(e||"Maximum follow-ups reached",429);if(s.status>=500)throw new t(e||"Something went wrong — please try again",s.status,n);throw new t(e||"Something went wrong",s.status,n)}return s.json()},s=async(e,t)=>{let n=new URLSearchParams({workspace_id:t}),r=await fetch(`/api/email/${e}/body?${n}`,{credentials:"include"});if(!r.ok)return{content:"(body not available)",isHtml:!1};let o=r.headers.get("Content-Type")??"";return{content:await r.text(),isHtml:o.includes("text/html")}},l=async(e,n)=>{let r=new FormData;r.append("file",e);let i=await fetch(`/api/email/upload${o(n)}`,{method:"POST",credentials:"include",body:r});if(!i.ok)throw new t(await i.text().catch(()=>"Upload failed"),i.status);return i.json()},c=async(e,n)=>{let i;if(!n.files||0===n.files.length)return r(`/api/issues${o(e)}`,{method:"POST",body:JSON.stringify({agent_id:n.agent_id,title:n.title,description:n.description})});let a=new FormData;for(let e of(n.agent_id&&a.append("agent_id",n.agent_id),a.append("title",n.title),a.append("description",n.description??""),n.files))a.append("file",e);try{i=await fetch(`/api/issues${o(e)}`,{method:"POST",credentials:"include",body:a})}catch(e){if(e instanceof TypeError)throw new t("Unable to connect — check your network",0);throw e}if(401===i.status)throw window.location.href="/sign-in",new t("Unauthorized",401);if(!i.ok){let e,n;try{let t=await i.json();e=t.error,n=t.details}catch{}if(429===i.status)throw new t("Please wait a moment before trying again",429);if(i.status>=500)throw new t(e||"Something went wrong — please try again",i.status,n);throw new t(e||"Something went wrong",i.status,n)}return i.json()},u=async(e,t)=>{let n=new URLSearchParams({workspace_id:t}),r=await fetch(`/api/artifacts/${e}/content?${n}`,{credentials:"include"});return r.ok?r.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${o(n)}`,{method:"POST",body:JSON.stringify({email:t})}),"approveMeeting",0,(e,t,n)=>r(`/api/agents/${e}/meetings/${t}/approve${o(n)}`,{method:"POST"}),"cancelActiveTask",0,(e,t)=>r(`/api/conversations/${e}/active-task${o(t)}`,{method:"DELETE"}),"chatInit",0,(e,t,n)=>r(`/api/agents/${e}/chat-init${o(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${o(t,n)}`)},"conversationInit",0,(e,t,n)=>{let i={};return n?.newestMessageId&&(i.newest_message_id=n.newestMessageId),r(`/api/conversations/${e}/init${o(t,i)}`)},"createAgent",0,(e,t)=>r(`/api/agents${o(t)}`,{method:"POST",body:JSON.stringify(e)}),"createAgentLink",0,(e,t)=>r(`/api/agent-links${o(t)}`,{method:"POST",body:JSON.stringify(e)}),"createBufferedMessage",0,a,"createCalendarEvent",0,(e,t)=>r(`/api/calendar${o(t)}`,{method:"POST",body:JSON.stringify(e)}),"createChannelApi",0,(e,t)=>r(`/api/channels${o(e)}`,{method:"POST",body:JSON.stringify({name:t})}),"createConversation",0,(e,t,n)=>r(`/api/conversations${o(t)}`,{method:"POST",body:JSON.stringify({agent_id:e,...n?{channel:n}:{}})}),"createEmailAccount",0,(e,t,n)=>r(`/api/agents/${e}/email-accounts${o(n)}`,{method:"POST",body:JSON.stringify(t)}),"createInvite",0,e=>r(`/api/workspaces/${e}/invites${o(e)}`,{method:"POST"}),"createIssue",0,c,"createMachineToken",0,(e,t)=>r(`/api/machine-tokens${t?o(t):""}`,{method:"POST",body:JSON.stringify({name:e||"default"})}),"createMeeting",0,(e,t,n)=>r(`/api/agents/${e}/meetings${o(t)}`,{method:"POST",body:JSON.stringify(n)}),"createWorkspace",0,(e,t)=>r("/api/workspaces",{method:"POST",body:JSON.stringify({name:e,slug:t||e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"workspace"})}),"deleteAgent",0,(e,t)=>r(`/api/agents/${e}${o(t)}`,{method:"DELETE"}),"deleteAgentLink",0,(e,t)=>r(`/api/agent-links/${e}${o(t)}`,{method:"DELETE"}),"deleteBufferedMessage",0,(e,t,n)=>r(`/api/conversations/${e}/buffered-messages/${t}${o(n)}`,{method:"DELETE"}),"deleteCalendarEvent",0,(e,t,n)=>r(`/api/calendar/${e}${o(t)}`,{method:"DELETE",...n&&n.scope?{headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}:{}}),"deleteChannelApi",0,(e,t)=>r(`/api/channels/${e}${o(t)}`,{method:"DELETE"}),"deleteEmail",0,(e,t)=>r(`/api/email/${e}${o(t)}`,{method:"DELETE"}),"deleteEmailAccount",0,(e,t,n)=>r(`/api/agents/${e}/email-accounts/${t}${o(n)}`,{method:"DELETE"}),"deleteIssue",0,(e,t)=>r(`/api/issues/${t}${o(e)}`,{method:"DELETE"}),"deleteMachine",0,(e,t)=>r(`/api/runtimes/machine${o(t,{daemon_id:e})}`,{method:"DELETE"}),"deleteMeeting",0,(e,t,n)=>r(`/api/agents/${e}/meetings/${t}${o(n)}`,{method:"DELETE"}),"deleteWorkspace",0,(e,t)=>r(`/api/workspaces/${e}${o(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${o(e)}`,{method:"POST",body:JSON.stringify({messageId:t})}),"getActiveTask",0,(e,t)=>r(`/api/conversations/${e}/active-task${o(t)}`),"getAgentSkills",0,(e,t)=>r(`/api/agents/${e}/skills${o(t)}`),"getArtifactContent",0,u,"getCalendarEvent",0,(e,t)=>r(`/api/calendar/${e}${o(t)}`),"getEmail",0,(e,t)=>r(`/api/email/${e}${o(t)}`),"getEmailBody",0,s,"getEmailThread",0,(e,t)=>r(`/api/email/${e}/thread${o(t)}`),"getFlaggedCount",0,e=>r(`/api/flags/count${o(e)}`),"getInboxCount",0,(e,t)=>{let n={};return t?.types?.length&&(n.types=t.types.join(",")),r(`/api/inbox/count${o(e,n)}`)},"getInviteInfo",0,e=>r(`/api/invite/${e}`),"getIssue",0,(e,t)=>r(`/api/issues/${t}${o(e)}`),"getMemberMe",0,e=>r(`/api/members/me${o(e)}`),"getMinCliVersion",0,()=>r("/api/config/min-version"),"getTask",0,(e,t)=>r(`/api/tasks/${e}${o(t)}`),"getTaskMessages",0,(e,t,n)=>r(`/api/tasks/${e}/messages${o(t,n?{since:String(n)}:void 0)}`),"getTrace",0,(e,t)=>r(`/api/traces/${e}${o(t)}`),"getWorkspaceOverview",0,e=>r(`/api/workspaces/${e}/overview${o(e)}`),"grantAgentAccess",0,(e,t,n)=>r(`/api/agents/${t}/access${o(e)}`,{method:"POST",body:JSON.stringify({user_id:n})}),"listAgentAccess",0,(e,t)=>r(`/api/agents/${t}/access${o(e)}`),"listAgentActiveTaskCounts",0,e=>r(`/api/agents/active-task-counts${o(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${o(t,i)}`)},"listAgentLinks",0,e=>r(`/api/agent-links${o(e)}`),"listAgentPins",0,e=>r(`/api/agents/pins${o(e)}`),"listAgents",0,e=>r(`/api/agents${o(e)}`),"listArtifacts",0,(e,t)=>r(`/api/artifacts${o(t,{conversation_id:e})}`),"listBufferedMessages",0,(e,t)=>r(`/api/conversations/${e}/buffered-messages${o(t)}`),"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${o(e,n)}`)},"listChannels",0,e=>r(`/api/channels${o(e)}`),"listEmailAccounts",0,(e,t)=>r(`/api/agents/${e}/email-accounts${o(t)}`),"listEmails",0,(e,t,n,i)=>r(`/api/email${o(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${o(e,n)}`)},"listFlaggedMessageIds",0,(e,t)=>r(`/api/flags${o(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${o(e,n)}`)},"listInvites",0,e=>r(`/api/workspaces/${e}/invites${o(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${o(e,n)}`)},"listMeetings",0,(e,t)=>r(`/api/agents/${e}/meetings${o(t)}`),"listMembers",0,e=>r(`/api/workspaces/${e}/members${o(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${o(t,i)}`)},"listMessagesAroundTask",0,(e,t,n)=>r(`/api/conversations/${e}/messages${o(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${o(t,i)}`)},"listRuntimes",0,e=>r(`/api/runtimes${o(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${o(e,n)}`)},"listWhitelist",0,(e,t)=>r(`/api/agents/${e}/whitelist${o(t)}`),"listWorkspaceActiveTasks",0,e=>r(`/api/agents/active-tasks${o(e)}`),"listWorkspaces",0,()=>r("/api/workspaces"),"markAllInboxRead",0,e=>r(`/api/inbox/read-all${o(e)}`,{method:"POST"}),"markInboxRead",0,(e,t)=>r(`/api/inbox/read${o(t)}`,{method:"POST",body:JSON.stringify({conversationId:e})}),"pinAgent",0,(e,t)=>r(`/api/agents/${t}/pin${o(e)}`,{method:"POST"}),"removeMember",0,(e,t)=>r(`/api/workspaces/${e}/members/${t}${o(e)}`,{method:"DELETE"}),"removeWhitelistEmail",0,(e,t,n)=>r(`/api/agents/${e}/whitelist/${t}${o(n)}`,{method:"DELETE"}),"renameChannelApi",0,(e,t,n)=>r(`/api/channels/${e}${o(t)}`,{method:"PATCH",body:JSON.stringify({name:n})}),"reorderAgentPins",0,(e,t)=>r(`/api/agents/pins/reorder${o(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"reorderChannelsApi",0,(e,t)=>r(`/api/channels/reorder${o(e)}`,{method:"PUT",body:JSON.stringify({ordered_channel_ids:t})}),"reorderUnpinnedAgents",0,(e,t)=>r(`/api/agents/sidebar/reorder${o(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"requestWorkspaceBrowse",0,(e,t,n,i)=>r(`/api/agents/${e}/workspace/browse${o(t)}`,{method:"POST",body:JSON.stringify({request_type:n,path:i})}),"retryTask",0,(e,t)=>r(`/api/tasks/${e}/retry${o(t)}`,{method:"POST"}),"revokeAgentAccess",0,(e,t,n,i=!1)=>r(`/api/agents/${t}/access/${n}${o(e)}${i?"&remove_whitelist=true":""}`,{method:"DELETE"}),"revokeInvite",0,(e,t)=>r(`/api/workspaces/${e}/invites/${t}${o(e)}`,{method:"DELETE"}),"sendEmail",0,(e,t,n,i,a,s,l,c)=>r(`/api/email/send${o(a)}`,{method:"POST",body:JSON.stringify({agentId:e,to:t,subject:n,htmlBody:i,attachments:s,...l,customAccountId:c})}),"sendMessage",0,i,"stopMeeting",0,(e,t,n)=>r(`/api/agents/${e}/meetings/${t}/stop${o(n)}`,{method:"POST"}),"syncEmailAccount",0,(e,t,n)=>r(`/api/agents/${e}/email-accounts/${t}/sync${o(n)}`,{method:"POST"}),"triggerRuntimeRescan",0,(e,t)=>r(`/api/runtimes/${e}/rescan${o(t)}`,{method:"POST"}),"triggerRuntimeUpdate",0,(e,t)=>r(`/api/runtimes/${e}/update${o(t)}`,{method:"POST"}),"unflagMessage",0,(e,t)=>r(`/api/flags/${t}${o(e)}`,{method:"DELETE"}),"unpinAgent",0,(e,t)=>r(`/api/agents/${t}/pin${o(e)}`,{method:"DELETE"}),"updateAgent",0,(e,t,n)=>r(`/api/agents/${e}${o(n)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateAgentLink",0,(e,t,n)=>r(`/api/agent-links/${e}${o(n)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateCalendarEvent",0,(e,t,n)=>r(`/api/calendar/${e}${o(n)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateEmailStatus",0,(e,t,n)=>r(`/api/email/${e}${o(t)}`,{method:"PATCH",body:JSON.stringify({status:n})}),"updateIssue",0,(e,t,n)=>r(`/api/issues/${t}${o(e)}`,{method:"PATCH",body:JSON.stringify(n)}),"updateMemberMe",0,(e,t)=>r(`/api/members/me${o(e)}`,{method:"PATCH",body:JSON.stringify({global_instruction:t})}),"updateWorkspace",0,(e,t)=>r(`/api/workspaces/${e}${o(e)}`,{method:"PATCH",body:JSON.stringify(t)}),"uploadEmailAttachment",0,l],222862)},500324,e=>{"use strict";var t=e.i(368075),n=e.i(298699);let r=(0,n.createContext)(null);e.s(["WorkspaceProvider",0,function({workspaceId:e,slug:o,children:i}){return(0,n.useEffect)(()=>{try{localStorage.setItem("lastWorkspace",o)}catch{}},[o]),(0,t.jsx)(r.Provider,{value:{workspaceId:e,slug:o},children:i})},"useWorkspace",0,function(){let e=(0,n.useContext)(r);if(!e)throw Error("useWorkspace must be used within WorkspaceProvider");return e}])},642342,e=>{"use strict";var t=e.i(459119),n=e.i(298699);let r=(0,e.i(613349).isLocalMode)(),o=Number(t.default.env.NEXT_PUBLIC_WS_DO_PORT)||8789,i=Number(t.default.env.NEXT_PUBLIC_WS_RECONNECT_DELAY_MS)||1e3,a=Number(t.default.env.NEXT_PUBLIC_WS_RECONNECT_MAX_DELAY_MS)||3e4;e.s(["useUserWs",0,function(e,t){let s=(0,n.useRef)(null),l=(0,n.useRef)(i),c=(0,n.useRef)(e),u=(0,n.useRef)(t?.onReconnect),d=(0,n.useRef)(null),f=(0,n.useRef)(!1),m=(0,n.useRef)(0),p=(0,n.useRef)(null),g=(0,n.useRef)(null);(0,n.useEffect)(()=>{c.current=e},[e]),(0,n.useEffect)(()=>{u.current=t?.onReconnect},[t?.onReconnect]);let _=(0,n.useRef)(null),h=(0,n.useCallback)(()=>{let e=Math.min(l.current,a);l.current=Math.min(2*e,a),d.current=setTimeout(()=>{_.current?.()},e+500*Math.random())},[]),E=(0,n.useCallback)(async()=>{let e,t,n,a=o;try{let n=await fetch("/api/ws/token");if(!n.ok){console.warn("[ws] token fetch failed:",n.status),h();return}let r=await n.json();e=r.userId,t=r.token,r.wsPort&&(a=r.wsPort)}catch(e){console.warn("[ws] token fetch error:",e),h();return}let d=r?`ws://localhost:${a}/?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),h();return}s.current=n,n.onopen=()=>{l.current=i,n.send(JSON.stringify({type:"auth",token:t})),f.current&&u.current?.(),f.current=!0,m.current=Date.now(),p.current=setInterval(()=>{n.readyState===WebSocket.OPEN&&n.send("ping")},25e3),g.current=setInterval(()=>{Date.now()-m.current>3e4&&n.close()},5e3)},n.onmessage=e=>{m.current=Date.now();try{let t=JSON.parse(e.data);if("auth.ok"===t.type)return;c.current(t)}catch{}},n.onerror=()=>{},n.onclose=()=>{n===s.current&&(p.current&&(clearInterval(p.current),p.current=null),g.current&&(clearInterval(g.current),g.current=null),h())}},[h]);(0,n.useEffect)(()=>{_.current=E},[E]),(0,n.useEffect)(()=>(E(),()=>{null!==d.current&&(clearTimeout(d.current),d.current=null),p.current&&(clearInterval(p.current),p.current=null),g.current&&(clearInterval(g.current),g.current=null);let e=s.current;s.current=null,e?.close()}),[E])}])},355578,e=>{"use strict";var t=e.i(368075),n=e.i(298699),r=e.i(222862),o=e.i(880932),i=e.i(642342);let a=(0,n.createContext)(null);e.s(["AgentProvider",0,function({workspaceId:e,children:s}){let[l,c]=(0,n.useState)([]),[u,d]=(0,n.useState)([]),[f,m]=(0,n.useState)(!0),[p,g]=(0,n.useState)({}),[_,h]=(0,n.useState)([]),E=(0,n.useRef)(!1),[C,w]=(0,n.useState)([]),[S,y]=(0,n.useState)(new Map),[T,k]=(0,n.useState)(new Map),O=(0,n.useRef)(!1),v=(0,n.useRef)(new Set),b=(0,n.useRef)(!0),M=(0,n.useRef)(!1),$=(0,n.useCallback)(e=>(v.current.add(e),()=>{v.current.delete(e)}),[]),I=(0,n.useRef)(!1),P=(0,n.useCallback)(async()=>{if(!I.current){I.current=!0;try{if(E.current){let t=await (0,r.listWorkspaceActiveTasks)(e);if(!b.current)return;h(t.tasks);let n={};for(let e of t.tasks)n[e.agent_id]=(n[e.agent_id]??0)+1;g(n),E.current=t.tasks.length>0}else{let t=await (0,r.listAgentActiveTaskCounts)(e);if(!b.current)return;if(g(t.counts),Object.values(t.counts).some(e=>e>0)){E.current=!0;let t=await (0,r.listWorkspaceActiveTasks)(e);b.current&&h(t.tasks)}else h([])}}catch{}finally{I.current=!1}}},[e]);(0,n.useEffect)(()=>{b.current=!0,P();let e=setInterval(P,15e3);return()=>{b.current=!1,clearInterval(e)}},[P]);let N=(0,n.useCallback)(async()=>{try{let[t,n,o,i]=await Promise.all([(0,r.listAgents)(e),(0,r.listRuntimes)(e),(0,r.listAgentPins)(e),(0,r.listAgentLinks)(e)]);c(t),d(n),w(i),y(new Map(o.pins.map(e=>[e.agent_id,{created_at:e.created_at,position:e.position}]))),k(new Map(o.sidebar_order.map(e=>[e.agent_id,e.position])))}catch(e){o.toast.error(e instanceof Error?e.message:"Failed to load data")}finally{m(!1),O.current=!0}},[e]),A=(0,n.useCallback)(async()=>{if(!M.current){M.current=!0;try{let t=await (0,r.listRuntimes)(e);d(t)}catch{}finally{M.current=!1}}},[e]);(0,n.useEffect)(()=>{N()},[N]),(0,n.useEffect)(()=>{let e=null,t=setInterval(()=>{"visible"===document.visibilityState&&A()},3e4),n=()=>{"visible"===document.visibilityState&&(e=setTimeout(()=>A(),2e3*Math.random()))};return document.addEventListener("visibilitychange",n),()=>{clearInterval(t),e&&clearTimeout(e),document.removeEventListener("visibilitychange",n)}},[A]);let D=(0,n.useCallback)(t=>{for(let e of v.current)e(t);switch(t.type){case"runtime.registered":if(t.workspaceId!==e)break;N();break;case"runtime.deleted":N();break;case"runtime.status":if(t.workspaceId!==e)break;A();break;case"task.updated":P()}},[N,A,P,e]);(0,i.useUserWs)(D,{onReconnect:A});let R=(0,n.useCallback)(async t=>{try{let n=await (0,r.createAgent)(t,e);return await N(),n}catch(e){return o.toast.error(e instanceof Error?e.message:"Failed to create agent"),null}},[N,e]),x=(0,n.useCallback)(async(t,n)=>{try{return await (0,r.updateAgent)(t,n,e),await N(),!0}catch(e){return o.toast.error(e instanceof Error?e.message:"Failed to update agent"),!1}},[N,e]),L=(0,n.useCallback)(async t=>{try{return await (0,r.deleteAgent)(t,e),await N(),!0}catch(e){return o.toast.error(e instanceof Error?e.message:"Failed to remove agent"),!1}},[N,e]),U=(0,n.useCallback)(async t=>{y(e=>{let n=Math.max(-1,...[...e.values()].map(e=>e.position));return new Map(e).set(t,{created_at:new Date().toISOString(),position:n+1})});try{await (0,r.pinAgent)(e,t)}catch{y(e=>{let n=new Map(e);return n.delete(t),n}),o.toast.error("Failed to pin agent")}},[e]),q=(0,n.useCallback)(async t=>{let n;y(e=>{n=e.get(t);let r=new Map(e);return r.delete(t),r});try{await (0,r.unpinAgent)(e,t)}catch{void 0!==n&&y(e=>new Map(e).set(t,n)),o.toast.error("Failed to unpin agent")}},[e]),W=(0,n.useCallback)(async t=>{let n=new Map(S);y(e=>{let n=new Map(e);return t.forEach((e,t)=>{let r=n.get(e);r&&n.set(e,{...r,position:t})}),n});try{await (0,r.reorderAgentPins)(e,t)}catch{y(n),o.toast.error("Failed to reorder pins")}},[e,S]),F=(0,n.useCallback)(async t=>{let n=new Map(T);k(new Map(t.map((e,t)=>[e,t])));try{await (0,r.reorderUnpinnedAgents)(e,t)}catch{k(n),o.toast.error("Failed to reorder agents")}},[e,T]),j=(0,n.useCallback)(()=>{let e=u.find(e=>"online"===e.status);return e?.id??""},[u]),J=(0,n.useCallback)(async()=>{try{return(await (0,r.createMachineToken)("cli",e)).token}catch(e){return o.toast.error(e instanceof Error?e.message:"Failed to generate token"),null}},[e]),V=(0,n.useCallback)(async t=>{try{return await (0,r.deleteMachine)(t,e),await N(),!0}catch(e){return o.toast.error(e instanceof Error?e.message:"Failed to remove machine"),!1}},[N,e]);return(0,t.jsx)(a.Provider,{value:{workspaceId:e,agents:l,agentLinks:C,runtimes:u,loading:f,activeTaskCounts:p,activeTaskDetails:_,pins:S,reload:N,subscribeWs:$,handleCreateAgent:R,handleUpdateAgent:x,handleDeleteAgent:L,handlePinAgent:U,handleUnpinAgent:q,handleReorderPins:W,unpinnedOrder:T,handleReorderUnpinned:F,getFirstOnlineRuntimeId:j,handleGenerateToken:J,handleDeleteMachine:V},children:s})},"useAgentContext",0,function(){let e=(0,n.useContext)(a);if(!e)throw Error("useAgentContext must be used within AgentProvider");return e},"useAgentContextSafe",0,function(){return(0,n.useContext)(a)}])},980630,e=>{"use strict";let t="browser-notification-enabled",n="browser-notification-events",r=["completed","failed"],o={completed:"Task Completed",failed:"Task Failed"};function i(){return"Notification"in window}function a(){return"true"===localStorage.getItem(t)}function s(){try{let e=localStorage.getItem(n);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,o,"getNotificationEnabled",0,a,"getNotificationEvents",0,s,"isNotificationSupported",0,i,"requestNotificationPermission",0,l,"sendTaskNotification",0,function(e,t,n){if(!i()||"granted"!==Notification.permission||!a()||!s().includes(e))return;let r=o[e]??`Task ${e}`;new Notification(t?`${t} — ${r}`:r,{body:n??"",icon:"/alook.svg"})},"setNotificationEnabled",0,function(e){localStorage.setItem(t,String(e))},"setNotificationEvents",0,function(e){localStorage.setItem(n,JSON.stringify(e))}])},875494,685835,e=>{"use strict";var t=e.i(368075),n=e.i(298699),r=e.i(222862),o=e.i(355578),i=e.i(500324),a=e.i(980630);let s="inbox-filter-types",l=["user_dm_message","calendar_event","email_notification"],c=["user_dm_message"],u=["user_dm_message"];function d(){try{let e=localStorage.getItem(s);if(!e)return c;let t=JSON.parse(e).filter(e=>l.includes(e));if(0===t.length)return c;for(let e of u)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,u,"getInboxFilterTypes",0,d,"setInboxFilterTypes",0,function(e){let t=[...e];for(let e of u)t.includes(e)||t.unshift(e);localStorage.setItem(s,JSON.stringify(t))}],685835);let f=(0,n.createContext)(null),m={count:0,notificationToken:0,refresh:()=>{},decrement:()=>{}};e.s(["InboxCountProvider",0,function({children:e}){let{workspaceId:s}=(0,i.useWorkspace)(),{subscribeWs:l,agents:c}=(0,o.useAgentContext)(),[u,m]=(0,n.useState)(0),[p,g]=(0,n.useState)(0),_=(0,n.useRef)(null),h=(0,n.useRef)(null),E=(0,n.useRef)(c);(0,n.useEffect)(()=>{E.current=c});let C=(0,n.useCallback)(()=>{let e=d();(0,r.getInboxCount)(s,{types:e}).then(e=>{let t=_.current;if(_.current=e.count,m(e.count),null!==t&&e.count>t){g(e=>e+1);let e=h.current?E.current.find(e=>e.id===h.current):void 0;(0,a.sendTaskNotification)("completed",e?.name)}h.current=null}).catch(()=>{})},[s]),w=(0,n.useCallback)(()=>{m(e=>{let t=Math.max(0,e-1);return _.current=t,t})},[]);return(0,n.useEffect)(()=>{C()},[C]),(0,n.useEffect)(()=>l(e=>{"task.updated"===e.type&&("completed"===e.status||"failed"===e.status)&&(h.current=e.agentId,C())}),[l,C]),(0,n.useEffect)(()=>{let e=setInterval(C,6e4);return()=>clearInterval(e)},[C]),(0,t.jsx)(f.Provider,{value:{count:u,notificationToken:p,refresh:C,decrement:w},children:e})},"useInboxCount",0,function(){return(0,n.useContext)(f)??m}],875494)},192935,e=>{e.v({button:"cloud-code-monster-pet-module__wqv_bq__button","cloud-code-monster-bell-alert":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-bell-alert","cloud-code-monster-breathe":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-breathe","cloud-code-monster-faint":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-faint","cloud-code-monster-footprint":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-footprint","cloud-code-monster-keytap":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-keytap","cloud-code-monster-left-foot":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-left-foot","cloud-code-monster-peek":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-peek","cloud-code-monster-phone":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-phone","cloud-code-monster-phone-glow":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-phone-glow","cloud-code-monster-read":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-read","cloud-code-monster-right-foot":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-right-foot","cloud-code-monster-shaken":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-shaken","cloud-code-monster-shock-pixels":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-shock-pixels","cloud-code-monster-sleep":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-sleep","cloud-code-monster-sleep-pixels":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-sleep-pixels","cloud-code-monster-snack":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-snack","cloud-code-monster-startled":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-startled","cloud-code-monster-thought":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-thought","cloud-code-monster-walk":"cloud-code-monster-pet-module__wqv_bq__cloud-code-monster-walk",footprint:"cloud-code-monster-pet-module__wqv_bq__footprint",footsteps:"cloud-code-monster-pet-module__wqv_bq__footsteps",notificationBell:"cloud-code-monster-pet-module__wqv_bq__notificationBell",notificationBellPixel:"cloud-code-monster-pet-module__wqv_bq__notificationBellPixel",pet:"cloud-code-monster-pet-module__wqv_bq__pet",petLayer:"cloud-code-monster-pet-module__wqv_bq__petLayer"})},105583,e=>{"use strict";var t=e.i(368075),n=e.i(298699),r=e.i(355578),o=e.i(875494),i=e.i(192935),a=e.i(396328),s=e.i(434623),l=e.i(460520);function c(e,t){let n=t?.getBoundingClientRect();return{x:e.clientX-(n?.left??0),y:e.clientY-(n?.top??0)}}var u=e.i(961909),d=e.i(399561);let f=[];function m({boundaryRef:e,initialPosition:p,previewComebackToken:g=0,notificationToken:_=0,peekTargets:h=f}){let E,C,w,[S,y]=(0,n.useState)(null),[T,k]=(0,n.useState)(null),[O,v]=(0,n.useState)(!1),[b,M]=(0,n.useState)(!1),[$,I]=(0,n.useState)(!1),[P,N]=(0,n.useState)(!1),[A,D]=(0,n.useState)(!1),[R,x]=(0,n.useState)(!1),[L,U]=(0,n.useState)(!1),[q,W]=(0,n.useState)(d.CLOUD_CODE_MONSTER_PET_PRESETS[0].id),[F,j]=(0,n.useState)(1),[J,V]=(0,n.useState)("right"),[B,H]=(0,n.useState)([]),K=(0,n.useRef)(0),Y=(0,n.useRef)(null),Z=(0,n.useRef)(1),z=(0,n.useRef)("left"),X=(0,n.useRef)(null),G=(0,n.useRef)([]),Q=(0,n.useRef)(h),{clearAllPetTimers:ee,clearPetTimer:et,setPetTimer:en}=(E=(0,n.useRef)({reaction:null,shake:null,faint:null,autonomousWalk:null,peek:null,peekStop:null,notification:null,walkSettle:null,walkToTargetPeek:null}),C=(0,n.useCallback)(e=>{let t=E.current[e];null!==t&&(window.clearTimeout(t),E.current[e]=null)},[]),w=(0,n.useCallback)((e,t,n)=>{C(e),E.current[e]=window.setTimeout(()=>{E.current[e]=null,t()},n)},[C]),{clearAllPetTimers:(0,n.useCallback)(()=>{for(let e of Object.keys(E.current))C(e)},[C]),clearPetTimer:C,setPetTimer:w});(0,n.useEffect)(()=>{let e=e=>{W(e?(0,d.getCloudCodeMonsterPreset)(e).id:(0,d.readCloudCodeMonsterPetPresetId)())},t=t=>{e(t.detail?.presetId)},n=t=>{t.key===l.CLOUD_CODE_MONSTER_PRESET_STORAGE_KEY&&e(t.newValue)};return e(),window.addEventListener(l.CLOUD_CODE_MONSTER_PRESET_CHANGED_EVENT,t),window.addEventListener("storage",n),()=>{window.removeEventListener(l.CLOUD_CODE_MONSTER_PRESET_CHANGED_EVENT,t),window.removeEventListener("storage",n)}},[]),(0,n.useEffect)(()=>{let e=(0,a.resolveCloudCodeMonsterVisibleState)((0,a.readStoredActivity)());(0,a.writeStoredActivity)(e),y(e);let t=()=>{let e=Date.now();y(t=>{let n="hidden"===document.visibilityState?(0,a.createCloudCodeMonsterHiddenState)(t,e):(0,a.resolveCloudCodeMonsterVisibleState)(t??(0,a.readStoredActivity)(),e);return(0,a.writeStoredActivity)(n),n})};return document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}},[]),(0,n.useEffect)(()=>{if(g<=0)return;let e=(0,a.resolveCloudCodeMonsterPreviewComebackState)();(0,a.writeStoredActivity)(e),y(e)},[g]),(0,n.useEffect)(()=>{let t=()=>{let t=(0,a.getBounds)(e.current);k(e=>e?(0,a.clampPetPosition)(e,t,l.CLOUD_CODE_MONSTER_SIZE):(0,a.clampPetPosition)(p??{x:t.width-l.CLOUD_CODE_MONSTER_SIZE.width-112,y:Math.min(.48*t.height,t.height-l.CLOUD_CODE_MONSTER_SIZE.height-120)},t,l.CLOUD_CODE_MONSTER_SIZE))};return t(),window.addEventListener("resize",t),"u">typeof ResizeObserver&&e.current&&(X.current=new ResizeObserver(t),X.current.observe(e.current)),()=>{window.removeEventListener("resize",t),X.current?.disconnect(),X.current=null}},[e,p]),(0,n.useEffect)(()=>ee,[ee]);let er=(0,n.useMemo)(()=>S?.activityId?s.CLOUD_CODE_MONSTER_ACTIVITIES.find(e=>e.id===S.activityId):null,[S]),eo=(0,n.useMemo)(()=>(0,d.getCloudCodeMonsterPreset)(q),[q]),ei=O||b,ea=null!==T,es=h.length>0,el=(0,a.shouldCloudCodeMonsterAutoWalk)(S?.activityId??null);(0,n.useEffect)(()=>{Q.current=h},[h]);let{count:ec}=(0,o.useInboxCount)(),[eu,ed]=(0,n.useState)(!1),ef=(0,n.useRef)(null);(0,n.useEffect)(()=>(!(ec>0)||L||O?0===ec&&(null!==ef.current&&(window.clearTimeout(ef.current),ef.current=null),ed(!1)):null===ef.current&&(ef.current=window.setTimeout(()=>{ef.current=null,ed(!0)},300)),()=>{null!==ef.current&&(window.clearTimeout(ef.current),ef.current=null)}),[ec,L,O]);let em=(0,n.useCallback)((e,t)=>{j(t);let n=performance.now();if(n-K.current>=(0,a.getMonsterFootstepIntervalMs)(t)){let r=z.current;z.current="left"===r?"right":"left";let o="left"===r?25:52;H(n=>[...n.slice(-13),{id:Z.current++,x:e.x+o,y:e.y+l.CLOUD_CODE_MONSTER_SIZE.height-7,side:r,intensity:t}]),K.current=n}},[]),ep=function({boundaryRef:e,targetId:t,enabled:r,position:o,setPosition:i,onArrive:s,onStep:c}){let[u,d]=(0,n.useState)(!1),[f,m]=(0,n.useState)(!1),[p,g]=(0,n.useState)("left"),_=(0,n.useRef)(null),h=(0,n.useRef)(!1),E=(0,n.useRef)(r),C=(0,n.useRef)(o);(0,n.useEffect)(()=>{E.current=r},[r]),(0,n.useEffect)(()=>{C.current=o},[o]);let w=(0,n.useCallback)(()=>{null!==_.current&&(window.clearTimeout(_.current),_.current=null)},[]),S=(0,n.useCallback)(()=>{w(),d(!1),m(!1),h.current=!1},[w]);return(0,n.useEffect)(()=>{if(!r||!t||!o)return void S();if(h.current)return;d(!0),m(!1);let n=()=>{_.current=window.setTimeout(()=>{if(_.current=null,!E.current)return void d(!1);let r=function(e,t){if(!e)return null;let n=e.querySelector(`[data-pet-target-id="${t}"]`)??document.querySelector(`[data-pet-target-id="${t}"]`);if(!n)return null;let r=n.getBoundingClientRect(),o=(0,a.getBounds)(e),i=r.right+22,s=r.top+r.height/2-l.CLOUD_CODE_MONSTER_SIZE.height/2;return(0,a.clampPetPosition)({x:i,y:s},o,l.CLOUD_CODE_MONSTER_SIZE)}(e.current,t),o=C.current;if(!r||!o)return void n();if(10>Math.hypot(r.x-o.x,r.y-o.y)){h.current=!0,d(!1),m(!0),g("left"),i(()=>r),s();return}let u=(0,a.createWalkToTargetVelocity)(o,r,3.2);g(u.x>=0?"right":"left");let f=(0,a.clampPetPosition)({x:o.x+u.x,y:o.y+u.y},(0,a.getBounds)(e.current),l.CLOUD_CODE_MONSTER_SIZE);i(()=>f),c(f,1.45),n()},l.CLOUD_CODE_MONSTER_AUTO_WALK_STEP_MS)};return n(),()=>{w()}},[r,t,!!o,e,S,w,s,c,i]),{isWalking:u,isIdlingAtTarget:f,walkDirection:p}}({boundaryRef:e,targetId:eu?"inbox":null,enabled:eu&&!O&&!A&&!R&&!L,position:T,setPosition:k,onArrive:(0,n.useCallback)(()=>{I(!0),j(1),en("walkToTargetPeek",()=>{I(!1);let e=()=>{en("walkToTargetPeek",()=>{I(!0),en("peekStop",()=>{I(!1),e()},l.CLOUD_CODE_MONSTER_PEEK_MS)},l.CLOUD_CODE_MONSTER_PEEK_INTERVAL_MS)};e()},l.CLOUD_CODE_MONSTER_PEEK_MS)},[en]),onStep:em}),eg=ep.isWalking||ep.isIdlingAtTarget,e_=ei||ep.isWalking,eh=(0,n.useRef)(!1);(0,n.useEffect)(()=>{eh.current&&!eg&&(et("walkToTargetPeek"),I(!1)),eh.current=eg},[eg,et]);let eE=(0,r.useAgentContextSafe)(),eC=(eE?.activeTaskDetails.length??0)>0,ew=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(eC&&!eg){if(!ew.current){let e=["coding","thinking","reading"];ew.current=e[Math.floor(Math.random()*e.length)]}let e=ew.current;y(t=>{if(t?.activityId===e)return t;let n={activityId:e,updatedAt:Date.now(),hiddenAt:null};return(0,a.writeStoredActivity)(n),n})}else if(!eC&&ew.current){ew.current=null;let e=(0,a.createCloudCodeMonsterIdleState)();(0,a.writeStoredActivity)(e),y(e)}},[eC,eg]);let eS=(0,n.useCallback)((e,t)=>{let n=z.current;z.current="left"===n?"right":"left";let r="left"===n?25:52;H(o=>[...o.slice(-13),{id:Z.current++,x:e.x+r,y:e.y+l.CLOUD_CODE_MONSTER_SIZE.height-7,side:n,intensity:t}])},[]);(0,n.useEffect)(()=>{if(!ea||!S?.activityId||!el||O||A||R||L||$||eg){M(!1),j(1),Y.current=null;return}M(!0),Y.current??=(0,a.createCloudCodeMonsterWalkVelocity)();let t=()=>{en("autonomousWalk",()=>{let n=(0,a.getBounds)(e.current);j(1.45),k(e=>{let t=Y.current;if(!e||!t)return e;let r=(0,a.reflectCloudCodeMonsterWalk)(e,t,n,l.CLOUD_CODE_MONSTER_SIZE);Y.current=r.velocity,V(r.velocity.x>=0?"right":"left");let o=performance.now();return o-K.current>=(0,a.getMonsterFootstepIntervalMs)(1.45)&&(eS(r.position,1.45),K.current=o),r.position}),t()},l.CLOUD_CODE_MONSTER_AUTO_WALK_STEP_MS)};return en("autonomousWalk",t,l.CLOUD_CODE_MONSTER_AUTO_WALK_STEP_MS),()=>{et("autonomousWalk")}},[S?.activityId,e,L,ea,O,$,eg,A,et,eS,R,el,en]),(0,n.useEffect)(()=>{if(ea&&es&&!O&&!A&&!R&&!L&&!eg)return en("peek",()=>{let t=Q.current,n=t[Math.floor(Math.random()*t.length)]??t[0];if(!n)return;let r=(0,a.getBounds)(e.current),o=(0,a.resolveCloudCodeMonsterPeekPosition)(n,e.current,r);M(!1),Y.current=null,I(!0),j(1),k(o),en("peekStop",()=>{I(!1)},l.CLOUD_CODE_MONSTER_PEEK_MS)},l.CLOUD_CODE_MONSTER_PEEK_INTERVAL_MS+4e3*Math.random()),()=>{et("peek")}},[e,et,L,es,ea,O,eg,A,R,en]);let ey=(0,n.useCallback)(()=>{y(e=>{if(e&&!e.activityId&&null===e.hiddenAt)return e;let t=(0,a.createCloudCodeMonsterIdleState)();return(0,a.writeStoredActivity)(t),t})},[]),eT=(0,n.useCallback)(()=>{M(!1),I(!1),G.current=[],Y.current=null,et("autonomousWalk"),et("peek"),et("peekStop"),et("walkToTargetPeek")},[et]),ek=(0,n.useCallback)(()=>{D(!0),en("reaction",()=>{D(!1)},l.CLOUD_CODE_MONSTER_REACTION_MS)},[en]);(0,n.useEffect)(()=>{_<=0||(eT(),S?.activityId&&ey(),ek(),N(!0),en("notification",()=>{N(!1)},l.CLOUD_CODE_MONSTER_REACTION_MS+1500))},[S?.activityId,_,en,ek,eT,ey]);let eO=(0,n.useCallback)(()=>{L||(S?.activityId&&ey(),x(!0),en("shake",()=>{x(!1)},l.CLOUD_CODE_MONSTER_SHAKE_REACTION_MS))},[S?.activityId,L,en,ey]),ev=(0,n.useCallback)(()=>{et("faint"),et("reaction"),et("shake"),ey(),eT(),D(!1),x(!1),U(!0),j(1),en("faint",()=>{U(!1)},l.CLOUD_CODE_MONSTER_FAINT_MS)},[et,en,eT,ey]),{handlePetClick:eb,handlePointerDown:eM,handlePointerMove:e$,stopDragging:eI}=function({boundaryRef:e,initialPosition:t,position:r,isDragging:o,fainted:i,activityState:s,lastFootstepAtRef:u,violentDragEventsRef:d,setIsDragging:f,setNotificationActive:m,setFainted:p,setWalkDirection:g,setWalkIntensity:_,setPosition:h,clearPetTimer:E,setPetTimer:C,pushFootprint:w,stopTemporaryMotion:S,wakeMonsterToDefault:y,startShockReaction:T,startShakeReaction:k,startFaintReaction:O}){let v=(0,n.useRef)({x:0,y:0}),b=(0,n.useRef)(null),M=(0,n.useRef)(null),$=(0,n.useRef)(null),I=(0,n.useRef)(!1),P=(0,n.useCallback)(()=>{if(S(),m(!1),E("notification"),I.current){I.current=!1;return}o||(s?.activityId&&y(),i&&(p(!1),E("faint")),T())},[s?.activityId,E,i,o,p,m,T,S,y]),N=(0,n.useCallback)(n=>{if(0!==n.button)return;let o=(0,a.getBounds)(e.current),i=r??(0,a.clampPetPosition)(t??{x:o.width-l.CLOUD_CODE_MONSTER_SIZE.width-112,y:.48*o.height},o,l.CLOUD_CODE_MONSTER_SIZE),s=c(n,e.current),d=performance.now();v.current={x:s.x-i.x,y:s.y-i.y},b.current=s,M.current={point:s,time:d},$.current=null,u.current=d,I.current=!1,S(),f(!0),_(1.1),n.currentTarget.setPointerCapture(n.pointerId)},[e,t,u,r,f,_,S]);return{handlePetClick:P,handlePointerDown:N,handlePointerMove:(0,n.useCallback)(t=>{if(!o)return;let n=(0,a.getBounds)(e.current),r=c(t,e.current),s=performance.now(),f=M.current??{point:r,time:s},m=r.x-f.point.x,p=r.y-f.point.y,E={x:m,y:p},C=Math.hypot(m,p),S=Math.max(1,s-f.time),y=(0,a.calculateMonsterWalkIntensity)(C,S),T=(0,a.clampPetPosition)({x:r.x-v.current.x,y:r.y-v.current.y},n,l.CLOUD_CODE_MONSTER_SIZE),P=b.current??r,N=Math.abs(r.x-P.x),A=Math.abs(r.y-P.y);(N>3||A>3)&&(I.current=!0),Math.abs(m)>.5&&g(m>=0?"right":"left");let D=(0,a.hasViolentMonsterDirectionChange)($.current,E);(!i&&(0,a.isViolentMonsterDrag)(C,S,D)&&k(),!i&&(0,a.isMonsterFaintShakeEvent)(C,S,D)&&(d.current=[...d.current.filter(e=>s-e<=l.CLOUD_CODE_MONSTER_FAINT_EVENT_WINDOW_MS),s],(0,a.shouldFaintFromMonsterShake)(d.current,s)))?O():(_(y),h(T),M.current={point:r,time:s},C>.5&&($.current=E),C>1&&s-u.current>=(0,a.getMonsterFootstepIntervalMs)(y)&&(w(T,y),u.current=s))},[e,i,o,u,w,h,g,_,O,k,d]),stopDragging:(0,n.useCallback)(e=>{o&&(f(!1),d.current=[],b.current=null,M.current=null,$.current=null,C("walkSettle",()=>{_(1)},180),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))},[o,f,C,_,d])}}({activityState:S,boundaryRef:e,fainted:L,initialPosition:p,isDragging:O,lastFootstepAtRef:K,position:T,pushFootprint:eS,setFainted:U,setIsDragging:v,setNotificationActive:N,setPetTimer:en,setPosition:k,setWalkDirection:V,setWalkIntensity:j,clearPetTimer:et,startFaintReaction:ev,startShakeReaction:eO,startShockReaction:ek,stopTemporaryMotion:eT,violentDragEventsRef:G,wakeMonsterToDefault:ey});if(!T||!S)return null;let eP=$||L?null:er;return(0,t.jsxs)("div",{className:i.default.petLayer,children:[(0,t.jsx)("div",{className:i.default.footsteps,"aria-hidden":"true",children:B.map(e=>(0,t.jsx)("span",{className:i.default.footprint,"data-side":e.side,onAnimationEnd:()=>{H(t=>t.filter(t=>t.id!==e.id))},style:{"--monster-footprint-x":`${e.x}px`,"--monster-footprint-y":`${e.y}px`,"--monster-footprint-scale":String(Math.min(1.35,Math.max(.75,e.intensity/1.45)))}},e.id))}),(0,t.jsxs)("aside",{"aria-label":`${eo.name} pixel PET: ${L?"fainted":$?"peeking at work":eP?.label??"idle"}`,className:i.default.pet,"data-activity":eP?.id??"idle","data-dragging":O,"data-walking":e_,"data-direction":eg?ep.walkDirection:J,"data-reaction":R?"shake":A?"shock":"none","data-reacting":A,"data-shaken":R,"data-fainted":L,"data-peeking":$,"data-notifying":P,style:{"--cloud-code-monster-pet-x":`${T.x}px`,"--cloud-code-monster-pet-y":`${T.y}px`,"--monster-walk-duration":`${Math.round(360/Math.max(.75,F))}ms`,"--monster-walk-lift":`-${Math.round(2*Math.max(.75,F))}px`,"--monster-walk-intensity":String(F)},children:[P?(0,t.jsx)("span",{className:i.default.notificationBell,"aria-hidden":"true",children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:`${i.default.notificationBellPixel} size-6`,role:"img",shapeRendering:"crispEdges",children:[(0,t.jsx)("rect",{x:"10",y:"2",width:"4",height:"3",fill:"#2b2112"}),(0,t.jsx)("rect",{x:"8",y:"5",width:"8",height:"3",fill:"#2b2112"}),(0,t.jsx)("rect",{x:"6",y:"8",width:"12",height:"8",fill:"#2b2112"}),(0,t.jsx)("rect",{x:"4",y:"16",width:"16",height:"4",fill:"#2b2112"}),(0,t.jsx)("rect",{x:"9",y:"20",width:"6",height:"2",fill:"#2b2112"}),(0,t.jsx)("rect",{x:"10",y:"5",width:"4",height:"2",fill:"#ffe37a"}),(0,t.jsx)("rect",{x:"8",y:"8",width:"8",height:"8",fill:"#f4c84f"}),(0,t.jsx)("rect",{x:"6",y:"16",width:"12",height:"2",fill:"#f4c84f"}),(0,t.jsx)("rect",{x:"9",y:"9",width:"3",height:"7",fill:"#ffe37a"}),(0,t.jsx)("rect",{x:"13",y:"18",width:"3",height:"2",fill:"#c8922f"})]})}):null,(0,t.jsx)("button",{type:"button",className:i.default.button,"data-dragging":O,"data-fainted":L,onClick:eb,onPointerDown:eM,onPointerMove:e$,onPointerUp:eI,onPointerCancel:eI,onLostPointerCapture:eI,"aria-label":`Claude Code pixel monster is ${L?"fainted":$?"peeking at work":eP?.label??"idle"}. Click to ${eP||L||$?"interrupt it":"notice it"}, drag to make it walk.`,children:(0,t.jsx)(u.MonsterSvg,{activityId:eP?.id??null,preset:eo,reacting:A,shaken:R,fainted:L})})]})]})}e.s(["CloudCodeMonsterPet",0,m],626620),e.i(626620),e.s(["CLOUD_CODE_MONSTER_ACTIVITIES",()=>s.CLOUD_CODE_MONSTER_ACTIVITIES,"CLOUD_CODE_MONSTER_ACTIVITY_REFRESH_MS",()=>l.CLOUD_CODE_MONSTER_ACTIVITY_REFRESH_MS,"CLOUD_CODE_MONSTER_AUTOWALK_ACTIVITY_IDS",()=>s.CLOUD_CODE_MONSTER_AUTOWALK_ACTIVITY_IDS,"CLOUD_CODE_MONSTER_FAINT_MIN_EVENTS",()=>l.CLOUD_CODE_MONSTER_FAINT_MIN_EVENTS,"CLOUD_CODE_MONSTER_FAINT_MS",()=>l.CLOUD_CODE_MONSTER_FAINT_MS,"CLOUD_CODE_MONSTER_PET_PRESETS",()=>d.CLOUD_CODE_MONSTER_PET_PRESETS,"CLOUD_CODE_MONSTER_PRESET_CHANGED_EVENT",()=>l.CLOUD_CODE_MONSTER_PRESET_CHANGED_EVENT,"CLOUD_CODE_MONSTER_PRESET_STORAGE_KEY",()=>l.CLOUD_CODE_MONSTER_PRESET_STORAGE_KEY,"CloudCodeMonsterPet",0,m,"CloudCodeMonsterPresetPreview",()=>u.CloudCodeMonsterPresetPreview,"calculateMonsterWalkIntensity",()=>a.calculateMonsterWalkIntensity,"clampPetPosition",()=>a.clampPetPosition,"createCloudCodeMonsterHiddenState",()=>a.createCloudCodeMonsterHiddenState,"createCloudCodeMonsterIdleState",()=>a.createCloudCodeMonsterIdleState,"createCloudCodeMonsterPreviewAwayState",()=>a.createCloudCodeMonsterPreviewAwayState,"createCloudCodeMonsterWalkVelocity",()=>a.createCloudCodeMonsterWalkVelocity,"createWalkToTargetVelocity",()=>a.createWalkToTargetVelocity,"getCloudCodeMonsterExpression",()=>a.getCloudCodeMonsterExpression,"getCloudCodeMonsterPreset",()=>d.getCloudCodeMonsterPreset,"getMonsterFootstepIntervalMs",()=>a.getMonsterFootstepIntervalMs,"hasViolentMonsterDirectionChange",()=>a.hasViolentMonsterDirectionChange,"isMonsterFaintShakeEvent",()=>a.isMonsterFaintShakeEvent,"isViolentMonsterDrag",()=>a.isViolentMonsterDrag,"pickCloudCodeMonsterActivity",()=>a.pickCloudCodeMonsterActivity,"readCloudCodeMonsterPetPresetId",()=>d.readCloudCodeMonsterPetPresetId,"reflectCloudCodeMonsterWalk",()=>a.reflectCloudCodeMonsterWalk,"resolveCloudCodeMonsterActivityState",()=>a.resolveCloudCodeMonsterActivityState,"resolveCloudCodeMonsterPeekPosition",()=>a.resolveCloudCodeMonsterPeekPosition,"resolveCloudCodeMonsterPreviewComebackState",()=>a.resolveCloudCodeMonsterPreviewComebackState,"resolveCloudCodeMonsterVisibleState",()=>a.resolveCloudCodeMonsterVisibleState,"shouldCloudCodeMonsterAutoWalk",()=>a.shouldCloudCodeMonsterAutoWalk,"shouldFaintFromMonsterShake",()=>a.shouldFaintFromMonsterShake,"shouldRefreshCloudCodeMonsterActivity",()=>a.shouldRefreshCloudCodeMonsterActivity,"writeCloudCodeMonsterPetPresetId",()=>d.writeCloudCodeMonsterPetPresetId],105583)},928210,e=>{e.n(e.i(105583))},631822,e=>{e.v(t=>Promise.all(["static/chunks/0wjp8xrzix2_f.js"].map(t=>e.l(t))).then(()=>t(70725)))}]);
|
package/bundled/web/.open-next/assets/_next/static/chunks/{16_j-kl72ldc4.js → 07ju9-jia-17m.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,934351,e=>{"use strict";var t=e.i(368075),s=e.i(613349);e.s(["Card",0,function({className:e,size:a="default",...i}){return(0,t.jsx)("div",{"data-slot":"card","data-size":a,className:(0,s.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...i})},"CardAction",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-action",className:(0,s.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...a})},"CardContent",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("px-4 group-data-[size=sm]/card:px-3",e),...a})},"CardHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,s.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",e),...a})},"CardTitle",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,s.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...a})}])},866519,e=>{"use strict";let t=(0,e.i(406963).default)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);e.s(["LogOut",0,t],866519)},371406,e=>{"use strict";var t=e.i(368075),s=e.i(298699),a=e.i(186339),i=e.i(329686),n=e.i(541544),o=e.i(880932),r=e.i(613349);function l({step:e,completed:s}){return s?(0,t.jsx)("span",{className:"flex items-center justify-center size-5 rounded-full bg-emerald-500 text-white transition-all duration-300",children:(0,t.jsx)(n.Check,{className:"size-3",strokeWidth:3})}):(0,t.jsx)("span",{className:"flex items-center justify-center size-5 rounded-full bg-foreground text-background text-xs font-semibold",children:e})}e.s(["ConnectMachineSteps",0,function({generatedToken:e,generatingToken:n,onGenerateToken:c,registered:d}){let u=(0,s.useRef)(!1);(0,s.useEffect)(()=>{e||n||u.current||(u.current=!0,c())},[e,n,c]);let h=()=>{navigator.clipboard.writeText(`${(0,r.cliCmd)()} register --token ${e}`),o.toast.success("Copied to clipboard")},m=(0,r.daemonStartCmd)(),p=()=>{navigator.clipboard.writeText(m),o.toast.success("Copied to clipboard")};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("p",{className:"text-sm font-medium flex items-center gap-2",children:[(0,t.jsx)(l,{step:1,completed:d}),"Register your CLI",d&&(0,t.jsx)("span",{className:"text-xs text-emerald-500 font-normal",children:"Done"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground pl-7",children:"Run this in your terminal to link your machine."}),n?(0,t.jsx)("div",{className:"pl-7",children:(0,t.jsx)("div",{className:"rounded-md bg-muted p-2.5 font-mono text-xs text-muted-foreground animate-pulse",children:"Generating token..."})}):e?(0,t.jsxs)("div",{className:"pl-7 space-y-2",children:[(0,t.jsxs)(i.Tooltip,{children:[(0,t.jsxs)(i.TooltipTrigger,{render:(0,t.jsx)("div",{className:"rounded-md bg-muted p-2.5 font-mono text-xs text-muted-foreground cursor-pointer hover:bg-muted/80 transition-colors break-all",onClick:h}),children:[(0,r.cliCmd)()," register --token"," ",(0,t.jsx)("span",{className:"text-foreground/70",children:e})]}),(0,t.jsx)(i.TooltipContent,{children:"Click to copy"})]}),!d&&(0,t.jsx)(a.Button,{size:"sm",onClick:h,className:"w-full",children:"Copy Command"})]}):null]}),(0,t.jsxs)("div",{className:`space-y-2 transition-opacity duration-300 ${!d?"opacity-40 pointer-events-none":""}`,children:[(0,t.jsxs)("p",{className:"text-sm font-medium flex items-center gap-2",children:[(0,t.jsx)(l,{step:2,completed
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,934351,e=>{"use strict";var t=e.i(368075),s=e.i(613349);e.s(["Card",0,function({className:e,size:a="default",...i}){return(0,t.jsx)("div",{"data-slot":"card","data-size":a,className:(0,s.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...i})},"CardAction",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-action",className:(0,s.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...a})},"CardContent",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("px-4 group-data-[size=sm]/card:px-3",e),...a})},"CardHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,s.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",e),...a})},"CardTitle",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,s.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...a})}])},866519,e=>{"use strict";let t=(0,e.i(406963).default)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);e.s(["LogOut",0,t],866519)},371406,e=>{"use strict";var t=e.i(368075),s=e.i(298699),a=e.i(186339),i=e.i(329686),n=e.i(541544),o=e.i(880932),r=e.i(613349);function l({step:e,completed:s}){return s?(0,t.jsx)("span",{className:"flex items-center justify-center size-5 rounded-full bg-emerald-500 text-white transition-all duration-300",children:(0,t.jsx)(n.Check,{className:"size-3",strokeWidth:3})}):(0,t.jsx)("span",{className:"flex items-center justify-center size-5 rounded-full bg-foreground text-background text-xs font-semibold",children:e})}e.s(["ConnectMachineSteps",0,function({generatedToken:e,generatingToken:n,onGenerateToken:c,registered:d}){let u=(0,s.useRef)(!1);(0,s.useEffect)(()=>{e||n||u.current||(u.current=!0,c())},[e,n,c]);let h=()=>{navigator.clipboard.writeText(`${(0,r.cliCmd)()} register --token ${e}`),o.toast.success("Copied to clipboard")},m=(0,r.daemonStartCmd)(),p=()=>{navigator.clipboard.writeText(m),o.toast.success("Copied to clipboard")};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("p",{className:"text-sm font-medium flex items-center gap-2",children:[(0,t.jsx)(l,{step:1,completed:d}),"Register your CLI",d&&(0,t.jsx)("span",{className:"text-xs text-emerald-500 font-normal",children:"Done"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground pl-7",children:"Run this in your terminal to link your machine."}),n?(0,t.jsx)("div",{className:"pl-7",children:(0,t.jsx)("div",{className:"rounded-md bg-muted p-2.5 font-mono text-xs text-muted-foreground animate-pulse",children:"Generating token..."})}):e?(0,t.jsxs)("div",{className:"pl-7 space-y-2",children:[(0,t.jsxs)(i.Tooltip,{children:[(0,t.jsxs)(i.TooltipTrigger,{render:(0,t.jsx)("div",{className:"rounded-md bg-muted p-2.5 font-mono text-xs text-muted-foreground cursor-pointer hover:bg-muted/80 transition-colors break-all",onClick:h}),children:[(0,r.cliCmd)()," register --token"," ",(0,t.jsx)("span",{className:"text-foreground/70",children:e})]}),(0,t.jsx)(i.TooltipContent,{children:"Click to copy"})]}),!d&&(0,t.jsx)(a.Button,{size:"sm",onClick:h,className:"w-full",children:"Copy Command"})]}):null]}),(0,t.jsxs)("div",{className:`space-y-2 transition-opacity duration-300 ${!d?"opacity-40 pointer-events-none":""}`,children:[(0,t.jsxs)("p",{className:"text-sm font-medium flex items-center gap-2",children:[(0,t.jsx)(l,{step:2,completed:d}),"Start the daemon",d&&(0,t.jsx)("span",{className:"text-xs text-emerald-500 font-normal",children:"Done"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground pl-7",children:"The daemon connects your local agents to Alook."}),(0,t.jsxs)(i.Tooltip,{children:[(0,t.jsx)(i.TooltipTrigger,{render:(0,t.jsx)("div",{className:"ml-7 rounded-md bg-muted p-2.5 font-mono text-xs text-muted-foreground cursor-pointer hover:bg-muted/80 transition-colors",onClick:p}),children:m}),(0,t.jsx)(i.TooltipContent,{children:"Click to copy"})]}),d&&(0,t.jsx)("div",{className:"pl-7",children:(0,t.jsx)(a.Button,{size:"sm",onClick:p,className:"w-full",children:"Copy Command"})})]})]})}])},319755,e=>{"use strict";var t=e.i(368075),s=e.i(298699),a=e.i(208020),i=e.i(186339),n=e.i(903477),o=e.i(371522),r=e.i(596519),l=e.i(406963);let c=(0,l.default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);var d=e.i(866519),u=e.i(113354);let h=(0,l.default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);var m=e.i(880932),p=e.i(23055),f=e.i(275351),g=e.i(371406),x=e.i(613349),y=e.i(909832);e.i(400175);var w=e.i(126366);let v=`## Reporting Protocol
|
|
2
2
|
When done, structure your reply:
|
|
3
3
|
- **Status:** DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT
|
|
4
4
|
- Use DONE_WITH_CONCERNS if you completed work but have doubts.
|
|
@@ -322,4 +322,4 @@ Report additionally:
|
|
|
322
322
|
- Don't make policy exceptions without escalating to the leader.
|
|
323
323
|
- Don't send a response you're unsure about — flag it as DONE_WITH_CONCERNS.
|
|
324
324
|
|
|
325
|
-
${b}`}]},{id:"custom",label:"Custom",description:"Build your own team from scratch",icon:"✨",members:[{role:"leader",description:"Coordinates work and replies to you",instructions:k}]}];function S(e){let t=new Set,s=[];for(let a=0;a<e;a++){let e,a=0;do e=(0,y.uniqueNamesGenerator)({dictionaries:[y.names],length:1,style:"capital"}),a++;while(t.has(e)&&a<100)t.add(e),s.push({name:e,avatarUrl:(0,w.serializeAvatarConfig)((0,w.randomConfig)())})}return s}function I({selected:e,onSelect:s,onBrowseTemplates:a}){return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-base font-semibold tracking-tight",children:"What will your company focus on?"}),a&&(0,t.jsxs)("button",{type:"button",onClick:a,className:"text-[11px] text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2",children:["Browse templates ",(0,t.jsx)("span",{"aria-hidden":"true",children:"›"})]})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:C.map(a=>(0,t.jsxs)("button",{onClick:()=>s(a.id),className:(0,x.cn)("flex flex-col items-start gap-1 rounded-lg border p-4 text-left transition-all hover:border-foreground/30",e===a.id?"border-foreground/50 bg-muted/50":"border-border"),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,t.jsx)("span",{className:"text-lg",children:a.icon}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground/70",children:[a.members.length," agent",a.members.length>1?"s":""]})]}),(0,t.jsx)("span",{className:"text-sm font-medium",children:a.label}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground leading-tight",children:a.description})]},a.id))})]})}var D=e.i(934351),T=e.i(4581),W=e.i(89110),z=e.i(855372);let R={leader:"Lead",researcher:"Researcher",engineer:"Engineer",assistant:"Assistant"};function Y({members:e,runtimes:s,onShuffle:a,onAssignRuntime:n}){let o=s.length>1&&n;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-base font-semibold tracking-tight",children:"Your company"}),(0,t.jsxs)(i.Button,{variant:"ghost",size:"sm",onClick:a,className:"h-7 text-xs gap-1.5",children:[(0,t.jsx)(T.RefreshCw,{className:"size-3"}),"Shuffle"]})]}),(0,t.jsx)("div",{className:(0,x.cn)("grid gap-3 grid-cols-1",2===e.length&&"sm:grid-cols-2",3===e.length&&"sm:grid-cols-2 md:grid-cols-3",e.length>=4&&"sm:grid-cols-2 md:grid-cols-4"),children:e.map((e,a)=>{let i,r=e.avatarUrl?(0,w.parseAvatarUrl)(e.avatarUrl):null;return(0,t.jsxs)(D.Card,{size:"sm",className:"flex flex-col px-3 py-4 gap-2 h-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[r?(0,t.jsx)(w.AvatarRenderer,{config:r,size:36,className:"rounded-xl shrink-0"}):(0,t.jsx)("div",{className:"size-9 rounded-xl bg-muted flex items-center justify-center text-sm font-semibold shrink-0",children:e.name.charAt(0)}),(0,t.jsxs)("div",{className:"flex flex-col items-start gap-0.5",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground bg-muted/60 px-1.5 py-0.5 rounded",children:R[e.role]})]})]}),(0,t.jsxs)("p",{className:"text-[10px] text-muted-foreground/70 font-mono truncate",children:[e.emailHandle||e.name.toLowerCase(),"@alook.ai"]}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground leading-snug flex-1",children:e.description}),o&&(i=s.find(t=>t.id===e.runtimeId),(0,t.jsx)("div",{className:"mt-1",children:(0,t.jsxs)(W.Select,{value:e.runtimeId,onValueChange:e=>{e&&n(a,e)},children:[(0,t.jsx)(W.SelectTrigger,{className:"h-7 text-[11px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5 truncate",children:[i&&(0,t.jsx)(z.ProviderLogo,{provider:i.provider||"",className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:i?.provider||i?.runtime_mode||"Select"})]})}),(0,t.jsx)(W.SelectPopup,{children:s.map(e=>(0,t.jsx)(W.SelectItem,{value:e.id,children:e.provider||e.runtime_mode},e.id))})]})}))]},a)})})]})}var O=e.i(222862),B=e.i(642342);e.s(["StudioOnboardingClient",0,function({workspaceId:e,workspaceSlug:l,workspaceName:x,initialTemplate:y}){let w=(0,a.useRouter)(),v=!e,[b,k]=(0,s.useState)(e),j=(0,s.useRef)(b);(0,s.useEffect)(()=>{j.current=b},[b]);let[N,D]=(0,s.useState)([]),[T,W]=(0,s.useState)(!!e),[z,R]=(0,s.useState)(y?y.baseScenario:null),[E,L]=(0,s.useState)(v||"Personal"===x?"":x),[H,P]=(0,s.useState)(null),[A,F]=(0,s.useState)(!1),[U,$]=(0,s.useState)([]),[q,_]=(0,s.useState)(!1),[M,K]=(0,s.useState)(""),[G,X]=(0,s.useState)(!1),[V,J]=(0,s.useState)(!1),[Q,Z]=(0,s.useState)(!1),ee=N.filter(e=>"online"===e.status),et=ee.length>0,es=new Set(ee.map(e=>e.daemon_id).filter(Boolean)).size;(0,s.useEffect)(()=>{b&&(0,O.listRuntimes)(b).then(D).catch(()=>{}).finally(()=>W(!1))},[b]);let ea=(0,s.useCallback)(e=>{let t=j.current;if("runtime.registered"===e.type){J(!0);let s=e.workspaceId;s&&!t?(k(s),(0,O.listRuntimes)(s).then(D).catch(()=>{})):t&&(0,O.listRuntimes)(t).then(D).catch(()=>{})}else if("runtime.status"===e.type&&e.payload?.status==="online"){J(!0);let e=j.current;e&&(0,O.listRuntimes)(e).then(D).catch(()=>{})}},[]);(0,B.useUserWs)(ea),(0,s.useEffect)(()=>{let e=ee[0]?.id;e&&$(t=>0!==t.length&&t.some(e=>!e.runtimeId)?t.map(t=>t.runtimeId?t:{...t,runtimeId:e}):t)},[ee]);let ei=(0,s.useCallback)(async e=>{try{let t=await fetch("/api/studios/check-handles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({names:e})});if(!t.ok)return null;return await t.json()}catch{return null}},[]);(0,s.useEffect)(()=>{if(!y||T||U.length>0)return;let e=S(y.members.length),t=ee[0]?.id||"",s=y.members.map((s,a)=>({name:e[a].name,role:s.role,description:s.description,instructions:s.instructions,avatarUrl:e[a].avatarUrl,runtimeId:t}));$(s),ei(s.map(e=>e.name)).then(e=>{e&&$(t=>t.map(t=>{let s=e.find(e=>e.name===t.name);return s?{...t,emailHandle:s.handle}:t}))})},[y,T]);let en=async e=>{R(e);let t=C.find(t=>t.id===e),s=S(t.members.length),a=ee[0]?.id||"",i=t.members.map((e,t)=>({name:s[t].name,role:e.role,description:e.description,instructions:e.instructions,avatarUrl:s[t].avatarUrl,runtimeId:a}));$(i);let n=await ei(i.map(e=>e.name));n&&$(e=>e.map(e=>{let t=n.find(t=>t.name===e.name);return t?{...e,emailHandle:t.handle}:e}))},eo=async()=>{let e=S(U.length),t=U.map((t,s)=>({...t,name:e[s].name,avatarUrl:e[s].avatarUrl,emailHandle:void 0}));$(t);let s=await ei(t.map(e=>e.name));s&&$(e=>e.map(e=>{let t=s.find(t=>t.name===e.name);return t?{...e,emailHandle:t.handle}:e}))},er=async()=>{if(E.trim()){F(!0),P(null);try{let e=b?`/api/studios/check-name?name=${encodeURIComponent(E.trim())}&workspace_id=${b}`:`/api/studios/check-name?name=${encodeURIComponent(E.trim())}`,t=await fetch(e),s=await t.json();P(s.available)}catch{P(null),m.toast.error("Failed to check name availability")}finally{F(!1)}}},el=(0,s.useCallback)(async()=>{X(!0);try{let e=await (0,O.createMachineToken)("cli",b||void 0);K(e.token)}catch{m.toast.error("Failed to generate token")}finally{X(!1)}},[b]),ec=async()=>{_(!0);try{if(!b){m.toast.error("Please connect a computer first"),_(!1);return}let e=await fetch("/api/studios",{method:"POST",headers:{"Content-Type":"application/json","X-Workspace-ID":b},body:JSON.stringify({name:E.trim()||void 0,scenario:z,members:U.map(e=>({name:e.name,role:e.role,runtime_id:e.runtimeId,description:e.description,instructions:e.instructions,avatar_url:e.avatarUrl||null,email_handle:e.emailHandle||void 0}))})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to create company")}let t=await e.json();m.toast.success("Company created!"),w.push(`/w/${t.workspace.slug}/agents/${t.leader_agent_id}`)}catch(e){m.toast.error(e instanceof Error?e.message:"Failed to create company"),_(!1)}},ed=v?E.trim()&&!0===H:!1!==H,eu=z&&U.length>0&&U.every(e=>e.runtimeId)&&ed&&(et||V);return z?(0,t.jsxs)("div",{className:"relative flex min-h-dvh flex-col items-center p-6",children:[(0,t.jsxs)("div",{className:"absolute top-4 left-4 flex items-center gap-1",children:[(0,t.jsxs)(i.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:()=>w.push("/workspaces"),children:[(0,t.jsx)(h,{className:"size-3 mr-1.5"}),"Workspaces"]}),(0,t.jsx)("span",{className:"text-muted-foreground/40",children:"/"}),(0,t.jsxs)(i.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:()=>R(null),children:[(0,t.jsx)(u.ArrowLeft,{className:"size-3 mr-1.5"}),"Back"]})]}),(0,t.jsxs)(i.Button,{variant:"ghost",size:"sm",className:"absolute top-4 right-4 text-xs text-muted-foreground",onClick:async()=>{await (0,f.clearAllCache)(),(0,p.signOut)({fetchOptions:{onSuccess:()=>w.push("/sign-in")}})},children:[(0,t.jsx)(d.LogOut,{className:"size-3 mr-1.5"}),"Sign out"]}),(0,t.jsxs)("div",{className:"w-full max-w-3xl space-y-10 py-14",children:[(0,t.jsx)("div",{className:"text-center",children:(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",style:{fontFamily:"var(--font-news)"},children:"Build your company"})}),T?(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)(o.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h2",{className:"text-base font-semibold tracking-tight",children:"Company name"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(n.Input,{value:E,onChange:e=>{L(e.target.value),P(null)},placeholder:"e.g. Atlas Lab",className:"text-sm"}),(0,t.jsx)(i.Button,{variant:"outline",size:"sm",onClick:er,disabled:!E.trim()||A,className:"shrink-0",children:A?(0,t.jsx)(o.Loader2,{className:"size-3 animate-spin"}):"Check"})]}),!1===H&&(0,t.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,t.jsx)(c,{className:"size-3"})," Name is taken, try another"]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground flex items-center gap-1.5",children:[!0===H&&(0,t.jsxs)("span",{className:"text-emerald-600 flex items-center gap-0.5",children:[(0,t.jsx)(r.CheckCircle2,{className:"size-3"})," Available"]}),!0===H&&(0,t.jsx)("span",{children:"·"}),v?(0,t.jsx)("span",{children:"Required — pick a name for your company."}):(0,t.jsx)("span",{children:"Optional — you can always rename later."})]})]}),(0,t.jsx)(Y,{members:U,runtimes:ee,onShuffle:eo,onAssignRuntime:(e,t)=>{$(s=>s.map((s,a)=>a===e?{...s,runtimeId:t}:s))}}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h2",{className:"text-base font-semibold tracking-tight",children:"Connect a computer"}),et?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("p",{className:"text-xs text-emerald-600 flex items-center gap-1",children:[(0,t.jsx)(r.CheckCircle2,{className:"size-3"})," ",es," computer",es>1?"s":""," connected"]}),(0,t.jsx)("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:()=>Z(e=>!e),children:"Register another"})]}),Q&&(0,t.jsx)("div",{className:"rounded-xl bg-muted/40 p-5",children:(0,t.jsx)(g.ConnectMachineSteps,{generatedToken:M,generatingToken:G,onGenerateToken:el,registered:V})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Your company needs a connected computer to run tasks."}),(0,t.jsx)("div",{className:"rounded-xl bg-muted/40 p-5",children:(0,t.jsx)(g.ConnectMachineSteps,{generatedToken:M,generatingToken:G,onGenerateToken:el,registered:V})})]})]}),(0,t.jsx)(i.Button,{onClick:ec,disabled:!eu||q,className:"w-full",size:"lg",children:q?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Loader2,{className:"size-4 animate-spin mr-2"}),"Launching..."]}):v&&E.trim()&&!0!==H?"Check company name first":"Launch company"})]})]})]}):(0,t.jsxs)("div",{className:"relative flex min-h-dvh flex-col items-center justify-center px-6 pt-14 pb-6 sm:p-6",children:[(0,t.jsxs)(i.Button,{variant:"ghost",size:"sm",className:"absolute top-4 left-4 text-xs text-muted-foreground",onClick:()=>w.push("/workspaces"),children:[(0,t.jsx)(h,{className:"size-3 mr-1.5"}),"Workspaces"]}),(0,t.jsxs)(i.Button,{variant:"ghost",size:"sm",className:"absolute top-4 right-4 text-xs text-muted-foreground",onClick:async()=>{await (0,f.clearAllCache)(),(0,p.signOut)({fetchOptions:{onSuccess:()=>w.push("/sign-in")}})},children:[(0,t.jsx)(d.LogOut,{className:"size-3 mr-1.5"}),"Sign out"]}),(0,t.jsxs)("div",{className:"w-full max-w-3xl space-y-8",children:[(0,t.jsxs)("div",{className:"text-center space-y-2",children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",style:{fontFamily:"var(--font-news)"},children:"What will your company do?"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Pick a focus area. You can always add more agents later."})]}),(0,t.jsx)(I,{selected:z,onSelect:en,onBrowseTemplates:()=>w.push(b?`/templates?workspace_id=${b}`:"/templates")}),b&&(0,t.jsx)("div",{className:"flex justify-center pt-2",children:(0,t.jsx)("button",{type:"button",onClick:()=>{document.cookie=`skip_init=${b};path=/;max-age=86400`,w.push(`/w/${l}/home`)},className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Skip for now"})})]})]})}],319755)}]);
|
|
325
|
+
${b}`}]},{id:"custom",label:"Custom",description:"Build your own team from scratch",icon:"✨",members:[{role:"leader",description:"Coordinates work and replies to you",instructions:k}]}];function S(e){let t=new Set,s=[];for(let a=0;a<e;a++){let e,a=0;do e=(0,y.uniqueNamesGenerator)({dictionaries:[y.names],length:1,style:"capital"}),a++;while(t.has(e)&&a<100)t.add(e),s.push({name:e,avatarUrl:(0,w.serializeAvatarConfig)((0,w.randomConfig)())})}return s}function D({selected:e,onSelect:s,onBrowseTemplates:a}){return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-base font-semibold tracking-tight",children:"What will your company focus on?"}),a&&(0,t.jsxs)("button",{type:"button",onClick:a,className:"text-[11px] text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2",children:["Browse templates ",(0,t.jsx)("span",{"aria-hidden":"true",children:"›"})]})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:C.map(a=>(0,t.jsxs)("button",{onClick:()=>s(a.id),className:(0,x.cn)("flex flex-col items-start gap-1 rounded-lg border p-4 text-left transition-all hover:border-foreground/30",e===a.id?"border-foreground/50 bg-muted/50":"border-border"),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,t.jsx)("span",{className:"text-lg",children:a.icon}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground/70",children:[a.members.length," agent",a.members.length>1?"s":""]})]}),(0,t.jsx)("span",{className:"text-sm font-medium",children:a.label}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground leading-tight",children:a.description})]},a.id))})]})}var I=e.i(934351),W=e.i(4581),T=e.i(89110),z=e.i(855372);let R={leader:"Lead",researcher:"Researcher",engineer:"Engineer",assistant:"Assistant"};function Y({members:e,runtimes:s,onShuffle:a,onAssignRuntime:n}){let o=s.length>1&&n;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-base font-semibold tracking-tight",children:"Your company"}),(0,t.jsxs)(i.Button,{variant:"ghost",size:"sm",onClick:a,className:"h-7 text-xs gap-1.5",children:[(0,t.jsx)(W.RefreshCw,{className:"size-3"}),"Shuffle"]})]}),(0,t.jsx)("div",{className:(0,x.cn)("grid gap-3 grid-cols-1",2===e.length&&"sm:grid-cols-2",3===e.length&&"sm:grid-cols-2 md:grid-cols-3",e.length>=4&&"sm:grid-cols-2 md:grid-cols-4"),children:e.map((e,a)=>{let i,r=e.avatarUrl?(0,w.parseAvatarUrl)(e.avatarUrl):null;return(0,t.jsxs)(I.Card,{size:"sm",className:"flex flex-col px-3 py-4 gap-2 h-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[r?(0,t.jsx)(w.AvatarRenderer,{config:r,size:36,className:"rounded-xl shrink-0"}):(0,t.jsx)("div",{className:"size-9 rounded-xl bg-muted flex items-center justify-center text-sm font-semibold shrink-0",children:e.name.charAt(0)}),(0,t.jsxs)("div",{className:"flex flex-col items-start gap-0.5",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground bg-muted/60 px-1.5 py-0.5 rounded",children:R[e.role]})]})]}),(0,t.jsxs)("p",{className:"text-[10px] text-muted-foreground/70 font-mono truncate",children:[e.emailHandle||e.name.toLowerCase(),"@alook.ai"]}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground leading-snug flex-1",children:e.description}),o&&(i=s.find(t=>t.id===e.runtimeId),(0,t.jsx)("div",{className:"mt-1",children:(0,t.jsxs)(T.Select,{value:e.runtimeId,onValueChange:e=>{e&&n(a,e)},children:[(0,t.jsx)(T.SelectTrigger,{className:"h-7 text-[11px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5 truncate",children:[i&&(0,t.jsx)(z.ProviderLogo,{provider:i.provider||"",className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:i?.provider||i?.runtime_mode||"Select"})]})}),(0,t.jsx)(T.SelectPopup,{children:s.map(e=>(0,t.jsx)(T.SelectItem,{value:e.id,children:e.provider||e.runtime_mode},e.id))})]})}))]},a)})})]})}var O=e.i(222862),B=e.i(642342);e.s(["StudioOnboardingClient",0,function({workspaceId:e,workspaceSlug:l,workspaceName:x,initialTemplate:y}){let w=(0,a.useRouter)(),v=!e,[b,k]=(0,s.useState)(e),j=(0,s.useRef)(b);(0,s.useEffect)(()=>{j.current=b},[b]);let[N,I]=(0,s.useState)([]),[W,T]=(0,s.useState)(!!e),[z,R]=(0,s.useState)(y?y.baseScenario:null),[E,L]=(0,s.useState)(v||"Personal"===x?"":x),[P,H]=(0,s.useState)(null),[A,F]=(0,s.useState)(!1),[U,$]=(0,s.useState)([]),[q,_]=(0,s.useState)(!1),[M,K]=(0,s.useState)(""),[G,X]=(0,s.useState)(!1),[V,J]=(0,s.useState)(!1),[Q,Z]=(0,s.useState)(!1),ee=N.filter(e=>"online"===e.status),et=ee.length>0,es=new Set(ee.map(e=>e.daemon_id).filter(Boolean)).size;(0,s.useEffect)(()=>{b&&(0,O.listRuntimes)(b).then(I).catch(()=>{}).finally(()=>T(!1))},[b]);let ea=(0,s.useCallback)(e=>{let t=j.current;if("runtime.registered"===e.type){J(!0);let s=e.workspaceId;s&&!t?(k(s),(0,O.listRuntimes)(s).then(I).catch(()=>{})):t&&(0,O.listRuntimes)(t).then(I).catch(()=>{})}else if("runtime.status"===e.type&&"online"===e.status){J(!0);let e=j.current;e&&(0,O.listRuntimes)(e).then(I).catch(()=>{})}},[]);(0,B.useUserWs)(ea),(0,s.useEffect)(()=>{let e=ee[0]?.id;e&&$(t=>0!==t.length&&t.some(e=>!e.runtimeId)?t.map(t=>t.runtimeId?t:{...t,runtimeId:e}):t)},[ee]);let ei=(0,s.useCallback)(async e=>{try{let t=await fetch("/api/studios/check-handles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({names:e})});if(!t.ok)return null;return await t.json()}catch{return null}},[]);(0,s.useEffect)(()=>{if(!y||W||U.length>0)return;let e=S(y.members.length),t=ee[0]?.id||"",s=y.members.map((s,a)=>({name:e[a].name,role:s.role,description:s.description,instructions:s.instructions,avatarUrl:e[a].avatarUrl,runtimeId:t}));$(s),ei(s.map(e=>e.name)).then(e=>{e&&$(t=>t.map(t=>{let s=e.find(e=>e.name===t.name);return s?{...t,emailHandle:s.handle}:t}))})},[y,W]);let en=async e=>{R(e);let t=C.find(t=>t.id===e),s=S(t.members.length),a=ee[0]?.id||"",i=t.members.map((e,t)=>({name:s[t].name,role:e.role,description:e.description,instructions:e.instructions,avatarUrl:s[t].avatarUrl,runtimeId:a}));$(i);let n=await ei(i.map(e=>e.name));n&&$(e=>e.map(e=>{let t=n.find(t=>t.name===e.name);return t?{...e,emailHandle:t.handle}:e}))},eo=async()=>{let e=S(U.length),t=U.map((t,s)=>({...t,name:e[s].name,avatarUrl:e[s].avatarUrl,emailHandle:void 0}));$(t);let s=await ei(t.map(e=>e.name));s&&$(e=>e.map(e=>{let t=s.find(t=>t.name===e.name);return t?{...e,emailHandle:t.handle}:e}))},er=async()=>{if(E.trim()){F(!0),H(null);try{let e=b?`/api/studios/check-name?name=${encodeURIComponent(E.trim())}&workspace_id=${b}`:`/api/studios/check-name?name=${encodeURIComponent(E.trim())}`,t=await fetch(e),s=await t.json();H(s.available)}catch{H(null),m.toast.error("Failed to check name availability")}finally{F(!1)}}},el=(0,s.useCallback)(async()=>{X(!0);try{let e=j.current;!e&&v&&(e=(await (0,O.createWorkspace)("Personal")).id,k(e));let t=await (0,O.createMachineToken)("cli",e||void 0);K(t.token)}catch{m.toast.error("Failed to generate token")}finally{X(!1)}},[v]),ec=async()=>{_(!0);try{if(!b){m.toast.error("Please connect a computer first"),_(!1);return}let e=await fetch("/api/studios",{method:"POST",headers:{"Content-Type":"application/json","X-Workspace-ID":b},body:JSON.stringify({name:E.trim()||void 0,scenario:z,members:U.map(e=>({name:e.name,role:e.role,runtime_id:e.runtimeId,description:e.description,instructions:e.instructions,avatar_url:e.avatarUrl||null,email_handle:e.emailHandle||void 0}))})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to create company")}let t=await e.json();m.toast.success("Company created!"),w.push(`/w/${t.workspace.slug}/agents/${t.leader_agent_id}`)}catch(e){m.toast.error(e instanceof Error?e.message:"Failed to create company"),_(!1)}},ed=v?E.trim()&&!0===P:!1!==P,eu=z&&U.length>0&&U.every(e=>e.runtimeId)&&ed&&(et||V);return z?(0,t.jsxs)("div",{className:"relative flex min-h-dvh flex-col items-center p-6",children:[(0,t.jsxs)("div",{className:"absolute top-4 left-4 flex items-center gap-1",children:[(0,t.jsxs)(i.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:()=>w.push("/workspaces"),children:[(0,t.jsx)(h,{className:"size-3 mr-1.5"}),"Workspaces"]}),(0,t.jsx)("span",{className:"text-muted-foreground/40",children:"/"}),(0,t.jsxs)(i.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:()=>R(null),children:[(0,t.jsx)(u.ArrowLeft,{className:"size-3 mr-1.5"}),"Back"]})]}),(0,t.jsxs)(i.Button,{variant:"ghost",size:"sm",className:"absolute top-4 right-4 text-xs text-muted-foreground",onClick:async()=>{await (0,f.clearAllCache)(),(0,p.signOut)({fetchOptions:{onSuccess:()=>w.push("/sign-in")}})},children:[(0,t.jsx)(d.LogOut,{className:"size-3 mr-1.5"}),"Sign out"]}),(0,t.jsxs)("div",{className:"w-full max-w-3xl space-y-10 py-14",children:[(0,t.jsx)("div",{className:"text-center",children:(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",style:{fontFamily:"var(--font-news)"},children:"Build your company"})}),W?(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)(o.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h2",{className:"text-base font-semibold tracking-tight",children:"Company name"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(n.Input,{value:E,onChange:e=>{L(e.target.value),H(null)},placeholder:"e.g. Atlas Lab",className:"text-sm"}),(0,t.jsx)(i.Button,{variant:"outline",size:"sm",onClick:er,disabled:!E.trim()||A,className:"shrink-0",children:A?(0,t.jsx)(o.Loader2,{className:"size-3 animate-spin"}):"Check"})]}),!1===P&&(0,t.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,t.jsx)(c,{className:"size-3"})," Name is taken, try another"]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground flex items-center gap-1.5",children:[!0===P&&(0,t.jsxs)("span",{className:"text-emerald-600 flex items-center gap-0.5",children:[(0,t.jsx)(r.CheckCircle2,{className:"size-3"})," Available"]}),!0===P&&(0,t.jsx)("span",{children:"·"}),v?(0,t.jsx)("span",{children:"Required — pick a name for your company."}):(0,t.jsx)("span",{children:"Optional — you can always rename later."})]})]}),(0,t.jsx)(Y,{members:U,runtimes:ee,onShuffle:eo,onAssignRuntime:(e,t)=>{$(s=>s.map((s,a)=>a===e?{...s,runtimeId:t}:s))}}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h2",{className:"text-base font-semibold tracking-tight",children:"Connect a computer"}),et?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("p",{className:"text-xs text-emerald-600 flex items-center gap-1",children:[(0,t.jsx)(r.CheckCircle2,{className:"size-3"})," ",es," computer",es>1?"s":""," connected"]}),(0,t.jsx)("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:()=>Z(e=>!e),children:"Register another"})]}),Q&&(0,t.jsx)("div",{className:"rounded-xl bg-muted/40 p-5",children:(0,t.jsx)(g.ConnectMachineSteps,{generatedToken:M,generatingToken:G,onGenerateToken:el,registered:V})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Your company needs a connected computer to run tasks."}),(0,t.jsx)("div",{className:"rounded-xl bg-muted/40 p-5",children:(0,t.jsx)(g.ConnectMachineSteps,{generatedToken:M,generatingToken:G,onGenerateToken:el,registered:V})})]})]}),(0,t.jsx)(i.Button,{onClick:ec,disabled:!eu||q,className:"w-full",size:"lg",children:q?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Loader2,{className:"size-4 animate-spin mr-2"}),"Launching..."]}):v&&E.trim()&&!0!==P?"Check company name first":"Launch company"})]})]})]}):(0,t.jsxs)("div",{className:"relative flex min-h-dvh flex-col items-center justify-center px-6 pt-14 pb-6 sm:p-6",children:[(0,t.jsxs)(i.Button,{variant:"ghost",size:"sm",className:"absolute top-4 left-4 text-xs text-muted-foreground",onClick:()=>w.push("/workspaces"),children:[(0,t.jsx)(h,{className:"size-3 mr-1.5"}),"Workspaces"]}),(0,t.jsxs)(i.Button,{variant:"ghost",size:"sm",className:"absolute top-4 right-4 text-xs text-muted-foreground",onClick:async()=>{await (0,f.clearAllCache)(),(0,p.signOut)({fetchOptions:{onSuccess:()=>w.push("/sign-in")}})},children:[(0,t.jsx)(d.LogOut,{className:"size-3 mr-1.5"}),"Sign out"]}),(0,t.jsxs)("div",{className:"w-full max-w-3xl space-y-8",children:[(0,t.jsxs)("div",{className:"text-center space-y-2",children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",style:{fontFamily:"var(--font-news)"},children:"What will your company do?"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Pick a focus area. You can always add more agents later."})]}),(0,t.jsx)(D,{selected:z,onSelect:en,onBrowseTemplates:()=>w.push(b?`/templates?workspace_id=${b}`:"/templates")}),b&&(0,t.jsx)("div",{className:"flex justify-center pt-2",children:(0,t.jsx)("button",{type:"button",onClick:()=>{document.cookie=`skip_init=${b};path=/;max-age=86400`,w.push(`/w/${l}/home`)},className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Skip for now"})})]})]})}],319755)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,208020,(e,t,a)=>{t.exports=e.r(170928)},931764,536460,e=>{"use strict";e.i(459119);var t=e.i(298699),a=e.i(92615),i=e.i(673664),n=e.i(893205),s=e.i(390072),r=e.i(240003);let o=t.createContext(void 0);function l(e=!1){let a=t.useContext(o);if(void 0===a&&!e)throw Error((0,r.default)(16));return a}function d(e){return(0,a.isHTMLElement)(e)&&"BUTTON"===e.tagName}e.s(["CompositeRootContext",0,o,"useCompositeRootContext",0,l],536460),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=l(!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,l=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||l)&&(e.disabled=i),e},[n,i,a,o,l,r,s])}}({focusableWhenDisabled:r,disabled:a,composite:m,tabIndex:o,isNativeButton:c}),f=t.useCallback(()=>{let e=p.current;d(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,...l}=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,l=d(o),u=!c&&(i=o,!!(i?.tagName==="A"&&i?.href)),p=n&&(c?l:!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&&l?(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&&d(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,l)},[a,h,m,c]),buttonRef:(0,i.useStableCallback)(e=>{p.current=e,f()})}}],931764)},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,l=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]}),d=n&&Object.entries(n).reduce((e,t)=>{let[a,i]=t;return void 0===i||(e[a]=i),e},{});return i(e,l,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,...d}[t]):({...o,...d})[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(368075);e.i(459119);var a=e.i(298699),i=e.i(931764),n=e.i(863764);let s=a.forwardRef(function(e,t){let{render:a,className:s,disabled:r=!1,focusableWhenDisabled:o=!1,nativeButton:l=!0,style:d,...c}=e,{getButtonProps:u,buttonRef:p}=(0,i.useButton)({disabled:r,focusableWhenDisabled:o,native:l});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 l=(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)(l({variant:a,size:i,className:e})),...n})},"buttonVariants",0,l],186339)},222862,636557,e=>{"use strict";class t 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 a(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," "),l=n.toLowerCase().replace(/[_-]+/g," ");return l&&o.startsWith(`${l} `)&&(r=r.slice(n.length).trimStart()),s?`${s} ${r}`:r}(t[0]):e}async function i(e,i){let n;try{n=await fetch(""+e,{...i,credentials:"include",headers:{"Content-Type":"application/json",...i?.headers}})}catch(e){if(e instanceof TypeError)throw new t("Unable to connect — check your network",0);throw e}if(401===n.status)throw window.location.href="/sign-in",new t("Unauthorized",401);if(!n.ok){let e,i;try{let t=await n.json();e=t.error,i=t.details}catch{}if(429===n.status)throw new t("Please wait a moment before trying again",429);if(n.status>=500)throw new t(a(e,i)||"Something went wrong — please try again",n.status,i);throw new t(a(e,i)||"Something went wrong",n.status,i)}if(204!==n.status)return n.json()}function n(e,t){let a=new URLSearchParams({workspace_id:e,...t});return`?${a.toString()}`}e.s(["ApiError",0,t],636557);let s=async(e,a,s,r)=>{let o;if(!r||0===r.length)return i(`/api/conversations/${e}/messages${n(s)}`,{method:"POST",body:JSON.stringify({content:a})});let l=new FormData;for(let e of(l.append("content",a),r))l.append("file",e);try{o=await fetch(`/api/conversations/${e}/messages${n(s)}`,{method:"POST",credentials:"include",body:l})}catch(e){if(e instanceof TypeError)throw new t("Unable to connect — check your network",0);throw e}if(401===o.status)throw window.location.href="/sign-in",new t("Unauthorized",401);if(!o.ok){let e,a;try{let t=await o.json();e=t.error,a=t.details}catch{}if(429===o.status)throw new t("Please wait a moment before trying again",429);if(o.status>=500)throw new t(e||"Something went wrong — please try again",o.status,a);throw new t(e||"Something went wrong",o.status,a)}return o.json()},r=async(e,a,s,r)=>{let o;if(!r||0===r.length)return i(`/api/conversations/${e}/buffered-messages${n(s)}`,{method:"POST",body:JSON.stringify({content:a})});let l=new FormData;for(let e of(l.append("content",a),r))l.append("file",e);try{o=await fetch(`/api/conversations/${e}/buffered-messages${n(s)}`,{method:"POST",credentials:"include",body:l})}catch(e){if(e instanceof TypeError)throw new t("Unable to connect — check your network",0);throw e}if(401===o.status)throw window.location.href="/sign-in",new t("Unauthorized",401);if(!o.ok){let e,a;try{let t=await o.json();e=t.error,a=t.details}catch{}if(429===o.status)throw new t(e||"Maximum follow-ups reached",429);if(o.status>=500)throw new t(e||"Something went wrong — please try again",o.status,a);throw new t(e||"Something went wrong",o.status,a)}return o.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")}},l=async(e,a)=>{let i=new FormData;i.append("file",e);let s=await fetch(`/api/email/upload${n(a)}`,{method:"POST",credentials:"include",body:i});if(!s.ok)throw new t(await s.text().catch(()=>"Upload failed"),s.status);return s.json()},d=async(e,a)=>{let s;if(!a.files||0===a.files.length)return i(`/api/issues${n(e)}`,{method:"POST",body:JSON.stringify({agent_id:a.agent_id,title:a.title,description:a.description})});let r=new FormData;for(let e of(a.agent_id&&r.append("agent_id",a.agent_id),r.append("title",a.title),r.append("description",a.description??""),a.files))r.append("file",e);try{s=await fetch(`/api/issues${n(e)}`,{method:"POST",credentials:"include",body:r})}catch(e){if(e instanceof TypeError)throw new t("Unable to connect — check your network",0);throw e}if(401===s.status)throw window.location.href="/sign-in",new t("Unauthorized",401);if(!s.ok){let e,a;try{let t=await s.json();e=t.error,a=t.details}catch{}if(429===s.status)throw new t("Please wait a moment before trying again",429);if(s.status>=500)throw new t(e||"Something went wrong — please try again",s.status,a);throw new t(e||"Something went wrong",s.status,a)}return s.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=>i(`/api/invite/${e}`,{method:"POST"}),"addWhitelistEmail",0,(e,t,a)=>i(`/api/agents/${e}/whitelist${n(a)}`,{method:"POST",body:JSON.stringify({email:t})}),"approveMeeting",0,(e,t,a)=>i(`/api/agents/${e}/meetings/${t}/approve${n(a)}`,{method:"POST"}),"cancelActiveTask",0,(e,t)=>i(`/api/conversations/${e}/active-task${n(t)}`,{method:"DELETE"}),"chatInit",0,(e,t,a)=>i(`/api/agents/${e}/chat-init${n(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),i(`/api/conversations/check-fresh${n(t,a)}`)},"conversationInit",0,(e,t,a)=>{let s={};return a?.newestMessageId&&(s.newest_message_id=a.newestMessageId),i(`/api/conversations/${e}/init${n(t,s)}`)},"createAgent",0,(e,t)=>i(`/api/agents${n(t)}`,{method:"POST",body:JSON.stringify(e)}),"createAgentLink",0,(e,t)=>i(`/api/agent-links${n(t)}`,{method:"POST",body:JSON.stringify(e)}),"createBufferedMessage",0,r,"createCalendarEvent",0,(e,t)=>i(`/api/calendar${n(t)}`,{method:"POST",body:JSON.stringify(e)}),"createChannelApi",0,(e,t)=>i(`/api/channels${n(e)}`,{method:"POST",body:JSON.stringify({name:t})}),"createConversation",0,(e,t,a)=>i(`/api/conversations${n(t)}`,{method:"POST",body:JSON.stringify({agent_id:e,...a?{channel:a}:{}})}),"createEmailAccount",0,(e,t,a)=>i(`/api/agents/${e}/email-accounts${n(a)}`,{method:"POST",body:JSON.stringify(t)}),"createInvite",0,e=>i(`/api/workspaces/${e}/invites${n(e)}`,{method:"POST"}),"createIssue",0,d,"createMachineToken",0,(e,t)=>i(`/api/machine-tokens${t?n(t):""}`,{method:"POST",body:JSON.stringify({name:e||"default"})}),"createMeeting",0,(e,t,a)=>i(`/api/agents/${e}/meetings${n(t)}`,{method:"POST",body:JSON.stringify(a)}),"createWorkspace",0,(e,t)=>i("/api/workspaces",{method:"POST",body:JSON.stringify({name:e,slug:t||e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"workspace"})}),"deleteAgent",0,(e,t)=>i(`/api/agents/${e}${n(t)}`,{method:"DELETE"}),"deleteAgentLink",0,(e,t)=>i(`/api/agent-links/${e}${n(t)}`,{method:"DELETE"}),"deleteBufferedMessage",0,(e,t,a)=>i(`/api/conversations/${e}/buffered-messages/${t}${n(a)}`,{method:"DELETE"}),"deleteCalendarEvent",0,(e,t,a)=>i(`/api/calendar/${e}${n(t)}`,{method:"DELETE",...a&&a.scope?{headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}:{}}),"deleteChannelApi",0,(e,t)=>i(`/api/channels/${e}${n(t)}`,{method:"DELETE"}),"deleteEmail",0,(e,t)=>i(`/api/email/${e}${n(t)}`,{method:"DELETE"}),"deleteEmailAccount",0,(e,t,a)=>i(`/api/agents/${e}/email-accounts/${t}${n(a)}`,{method:"DELETE"}),"deleteIssue",0,(e,t)=>i(`/api/issues/${t}${n(e)}`,{method:"DELETE"}),"deleteMachine",0,(e,t)=>i(`/api/runtimes/machine${n(t,{daemon_id:e})}`,{method:"DELETE"}),"deleteMeeting",0,(e,t,a)=>i(`/api/agents/${e}/meetings/${t}${n(a)}`,{method:"DELETE"}),"deleteWorkspace",0,(e,t)=>i(`/api/workspaces/${e}${n(e)}`,{method:"DELETE",body:JSON.stringify({confirm_name:t})}),"fetchLatestCliVersion",0,()=>i("/api/cli/latest-version"),"fetchModelOptions",0,()=>i("/api/config/model-options"),"flagMessage",0,(e,t)=>i(`/api/flags${n(e)}`,{method:"POST",body:JSON.stringify({messageId:t})}),"getActiveTask",0,(e,t)=>i(`/api/conversations/${e}/active-task${n(t)}`),"getAgentSkills",0,(e,t)=>i(`/api/agents/${e}/skills${n(t)}`),"getArtifactContent",0,c,"getCalendarEvent",0,(e,t)=>i(`/api/calendar/${e}${n(t)}`),"getEmail",0,(e,t)=>i(`/api/email/${e}${n(t)}`),"getEmailBody",0,o,"getEmailThread",0,(e,t)=>i(`/api/email/${e}/thread${n(t)}`),"getFlaggedCount",0,e=>i(`/api/flags/count${n(e)}`),"getInboxCount",0,(e,t)=>{let a={};return t?.types?.length&&(a.types=t.types.join(",")),i(`/api/inbox/count${n(e,a)}`)},"getInviteInfo",0,e=>i(`/api/invite/${e}`),"getIssue",0,(e,t)=>i(`/api/issues/${t}${n(e)}`),"getMemberMe",0,e=>i(`/api/members/me${n(e)}`),"getMinCliVersion",0,()=>i("/api/config/min-version"),"getTask",0,(e,t)=>i(`/api/tasks/${e}${n(t)}`),"getTaskMessages",0,(e,t,a)=>i(`/api/tasks/${e}/messages${n(t,a?{since:String(a)}:void 0)}`),"getTrace",0,(e,t)=>i(`/api/traces/${e}${n(t)}`),"getWorkspaceOverview",0,e=>i(`/api/workspaces/${e}/overview${n(e)}`),"grantAgentAccess",0,(e,t,a)=>i(`/api/agents/${t}/access${n(e)}`,{method:"POST",body:JSON.stringify({user_id:a})}),"listAgentAccess",0,(e,t)=>i(`/api/agents/${t}/access${n(e)}`),"listAgentActiveTaskCounts",0,e=>i(`/api/agents/active-task-counts${n(e)}`),"listAgentActivity",0,(e,t,a)=>{let s={};return a?.limit&&(s.limit=String(a.limit)),a?.before&&(s.before=a.before),a?.beforeId&&(s.before_id=a.beforeId),a?.status&&(s.status=a.status),a?.type&&(s.type=a.type),i(`/api/agents/${e}/activity${n(t,s)}`)},"listAgentLinks",0,e=>i(`/api/agent-links${n(e)}`),"listAgentPins",0,e=>i(`/api/agents/pins${n(e)}`),"listAgents",0,e=>i(`/api/agents${n(e)}`),"listArtifacts",0,(e,t)=>i(`/api/artifacts${n(t,{conversation_id:e})}`),"listBufferedMessages",0,(e,t)=>i(`/api/conversations/${e}/buffered-messages${n(t)}`),"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),i(`/api/calendar${n(e,a)}`)},"listChannels",0,e=>i(`/api/channels${n(e)}`),"listEmailAccounts",0,(e,t)=>i(`/api/agents/${e}/email-accounts${n(t)}`),"listEmails",0,(e,t,a,s)=>i(`/api/email${n(t,{agentId:e,...a?{folder:a}:{},...s?{address:s}:{}})}`),"listFlaggedItems",0,(e,t)=>{let a={};return t?.limit&&(a.limit=String(t.limit)),t?.before&&(a.before=t.before),i(`/api/flags${n(e,a)}`)},"listFlaggedMessageIds",0,(e,t)=>i(`/api/flags${n(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(",")),i(`/api/inbox${n(e,a)}`)},"listInvites",0,e=>i(`/api/workspaces/${e}/invites${n(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)),i(`/api/issues${n(e,a)}`)},"listMeetings",0,(e,t)=>i(`/api/agents/${e}/meetings${n(t)}`),"listMembers",0,e=>i(`/api/workspaces/${e}/members${n(e)}`),"listMessages",0,(e,t,a)=>{let s={};return a?.limit&&(s.limit=String(a.limit)),a?.before&&(s.before=a.before),a?.beforeId&&(s.before_id=a.beforeId),i(`/api/conversations/${e}/messages${n(t,s)}`)},"listMessagesAroundTask",0,(e,t,a)=>i(`/api/conversations/${e}/messages${n(t,{around_task:a})}`),"listPreviousConversations",0,(e,t,a)=>{let s={exclude:a.exclude,before:a.before};return a.channel&&(s.channel=a.channel),a.limit&&(s.limit=String(a.limit)),i(`/api/agents/${e}/conversations${n(t,s)}`)},"listRuntimes",0,e=>i(`/api/runtimes${n(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),i(`/api/traces${n(e,a)}`)},"listWhitelist",0,(e,t)=>i(`/api/agents/${e}/whitelist${n(t)}`),"listWorkspaceActiveTasks",0,e=>i(`/api/agents/active-tasks${n(e)}`),"listWorkspaces",0,()=>i("/api/workspaces"),"markAllInboxRead",0,e=>i(`/api/inbox/read-all${n(e)}`,{method:"POST"}),"markInboxRead",0,(e,t)=>i(`/api/inbox/read${n(t)}`,{method:"POST",body:JSON.stringify({conversationId:e})}),"pinAgent",0,(e,t)=>i(`/api/agents/${t}/pin${n(e)}`,{method:"POST"}),"removeMember",0,(e,t)=>i(`/api/workspaces/${e}/members/${t}${n(e)}`,{method:"DELETE"}),"removeWhitelistEmail",0,(e,t,a)=>i(`/api/agents/${e}/whitelist/${t}${n(a)}`,{method:"DELETE"}),"renameChannelApi",0,(e,t,a)=>i(`/api/channels/${e}${n(t)}`,{method:"PATCH",body:JSON.stringify({name:a})}),"reorderAgentPins",0,(e,t)=>i(`/api/agents/pins/reorder${n(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"reorderChannelsApi",0,(e,t)=>i(`/api/channels/reorder${n(e)}`,{method:"PUT",body:JSON.stringify({ordered_channel_ids:t})}),"reorderUnpinnedAgents",0,(e,t)=>i(`/api/agents/sidebar/reorder${n(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"requestWorkspaceBrowse",0,(e,t,a,s)=>i(`/api/agents/${e}/workspace/browse${n(t)}`,{method:"POST",body:JSON.stringify({request_type:a,path:s})}),"retryTask",0,(e,t)=>i(`/api/tasks/${e}/retry${n(t)}`,{method:"POST"}),"revokeAgentAccess",0,(e,t,a,s=!1)=>i(`/api/agents/${t}/access/${a}${n(e)}${s?"&remove_whitelist=true":""}`,{method:"DELETE"}),"revokeInvite",0,(e,t)=>i(`/api/workspaces/${e}/invites/${t}${n(e)}`,{method:"DELETE"}),"sendEmail",0,(e,t,a,s,r,o,l,d)=>i(`/api/email/send${n(r)}`,{method:"POST",body:JSON.stringify({agentId:e,to:t,subject:a,htmlBody:s,attachments:o,...l,customAccountId:d})}),"sendMessage",0,s,"stopMeeting",0,(e,t,a)=>i(`/api/agents/${e}/meetings/${t}/stop${n(a)}`,{method:"POST"}),"syncEmailAccount",0,(e,t,a)=>i(`/api/agents/${e}/email-accounts/${t}/sync${n(a)}`,{method:"POST"}),"triggerRuntimeRescan",0,(e,t)=>i(`/api/runtimes/${e}/rescan${n(t)}`,{method:"POST"}),"triggerRuntimeUpdate",0,(e,t)=>i(`/api/runtimes/${e}/update${n(t)}`,{method:"POST"}),"unflagMessage",0,(e,t)=>i(`/api/flags/${t}${n(e)}`,{method:"DELETE"}),"unpinAgent",0,(e,t)=>i(`/api/agents/${t}/pin${n(e)}`,{method:"DELETE"}),"updateAgent",0,(e,t,a)=>i(`/api/agents/${e}${n(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateAgentLink",0,(e,t,a)=>i(`/api/agent-links/${e}${n(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateCalendarEvent",0,(e,t,a)=>i(`/api/calendar/${e}${n(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateEmailStatus",0,(e,t,a)=>i(`/api/email/${e}${n(t)}`,{method:"PATCH",body:JSON.stringify({status:a})}),"updateIssue",0,(e,t,a)=>i(`/api/issues/${t}${n(e)}`,{method:"PATCH",body:JSON.stringify(a)}),"updateMemberMe",0,(e,t)=>i(`/api/members/me${n(e)}`,{method:"PATCH",body:JSON.stringify({global_instruction:t})}),"updateWorkspace",0,(e,t)=>i(`/api/workspaces/${e}${n(e)}`,{method:"PATCH",body:JSON.stringify(t)}),"uploadEmailAttachment",0,l],222862)},728886,e=>{"use strict";var t=e.i(368075),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(368075),a=e.i(298699),i=e.i(208020),n=e.i(880932),s=e.i(222862),r=e.i(186339),o=e.i(728886);e.s(["default",0,function(){let{token:e}=(0,i.useParams)(),l=(0,i.useRouter)(),[d,c]=(0,a.useState)("loading"),[u,p]=(0,a.useState)(null),[g,m]=(0,a.useState)("");(0,a.useEffect)(()=>{e&&(0,s.getInviteInfo)(e).then(e=>{p(e),c("ready")}).catch(e=>{m(e instanceof Error?e.message:"Invalid or expired invite link"),c("error")})},[e]);let h=async()=>{if(e){c("accepting");try{let t=await (0,s.acceptInvite)(e);c("done"),n.toast.success(`Joined ${u?.workspace_name??"workspace"}`),l.replace(`/w/${t.workspace_slug}/home`)}catch(e){m(e instanceof Error?e.message:"Failed to join workspace"),c("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"===d&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(o.Skeleton,{className:"h-6 w-48 mx-auto"}),(0,t.jsx)(o.Skeleton,{className:"h-4 w-64 mx-auto"}),(0,t.jsx)(o.Skeleton,{className:"h-9 w-32 mx-auto"})]}),"ready"===d&&u&&(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:[u.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:u.workspace_name}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Workspace"})]}),(0,t.jsx)(r.Button,{className:"w-full",onClick:h,children:"Join Workspace"})]}),"accepting"===d&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(o.Skeleton,{className:"h-6 w-48 mx-auto"}),(0,t.jsx)(o.Skeleton,{className:"h-4 w-64 mx-auto"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Joining workspace…"})]}),"error"===d&&(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:g})]}),(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>l.replace("/workspaces"),children:"Go to workspaces"})]})]})})}])}]);
|