@vellumai/web 0.10.7-dev.202607092332.9deedf4 → 0.10.7-dev.202607100313.fffdfea
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/dist/assets/{account-page-CMV43GIE.js → account-page-Ce-pbLMJ.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-Q6Pa1K4J.js → acp-run-detail-panel-T0GBDg-W.js} +1 -1
- package/dist/assets/{activity-steps-panel-CtNAZTDH.js → activity-steps-panel-BXXeXc19.js} +1 -1
- package/dist/assets/{advanced-page-BznS_S2-.js → advanced-page-C8Ib_u5F.js} +1 -1
- package/dist/assets/ai-page-BezzLmVq.js +1 -0
- package/dist/assets/{animated-avatar-DK4gO-3x.js → animated-avatar-DDpjZzRx.js} +1 -1
- package/dist/assets/{api-ByWcEKXC.js → api-Zs5JMgKY.js} +1 -1
- package/dist/assets/{api-key-screen-COgM-31V.js → api-key-screen-B_g5hH5v.js} +1 -1
- package/dist/assets/{archive-page-CbI42Xl9.js → archive-page-rl2uRUik.js} +1 -1
- package/dist/assets/{assistant-feature-flag-store-DZtH0LSq.js → assistant-feature-flag-store-CKUjJHuh.js} +1 -1
- package/dist/assets/{assistant-status-panel-je6tdnDq.js → assistant-status-panel-DPwgE1TF.js} +1 -1
- package/dist/assets/{auth-store-B0Vpa2Ej.js → auth-store-CKsDsnkp.js} +1 -1
- package/dist/assets/{background-task-detail-panel-C9gXqdcp.js → background-task-detail-panel-3xiHMnCC.js} +1 -1
- package/dist/assets/{billing-page-1lNYGQXM.js → billing-page-D-gIsav0.js} +1 -1
- package/dist/assets/{bookmarks-page-CrTrSqCx.js → bookmarks-page-giPayf1N.js} +1 -1
- package/dist/assets/{build-state-mRQrHtjQ.js → build-state-BLXpH8o6.js} +1 -1
- package/dist/assets/{channels-page-route-CH4rDnAa.js → channels-page-route-DAZ5e9vo.js} +1 -1
- package/dist/assets/{chat-markdown-message-Di8W_mZ2.js → chat-markdown-message-BuypfAkx.js} +1 -1
- package/dist/assets/{client-feature-flag-store-DdDbgq_C.js → client-feature-flag-store-C0g8zi1W.js} +1 -1
- package/dist/assets/{command-palette-CESousz_.js → command-palette-C0XZVlzp.js} +1 -1
- package/dist/assets/{command-palette-window-page-CDsU8OFx.js → command-palette-window-page-CxIvQGwt.js} +1 -1
- package/dist/assets/{community-page-C5ZLBw-d.js → community-page-CwSloAl0.js} +1 -1
- package/dist/assets/{contacts-page-route-7vAYmrEW.js → contacts-page-route-CBqOhX8s.js} +1 -1
- package/dist/assets/{conversation-list-fetchers-DPPBc9-e.js → conversation-list-fetchers-tE99dnUJ.js} +1 -1
- package/dist/assets/{credentials-page-DPAWp3ig.js → credentials-page-Bd-E5j_2.js} +1 -1
- package/dist/assets/{debug-page-ChigwOvQ.js → debug-page-CU0jo5tG.js} +1 -1
- package/dist/assets/{deploy-dialogs-BYLzWrGV.js → deploy-dialogs-8TBhlLXZ.js} +1 -1
- package/dist/assets/{detail-panel-stop-button-CzdpVulo.js → detail-panel-stop-button-B0utUgSr.js} +1 -1
- package/dist/assets/{developer-page-DpEsh6NB.js → developer-page-Da1bdSPK.js} +1 -1
- package/dist/assets/{devices-page-Pnn1eowJ.js → devices-page-DC9det1s.js} +1 -1
- package/dist/assets/{dictation-overlay-page-ChVTUFRD.js → dictation-overlay-page-6l-KJCrE.js} +1 -1
- package/dist/assets/{document-viewer-page-2ll_cJLl.js → document-viewer-page-djjsg4WE.js} +1 -1
- package/dist/assets/{earn-credits-modal-DeZpTKSj.js → earn-credits-modal-B4iirPUC.js} +1 -1
- package/dist/assets/{emails-page-ABf-We6M.js → emails-page-RItjmMG5.js} +1 -1
- package/dist/assets/feature-flag-catalog-CHuc71P8.js +1 -0
- package/dist/assets/{general-page-DkKSrMme.js → general-page-BtAuGqFM.js} +1 -1
- package/dist/assets/{hatching-screen-D8Pjfvhy.js → hatching-screen-C71v2Kqp.js} +1 -1
- package/dist/assets/{home-page-route-B1N6-RGa.js → home-page-route-DxKq7gEn.js} +1 -1
- package/dist/assets/{hosting-screen-BiP9Rnsg.js → hosting-screen-DBN9hO0s.js} +1 -1
- package/dist/assets/{identity-page-route-BWqNkDHQ.js → identity-page-route-Ck1TCmSd.js} +1 -1
- package/dist/assets/index-DQjUULFO.js +113 -0
- package/dist/assets/{inspect-page-C4TiFioA.js → inspect-page-BuriU_iU.js} +2 -2
- package/dist/assets/{integrations-page-DtTvWU0Y.js → integrations-page-N-I7F_JQ.js} +1 -1
- package/dist/assets/{intelligence-layout-BUgKwjS8.js → intelligence-layout-C_H2Uec7.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-page-B2sR16aW.js → keyboard-shortcuts-page-B2ozF8zY.js} +1 -1
- package/dist/assets/{library-detail-page-CWNbUJqt.js → library-detail-page-BKj7gWNL.js} +1 -1
- package/dist/assets/{library-page-5UprXzT9.js → library-page-BJljT3MY.js} +1 -1
- package/dist/assets/{login-flow-C69Wgb68.js → login-flow-C4Ehxg-g.js} +1 -1
- package/dist/assets/{login-page-jYS-XYJb.js → login-page-CZBdlVje.js} +1 -1
- package/dist/assets/{logout-page-DDATXd1t.js → logout-page-BryU7bK_.js} +1 -1
- package/dist/assets/{logs-layout-DGGiZCW7.js → logs-layout-nPLZjXX5.js} +1 -1
- package/dist/assets/{memory-router-playground-page-CC3Q-ii9.js → memory-router-playground-page-qIG7U97D.js} +1 -1
- package/dist/assets/{messages-CUJ5eqjM.js → messages-DF7pzUR8.js} +2 -2
- package/dist/assets/{mobile-sidebar-drawer-UKduN0Pv.js → mobile-sidebar-drawer-DpvWGGSA.js} +1 -1
- package/dist/assets/{notifications-page-7QBHhSOv.js → notifications-page-DBlKmak1.js} +1 -1
- package/dist/assets/{oauth-complete-page-nDiAeozi.js → oauth-complete-page-D8aQ3tJ_.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-weYCBDud.js → oauth-popup-complete-page-CXXZdxWJ.js} +1 -1
- package/dist/assets/{pairing-page-BAl_HWtd.js → pairing-page-b1uNitAm.js} +1 -1
- package/dist/assets/{platform-loopback-page-Bgb9VIUM.js → platform-loopback-page-hCZEK9-q.js} +1 -1
- package/dist/assets/{plugins-page-B4pNE_2E.js → plugins-page-C0TtdwgQ.js} +1 -1
- package/dist/assets/{prechat-route-C9OMadRC.js → prechat-route-CnIcxqAR.js} +1 -1
- package/dist/assets/{prefs-DIsAodtg.js → prefs-hu4Ft3Gc.js} +1 -1
- package/dist/assets/{privacy-page-59CvcL5F.js → privacy-page-PFWKww1A.js} +1 -1
- package/dist/assets/{privacy-screen-BoOkqfMk.js → privacy-screen-DSr2ddPX.js} +1 -1
- package/dist/assets/{provider-callback-page-BZSaYWMK.js → provider-callback-page-CVVL9mxY.js} +1 -1
- package/dist/assets/{provider-key-BBkXTnhk.js → provider-key-B9HxajGj.js} +1 -1
- package/dist/assets/{provider-signup-page-Dxl1u-LY.js → provider-signup-page-BBqT_sHe.js} +1 -1
- package/dist/assets/{quick-input-page-C8ZUm4TO.js → quick-input-page-CLwquN93.js} +1 -1
- package/dist/assets/react-query.gen-DOfazqkL.js +1 -0
- package/dist/assets/{research-mock-page-CyAaxUmt.js → research-mock-page-DeBKxHSz.js} +1 -1
- package/dist/assets/{research-onboarding-route-DfFaJpJ1.js → research-onboarding-route-2nc0yKsq.js} +4 -4
- package/dist/assets/{review-terms-screen-sQAJ3zHo.js → review-terms-screen-QliTExQL.js} +1 -1
- package/dist/assets/{risk-CrkyJx_W.js → risk-jKF7qGwV.js} +1 -1
- package/dist/assets/{schedules-BnoWhTUm.js → schedules-CQO3UwTc.js} +1 -1
- package/dist/assets/sdk.gen-jDeNbBv8.js +6 -0
- package/dist/assets/{security-page-edEfQa2K.js → security-page-CQfQh2wW.js} +1 -1
- package/dist/assets/{select-assistant-screen-BaWxwdJN.js → select-assistant-screen-BsGcZIsZ.js} +1 -1
- package/dist/assets/{settings-layout-DmT_OhwB.js → settings-layout-hvCEbqwx.js} +1 -1
- package/dist/assets/{share-feedback-modal-CiZZc4P8.js → share-feedback-modal-BFxBtlP7.js} +1 -1
- package/dist/assets/{sidebar-tree-DqBUS7Di.js → sidebar-tree-BaU6dAAM.js} +1 -1
- package/dist/assets/{signup-page-RKGKd4D4.js → signup-page-COVsB50a.js} +1 -1
- package/dist/assets/{site-favicon-BOtLPhLi.js → site-favicon-D9Rp1QPZ.js} +1 -1
- package/dist/assets/{skill-detail-page-BA-R0TUF.js → skill-detail-page-D5UAAUmZ.js} +1 -1
- package/dist/assets/{skill-detail-panel-qExRv5Fy.js → skill-detail-panel-DIoN-AUc.js} +1 -1
- package/dist/assets/{skills-cdOwT5VQ.js → skills-C9wbjXsQ.js} +1 -1
- package/dist/assets/{skills-page-DTyII3yz.js → skills-page-DhUitBj9.js} +1 -1
- package/dist/assets/{sound-manager-D6rR29ls.js → sound-manager-CSAwT8Vm.js} +1 -1
- package/dist/assets/{sounds-page-DX0M0BI7.js → sounds-page-DeBeDlcY.js} +1 -1
- package/dist/assets/{subagent-detail-panel-DZ2aFOtQ.js → subagent-detail-panel-CF-VVQJA.js} +1 -1
- package/dist/assets/{subagent-store-CkVBDrlq.js → subagent-store-C-pyGmFU.js} +1 -1
- package/dist/assets/{system-events-page-C7PYjQ1_.js → system-events-page-CYqUpGpC.js} +1 -1
- package/dist/assets/{tiptap-document-editor-UuUX9dDg.js → tiptap-document-editor-aGPkbqbr.js} +1 -1
- package/dist/assets/{tool-detail-panel-CNNk22iE.js → tool-detail-panel-CzkNK-ue.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-DtomPtfd.js → upgrade-cancel-page-BytvxNqQ.js} +1 -1
- package/dist/assets/{upgrade-success-page-ByqZaDgj.js → upgrade-success-page-CeuBASa8.js} +1 -1
- package/dist/assets/{usage-page-4pf5Kokb.js → usage-page-CI7scN-b.js} +1 -1
- package/dist/assets/{use-edge-swipe-back-KZ3UbiGX.js → use-edge-swipe-back-U9h8O8rp.js} +1 -1
- package/dist/assets/{use-invite-link-dialog-CefIg3No.js → use-invite-link-dialog-JL5Jevln.js} +1 -1
- package/dist/assets/use-is-org-ready-BP6_0L-A.js +1 -0
- package/dist/assets/{use-onboarding-login-BE7XAcLS.js → use-onboarding-login-CP7O8ZzB.js} +1 -1
- package/dist/assets/{use-skill-actions-DvXJseoE.js → use-skill-actions-BKfLB9Oe.js} +1 -1
- package/dist/assets/{use-skill-categories-SyeYfwMa.js → use-skill-categories-8DmU61Hs.js} +1 -1
- package/dist/assets/{use-skill-detail-files-DEAuvZ9C.js → use-skill-detail-files-DmLQiG5u.js} +1 -1
- package/dist/assets/{viewer-store-B7if16dM.js → viewer-store-SsoxBypb.js} +1 -1
- package/dist/assets/{voice-page-vBrdgTVm.js → voice-page-DX8ma3dY.js} +1 -1
- package/dist/assets/{weather-forecast-display-LnisXlEl.js → weather-forecast-display-hxrsJwFy.js} +1 -1
- package/dist/assets/{welcome-screen-CWHGZa4i.js → welcome-screen-Drx018g8.js} +1 -1
- package/dist/assets/{workflow-detail-panel-BUjpdiIu.js → workflow-detail-panel-n5adDCz2.js} +1 -1
- package/dist/assets/{workflow-store-CKPwCutv.js → workflow-store-B_M196cU.js} +1 -1
- package/dist/assets/workspace-page-CYDMc7C-.js +1 -0
- package/dist/index.html +23 -23
- package/package.json +1 -1
- package/dist/assets/ai-page-DUWe0qVj.js +0 -1
- package/dist/assets/feature-flag-catalog-8Bd8qhz2.js +0 -1
- package/dist/assets/index-6YxiY2Ly.js +0 -113
- package/dist/assets/react-query.gen-SVZdN1r_.js +0 -1
- package/dist/assets/sdk.gen-D-8W_bKa.js +0 -6
- package/dist/assets/use-is-org-ready-BrsKMV8W.js +0 -1
- package/dist/assets/workspace-page-BTFdn_4T.js +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
var e=(e,t,n)=>{typeof n==`string`||n instanceof Blob?e.append(t,n):n instanceof Date?e.append(t,n.toISOString()):e.append(t,JSON.stringify(n))},t={bodySerializer:t=>{let n=new FormData;return Object.entries(t).forEach(([t,r])=>{r!=null&&(Array.isArray(r)?r.forEach(r=>e(n,t,r)):e(n,t,r))}),n}},n={bodySerializer:e=>JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString():t)};Object.entries({$body_:`body`,$headers_:`headers`,$path_:`path`,$query_:`query`});function r({onRequest:e,onSseError:t,onSseEvent:n,responseTransformer:r,responseValidator:i,sseDefaultRetryDelay:a,sseMaxRetryAttempts:o,sseMaxRetryDelay:s,sseSleepFn:c,url:l,...u}){let d,f=c??(e=>new Promise(t=>setTimeout(t,e)));return{stream:async function*(){let c=a??3e3,p=0,m=u.signal??new AbortController().signal;for(;!m.aborted;){p++;let a=u.headers instanceof Headers?u.headers:new Headers(u.headers);d!==void 0&&a.set(`Last-Event-ID`,d);try{let t={redirect:`follow`,...u,body:u.serializedBody,headers:a,signal:m},o=new Request(l,t);e&&(o=await e(l,t));let s=await(u.fetch??globalThis.fetch)(o);if(!s.ok)throw Error(`SSE failed: ${s.status} ${s.statusText}`);if(!s.body)throw Error(`No body in SSE response`);let f=s.body.pipeThrough(new TextDecoderStream).getReader(),p=``,h=()=>{try{f.cancel()}catch{}};m.addEventListener(`abort`,h);try{for(;;){let{done:e,value:t}=await f.read();if(e)break;p+=t,p=p.replace(/\r\n?/g,`
|
|
2
|
+
`);let a=p.split(`
|
|
3
|
+
|
|
4
|
+
`);p=a.pop()??``;for(let e of a){let t=e.split(`
|
|
5
|
+
`),a=[],o;for(let e of t)if(e.startsWith(`data:`))a.push(e.replace(/^data:\s*/,``));else if(e.startsWith(`event:`))o=e.replace(/^event:\s*/,``);else if(e.startsWith(`id:`))d=e.replace(/^id:\s*/,``);else if(e.startsWith(`retry:`)){let t=Number.parseInt(e.replace(/^retry:\s*/,``),10);Number.isNaN(t)||(c=t)}let s,l=!1;if(a.length){let e=a.join(`
|
|
6
|
+
`);try{s=JSON.parse(e),l=!0}catch{s=e}}l&&(i&&await i(s),r&&(s=await r(s))),n?.({data:s,event:o,id:d,retry:c}),a.length&&(yield s)}}}finally{m.removeEventListener(`abort`,h),f.releaseLock()}break}catch(e){if(t?.(e),o!==void 0&&p>=o)break;await f(Math.min(c*2**(p-1),s??3e4))}}}()}}var i=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},a=e=>{switch(e){case`form`:return`,`;case`pipeDelimited`:return`|`;case`spaceDelimited`:return`%20`;default:return`,`}},o=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},s=({allowReserved:e,explode:t,name:n,style:r,value:o})=>{if(!t){let t=(e?o:o.map(e=>encodeURIComponent(e))).join(a(r));switch(r){case`label`:return`.${t}`;case`matrix`:return`;${n}=${t}`;case`simple`:return t;default:return`${n}=${t}`}}let s=i(r),l=o.map(t=>r===`label`||r===`simple`?e?t:encodeURIComponent(t):c({allowReserved:e,name:n,value:t})).join(s);return r===`label`||r===`matrix`?s+l:l},c=({allowReserved:e,name:t,value:n})=>{if(n==null)return``;if(typeof n==`object`)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},l=({allowReserved:e,explode:t,name:n,style:r,value:i,valueOnly:a})=>{if(i instanceof Date)return a?i.toISOString():`${n}=${i.toISOString()}`;if(r!==`deepObject`&&!t){let t=[];Object.entries(i).forEach(([n,r])=>{t=[...t,n,e?r:encodeURIComponent(r)]});let a=t.join(`,`);switch(r){case`form`:return`${n}=${a}`;case`label`:return`.${a}`;case`matrix`:return`;${n}=${a}`;default:return a}}let s=o(r),l=Object.entries(i).map(([t,i])=>c({allowReserved:e,name:r===`deepObject`?`${n}[${t}]`:t,value:i})).join(s);return r===`label`||r===`matrix`?s+l:l},u=/\{[^{}]+\}/g,d=({path:e,url:t})=>{let n=t,r=t.match(u);if(r)for(let t of r){let r=!1,i=t.substring(1,t.length-1),a=`simple`;i.endsWith(`*`)&&(r=!0,i=i.substring(0,i.length-1)),i.startsWith(`.`)?(i=i.substring(1),a=`label`):i.startsWith(`;`)&&(i=i.substring(1),a=`matrix`);let o=e[i];if(o==null)continue;if(Array.isArray(o)){n=n.replace(t,s({explode:r,name:i,style:a,value:o}));continue}if(typeof o==`object`){n=n.replace(t,l({explode:r,name:i,style:a,value:o,valueOnly:!0}));continue}if(a===`matrix`){n=n.replace(t,`;${c({name:i,value:o})}`);continue}let u=encodeURIComponent(a===`label`?`.${o}`:o);n=n.replace(t,u)}return n},f=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let a=i.startsWith(`/`)?i:`/${i}`,o=(e??``)+a;t&&(o=d({path:t,url:o}));let s=n?r(n):``;return s.startsWith(`?`)&&(s=s.substring(1)),s&&(o+=`?${s}`),o};function p(e){let t=e.body!==void 0;if(t&&e.bodySerializer)return`serializedBody`in e?e.serializedBody!==void 0&&e.serializedBody!==``?e.serializedBody:null:e.body===``?null:e.body;if(t)return e.body}var m=async(e,t)=>{let n=typeof t==`function`?await t(e):t;if(n)return e.scheme===`bearer`?`Bearer ${n}`:e.scheme===`basic`?`Basic ${btoa(n)}`:n},h=({parameters:e={},...t}={})=>n=>{let r=[];if(n&&typeof n==`object`)for(let i in n){let a=n[i];if(a==null)continue;let o=e[i]||t;if(Array.isArray(a)){let e=s({allowReserved:o.allowReserved,explode:!0,name:i,style:`form`,value:a,...o.array});e&&r.push(e)}else if(typeof a==`object`){let e=l({allowReserved:o.allowReserved,explode:!0,name:i,style:`deepObject`,value:a,...o.object});e&&r.push(e)}else{let e=c({allowReserved:o.allowReserved,name:i,value:a});e&&r.push(e)}}return r.join(`&`)},ee=e=>{if(!e)return`stream`;let t=e.split(`;`)[0]?.trim();if(t){if(t.startsWith(`application/json`)||t.endsWith(`+json`))return`json`;if(t===`multipart/form-data`)return`formData`;if([`application/`,`audio/`,`image/`,`video/`].some(e=>t.startsWith(e)))return`blob`;if(t.startsWith(`text/`))return`text`}},g=(e,t)=>t?!!(e.headers.has(t)||e.query?.[t]||e.headers.get(`Cookie`)?.includes(`${t}=`)):!1,te=async({security:e,...t})=>{for(let n of e){if(g(t,n.name))continue;let e=await m(n,t.auth);if(!e)continue;let r=n.name??`Authorization`;switch(n.in){case`query`:t.query||={},t.query[r]=e;break;case`cookie`:t.headers.append(`Cookie`,`${r}=${e}`);break;default:t.headers.set(r,e);break}}},_=e=>f({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer==`function`?e.querySerializer:h(e.querySerializer),url:e.url}),v=(e,t)=>{let n={...e,...t};return n.baseUrl?.endsWith(`/`)&&(n.baseUrl=n.baseUrl.substring(0,n.baseUrl.length-1)),n.headers=b(e.headers,t.headers),n},y=e=>{let t=[];return e.forEach((e,n)=>{t.push([n,e])}),t},b=(...e)=>{let t=new Headers;for(let n of e){if(!n)continue;let e=n instanceof Headers?y(n):Object.entries(n);for(let[n,r]of e)if(r===null)t.delete(n);else if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.set(n,typeof r==`object`?JSON.stringify(r):r)}return t},x=class{fns=[];clear(){this.fns=[]}eject(e){let t=this.getInterceptorIndex(e);this.fns[t]&&(this.fns[t]=null)}exists(e){let t=this.getInterceptorIndex(e);return!!this.fns[t]}getInterceptorIndex(e){return typeof e==`number`?this.fns[e]?e:-1:this.fns.indexOf(e)}update(e,t){let n=this.getInterceptorIndex(e);return this.fns[n]?(this.fns[n]=t,e):!1}use(e){return this.fns.push(e),this.fns.length-1}},S=()=>({error:new x,request:new x,response:new x}),C=h({allowReserved:!1,array:{explode:!0,style:`form`},object:{explode:!0,style:`deepObject`}}),w={"Content-Type":`application/json`},T=(e={})=>({...n,headers:w,parseAs:`auto`,querySerializer:C,...e}),E=((e={})=>{let t=v(T(),e),n=()=>({...t}),i=e=>(t=v(t,e),n()),a=S(),o=async e=>{let n={...t,...e,fetch:e.fetch??t.fetch??globalThis.fetch,headers:b(t.headers,e.headers),serializedBody:void 0};n.security&&await te({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body!==void 0&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.body===void 0||n.serializedBody===``)&&n.headers.delete(`Content-Type`);let r=n;return{opts:r,url:_(r)}},s=async e=>{let n=e.throwOnError??t.throwOnError,r=e.responseStyle??t.responseStyle,i,s;try{let{opts:t,url:n}=await o(e),r={redirect:`follow`,...t,body:p(t)};i=new Request(n,r);for(let e of a.request.fns)e&&(i=await e(i,t));let c=t.fetch;s=await c(i);for(let e of a.response.fns)e&&(s=await e(s,i,t));let l={request:i,response:s};if(s.ok){let e=(t.parseAs===`auto`?ee(s.headers.get(`Content-Type`)):t.parseAs)??`json`;if(s.status===204||s.headers.get(`Content-Length`)===`0`){let n;switch(e){case`arrayBuffer`:case`blob`:case`text`:n=await s[e]();break;case`formData`:n=new FormData;break;case`stream`:n=s.body;break;default:n={};break}return t.responseStyle===`data`?n:{data:n,...l}}let n;switch(e){case`arrayBuffer`:case`blob`:case`formData`:case`text`:n=await s[e]();break;case`json`:{let e=await s.text();n=e?JSON.parse(e):{};break}case`stream`:return t.responseStyle===`data`?s.body:{data:s.body,...l}}return e===`json`&&(t.responseValidator&&await t.responseValidator(n),t.responseTransformer&&(n=await t.responseTransformer(n))),t.responseStyle===`data`?n:{data:n,...l}}let u=await s.text(),d;try{d=JSON.parse(u)}catch{}throw d??u}catch(t){let o=t;for(let t of a.error.fns)t&&(o=await t(o,s,i,e));if(o||={},n)throw o;return r===`data`?void 0:{error:o,request:i,response:s}}},c=e=>t=>s({...t,method:e}),l=e=>async t=>{let{opts:n,url:i}=await o(t);return r({...n,body:n.body,method:e,onRequest:async(e,t)=>{let r=new Request(e,t);for(let e of a.request.fns)e&&(r=await e(r,n));return r},serializedBody:p(n),url:i})};return{buildUrl:e=>_({...t,...e}),connect:c(`CONNECT`),delete:c(`DELETE`),get:c(`GET`),getConfig:n,head:c(`HEAD`),interceptors:a,options:c(`OPTIONS`),patch:c(`PATCH`),post:c(`POST`),put:c(`PUT`),request:s,setConfig:i,sse:{connect:l(`CONNECT`),delete:l(`DELETE`),get:l(`GET`),head:l(`HEAD`),options:l(`OPTIONS`),patch:l(`PATCH`),post:l(`POST`),put:l(`PUT`),trace:l(`TRACE`)},trace:c(`TRACE`)}})(T()),D=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/apps`,...e}),O=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/apps/{id}/delete`,...e}),k=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/apps/{id}/open`,...e}),A=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/apps/{id}/publish`,...e}),j=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/apps/{id}/publish-status`,...e}),M=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/apps/{id}/share-cloud`,...e}),N=e=>(e.client??E).post({bodySerializer:null,url:`/v1/assistants/{assistant_id}/apps/import-bundle`,...e,headers:{"Content-Type":`application/octet-stream`,...e.headers}}),P=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/apps/shared/{token}`,...e}),F=e=>(e.client??E).post({...t,url:`/v1/assistants/{assistant_id}/attachments`,...e,headers:{"Content-Type":null,...e.headers}}),I=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/attachments/{id}/content`,...e}),L=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/avatar/character-components`,...e}),R=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/avatar/image`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),z=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/avatar/render-from-traits`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),B=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/avatar/state`,...e}),V=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/background-tools`,...e}),H=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/background-tools/cancel`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),U=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/backups`,...e}),W=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/backups/create`,...e}),G=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/backups/restore`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),K=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/bookmarks`,...e}),q=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/bookmarks`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),J=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/bookmarks/by-message/{messageId}`,...e}),Y=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/channels/available`,...e}),X=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/channels/readiness`,...e}),Z=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/config`,...e}),Q=e=>(e.client??E).patch({url:`/v1/assistants/{assistant_id}/config`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),ne=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/config/llm/call-sites`,...e}),re=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/config/llm/default-provider`,...e}),ie=e=>(e.client??E).put({url:`/v1/assistants/{assistant_id}/config/llm/default-provider`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),ae=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/config/llm/profiles`,...e}),oe=e=>(e.client??E).put({url:`/v1/assistants/{assistant_id}/config/llm/profiles/{name}`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),se=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/confirm`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),ce=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/consolidation/config`,...e}),le=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/consolidation/run-now`,...e}),ue=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/consolidation/runs`,...e}),de=e=>(e.client??E).patch({url:`/v1/assistants/{assistant_id}/contact-channels/{contactChannelId}`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),fe=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/contacts`,...e}),pe=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/contacts/merge`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),me=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/conversation-starters`,...e}),he=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/conversations`,...e}),ge=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),_e=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/{conversationId}/slack-channel/resolve`,...e}),ve=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/conversations/{id}`,...e}),ye=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/{id}/archive`,...e}),be=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/{id}/cancel`,...e}),xe=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/conversations/{id}/compaction`,...e}),Se=e=>(e.client??E).put({url:`/v1/assistants/{assistant_id}/conversations/{id}/inference-profile`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Ce=e=>(e.client??E).patch({url:`/v1/assistants/{assistant_id}/conversations/{id}/name`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),we=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/{id}/slash`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Te=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/{id}/surface`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Ee=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/{id}/unarchive`,...e}),De=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/{id}/undo`,...e}),Oe=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/archive/bulk`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),ke=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/fork`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Ae=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/conversations/llm-context`,...e}),je=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/reorder`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Me=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/seen`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Ne=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/seen/bulk`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Pe=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/summarize`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Fe=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/unread`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Ie=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/credentials/delete`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Le=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/credentials/inspect`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Re=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/credentials/list`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),ze=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/credentials/set`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Be=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/dictation`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Ve=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/disk-pressure/acknowledge`,...e}),He=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/disk-pressure/status`,...e}),Ue=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/documents`,...e}),We=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/documents`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Ge=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/documents/{id}`,...e}),Ke=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/documents/{id}/comments`,...e}),qe=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/documents/{id}/comments`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Je=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/documents/{id}/comments/{commentId}`,...e}),Ye=e=>(e.client??E).patch({url:`/v1/assistants/{assistant_id}/documents/{id}/comments/{commentId}`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Xe=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/documents/{id}/conversations`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Ze=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/documents/{id}/pdf`,...e}),Qe=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/events/tail`,...e}),$e=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/groups`,...e}),et=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/groups`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),tt=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/groups/{groupId}`,...e}),nt=e=>(e.client??E).patch({url:`/v1/assistants/{assistant_id}/groups/{groupId}`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),rt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/healthz`,...e}),it=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/heartbeat/config`,...e}),at=e=>(e.client??E).put({url:`/v1/assistants/{assistant_id}/heartbeat/config`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),ot=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/heartbeat/run-now`,...e}),st=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/heartbeat/runs`,...e}),ct=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/home/feed`,...e}),lt=e=>(e.client??E).patch({url:`/v1/assistants/{assistant_id}/home/feed/{id}`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),ut=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/home/feed/{id}/actions/{actionId}`,...e}),dt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/home/feed/mark-all`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),ft=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/home/state`,...e}),pt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/identity`,...e}),mt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/inference/chatgpt-subscription/auth`,...e}),ht=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/inference/chatgpt-subscription/auth/exchange`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),gt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/inference/provider-connections`,...e}),_t=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/inference/provider-connections`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),vt=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/inference/provider-connections/{name}`,...e}),yt=e=>(e.client??E).patch({url:`/v1/assistants/{assistant_id}/inference/provider-connections/{name}`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),bt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/integrations/a2a/invite`,...e}),xt=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/integrations/slack/channel/config`,...e}),St=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/integrations/slack/channel/config`,...e}),Ct=e=>(e.client??E).patch({url:`/v1/assistants/{assistant_id}/integrations/slack/channel/config`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),wt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/integrations/slack/channel/config`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Tt=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/integrations/telegram/config`,...e}),Et=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/integrations/telegram/config`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Dt=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/integrations/twilio/credentials`,...e}),Ot=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/integrations/twilio/credentials`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),kt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/integrations/vercel/config`,...e}),At=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/integrations/vercel/config`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),jt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/llm-request-logs/{id}/context`,...e}),Mt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/llm-request-logs/{id}/payload`,...e}),Nt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/logs/export`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Pt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/memory-graph`,...e}),Ft=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/memory-graph-node`,...e}),It=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/memory/v2/concept-page`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Lt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/memory/v2/now-text`,...e}),Rt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/memory/v2/router-prompt-template`,...e}),zt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/memory/v2/simulate-router`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Bt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/memory/worker/start`,...e}),Vt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/memory/worker/status`,...e}),Ht=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/memory/worker/stop`,...e}),Ut=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/messages`,...e}),Wt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/messages`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Gt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/messages/{id}/llm-context`,...e}),Kt=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/messages/queued/{id}`,...e}),qt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/messages/queued/{id}/steer`,...e}),Jt=e=>(e.client??E).put({url:`/v1/assistants/{assistant_id}/model/image-gen`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Yt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/notification-intent-result`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Xt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/oauth/apps`,...e}),Zt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/oauth/apps`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Qt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/oauth/apps/{appId}/connect`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),$t=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/oauth/apps/{appId}/connections`,...e}),en=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/oauth/apps/{id}`,...e}),tn=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/oauth/connections/{id}`,...e}),nn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/oauth/providers`,...e}),rn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/oauth/providers/{providerKey}`,...e}),an=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/onboarding/checkin`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),on=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/pending-interactions`,...e}),sn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/plugins`,...e}),cn=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/plugins/{name}`,...e}),ln=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/plugins/{name}`,...e}),un=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/plugins/{name}/disable`,...e}),dn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/plugins/{name}/enable`,...e}),fn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/plugins/{name}/icon`,...e}),pn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/plugins/{name}/inspect`,...e}),mn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/plugins/{name}/upgrade`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),hn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/plugins/install`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),gn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/plugins/search`,...e}),_n=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/question-response`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),vn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/retrospective/config`,...e}),yn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/retrospective/runs`,...e}),bn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/schedules`,...e}),xn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/schedules`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Sn=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/schedules/{id}`,...e}),Cn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/schedules/{id}/run`,...e}),wn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/schedules/{id}/runs`,...e}),Tn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/schedules/{id}/toggle`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),En=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/schedules/usage-summary`,...e}),Dn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/search/global`,...e}),On=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/secret`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),kn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/secrets`,...e}),An=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/secrets`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),jn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/secrets/read`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Mn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/skills`,...e}),Nn=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/skills/{id}`,...e}),Pn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/skills/{id}`,...e}),Fn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/skills/{id}/files`,...e}),In=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/skills/{id}/files/content`,...e}),Ln=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/skills/categories`,...e}),Rn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/skills/install`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),zn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/slack/channels`,...e}),Bn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/slack/users`,...e}),Vn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/sounds/available`,...e}),Hn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/sounds/config`,...e}),Un=e=>(e.client??E).put({url:`/v1/assistants/{assistant_id}/sounds/config`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Wn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/stt/transcribe`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Gn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/subagents/{id}`,...e}),Kn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/subagents/{id}/abort`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),qn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/suggestion`,...e}),$=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/surface-actions`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Jn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/surfaces/{surfaceId}`,...e}),Yn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/tts/providers`,...e}),Xn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/usage/breakdown`,...e}),Zn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/usage/daily`,...e}),Qn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/usage/series`,...e}),$n=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/usage/totals`,...e}),er=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/workflows/runs/{id}`,...e}),tr=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/workflows/runs/{id}/abort`,...e}),nr=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/workflows/runs/{id}/journal`,...e}),rr=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/workspace/delete`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),ir=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/workspace/file`,...e}),ar=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/workspace/file/content`,...e}),or=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/workspace/mkdir`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),sr=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/workspace/rename`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),cr=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/workspace/tree`,...e}),lr=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/workspace/write`,...e,headers:{"Content-Type":`application/json`,...e.headers}});export{Ae as $,kn as $n,Ot as $t,ae as A,on as An,ir as Ar,at as At,_e as B,gn as Bn,mt as Bt,Y as C,en as Cn,Qn as Cr,Qe as Ct,re as D,rn as Dn,nr as Dr,et as Dt,ne as E,tn as En,er as Er,$e as Et,ue as F,fn as Fn,E as Fr,ct as Ft,Se as G,Cn as Gn,bt as Gt,be as H,vn as Hn,yt as Ht,de as I,pn as In,dt as It,Te as J,bn as Jn,Ct as Jt,Ce as K,wn as Kn,xt as Kt,fe as L,mn as Ln,ft as Lt,se as M,un as Mn,sr as Mr,st as Mt,ce as N,dn as Nn,cr as Nr,ut as Nt,ie as O,nn as On,rr as Or,rt as Ot,le as P,ln as Pn,lr as Pr,lt as Pt,he as Q,On as Qn,Dt as Qt,pe as R,sn as Rn,pt as Rt,q as S,$t as Sn,Zn as Sr,We as St,Z as T,Zt as Tn,tr as Tr,nt as Tt,xe as U,yn as Un,gt as Ut,ye as V,_n as Vn,vt as Vt,ve as W,Sn as Wn,_t as Wt,De as X,En as Xn,Tt as Xt,Ee as Y,xn as Yn,wt as Yt,ke as Z,Dn as Zn,Et as Zt,W as _,Kt as _n,qn as _r,qe as _t,M as a,It as an,Pn as ar,Fe as at,J as b,Yt as bn,Yn as br,Ze as bt,P as c,zt as cn,Rn as cr,Le as ct,L as d,Ht as dn,Vn as dr,Be as dt,kt as en,An as er,ge as et,R as f,Pt as fn,Hn as fr,Ve as ft,V as g,Wt as gn,Gn as gr,Ke as gt,H as h,Ut as hn,Kn as hr,Ye as ht,j as i,Nt as in,Fn as ir,Pe as it,Q as j,cn as jn,or as jr,ot as jt,oe as k,an as kn,ar as kr,it as kt,I as l,Bt as ln,zn as lr,Re as lt,B as m,Gt as mn,Wn as mr,Je as mt,k as n,jt as nn,Nn as nr,Ne as nt,D as o,Lt as on,Ln as or,me as ot,z as p,Ft as pn,Un as pr,He as pt,we as q,Tn as qn,St as qt,A as r,Mt as rn,In as rr,Me as rt,N as s,Rt as sn,Mn as sr,Ie as st,O as t,At as tn,jn as tr,je as tt,F as u,Vt as un,Bn as ur,ze as ut,U as v,qt as vn,$ as vr,Xe as vt,X as w,Xt as wn,$n as wr,tt as wt,K as x,Qt as xn,Xn as xr,Ue as xt,G as y,Jt as yn,Jn as yr,Ge as yt,Oe as z,hn as zn,ht as zt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./copy-Cn1FKrEp.js";import{t as c}from"./loader-circle-Cz7opInR.js";import{t as l}from"./notice-DkcNAP8O.js";import{t as u}from"./input-CoUmPnRU.js";import{t as d}from"./modal-D5nLWNN9.js";import{n as f}from"./toast-xTp-xwYL.js";import{t as p}from"./confirm-dialog-CSkhRFRk.js";import{Pt as m}from"./sdk.gen-CmKfVpgB.js";import{c as h}from"./routes-BbeIx_F9.js";import{t as g}from"./client-feature-flag-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./copy-Cn1FKrEp.js";import{t as c}from"./loader-circle-Cz7opInR.js";import{t as l}from"./notice-DkcNAP8O.js";import{t as u}from"./input-CoUmPnRU.js";import{t as d}from"./modal-D5nLWNN9.js";import{n as f}from"./toast-xTp-xwYL.js";import{t as p}from"./confirm-dialog-CSkhRFRk.js";import{Pt as m}from"./sdk.gen-CmKfVpgB.js";import{c as h}from"./routes-BbeIx_F9.js";import{t as g}from"./client-feature-flag-store-C0g8zi1W.js";import{At as _,Mt as v,Nt as y,jt as b,kt as x}from"./react-query.gen-DPzPS206.js";import{D as S,Ti as C,Wr as w}from"./index-DQjUULFO.js";import{t as T}from"./detail-card-RGTjHkZ8.js";var E=e(t(),1);function D(e){if(typeof e==`object`&&e&&`code`in e){let t=e.code;if(typeof t==`string`)return t}}var O=o();function k({open:e,onOpenChange:t}){let r=i(),[a,o]=(0,E.useState)(null),[l,p]=(0,E.useState)(``),[h,g]=(0,E.useState)(null),_=(0,E.useRef)(!1),v=(0,E.useRef)(e),S=()=>r.invalidateQueries({queryKey:y()}),C=e=>{m({path:{id:e}}).catch(()=>void 0).finally(()=>void S())},w=x({onSuccess:e=>{if(!v.current){C(e.factor_id);return}o(e)},onError:e=>{let n=D(e);n===`no_workos_account`?f.error(`Two-factor authentication is only available for Vellum platform accounts.`):n===`throttled`||n===`workos_rate_limited`?f.error(`Too many attempts. Try again in a minute.`):n===`factor_limit_reached`?f.error(`An authenticator app is already set up. Remove it before adding another.`):f.error(`Failed to start setup. Please try again.`),t(!1)}}),T=b({onSuccess:e=>{e.valid?(_.current=!0,f.success(`Two-factor authentication is on.`),S(),t(!1)):g(`That code didn't match. Check your authenticator app and try again.`)},onError:e=>{let n=D(e);if(n===`challenge_already_verified`){_.current=!0,f.success(`Two-factor authentication is on.`),S(),t(!1);return}if(n===`challenge_expired`||n===`challenge_not_found`){a&&C(a.factor_id),o(null),p(``),g(`This setup session expired. Scan the new QR code and try again.`),w.mutate({});return}if(n===`throttled`||n===`workos_rate_limited`){g(`Too many attempts. Wait a minute and try again.`);return}g(`Couldn't verify the code. Wait a moment and try again.`)}});(0,E.useEffect)(()=>{v.current=e,e&&(_.current=!1,o(null),p(``),g(null),w.mutate({}))},[e]);let k=e=>{!e&&T.isPending||(!e&&a&&!_.current&&C(a.factor_id),t(e))},A=()=>{a&&navigator.clipboard.writeText(a.secret).then(()=>f.success(`Setup key copied.`)).catch(()=>f.error(`Couldn't copy the setup key.`))},j=()=>{!a||l.length!==6||T.isPending||(g(null),T.mutate({body:{challenge_id:a.challenge_id,code:l}}))};return(0,O.jsx)(d.Root,{open:e,onOpenChange:k,children:(0,O.jsxs)(d.Content,{size:`sm`,children:[(0,O.jsxs)(d.Header,{children:[(0,O.jsx)(d.Title,{children:`Set up authenticator app`}),(0,O.jsx)(d.Description,{children:`Scan the QR code with an authenticator app such as Google Authenticator or 1Password, then enter the 6-digit code it shows.`})]}),(0,O.jsx)(d.Body,{children:a===null?(0,O.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,O.jsx)(c,{className:`h-5 w-5 animate-spin text-[var(--content-tertiary)]`})}):(0,O.jsxs)(`form`,{className:`flex flex-col items-center gap-4`,onSubmit:e=>{e.preventDefault(),j()},children:[(0,O.jsx)(`img`,{src:a.qr_code,alt:`QR code for your authenticator app`,className:`h-44 w-44 rounded-lg bg-white p-2`}),(0,O.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,O.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Can't scan it? Enter this setup key manually:`}),(0,O.jsxs)(`button`,{type:`button`,onClick:A,className:`flex cursor-pointer items-center gap-2 self-start font-mono text-body-small-default text-[var(--content-default)] hover:text-[var(--content-emphasised)]`,children:[(0,O.jsx)(`span`,{className:`break-all text-left`,children:a.secret}),(0,O.jsx)(s,{className:`h-3.5 w-3.5 shrink-0`})]})]}),(0,O.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,O.jsx)(`label`,{htmlFor:`totp-code`,className:`text-body-small-default text-[var(--content-tertiary)]`,children:`6-digit code`}),(0,O.jsx)(u,{id:`totp-code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:6,placeholder:`123456`,value:l,onChange:e=>p(e.target.value.replace(/\D/g,``).slice(0,6))}),h&&(0,O.jsx)(`p`,{role:`alert`,className:`text-body-small-default text-[var(--system-negative-strong)]`,children:h})]})]})}),(0,O.jsxs)(d.Footer,{children:[(0,O.jsx)(n,{variant:`outlined`,onClick:()=>k(!1),disabled:T.isPending,children:`Cancel`}),(0,O.jsx)(n,{onClick:j,disabled:a===null||l.length!==6||T.isPending,children:T.isPending?`Verifying…`:`Verify`})]})]})})}function A(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function j(){let e=i(),[t,r]=(0,E.useState)(!1),[o,s]=(0,E.useState)(null),u=a({...v()}),d=u.data??[],m=()=>e.invalidateQueries({queryKey:y()}),h=_({onSuccess:()=>{f.success(`Authenticator app removed.`),m()},onError:e=>{if(D(e)===`factor_not_found`){m();return}f.error(`Failed to remove the authenticator app. Please try again.`)}});return(0,O.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[u.isPending?(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:[(0,O.jsx)(c,{className:`h-4 w-4 animate-spin`}),(0,O.jsx)(`span`,{className:`text-body-medium-default`,children:`Loading authenticator apps…`})]}):u.isError?(0,O.jsxs)(l,{tone:`error`,children:[`Couldn't load your authenticator apps.`,` `,(0,O.jsx)(`button`,{type:`button`,className:`cursor-pointer underline`,onClick:()=>void u.refetch(),children:`Try again`})]}):d.length===0?(0,O.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`No authenticator app is set up. Add one to require a one-time code at sign-in.`}):(0,O.jsx)(`ul`,{className:`flex flex-col divide-y divide-[var(--border-base)]`,children:d.map(e=>(0,O.jsxs)(`li`,{className:`flex items-center justify-between gap-3 py-3`,children:[(0,O.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,O.jsx)(C,{className:`h-5 w-5 shrink-0 text-[var(--content-tertiary)]`}),(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Authenticator app`}),(0,O.jsxs)(`div`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,children:[e.user,e.created_at?` · Added ${A(e.created_at)}`:``]})]})]}),(0,O.jsx)(n,{variant:`dangerOutline`,onClick:()=>s(e),disabled:h.isPending,children:`Remove`})]},e.id))}),!u.isPending&&!u.isError&&d.length===0&&(0,O.jsx)(n,{onClick:()=>r(!0),className:`self-start`,children:`Add authenticator app`}),(0,O.jsx)(k,{open:t,onOpenChange:r}),(0,O.jsx)(p,{open:o!==null,title:`Remove authenticator app`,message:`Signing in will no longer ask for a code from this app. You can set up a new authenticator app at any time.`,confirmLabel:`Remove`,destructive:!0,onConfirm:()=>{o&&h.mutate({path:{id:o.id}}),s(null)},onCancel:()=>s(null)})]})}function M(){let e=g.use.accountMfa(),t=g.use.hydrated(),n=w();return t&&!e?(0,O.jsx)(r,{replace:!0,to:h.settings.general}):!e||n===`gated`?null:(0,O.jsx)(`div`,{className:`space-y-4`,children:(0,O.jsx)(T,{title:`Two-Factor Authentication`,subtitle:`Require a code from an authenticator app when you sign in.`,children:n===`disabled`?(0,O.jsx)(S,{children:`Log in to the Vellum platform to manage two-factor authentication.`}):(0,O.jsx)(j,{})})})}export{M as SecurityPage};
|
package/dist/assets/{select-assistant-screen-BaWxwdJN.js → select-assistant-screen-BsGcZIsZ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./check-DFNrQERi.js";import{t as s}from"./modal-D5nLWNN9.js";import{t as c}from"./confirm-dialog-CSkhRFRk.js";import{A as l,F as u,M as d,d as f,lt as ee,rt as te,t as ne}from"./local-mode-grqHUoNh.js";import{t as p}from"./is-electron-y5bNUVyG.js";import{n as m}from"./resolved-assistants-store-BSZbT8Ju.js";import{D as h,O as g,i as _,n as v}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./check-DFNrQERi.js";import{t as s}from"./modal-D5nLWNN9.js";import{t as c}from"./confirm-dialog-CSkhRFRk.js";import{A as l,F as u,M as d,d as f,lt as ee,rt as te,t as ne}from"./local-mode-grqHUoNh.js";import{t as p}from"./is-electron-y5bNUVyG.js";import{n as m}from"./resolved-assistants-store-BSZbT8Ju.js";import{D as h,O as g,i as _,n as v}from"./auth-store-CKsDsnkp.js";import{c as y}from"./routes-BbeIx_F9.js";import{t as b}from"./use-onboarding-login-CP7O8ZzB.js";import{Mn as x,ga as S,jn as C,na as w,rn as T}from"./index-DQjUULFO.js";import{r as E}from"./format-date-BczUbfC1.js";var D=e(t(),1),O=a();function k({open:e,assistantName:t,isPending:r,errorMessage:i,onCancel:a,onRepair:o,onRetire:l}){let[u,d]=(0,D.useState)(`menu`);(0,D.useEffect)(()=>{e&&d(`menu`)},[e]);let f=i?(0,O.jsx)(`span`,{className:`mt-3 block text-body-small-default text-[var(--system-negative-strong)]`,children:i}):null;return u===`confirm-repair`?(0,O.jsx)(c,{open:e,title:`Repair Assistant?`,message:(0,O.jsxs)(O.Fragment,{children:[`Repairing re-provisions this assistant’s authentication token. Any other devices or browser sessions connected to it will be signed out and need to reconnect.`,f]}),confirmLabel:`Repair`,isPending:r,onConfirm:o,onCancel:()=>d(`menu`)}):u===`confirm-retire`?(0,O.jsx)(C,{open:e,isPending:r,extraMessage:f,onConfirm:l,onCancel:()=>d(`menu`)}):(0,O.jsx)(s.Root,{open:e,onOpenChange:e=>{!e&&!r&&a()},children:(0,O.jsxs)(s.Content,{size:`sm`,hideCloseButton:!0,onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),r||a()},children:[(0,O.jsx)(s.Header,{children:(0,O.jsx)(s.Title,{children:`Can’t Authenticate Assistant`})}),(0,O.jsxs)(s.Body,{children:[(0,O.jsxs)(s.Description,{children:[`The authentication token for `,t,` is missing or can no longer be refreshed, so this assistant can’t be connected. You can repair it, retire it, or pick a different assistant.`]}),f,(0,O.jsxs)(`div`,{className:`mt-5 flex w-full flex-col gap-2`,children:[(0,O.jsx)(n,{variant:`primary`,fullWidth:!0,disabled:r,onClick:()=>d(`confirm-repair`),children:`Wake & Repair`}),(0,O.jsx)(n,{variant:`dangerOutline`,fullWidth:!0,disabled:r,onClick:()=>d(`confirm-retire`),children:`Retire Assistant`}),(0,O.jsx)(n,{variant:`outlined`,fullWidth:!0,disabled:r,onClick:a,children:`Cancel`})]})]})]})})}function A(e){return e.name?e.name:e.isLocal?`Local Assistant`:`Cloud Assistant`}function j(e){if(e.hatchedAt)return`Created ${E(e.hatchedAt)}`}function M(){let e=r(),[t]=i(),a=t.get(`fromLogin`)===`1`,o=t.get(`noAutoSkip`)===`1`,s=p(),c=_(),S=m.use.assistants(),C=h.use.currentOrganizationId(),{loading:w,error:E,login:j,cancel:M}=b(),P=e=>e.isLocal||c,F=S.filter(P),I=S.some(e=>e.isPlatformHosted)&&!c,[L,R]=(0,D.useState)(null),[z,B]=(0,D.useState)(!1),[V,H]=(0,D.useState)(!1),[U,W]=(0,D.useState)(null),[G,K]=(0,D.useState)(null),[q,J]=(0,D.useState)(!1),[Y,X]=(0,D.useState)(null);(0,D.useEffect)(()=>{if(L!=null||F.length===0)return;let e=g(C);R(F.find(t=>t.id===e)?.id??F[0].id)},[L,F,C]);let Z=async t=>{B(!0),W(null);try{t.isLocal?await v.getState().connectLocalAssistant(t.id):await v.getState().connectPlatformAssistant(t.id),e(y.assistant,{replace:!0})}catch(e){console.error(`selectAssistant.handleConnect failed`,e),t.isLocal&&l()&&(d(e)||ee(e)||e instanceof ne)&&f(t.id)?K(t):W(`Failed to connect. Please try again.`),B(!1)}},Q=()=>{K(null),J(!1),X(null),H(!1)},re=async()=>{if(!(!G||q)){J(!0),X(null);try{let e=await u(G.id,{repairGuardian:!0});if(e.ok){te(),Q(),Z(G);return}X(e.error||`Repair failed. Please try again.`)}catch(e){console.error(`selectAssistant.recoveryRepair failed`,e),X(`Repair failed. Please try again.`)}J(!1)}},ie=async()=>{if(!(!G||q)){J(!0),X(null);try{let t=await x(G.id);if(t.ok){Q(),e(t.nextRoute,{replace:!0});return}X(t.error)}catch(e){console.error(`selectAssistant.recoveryRetire failed`,e),X(`Failed to retire assistant. Please try again.`)}J(!1)}};(0,D.useEffect)(()=>{a||o||z||V||S.length!==0&&S.length===1&&F.length===1&&(H(!0),Z(F[0]))},[S.length,F.length]);let ae=()=>{let e=S.find(e=>e.id===L);e&&Z(e)},oe=()=>{e(y.welcome)},$=E??U;return V&&!$&&!G?(0,O.jsx)(T,{children:(0,O.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center justify-center px-6 text-[var(--content-default)]`,children:(0,O.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Connecting to your assistant…`})})}):(0,O.jsxs)(T,{children:[(0,O.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${s?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`min-h-screen px-6 pb-40 pt-16`} text-[var(--content-default)]`,children:[(0,O.jsx)(`h1`,{className:s?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Choose an Assistant`}),(0,O.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${s?`mt-3.5`:`mt-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Select which assistant you’d like to use.`}),$&&(0,O.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:$}),(0,O.jsx)(`div`,{className:`flex w-full flex-col ${s?`mt-8 gap-2`:`mt-10 gap-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:S.map(e=>{let t=P(e);return(0,O.jsx)(N,{assistant:e,selected:L===e.id,disabled:!t,badge:!t&&e.isPlatformHosted?`Requires Account`:void 0,onSelect:()=>{t&&R(e.id)}},e.id)})}),(0,O.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${s?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[F.length>0&&(0,O.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:ae,disabled:!L||z,children:z?`Connecting…`:`Continue`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:()=>void e(`${y.onboarding.hosting}?from=select-assistant`),disabled:z||w,children:`Create New Assistant`}),I&&(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:w?M:()=>void j(),disabled:z,children:w?`Cancel`:`Log In`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:oe,disabled:z||w,children:`Back`})]})]}),(0,O.jsx)(k,{open:G!=null,assistantName:G?A(G):``,isPending:q,errorMessage:Y??void 0,onCancel:Q,onRepair:()=>void re(),onRetire:()=>void ie()})]})}function N({assistant:e,selected:t,disabled:n,badge:r,onSelect:i}){let a=j(e),s=p();return(0,O.jsxs)(`button`,{type:`button`,onClick:i,disabled:n,className:[`group flex w-full items-center border text-left`,s?`gap-3 rounded-lg p-3`:`gap-4 rounded-2xl px-5 py-4`,`transition-all duration-200 ease-out`,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-[var(--surface-secondary)]`,t&&!n?`border-[var(--primary-base)] bg-[var(--primary-base)]/[0.08] shadow-[inset_0_0_0_1px_var(--primary-base)]`:`border-[var(--border-element)] bg-transparent`].join(` `),children:[(0,O.jsx)(`div`,{className:[`flex shrink-0 items-center justify-center transition-colors duration-200`,s?`h-8 w-8 rounded-lg`:`h-10 w-10 rounded-xl`,t&&!n?`bg-[var(--primary-base)]/15 text-[var(--primary-base)]`:`bg-[var(--surface-tertiary)] text-[var(--content-secondary)]`].join(` `),children:e.isLocal?(0,O.jsx)(w,{className:`h-5 w-5`}):(0,O.jsx)(S,{className:`h-5 w-5`})}),(0,O.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:A(e)}),r&&(0,O.jsx)(`span`,{className:`rounded-full bg-[var(--surface-tertiary)] px-2 py-0.5 text-[var(--content-tertiary)] ${s?`text-label-medium-default`:`text-body-small-default`}`,children:r})]}),a&&(0,O.jsx)(`span`,{className:`mt-0.5 block text-[var(--content-tertiary)] ${s?`text-label-medium-default`:`text-body-small-default`}`,children:a})]}),!n&&(0,O.jsx)(`div`,{className:[`flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)] group-hover:border-[var(--content-tertiary)]`].join(` `),children:t&&(0,O.jsx)(o,{className:`h-3 w-3 text-[var(--surface-base)]`,strokeWidth:3})})]})}export{M as SelectAssistantScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,i as r,u as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./log-in--aqELu3z.js";import{t as s}from"./is-electron-y5bNUVyG.js";import{i as c}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,i as r,u as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./log-in--aqELu3z.js";import{t as s}from"./is-electron-y5bNUVyG.js";import{i as c}from"./auth-store-CKsDsnkp.js";import{c as l}from"./routes-BbeIx_F9.js";import{t as u}from"./client-feature-flag-store-C0g8zi1W.js";import{t as d}from"./use-onboarding-login-CP7O8ZzB.js";import{t as f}from"./assistant-feature-flag-store-CKUjJHuh.js";import{Pt as p,Wr as m,Yi as h,hr as g}from"./index-DQjUULFO.js";import{n as _,t as v}from"./sidebar-tree-BaU6dAAM.js";var y=e(t(),1),b=a();function x(){let e=f.use.settingsDeveloperNav(),t=f.use.credentialsSettings(),a=u.use.platformNotifications(),x=u.use.bookmarks(),S=u.use.accountMfa(),C=m({platformHostedOnly:!0}),w=m(),{pathname:T}=i(),E=n(),D=c(),{login:O}=d(),k=(0,y.useMemo)(()=>p.filter(e=>!(e.id===`notifications`&&(!a||C===`gated`)||e.id===`billing`&&w!==`full`||e.id===`security`&&(!S||w===`gated`)||e.id===`bookmarks`&&!x||e.id===`credentials`&&!t||e.id===`devices`&&C===`gated`||e.id===`keyboard-shortcuts`&&!s()||e.id===`developer`)),[a,C,w,x,S,t]),A=(0,y.useMemo)(()=>{let t=[];return e&&t.push(...p.filter(e=>e.id===`developer`)),t.push(D?{id:`logout`,label:`Log Out`,icon:h,onSelect:()=>void g(E)}:{id:`login`,label:`Log In`,icon:o,onSelect:()=>void O()}),t},[e,D,E,O]),j=(0,y.useMemo)(()=>{if(T===l.settings.root)return`Settings`;let e=p.find(e=>T===e.href||T.startsWith(e.href+`/`));return e?e.label:`Settings`},[T]);return(0,b.jsx)(_,{backHref:l.assistant,sidebar:(0,b.jsx)(v,{items:k,bottomItems:A,indexPath:l.settings.root}),title:j,children:(0,b.jsx)(r,{})})}export{x as SettingsLayout};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-DJZBPgpf.js";import{F as r,n as i,t as a}from"./button-amTXFI-2.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./bug-BsuQ5ciQ.js";import{t as l}from"./download-CAuK-nZ6.js";import{t as u}from"./info-DsOyuMO9.js";import{t as d}from"./loader-circle-Cz7opInR.js";import{t as f}from"./x-CkSVp1Ok.js";import{t as p}from"./notice-DkcNAP8O.js";import{n as ee,t as m}from"./input-CoUmPnRU.js";import{t as h}from"./toggle-CDfguvUz.js";import{t as g}from"./dropdown-ByHOpeOU.js";import{t as _}from"./is-electron-y5bNUVyG.js";import{an as v}from"./sdk.gen-D-8W_bKa.js";import{t as y}from"./impersonate-version-flag-BhxfH6iZ.js";import{n as te}from"./auth-store-B0Vpa2Ej.js";import{t as b}from"./dist-DS5iJwBJ2.js";import{n as x}from"./diagnostics-COsnZMe5.js";import{L as S}from"./react-query.gen-DPzPS206.js";import{Ai as ne,Ji as re,Ki as C,Vi as ie,ea as w}from"./index-6YxiY2Ly.js";var T=e(n(),1),ae=e(r(),1),E=`vellum:debug:`;function oe(){let e={};if(typeof window>`u`)return e;try{for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);if(n===null||!n.startsWith(E))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function D(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:y()},overrides:oe()}}var O=t({ShareFeedbackModal:()=>z}),k=s(),A=[{value:`bug_report`,label:`Bug Report`,icon:c,includesLogsByDefault:!0},{value:`feature_request`,label:`Feature Request`,icon:w,includesLogsByDefault:!1},{value:`other`,label:`Other`,icon:C,includesLogsByDefault:!1}],j=[{value:`past_hour`,label:`Past hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,label:`Past 24 hours`,cutoffMs:1440*60*1e3},{value:`all_time`,label:`All time`,cutoffMs:null}],se=j.map(e=>({value:e.value,label:e.label})),M=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),N=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),P=10,F=50*1024*1024,ce={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function le(){return _()?`electron`:b.getPlatform()===`ios`?`ios`:`web`}function ue(e){if(e.size>F)return!1;if(e.type&&M.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?N.has(t):!1}return!1}function I(e,t){let n=Math.ceil(t.length/512),r=new Uint8Array(512+n*512),i=new TextEncoder,a=(e,t,n)=>{let a=i.encode(e);r.set(a.slice(0,n),t)},o=(e,t,n)=>{a(e.toString(8).padStart(n-1,`0`)+`\0`,t,n)};a(e,0,100),o(420,100,8),o(0,108,8),o(0,116,8),o(t.length,124,12),o(Math.floor(Date.now()/1e3),136,12);for(let e=148;e<156;e++)r[e]=32;r[156]=48,a(`ustar\0`,257,6),a(`00`,263,2);let s=0;for(let e=0;e<512;e++)s+=r[e];return o(s,148,7),r[155]=32,r.set(t,512),r}async function L(e,t){try{let n={};t.window.startTime!=null&&(n.startTime=t.window.startTime,n.endTime=t.window.endTime),t.activeConversationId&&(n.conversationId=t.activeConversationId);let{data:r,error:i}=await v({path:{assistant_id:e},body:n,parseAs:`blob`,throwOnError:!1});if(i||!(r instanceof Blob))return null;let a=await r.arrayBuffer();return new Uint8Array(a)}catch{return null}}async function R(e,t,n,r={}){if(typeof CompressionStream>`u`)return null;let{diagnosticsProvider:i,doctorSessionId:a,extraLogFiles:o=[]}=r,s=new Date,c=j.find(t=>t.value===e),l=s.getTime(),u=c?.cutoffMs==null?null:l-c.cutoffMs,d=u==null?null:new Date(u).toISOString(),f=null;try{f=i?.()??null}catch{f=null}let p=x(f),ee={collected_at:s.toISOString(),time_range:e,cutoff:d,log_window:{start_time_ms:u,end_time_ms:l},assistant_id:t,active_conversation_id:n,doctor_session_id:a??null,user_agent:typeof navigator<`u`?navigator.userAgent:``,language:typeof navigator<`u`?navigator.language:``,platform:typeof navigator<`u`?navigator.platform:``,url:typeof window<`u`?window.location.href:``,viewport:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:null,screen:typeof screen<`u`?{width:screen.width,height:screen.height}:null,connection:typeof navigator<`u`&&`connection`in navigator?{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}:null,deviceMemory:typeof navigator<`u`&&`deviceMemory`in navigator?navigator.deviceMemory:null,hardwareConcurrency:typeof navigator<`u`?navigator.hardwareConcurrency:null},m=new TextEncoder,h=m.encode(JSON.stringify(ee,null,2)),g=m.encode(JSON.stringify(p,null,2)),v=[I(`web-client-context.json`,h),I(`web-chat-diagnostics.json`,g)],y=new TextEncoder().encode(JSON.stringify(D(),null,2));v.push(I(`web-debug-flags.json`,y));for(let e of o){let t=e.contents.trim();t&&v.push(I(e.filename,m.encode(t)))}try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t={clientMessages:e.getClientMessages?.()??null,transcriptItems:e.getTranscriptItems?.()??null,pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},n=new TextEncoder().encode(JSON.stringify(t,null,2));v.push(I(`web-chat-debug-api-triage.json`,n))}}catch{}try{let e=typeof window<`u`?window._vellumDebug?.events:null;if(e){let t={focus:typeof document<`u`?{hasFocus:typeof document.hasFocus==`function`?document.hasFocus():null,visibilityState:document.visibilityState}:null,clients:e.getClients().map(({abortSignal:e,...t})=>({...t,aborted:e.aborted})),events:e.getEvents()},n=new TextEncoder().encode(JSON.stringify(t,null,2));v.push(I(`web-sse-liveness-triage.json`,n))}}catch{}if(_()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));v.push(I(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);v.push(I(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await L(t,{window:{startTime:u,endTime:l},activeConversationId:n});e&&v.push(I(`platform-logs.tar.gz`,e))}v.push(new Uint8Array(1024));let te=v.reduce((e,t)=>e+t.length,0),b=new Uint8Array(te),S=0;for(let e of v)b.set(e,S),S+=e.length;let ne=new Blob([b.buffer]),re=await new Response(ne.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([re],`web-client-logs-${s.getTime()}.tar.gz`,{type:`application/gzip`})}function z({open:e,onClose:t,initialReason:n,initialMessage:r,onSubmitted:s,assistantId:c,assistantVersion:v,activeConversationId:y,doctorSessionId:b,doctorSessionLog:x,getDiagnosticsSnapshot:C}){let w=te.use.user(),E=w?.email,oe=w?.isStaff??!1,D=(0,T.useId)(),O=(0,T.useRef)(null),j=(0,T.useRef)(null),M=(0,T.useRef)(null),N=(0,T.useRef)(null),[F,I]=(0,T.useState)(n??`bug_report`),[L,z]=(0,T.useState)(``),[B,pe]=(0,T.useState)(``),[V,H]=(0,T.useState)(A.find(e=>e.value===(n??`bug_report`))?.includesLogsByDefault??!0),[me,he]=(0,T.useState)(!1),[U,W]=(0,T.useState)(`past_hour`),[G,K]=(0,T.useState)([]),[ge,q]=(0,T.useState)(null),[_e,J]=(0,T.useState)(!1),[Y,ve]=(0,T.useState)(!1),[X,ye]=(0,T.useState)(!1),Z=o(S()),[be,Q]=(0,T.useState)(!1),$=Z.isPending||be,xe=!E,Se=(0,T.useMemo)(()=>L.trim().length>0&&B.trim().length>0,[L,B]);(0,T.useEffect)(()=>{if(!e)return;let t=n??`bug_report`;I(t),z(r??``),pe(E??``),H(A.find(e=>e.value===t)?.includesLogsByDefault??!0),he(!1),W(`past_hour`),K([]),ve(!1),ye(!1),q(null),Q(!1),Z.reset();let i=setTimeout(()=>{E?M.current?.focus():N.current?.focus()},50);return()=>clearTimeout(i)},[e]),(0,T.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e]);let Ce=e=>{I(e),me||H(A.find(t=>t.value===e)?.includesLogsByDefault??!1)},we=()=>{H(e=>!e),he(!0)},Te=x?.trim()?[{filename:`doctor-session.txt`,contents:x}]:[],Ee=(0,T.useCallback)(e=>{e.key===`Escape`&&!$&&t()},[t,$]),De=(0,T.useCallback)(e=>{e.target===O.current&&!$&&t()},[t,$]),Oe=(0,T.useCallback)(e=>{K(t=>{let n=P-t.length;if(n<=0)return t;let r=new Set(t.map(e=>`${e.name}:${e.size}`)),i=[];for(let t of e){if(i.length>=n)break;if(!ue(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),ke=e=>{e.target.files&&Oe(Array.from(e.target.files)),e.target.value=``},Ae=e=>{e.preventDefault(),J(!1),e.dataTransfer.files?.length&&Oe(Array.from(e.dataTransfer.files))},je=e=>{e.preventDefault(),J(!0)},Me=e=>{e.preventDefault(),e.currentTarget===e.target&&J(!1)},Ne=e=>{K(t=>t.filter((t,n)=>n!==e))};return e?(0,ae.createPortal)((0,k.jsx)(`div`,{ref:O,role:`dialog`,"aria-modal":`true`,"aria-labelledby":D,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:Ee,onClick:De,onDrop:Ae,onDragOver:je,onDragLeave:Me,children:(0,k.jsxs)(`div`,{className:`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,style:{backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,k.jsx)(`h2`,{id:D,className:`!m-0 text-title-small text-[var(--content-default)]`,children:`Share Feedback`}),(0,k.jsx)(a,{variant:`ghost`,iconOnly:(0,k.jsx)(f,{}),onClick:t,disabled:$,"aria-label":`Close`,tintColor:`var(--content-secondary)`})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${$?`pointer-events-none opacity-60`:``}`,children:[oe&&(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-2.5`,children:[(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,k.jsx)(h,{checked:X,onChange:()=>ye(e=>!e),"aria-label":`Download diagnostics directly`}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Download diagnostics directly`})]}),(0,k.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Admin only — builds the diagnostics archive locally and downloads it instead of submitting feedback or notifying Slack.`})]}),X?(0,k.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,k.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Time range`}),(0,k.jsx)(g,{options:se,value:U,onChange:W,"aria-label":`Diagnostics time range`})]}):(0,k.jsxs)(k.Fragment,{children:[xe&&(0,k.jsx)(m,{id:`${D}-email`,ref:N,label:`Email`,type:`email`,placeholder:`you@example.com`,value:B,onChange:e=>pe(e.target.value),leftIcon:(0,k.jsx)(re,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Category`}),(0,k.jsx)(`div`,{className:`flex gap-2`,children:A.map(e=>(0,k.jsx)(de,{option:e,isSelected:F===e.value,onSelect:()=>Ce(e.value)},e.value))})]}),(0,k.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),F===`bug_report`&&(0,k.jsxs)(p,{tone:`info`,children:[`Tip: Get faster support by posting in our`,` `,(0,k.jsx)(`a`,{href:`https://vellum.ai/community`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`Discord community`})]}),F===`feature_request`&&(0,k.jsxs)(p,{tone:`info`,children:[`Tip: Vote on features on our`,` `,(0,k.jsx)(`a`,{href:`https://vellum.ai/roadmap`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`public roadmap`})]}),(0,k.jsx)(ee,{id:`${D}-message`,ref:M,label:F===`bug_report`?`What went wrong?`:F===`feature_request`?`Describe your idea`:`What's on your mind?`,rows:3,placeholder:F===`bug_report`?`What did you expect to happen, and what happened instead?`:F===`feature_request`?`What problem would this solve for you?`:`Share your thoughts...`,value:L,onChange:e=>z(e.target.value),fullWidth:!0}),F!==`feature_request`&&(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,k.jsx)(h,{checked:V,onChange:we,"aria-label":`Include browser diagnostics`}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include diagnostics`})]}),(0,k.jsx)(i,{content:`Diagnostics include browser context, assistant logs, and timestamps — never passwords or credentials.`,children:(0,k.jsx)(`button`,{type:`button`,"aria-label":`About diagnostics`,className:`inline-flex items-center justify-center text-[var(--content-tertiary)]`,children:(0,k.jsx)(u,{className:`h-3.5 w-3.5`})})})]}),V&&(0,k.jsx)(g,{options:se,value:U,onChange:W,"aria-label":`Diagnostics time range`})]}),_()&&y&&F!==`feature_request`&&(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,k.jsx)(h,{checked:Y,onChange:()=>ve(e=>!e),"aria-label":`Include the most recent conversation`}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include the most recent conversation`})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Attachments`,G.length>0&&(0,k.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,G.length,`/`,P]})]}),(0,k.jsx)(a,{variant:`outlined`,size:`compact`,leftIcon:(0,k.jsx)(ie,{}),onClick:()=>j.current?.click(),disabled:G.length>=P,children:`Add files`}),(0,k.jsx)(`input`,{ref:j,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:ke,className:`hidden`})]}),G.length>0&&(0,k.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:G.map((e,t)=>(0,k.jsx)(fe,{file:e,onRemove:()=>Ne(t)},`${e.name}-${t}`))}),_e&&(0,k.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Drop files to attach…`})]})]}),ge&&(0,k.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:ge})]}),(0,k.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:$?(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,k.jsx)(d,{className:`h-4 w-4 animate-spin`}),X?`Preparing diagnostics…`:`Sending feedback…`]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(a,{variant:`ghost`,onClick:t,children:`Cancel`}),X?(0,k.jsx)(a,{variant:`primary`,leftIcon:(0,k.jsx)(l,{}),onClick:async()=>{if(!$){q(null),Q(!0);try{let e=await R(U,c??null,_()?Y?y??null:null:y??null,{diagnosticsProvider:C,doctorSessionId:b,extraLogFiles:Te});if(!e){q(`Diagnostics export isn't supported in this browser.`);return}let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=e.name,document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),0),t()}catch(e){q(e instanceof Error?e.message:`Failed to build diagnostics. Please try again.`)}finally{Q(!1)}}},children:`Download diagnostics`}):(0,k.jsx)(a,{variant:`primary`,leftIcon:(0,k.jsx)(ne,{}),onClick:async()=>{if(!(!Se||$)){q(null),Q(!0);try{let e=V&&F!==`feature_request`?await R(U,c??null,_()?Y?y??null:null:y??null,{diagnosticsProvider:C,doctorSessionId:b,extraLogFiles:Te}):null;await Z.mutateAsync({headers:{"Content-Type":null},body:{message:L.trim(),classification:ce[F],email:B.trim(),client:le(),client_version:void 0,...c?{assistant_id:c}:{},...v?{assistant_version:v}:{},...b?{doctor_session_id:b}:{},...e?{logs_file:e}:{},...G.length?{attachments:G}:{}},bodySerializer:e=>{let t=new FormData;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`attachments`&&Array.isArray(r)){for(let e of r)t.append(`attachments`,e);continue}r instanceof Blob?t.append(n,r):t.append(n,String(r))}return t}}),s?.(),t()}catch(e){q(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Q(!1)}}},disabled:!Se,children:`Submit`})]})})]})}),document.body):null}function de({option:e,isSelected:t,onSelect:n}){let r=e.icon;return(0,k.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,className:`flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-left transition-colors`,style:{borderColor:t?`var(--primary-base)`:`var(--border-base)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:`transparent`},children:[(0,k.jsx)(r,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,k.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:e.label})]})}function fe({file:e,onRemove:t}){let n=e.type.startsWith(`image/`),r=(0,T.useMemo)(()=>n?URL.createObjectURL(e):null,[e,n]);return(0,T.useEffect)(()=>{if(r)return()=>URL.revokeObjectURL(r)},[r]),(0,k.jsxs)(`div`,{className:`relative flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)]`,title:e.name,children:[n&&r?(0,k.jsx)(`img`,{src:r,alt:e.name,className:`h-full w-full object-cover`}):(0,k.jsx)(ie,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,k.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,k.jsx)(f,{}),onClick:t,"aria-label":`Remove ${e.name}`,className:`absolute top-0.5 right-0.5 h-4 w-4 rounded-full bg-black/60 text-white hover:bg-black/70`,tintColor:`#fff`})]})}export{O as n,z as t};
|
|
1
|
+
import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-DJZBPgpf.js";import{F as r,n as i,t as a}from"./button-amTXFI-2.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./bug-BsuQ5ciQ.js";import{t as l}from"./download-CAuK-nZ6.js";import{t as u}from"./info-DsOyuMO9.js";import{t as d}from"./loader-circle-Cz7opInR.js";import{t as f}from"./x-CkSVp1Ok.js";import{t as p}from"./notice-DkcNAP8O.js";import{n as ee,t as m}from"./input-CoUmPnRU.js";import{t as h}from"./toggle-CDfguvUz.js";import{t as g}from"./dropdown-ByHOpeOU.js";import{t as _}from"./is-electron-y5bNUVyG.js";import{in as v}from"./sdk.gen-jDeNbBv8.js";import{t as y}from"./impersonate-version-flag-BhxfH6iZ.js";import{n as te}from"./auth-store-CKsDsnkp.js";import{t as b}from"./dist-DS5iJwBJ2.js";import{n as x}from"./diagnostics-COsnZMe5.js";import{L as S}from"./react-query.gen-DPzPS206.js";import{Ai as ne,Ji as re,Ki as C,Vi as ie,ea as w}from"./index-DQjUULFO.js";var T=e(n(),1),ae=e(r(),1),E=`vellum:debug:`;function oe(){let e={};if(typeof window>`u`)return e;try{for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);if(n===null||!n.startsWith(E))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function D(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:y()},overrides:oe()}}var O=t({ShareFeedbackModal:()=>z}),k=s(),A=[{value:`bug_report`,label:`Bug Report`,icon:c,includesLogsByDefault:!0},{value:`feature_request`,label:`Feature Request`,icon:w,includesLogsByDefault:!1},{value:`other`,label:`Other`,icon:C,includesLogsByDefault:!1}],j=[{value:`past_hour`,label:`Past hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,label:`Past 24 hours`,cutoffMs:1440*60*1e3},{value:`all_time`,label:`All time`,cutoffMs:null}],se=j.map(e=>({value:e.value,label:e.label})),M=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),N=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),P=10,F=50*1024*1024,ce={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function le(){return _()?`electron`:b.getPlatform()===`ios`?`ios`:`web`}function ue(e){if(e.size>F)return!1;if(e.type&&M.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?N.has(t):!1}return!1}function I(e,t){let n=Math.ceil(t.length/512),r=new Uint8Array(512+n*512),i=new TextEncoder,a=(e,t,n)=>{let a=i.encode(e);r.set(a.slice(0,n),t)},o=(e,t,n)=>{a(e.toString(8).padStart(n-1,`0`)+`\0`,t,n)};a(e,0,100),o(420,100,8),o(0,108,8),o(0,116,8),o(t.length,124,12),o(Math.floor(Date.now()/1e3),136,12);for(let e=148;e<156;e++)r[e]=32;r[156]=48,a(`ustar\0`,257,6),a(`00`,263,2);let s=0;for(let e=0;e<512;e++)s+=r[e];return o(s,148,7),r[155]=32,r.set(t,512),r}async function L(e,t){try{let n={};t.window.startTime!=null&&(n.startTime=t.window.startTime,n.endTime=t.window.endTime),t.activeConversationId&&(n.conversationId=t.activeConversationId);let{data:r,error:i}=await v({path:{assistant_id:e},body:n,parseAs:`blob`,throwOnError:!1});if(i||!(r instanceof Blob))return null;let a=await r.arrayBuffer();return new Uint8Array(a)}catch{return null}}async function R(e,t,n,r={}){if(typeof CompressionStream>`u`)return null;let{diagnosticsProvider:i,doctorSessionId:a,extraLogFiles:o=[]}=r,s=new Date,c=j.find(t=>t.value===e),l=s.getTime(),u=c?.cutoffMs==null?null:l-c.cutoffMs,d=u==null?null:new Date(u).toISOString(),f=null;try{f=i?.()??null}catch{f=null}let p=x(f),ee={collected_at:s.toISOString(),time_range:e,cutoff:d,log_window:{start_time_ms:u,end_time_ms:l},assistant_id:t,active_conversation_id:n,doctor_session_id:a??null,user_agent:typeof navigator<`u`?navigator.userAgent:``,language:typeof navigator<`u`?navigator.language:``,platform:typeof navigator<`u`?navigator.platform:``,url:typeof window<`u`?window.location.href:``,viewport:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:null,screen:typeof screen<`u`?{width:screen.width,height:screen.height}:null,connection:typeof navigator<`u`&&`connection`in navigator?{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}:null,deviceMemory:typeof navigator<`u`&&`deviceMemory`in navigator?navigator.deviceMemory:null,hardwareConcurrency:typeof navigator<`u`?navigator.hardwareConcurrency:null},m=new TextEncoder,h=m.encode(JSON.stringify(ee,null,2)),g=m.encode(JSON.stringify(p,null,2)),v=[I(`web-client-context.json`,h),I(`web-chat-diagnostics.json`,g)],y=new TextEncoder().encode(JSON.stringify(D(),null,2));v.push(I(`web-debug-flags.json`,y));for(let e of o){let t=e.contents.trim();t&&v.push(I(e.filename,m.encode(t)))}try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t={clientMessages:e.getClientMessages?.()??null,transcriptItems:e.getTranscriptItems?.()??null,pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},n=new TextEncoder().encode(JSON.stringify(t,null,2));v.push(I(`web-chat-debug-api-triage.json`,n))}}catch{}try{let e=typeof window<`u`?window._vellumDebug?.events:null;if(e){let t={focus:typeof document<`u`?{hasFocus:typeof document.hasFocus==`function`?document.hasFocus():null,visibilityState:document.visibilityState}:null,clients:e.getClients().map(({abortSignal:e,...t})=>({...t,aborted:e.aborted})),events:e.getEvents()},n=new TextEncoder().encode(JSON.stringify(t,null,2));v.push(I(`web-sse-liveness-triage.json`,n))}}catch{}if(_()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));v.push(I(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);v.push(I(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await L(t,{window:{startTime:u,endTime:l},activeConversationId:n});e&&v.push(I(`platform-logs.tar.gz`,e))}v.push(new Uint8Array(1024));let te=v.reduce((e,t)=>e+t.length,0),b=new Uint8Array(te),S=0;for(let e of v)b.set(e,S),S+=e.length;let ne=new Blob([b.buffer]),re=await new Response(ne.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([re],`web-client-logs-${s.getTime()}.tar.gz`,{type:`application/gzip`})}function z({open:e,onClose:t,initialReason:n,initialMessage:r,onSubmitted:s,assistantId:c,assistantVersion:v,activeConversationId:y,doctorSessionId:b,doctorSessionLog:x,getDiagnosticsSnapshot:C}){let w=te.use.user(),E=w?.email,oe=w?.isStaff??!1,D=(0,T.useId)(),O=(0,T.useRef)(null),j=(0,T.useRef)(null),M=(0,T.useRef)(null),N=(0,T.useRef)(null),[F,I]=(0,T.useState)(n??`bug_report`),[L,z]=(0,T.useState)(``),[B,pe]=(0,T.useState)(``),[V,H]=(0,T.useState)(A.find(e=>e.value===(n??`bug_report`))?.includesLogsByDefault??!0),[me,he]=(0,T.useState)(!1),[U,W]=(0,T.useState)(`past_hour`),[G,K]=(0,T.useState)([]),[ge,q]=(0,T.useState)(null),[_e,J]=(0,T.useState)(!1),[Y,ve]=(0,T.useState)(!1),[X,ye]=(0,T.useState)(!1),Z=o(S()),[be,Q]=(0,T.useState)(!1),$=Z.isPending||be,xe=!E,Se=(0,T.useMemo)(()=>L.trim().length>0&&B.trim().length>0,[L,B]);(0,T.useEffect)(()=>{if(!e)return;let t=n??`bug_report`;I(t),z(r??``),pe(E??``),H(A.find(e=>e.value===t)?.includesLogsByDefault??!0),he(!1),W(`past_hour`),K([]),ve(!1),ye(!1),q(null),Q(!1),Z.reset();let i=setTimeout(()=>{E?M.current?.focus():N.current?.focus()},50);return()=>clearTimeout(i)},[e]),(0,T.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e]);let Ce=e=>{I(e),me||H(A.find(t=>t.value===e)?.includesLogsByDefault??!1)},we=()=>{H(e=>!e),he(!0)},Te=x?.trim()?[{filename:`doctor-session.txt`,contents:x}]:[],Ee=(0,T.useCallback)(e=>{e.key===`Escape`&&!$&&t()},[t,$]),De=(0,T.useCallback)(e=>{e.target===O.current&&!$&&t()},[t,$]),Oe=(0,T.useCallback)(e=>{K(t=>{let n=P-t.length;if(n<=0)return t;let r=new Set(t.map(e=>`${e.name}:${e.size}`)),i=[];for(let t of e){if(i.length>=n)break;if(!ue(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),ke=e=>{e.target.files&&Oe(Array.from(e.target.files)),e.target.value=``},Ae=e=>{e.preventDefault(),J(!1),e.dataTransfer.files?.length&&Oe(Array.from(e.dataTransfer.files))},je=e=>{e.preventDefault(),J(!0)},Me=e=>{e.preventDefault(),e.currentTarget===e.target&&J(!1)},Ne=e=>{K(t=>t.filter((t,n)=>n!==e))};return e?(0,ae.createPortal)((0,k.jsx)(`div`,{ref:O,role:`dialog`,"aria-modal":`true`,"aria-labelledby":D,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:Ee,onClick:De,onDrop:Ae,onDragOver:je,onDragLeave:Me,children:(0,k.jsxs)(`div`,{className:`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,style:{backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,k.jsx)(`h2`,{id:D,className:`!m-0 text-title-small text-[var(--content-default)]`,children:`Share Feedback`}),(0,k.jsx)(a,{variant:`ghost`,iconOnly:(0,k.jsx)(f,{}),onClick:t,disabled:$,"aria-label":`Close`,tintColor:`var(--content-secondary)`})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${$?`pointer-events-none opacity-60`:``}`,children:[oe&&(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-2.5`,children:[(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,k.jsx)(h,{checked:X,onChange:()=>ye(e=>!e),"aria-label":`Download diagnostics directly`}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Download diagnostics directly`})]}),(0,k.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Admin only — builds the diagnostics archive locally and downloads it instead of submitting feedback or notifying Slack.`})]}),X?(0,k.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,k.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Time range`}),(0,k.jsx)(g,{options:se,value:U,onChange:W,"aria-label":`Diagnostics time range`})]}):(0,k.jsxs)(k.Fragment,{children:[xe&&(0,k.jsx)(m,{id:`${D}-email`,ref:N,label:`Email`,type:`email`,placeholder:`you@example.com`,value:B,onChange:e=>pe(e.target.value),leftIcon:(0,k.jsx)(re,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Category`}),(0,k.jsx)(`div`,{className:`flex gap-2`,children:A.map(e=>(0,k.jsx)(de,{option:e,isSelected:F===e.value,onSelect:()=>Ce(e.value)},e.value))})]}),(0,k.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),F===`bug_report`&&(0,k.jsxs)(p,{tone:`info`,children:[`Tip: Get faster support by posting in our`,` `,(0,k.jsx)(`a`,{href:`https://vellum.ai/community`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`Discord community`})]}),F===`feature_request`&&(0,k.jsxs)(p,{tone:`info`,children:[`Tip: Vote on features on our`,` `,(0,k.jsx)(`a`,{href:`https://vellum.ai/roadmap`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`public roadmap`})]}),(0,k.jsx)(ee,{id:`${D}-message`,ref:M,label:F===`bug_report`?`What went wrong?`:F===`feature_request`?`Describe your idea`:`What's on your mind?`,rows:3,placeholder:F===`bug_report`?`What did you expect to happen, and what happened instead?`:F===`feature_request`?`What problem would this solve for you?`:`Share your thoughts...`,value:L,onChange:e=>z(e.target.value),fullWidth:!0}),F!==`feature_request`&&(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,k.jsx)(h,{checked:V,onChange:we,"aria-label":`Include browser diagnostics`}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include diagnostics`})]}),(0,k.jsx)(i,{content:`Diagnostics include browser context, assistant logs, and timestamps — never passwords or credentials.`,children:(0,k.jsx)(`button`,{type:`button`,"aria-label":`About diagnostics`,className:`inline-flex items-center justify-center text-[var(--content-tertiary)]`,children:(0,k.jsx)(u,{className:`h-3.5 w-3.5`})})})]}),V&&(0,k.jsx)(g,{options:se,value:U,onChange:W,"aria-label":`Diagnostics time range`})]}),_()&&y&&F!==`feature_request`&&(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,k.jsx)(h,{checked:Y,onChange:()=>ve(e=>!e),"aria-label":`Include the most recent conversation`}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include the most recent conversation`})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Attachments`,G.length>0&&(0,k.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,G.length,`/`,P]})]}),(0,k.jsx)(a,{variant:`outlined`,size:`compact`,leftIcon:(0,k.jsx)(ie,{}),onClick:()=>j.current?.click(),disabled:G.length>=P,children:`Add files`}),(0,k.jsx)(`input`,{ref:j,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:ke,className:`hidden`})]}),G.length>0&&(0,k.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:G.map((e,t)=>(0,k.jsx)(fe,{file:e,onRemove:()=>Ne(t)},`${e.name}-${t}`))}),_e&&(0,k.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Drop files to attach…`})]})]}),ge&&(0,k.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:ge})]}),(0,k.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:$?(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,k.jsx)(d,{className:`h-4 w-4 animate-spin`}),X?`Preparing diagnostics…`:`Sending feedback…`]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(a,{variant:`ghost`,onClick:t,children:`Cancel`}),X?(0,k.jsx)(a,{variant:`primary`,leftIcon:(0,k.jsx)(l,{}),onClick:async()=>{if(!$){q(null),Q(!0);try{let e=await R(U,c??null,_()?Y?y??null:null:y??null,{diagnosticsProvider:C,doctorSessionId:b,extraLogFiles:Te});if(!e){q(`Diagnostics export isn't supported in this browser.`);return}let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=e.name,document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),0),t()}catch(e){q(e instanceof Error?e.message:`Failed to build diagnostics. Please try again.`)}finally{Q(!1)}}},children:`Download diagnostics`}):(0,k.jsx)(a,{variant:`primary`,leftIcon:(0,k.jsx)(ne,{}),onClick:async()=>{if(!(!Se||$)){q(null),Q(!0);try{let e=V&&F!==`feature_request`?await R(U,c??null,_()?Y?y??null:null:y??null,{diagnosticsProvider:C,doctorSessionId:b,extraLogFiles:Te}):null;await Z.mutateAsync({headers:{"Content-Type":null},body:{message:L.trim(),classification:ce[F],email:B.trim(),client:le(),client_version:void 0,...c?{assistant_id:c}:{},...v?{assistant_version:v}:{},...b?{doctor_session_id:b}:{},...e?{logs_file:e}:{},...G.length?{attachments:G}:{}},bodySerializer:e=>{let t=new FormData;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`attachments`&&Array.isArray(r)){for(let e of r)t.append(`attachments`,e);continue}r instanceof Blob?t.append(n,r):t.append(n,String(r))}return t}}),s?.(),t()}catch(e){q(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Q(!1)}}},disabled:!Se,children:`Submit`})]})})]})}),document.body):null}function de({option:e,isSelected:t,onSelect:n}){let r=e.icon;return(0,k.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,className:`flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-left transition-colors`,style:{borderColor:t?`var(--primary-base)`:`var(--border-base)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:`transparent`},children:[(0,k.jsx)(r,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,k.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:e.label})]})}function fe({file:e,onRemove:t}){let n=e.type.startsWith(`image/`),r=(0,T.useMemo)(()=>n?URL.createObjectURL(e):null,[e,n]);return(0,T.useEffect)(()=>{if(r)return()=>URL.revokeObjectURL(r)},[r]),(0,k.jsxs)(`div`,{className:`relative flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)]`,title:e.name,children:[n&&r?(0,k.jsx)(`img`,{src:r,alt:e.name,className:`h-full w-full object-cover`}):(0,k.jsx)(ie,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,k.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,k.jsx)(f,{}),onClick:t,"aria-label":`Remove ${e.name}`,className:`absolute top-0.5 right-0.5 h-4 w-4 rounded-full bg-black/60 text-white hover:bg-black/70`,tintColor:`#fff`})]})}export{O as n,z as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,t as i,u as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./typography-D5f7kt80.js";import{t as c}from"./arrow-left-DI9551VI.js";import{t as l}from"./chevron-right-DqqmezXC.js";import{i as u}from"./src-B2IjVySQ.js";import{t as d}from"./is-electron-y5bNUVyG.js";import{c as f}from"./routes-BbeIx_F9.js";import{Nn as p,fn as m,vr as h}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,t as i,u as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./typography-D5f7kt80.js";import{t as c}from"./arrow-left-DI9551VI.js";import{t as l}from"./chevron-right-DqqmezXC.js";import{i as u}from"./src-B2IjVySQ.js";import{t as d}from"./is-electron-y5bNUVyG.js";import{c as f}from"./routes-BbeIx_F9.js";import{Nn as p,fn as m,vr as h}from"./index-DQjUULFO.js";import{t as g}from"./use-edge-swipe-back-U9h8O8rp.js";var _=e(t(),1),v=o();function y({sidebar:e,children:t,actions:o,backHref:l,title:u=`Settings`,menuRoute:y=f.settings.root}){let{pathname:b}=a(),x=r(),S=b===y,C=h(),w=(0,_.useRef)(null),T=(0,_.useRef)(null);(0,_.useLayoutEffect)(()=>{T.current?.scrollTo(0,0)},[b]);let E=S?l:y;g({containerRef:w,onBack:(0,_.useCallback)(()=>{x(E)},[x,E]),enabled:C,navKey:b});let D=d(),O=S?`Back from ${u}`:`Back to ${u} menu`,k=(0,v.jsx)(n,{variant:`ghost`,iconOnly:(0,v.jsx)(c,{}),"aria-label":O,tintColor:`var(--content-secondary)`,onClick:()=>x(E)}),A=(0,v.jsx)(n,{asChild:!0,variant:`outlined`,"aria-label":`Back from ${u}`,className:`h-8 w-8 px-0`,tintColor:`var(--content-secondary)`,children:(0,v.jsx)(i,{to:l,className:`flex items-center justify-center no-underline`,children:(0,v.jsx)(c,{size:16,"aria-hidden":`true`})})});return(0,v.jsxs)(`div`,{ref:w,className:`flex h-full min-h-0 w-full flex-1 flex-col gap-4 p-4 sm:p-6 md:gap-0`,style:{paddingTop:D?`3.75rem`:`1rem`},children:[(0,v.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 md:hidden`,children:[k,(0,v.jsx)(s,{as:`h1`,variant:`body-large-default`,className:`flex-1 truncate text-center`,style:{color:`var(--content-tertiary)`,lineHeight:1.4},children:u}),(0,v.jsx)(`div`,{className:`h-10 w-10 shrink-0`,"aria-hidden":`true`})]}),D?(0,v.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 pb-4 empty:hidden`,children:[(0,v.jsx)(p,{placement:`electron`,className:`px-0 pt-0`}),(0,v.jsx)(m,{placement:`electron`,className:`px-0 pt-0`})]}):null,(0,v.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden md:rounded-[12px] md:border md:border-[var(--border-base)] md:bg-[var(--surface-overlay)]`,children:[(0,v.jsxs)(`div`,{className:`hidden shrink-0 items-center justify-between gap-4 px-6 py-5 md:flex`,children:[(0,v.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[A,(0,v.jsx)(`h1`,{className:`text-title-large truncate`,style:{color:`var(--content-emphasised)`,lineHeight:1.2},children:u})]}),(0,v.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:o})]}),(0,v.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,v.jsx)(`aside`,{className:`hidden w-64 shrink-0 overflow-y-auto md:block`,"aria-label":`${u} navigation`,children:e}),S?(0,v.jsx)(`div`,{className:`flex min-w-0 min-h-0 flex-1 flex-col overflow-y-auto overflow-x-hidden pb-6 md:hidden`,children:e}):null,(0,v.jsx)(`main`,{ref:T,className:`min-w-0 min-h-0 flex-1 flex-col gap-4 overflow-y-auto overflow-x-hidden pb-6 md:flex md:px-6 md:pt-0 ${S?`hidden`:`flex`}`,children:t})]})]})]})}function b({items:e,bottomItems:t,indexPath:n}){let{pathname:i}=a(),o=r(),s=h(),c=(e,t,r)=>{let{href:a,onSelect:c}=e,d=a!=null&&(i===a||i.startsWith(a+`/`)||!s&&r&&n!=null&&i===n);return(0,v.jsxs)(_.Fragment,{children:[(0,v.jsx)(u.Item,{icon:e.icon,label:e.label,active:d,trailingIcon:a==null?void 0:l,trailingIconClassName:a==null?void 0:`md:hidden`,href:a,onSelect:c,onClick:a==null?void 0:e=>{e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||(e.preventDefault(),o(a))}}),!t&&(0,v.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`my-2 h-px w-full bg-[var(--border-base)] md:hidden`})]},e.id)};return(0,v.jsxs)(`nav`,{"aria-label":`Sidebar navigation`,className:`flex min-h-full flex-col md:gap-2 md:px-6 md:pb-4`,children:[e.map((n,r)=>c(n,r===e.length-1&&!t?.length,r===0)),t&&t.length>0&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`div`,{className:`flex-1`}),(0,v.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`mx-0 my-2 h-px w-full bg-[var(--border-base)] md:mx-0`}),t.map((e,n)=>c(e,n===t.length-1,!1))]})]})}export{y as n,b as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{f as t}from"./native-biometric-Czaf9IqI.js";import{t as n}from"./react-DJZBPgpf.js";import{h as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{n as a,r as o}from"./login-flow-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{f as t}from"./native-biometric-Czaf9IqI.js";import{t as n}from"./react-DJZBPgpf.js";import{h as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{n as a,r as o}from"./login-flow-C4Ehxg-g.js";import{t as s}from"./proxy-BzlH_XAe.js";import{t as c}from"./AnimatePresence-C8APSgIu.js";import{lt as l}from"./index-DQjUULFO.js";import{t as u}from"./signup-shell-D4Afeijm.js";var d=e(n(),1),f=i();function p({words:e}){let[t,n]=(0,d.useState)(0),r=(0,d.useMemo)(()=>e.reduce((e,t)=>e.length>=t.length?e:t),[e]);return(0,d.useEffect)(()=>{let t=setInterval(()=>{n(t=>(t+1)%e.length)},2400);return()=>clearInterval(t)},[e.length]),(0,f.jsxs)(`span`,{className:`signup__rotating`,children:[(0,f.jsxs)(`span`,{className:`signup__rotating-sizer`,"aria-hidden":!0,children:[r,`.`]}),(0,f.jsx)(c,{mode:`wait`,children:(0,f.jsxs)(s.em,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.3,ease:`easeInOut`},children:[e[t],`.`]},e[t])})]})}var m=[`Personal Intelligence`,`Software Engineer`,`Finance Ops`,`Household Manager`,`GTM Engineer`,`Product Lead`];function h({returnTo:e}){let[n,r]=(0,d.useState)(null),i=o(e,{authIntent:`signup`});return(0,f.jsxs)(u,{children:[(0,f.jsxs)(`h1`,{className:`signup__title`,children:[`Meet your new`,(0,f.jsx)(`br`,{}),(0,f.jsx)(p,{words:m})]}),(0,f.jsx)(`p`,{className:`signup__subtitle`,children:`The most powerful assistant that can handle your work and life admin tasks.`}),(0,f.jsx)(`div`,{className:`signup__buttons`,children:(0,f.jsx)(`button`,{type:`button`,className:`signup__btn`,onClick:()=>{r(null),t(a,i,{returnTo:e,intent:`signup`}).catch(e=>{console.error(`[signup] auth flow failed:`,e),r(`Something went wrong. Please try again.`)})},children:`Continue`})}),n&&(0,f.jsx)(`p`,{className:`signup__error`,children:n}),(0,f.jsxs)(`p`,{className:`signup__footer`,children:[`Already have an account?`,` `,(0,f.jsx)(`button`,{type:`button`,className:`signup__link`,onClick:()=>{r(null),t(a,o(e),{returnTo:e}).catch(e=>{console.error(`[signup] sign-in flow failed:`,e),r(`Something went wrong. Please try again.`)})},children:`Sign in`})]}),(0,f.jsxs)(`a`,{className:`signup__download`,href:`/downloads`,children:[(0,f.jsx)(l,{size:16}),`Download for macOS`]})]})}function g(){let[e]=r();return(0,f.jsx)(h,{returnTo:e.get(`returnTo`)})}export{g as SignupPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n}from"./button-amTXFI-2.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./typography-D5f7kt80.js";import{gt as a,ht as o,m as s,mt as c,p as l,pt as u}from"./risk-CrkyJx_W.js";import{t as d}from"./brain-BLDXGaUy.js";import{t as f}from"./check-DFNrQERi.js";import{t as p}from"./circle-alert-zOqdmf25.js";import{t as m}from"./circle-check-VSiny8yl.js";import{t as h}from"./code-Czx7d7SK.js";import{t as g}from"./file-text-CYJz-GvF.js";import{t as _}from"./globe-4qSOWE2N.js";import{t as v}from"./monitor-DfbL8_59.js";import{t as y}from"./sparkles-PGiR5v1g.js";import{t as ee}from"./triangle-alert-Z0Gq0IuB.js";import{t as b}from"./user-plus-DMh4_UTz.js";import"./src-B2IjVySQ.js";import{t as x}from"./popover-CFL4WZTr.js";import{T as te,w as S}from"./chat-B8mgARYR.js";import{t as C}from"./misc-BYQPh7vS.js";import{t as ne}from"./proxy-BzlH_XAe.js";import{t as re}from"./AnimatePresence-C8APSgIu.js";import{t as ie}from"./use-reduced-motion-CcGT6CHV.js";import{t as ae}from"./three-dot-indicator-BVtP8eei.js";var w=e(t(),1),oe=.44;function se(e,t){let n=[...e].sort((e,t)=>e.position-t.position),r=n[0]?.color??`white`,i=n[n.length-1]?.color??`white`,a=n.map(e=>{let t=(e.position-.5)*2*oe;return`${e.color} calc(50% + var(--gs-spread-mid) * ${t.toFixed(4)})`}).join(`, `);return[`linear-gradient(${t}deg`,`var(--gs-base) calc(50% - var(--gs-spread))`,`color-mix(in oklab, var(--gs-base) 42%, ${r}) calc(50% - var(--gs-spread-mid))`,a,`color-mix(in oklab, var(--gs-base) 42%, ${i}) calc(50% + var(--gs-spread-mid))`,`var(--gs-base) calc(50% + var(--gs-spread)))`].join(`, `)}var T={sunrise:[{color:`#B6D3EF`,position:0},{color:`#CAD1D7`,position:.153},{color:`#D7CFC8`,position:.252},{color:`#E1CDB9`,position:.341},{color:`#EAC6A5`,position:.424},{color:`#EDB185`,position:.505},{color:`#EF9B62`,position:.586},{color:`#F18F60`,position:.669},{color:`#F48D7A`,position:.758},{color:`#F78A94`,position:.857},{color:`#F888A0`,position:1}],bubble:[{color:`#F5EBD9`,position:0},{color:`#F2D4DB`,position:.31},{color:`#EBBDDE`,position:.5},{color:`#CCBAE3`,position:.65},{color:`#8CBFF0`,position:.82},{color:`#78B0FF`,position:1}],peach:[{color:`#D9F5FA`,position:0},{color:`#FCD9D6`,position:.31},{color:`#FCBAC9`,position:.61},{color:`#F0B3F5`,position:1}],tonic:[{color:`#E3EDF0`,position:0},{color:`#E8EBB8`,position:.27},{color:`#F0DEA3`,position:.43},{color:`#E8B078`,position:.75},{color:`#F29682`,position:1}],mint:[{color:`#DECEE8`,position:0},{color:`#CBBAEE`,position:.21},{color:`#7DC0FB`,position:.46},{color:`#00C7A6`,position:1}],spring:[{color:`#F7D5C5`,position:.07},{color:`#46A8C0`,position:.58},{color:`#43AE7D`,position:1}],twilight:[{color:`#E3CCE6`,position:0},{color:`#4E8CD5`,position:.35},{color:`#6068C2`,position:.64},{color:`#38364E`,position:1}],bay:[{color:`#DBE3D0`,position:0},{color:`#8DB8A7`,position:.23},{color:`#2D8E9A`,position:.42},{color:`#076492`,position:.59},{color:`#154288`,position:.79},{color:`#262C81`,position:1}]},ce={smooth:`cubic-bezier(0.45, 0, 0.55, 1)`,gentle:`cubic-bezier(0.76, 0, 0.24, 1)`,snappy:`cubic-bezier(0.3, 0, 0.2, 1)`};function le(){return typeof window>`u`?!0:typeof window.CSS?.supports==`function`?window.CSS.supports(`background-clip`,`text`)||window.CSS.supports(`-webkit-background-clip`,`text`):!1}function ue(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}var de=`160px`,fe=120;function pe(e,{pauseOnScroll:t,pauseWhenOffscreen:n},r){if(typeof window>`u`)return()=>{};let i=!n||typeof IntersectionObserver>`u`,a=typeof document>`u`?!0:!document.hidden,o=!0,s=()=>r(i&&a&&o),c;n&&typeof IntersectionObserver<`u`&&(c=new IntersectionObserver(e=>{let t=e[e.length-1];t&&(i=t.isIntersecting,s())},{rootMargin:de}),c.observe(e));let l=()=>{a=!document.hidden,s()};document.addEventListener(`visibilitychange`,l);let u,d=()=>{o=!1,s(),clearTimeout(u),u=setTimeout(()=>{o=!0,s()},fe)};return t&&window.addEventListener(`scroll`,d,{passive:!0,capture:!0}),s(),()=>{c?.disconnect(),document.removeEventListener(`visibilitychange`,l),t&&window.removeEventListener(`scroll`,d,{capture:!0}),clearTimeout(u)}}var me=96,E=48,D=.72,O=14,he=1.45,ge=3,k=105;function _e(e){return e?typeof e==`string`?T[e]??T.sunrise:e:T.sunrise}function A(e,t){return Number.isFinite(e)?e:t}function ve(e){e.style.removeProperty(`background-image`),e.style.removeProperty(`-webkit-text-fill-color`)}function ye({children:e,gradient:t,easing:n=`smooth`,duration:r=he,spread:i=ge,angle:a=k,pauseBetween:o=1e3,baseColor:s=`currentColor`,pauseOnScroll:c=!0,pauseWhenOffscreen:l=!0,respectReducedMotion:u=!0,as:d=`span`,className:f,style:p,...m}){let h=(0,w.useRef)(null),g=Math.max(.001,A(r,he)),_=Math.max(0,A(i,ge)),v=A(a,k),y=(0,w.useMemo)(()=>_e(t),[t]),ee=(0,w.useMemo)(()=>se(y,v),[y,v]),b=ce[n]??ce.smooth,x=Math.min(e.length*_,E);(0,w.useEffect)(()=>{let t=h.current;if(!t)return;let n=()=>{let n=t.getBoundingClientRect().width||me,r=(Number.parseFloat(getComputedStyle(t).fontSize)||O)/O,i=Math.min(e.length*_*r,E*r),a=Math.max(1,n+i*2),o=-i-a/2,s=n+i-a/2,c=g*1e3;return t.style.setProperty(`--gs-spread`,`${i}px`),t.style.setProperty(`--gs-spread-mid`,`${i*D}px`),t.style.backgroundSize=`${a}px 100%`,{start:o,end:s,durationMs:c}};if(!le()){ve(t);return}if(n(),u&&ue()||typeof t.animate!=`function`)return;let r=null,i,a=!0,s=!1,d=()=>{if(s)return;let{start:e,end:c,durationMs:l}=n(),u=t.animate([{backgroundPosition:`${e}px center`},{backgroundPosition:`${c}px center`}],{duration:l,easing:b,fill:`forwards`});a||u.pause(),r?.cancel(),r=u,u.onfinish=()=>{i=setTimeout(d,Math.max(0,o))}},f=pe(t,{pauseOnScroll:c,pauseWhenOffscreen:l},e=>{a=e,r&&(a?r.play():r.pause())});return d(),()=>{s=!0,r?.cancel(),clearTimeout(i),f()}},[e,_,g,b,o,c,l,u]);let te={position:`relative`,display:`inline-block`,backgroundImage:ee,backgroundRepeat:`no-repeat`,backgroundSize:`100% 100%`,backgroundColor:`var(--gs-base)`,WebkitBackgroundClip:`text`,backgroundClip:`text`,WebkitTextFillColor:`transparent`,"--gs-base":s,"--gs-spread":`${x}px`,"--gs-spread-mid":`${x*D}px`,...p};return(0,w.createElement)(d,{...m,ref:h,className:f,style:te},e)}var j=r();function be(e){let t=`color-mix(in srgb, ${e} 40%, white)`;return[{position:0,color:t},{position:.5,color:e},{position:1,color:t}]}var xe=`var(--avatar-accent, var(--content-emphasised))`;function M({children:e,colorHex:t,className:n,"data-testid":r}){let i=t??xe;return(0,j.jsx)(ye,{gradient:(0,w.useMemo)(()=>be(i),[i]),easing:`gentle`,duration:1.5,spread:6,angle:106,pauseBetween:0,pauseOnScroll:!1,baseColor:`color-mix(in srgb, currentColor 45%, transparent)`,className:n,"data-testid":r,children:e})}var Se=400;function Ce(e,t,n){let[r,i]=(0,w.useState)(e),a=(0,w.useRef)(null),o=(0,w.useRef)(null),s=(0,w.useRef)(null);return(0,w.useEffect)(()=>{if(Object.is(r,e)){o.current=null;return}if(n){s.current&&=(clearTimeout(s.current),null),o.current=null,i(e),a.current=Date.now();return}o.current=e;let c=Date.now();a.current===null&&(a.current=c);let l=c-a.current,u=Math.max(0,t-l);return s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{o.current!==null&&(i(o.current),a.current=Date.now(),o.current=null),s.current=null},u),()=>{s.current&&=(clearTimeout(s.current),null)}},[e,r,t,n]),r}function we({currentStepTitle:e,currentStepInfo:t,bypassDwell:n=!1,animationKey:r,shimmer:a=!1,inline:o=!1}){let s=ie(),c=Ce((0,w.useMemo)(()=>({title:e,info:t}),[e,t]),Se,n),l=s?{duration:0}:{duration:.25,ease:[.16,1,.3,1]},u=s?{opacity:0}:{y:-16,opacity:0},d=s?{opacity:1}:{y:0,opacity:1},f=s?{opacity:0}:{y:16,opacity:0},p=typeof c.info==`string`||typeof c.info==`number`,m=p?String(c.info):c.info==null?``:`node`,h=r??`${c.title}::${m}`,g=p?c.info!==``:c.info!=null,_=c.title.trim()!==``;return(0,j.jsx)(re,{initial:!1,mode:`popLayout`,children:(0,j.jsxs)(ne.span,{initial:u,animate:d,exit:f,transition:l,className:`flex min-w-0 flex-1 items-center gap-1`,children:[_?o?(0,j.jsx)(`span`,{className:g?`shrink-0 whitespace-nowrap text-[13px] font-medium leading-[16px] text-[var(--content-secondary)]`:`block min-w-0 flex-1 truncate text-left text-[13px] font-medium leading-[16px] text-[var(--content-secondary)]`,children:a?(0,j.jsx)(M,{children:c.title}):c.title}):(0,j.jsx)(i,{variant:`body-medium-default`,className:g?`ml-1 shrink-0 whitespace-nowrap text-[var(--content-emphasised)]`:`ml-1 block min-w-0 flex-1 truncate text-left text-[var(--content-emphasised)]`,children:a?(0,j.jsx)(M,{children:c.title}):c.title}):null,g?(0,j.jsxs)(j.Fragment,{children:[_?(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1 h-3.5 w-px shrink-0 bg-[var(--border-element)]`}):null,p?o&&!_?(0,j.jsx)(`span`,{className:`block min-w-0 flex-1 truncate text-left text-[13px] font-medium leading-[16px] text-[var(--content-secondary)]`,children:a&&typeof c.info==`string`?(0,j.jsx)(M,{children:c.info}):c.info}):(0,j.jsx)(i,{variant:_?`body-small-default`:`body-medium-default`,className:`ml-1 block min-w-0 flex-1 truncate text-left leading-[16px] ${_?`text-[var(--content-tertiary)]`:`text-[var(--content-emphasised)]`}`,children:a&&!_&&typeof c.info==`string`?(0,j.jsx)(M,{children:c.info}):c.info}):(0,j.jsx)(`span`,{className:`ml-1 block min-w-0 flex-1`,children:c.info})]}):null]},h)})}var Te=/^https?:\/\/\S+/,Ee=/^URL:\s*(https?:\/\/\S+)/i,De=/^\[\d+\]\s*(https?:\/\/\S+)/;function N(e){try{return new URL(e).hostname.replace(/^www\./,``)}catch{return``}}function Oe(e){let t=e.trim();return Ee.exec(t)?.[1]??De.exec(t)?.[1]??t}function ke(e){return e.trim().replace(/^\d+\.\s+/,``)}function Ae(e){let t=e.split(/\r?\n/),n=[],r=new Set,i=``;for(let e of t){let t=e.trim();if(!t){i=``;continue}let a=Oe(t);if(Te.test(a)){r.has(a)||(r.add(a),n.push({title:i,url:a})),i=``;continue}/^Web search results for /i.test(t)||/^Sources:?$/i.test(t)||(i=ke(t))}return n}function P(e){return!e||!e.trim()?[]:Ae(e).map((e,t)=>{let n=N(e.url);return{rank:t+1,title:e.title,url:e.url,domain:n}})}var F=5,je=new Set([`web_search`,`web_fetch`]);function I(e){if(!Number.isFinite(e)||e<1e3)return`<1s`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.round(t/60);return n<60?`${n}m`:`${Math.round(n/60)}h`}function L(e){return je.has(e.name)}function R(e){return e?`Searched the web`:`Searching the web`}function z(e){return{visible:e.slice(0,F),overflowResults:e.slice(F)}}function Me(e,t){let{visible:n,overflowResults:r}=z(e.results);return{kind:`web_search`,title:R(t),durationLabel:I(e.durationMs),linkCount:e.resultCount,results:n,overflowResults:r}}function Ne(e){let t=e.title??e.domain;return{kind:`thinking`,durationLabel:I(e.durationMs),text:`Reading ${t}`}}function Pe(){return{kind:`web_search`,title:`Searching the web`,durationLabel:``,linkCount:0,results:[]}}function Fe(){return{kind:`thinking`,durationLabel:``,text:`Reading…`}}function Ie(e){let t=P(e);if(t.length===0)return null;let{visible:n,overflowResults:r}=z(t);return{kind:`web_search`,title:R(!0),durationLabel:``,linkCount:t.length,results:n,overflowResults:r}}function Le(e){return{kind:`web_search_error`,title:`Web search failed`,durationLabel:I(e.durationMs),errorMessage:e.errorMessage??`Search is having trouble right now. You can try again in a moment, continue without web search, or paste the relevant details here and I'll use those.`}}function B(){return{kind:`web_search`,title:R(!0),durationLabel:``,linkCount:0,results:[]}}function V(e,t){return t[e.id]??e.activityMetadata}function H(e){return!S(e)}function U(e,t){return e.results.length>0?!1:!!e.errorMessage||!!t.isError}function W(e){return e.confirmationDecision===`denied`||e.confirmationDecision===`timed_out`?`denied`:e.isError?`error`:S(e)?`running`:`completed`}function G(e,t){return e==null||t==null?null:Math.max(0,t-e)}function K(e,t){let n=G(e,t);return n==null?``:I(n)}function q(e){return K(e.startedAt??void 0,e.completedAt??void 0)}function Re(e){return!l(e)&&S(e)}function ze(e,t){if(e.kind===`thinking`)return e.text?e.completedAt==null?e.startedAt!=null&&t!=null?Math.max(0,t-e.startedAt):null:G(e.startedAt,e.completedAt):null;let n=e.toolCall;if(l(n))return null;let r=te(n);return n.completedAt==null?S(n)&&r!=null&&t!=null?Math.max(0,t-r):null:G(r,n.completedAt)}function Be(e){return e.some(e=>e.kind===`thinking`?!!e.text&&e.startedAt!=null&&e.completedAt==null:Re(e.toolCall))}function Ve(e,t){let n=0,r=!1;for(let i of e){let e=ze(i,t);e!=null&&(r=!0,n+=e)}return r?I(n):``}function He(e){let{title:t,activity:n}=s(e);return{toolCallId:e.id,toolName:e.name,title:t,activity:n,input:e.input??{},result:e.result,streamedOutput:e.streamedOutput,status:W(e),riskLevel:e.riskLevel,riskReason:e.riskReason,durationLabel:q(e)}}function Ue(e){let{title:t,info:n,activity:r,iconName:i}=s(e);return{kind:`tool`,durationLabel:q(e),startedAt:e.startedAt??void 0,title:t,info:n,activity:r,riskLevel:e.riskLevel,iconName:i,toolCallId:e.id,status:W(e)}}function We(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(L(r)){let e=V(r,t),n=H(r);if(e?.webSearch&&U(e.webSearch,r))return`Web search failed`;if(r.name===`web_search`)return R(n);if(r.name===`web_fetch`)return`Thinking`}else return s(r).title}return``}function Ge(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(!L(r)){let{info:e,activity:t}=s(r);return t||e}let i=V(r,t),a=H(r);if(i?.webSearch){let e=i.webSearch;if(U(e,r))return e.errorMessage??`Search is having trouble right now. You can try again in a moment, continue without web search, or paste the relevant details here and I'll use those.`;if(e.results.length>0)return e.results[e.results.length-1].title;if(!a&&e.query)return`Searching ${e.query}`}if(i?.webFetch){let e=i.webFetch;return a?e.title??e.domain:`Reading ${e.domain}`}if(r.name===`web_search`){if(!a){let e=typeof r.input?.query==`string`?r.input.query.trim():``;return e?`Searching ${e}`:``}if(typeof r.result==`string`){let e=P(r.result);if(e.length>0){let t=e[e.length-1].title;if(t)return t}}}if(r.name===`web_fetch`){let e=typeof r.input?.url==`string`?r.input.url:``,t=e?N(e):``;if(t)return a?t:`Reading ${t}`}}return``}function Ke(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.name!==`web_search`)continue;let i=V(r,t)?.webSearch?.results;if(i&&i.length>0)return i}return[]}function qe(e){return e.includes(`denied`)?`denied`:e.includes(`loading`)?`loading`:e.includes(`error`)?`error`:`complete`}function Je(e){return qe(e.map(e=>e.confirmationDecision===`denied`||e.confirmationDecision===`timed_out`?`denied`:S(e)?`loading`:e.isError?`error`:`complete`))}function Ye(e,t){if(l(e))return null;if(!L(e))return Ue(e);let n=V(e,t),r=H(e);if(n?.webSearch){let t=n.webSearch;return U(t,e)?Le(t):Me(t,r)}return n?.webFetch?Ne(n.webFetch):r?e.name===`web_search`&&typeof e.result==`string`?Ie(e.result)??B():B():e.name===`web_search`?Pe():Fe()}function Xe(e,t,n){let r=e.filter(e=>e.kind===`toolCall`).map(e=>e.toolCall).filter(e=>!l(e)),i=[],a=null,o=0;for(let n of e){if(n.kind===`thinking`){n.text&&(i.push({kind:`thinking`,durationLabel:K(n.startedAt,n.completedAt),text:n.text,startedAt:n.startedAt,completedAt:n.completedAt,thinkingItemIndex:o++}),a=n.text);continue}let e=Ye(n.toolCall,t);e&&(i.push(e),a=null)}let s=Je(r),c,u,d;a===null?(c=We(r,t),u=Ge(r,t),d=`tool`):(c=`Thinking`,u=a,d=`thinking`);let f=Ke(r,t),p=`${i.length} step${i.length===1?``:`s`}`,m=Ve(e,n);return{currentStepTitle:c,currentStepInfo:u,currentStepKind:d,stepCount:p,totalDurationLabel:m,steps:i,state:s,carouselItems:f}}var J={code:h,terminal:u,file:g,globe:_,pen:o,monitor:v,plug:c,sparkle:y,"user-plus":b,bolt:a,brain:d};function Ze(e){if(e.kind===`thinking`)return`Thinking`;if(e.kind===`web_search`||e.kind===`web_search_error`)return`Searching the web`;if(e.kind===`tool_error`)return`Error`;let t=e.title;return t.startsWith(`Working`)?t:t===`Reading`||t===`Editing`||t.startsWith(`Running`)?`Working`:t===`Using a skill`?`Using a skill`:(t.startsWith(`Using `),t)}function Qe(e){if(!e||e===`<1s`)return 0;let t=/^(\d+)(s|m|h)$/.exec(e);if(!t)return 0;let n=Number(t[1]);switch(t[2]){case`h`:return n*36e5;case`m`:return n*6e4;default:return n*1e3}}function $e(e){let t=null;for(let n of e)(n.kind===`tool`||n.kind===`thinking`)&&n.startedAt!=null&&(t=t==null?n.startedAt:Math.min(t,n.startedAt));return t}function et(e){return new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`,second:`2-digit`})}function tt({durationLabel:e,startedAt:t}){let r=(0,j.jsx)(i,{variant:`label-medium-default`,className:`text-[var(--content-tertiary)]`,children:e});return t==null?r:(0,j.jsx)(n,{content:`Started at ${et(t)}`,side:`top`,align:`end`,children:(0,j.jsx)(`span`,{className:`cursor-default`,children:r})})}function Y(e){let t=0,n=!1;for(let r of e)r&&(n=!0,t+=Qe(r));return n?I(t):``}function X(e){if(e.length===0)return`running`;let t=!1;for(let n of e){if(n.kind===`tool`){if(n.status===`running`)return`running`;(n.status===`error`||n.status===`denied`)&&(t=!0);continue}if(n.kind===`web_search`){if(n.title===`Searching the web`)return`running`;continue}(n.kind===`tool_error`||n.kind===`web_search_error`)&&(t=!0)}return t?`failed`:`completed`}function nt(e){let t=[];for(let n of e){let e=Ze(n),r=t[t.length-1];r&&r.label===e?r.steps.push(n):t.push({label:e,steps:[n]})}return t}function rt({steps:e,renderStep:t,timeline:n=!1}){if(e.length===0)return null;let r=nt(e),i=[],a=0;for(let e of r)i.push(a),a+=e.steps.length;let o=(e,n)=>e.steps.map((e,r)=>{let i=ct(e,n+r);return(0,j.jsx)(w.Fragment,{children:t?t(e):(0,j.jsx)(dt,{step:e})},i)});return n?(0,j.jsx)(`div`,{className:`flex w-full flex-col`,children:r.map((e,t)=>(0,j.jsx)(it,{section:e,baseIndex:i[t],isLast:t===r.length-1,renderSectionSteps:o},`${e.label}-${t}`))}):(0,j.jsx)(`div`,{className:`flex w-full flex-col gap-3`,children:r.map((e,t)=>{let n=Y(e.steps.map(e=>`durationLabel`in e?e.durationLabel:``)),r=X(e.steps),a=i[t];return(0,j.jsxs)(`div`,{"data-testid":`phase-section`,"data-phase-label":e.label,className:`flex flex-col gap-1`,children:[(0,j.jsx)(lt,{label:e.label,durationLabel:n,status:r}),(0,j.jsx)(`div`,{className:`flex min-w-0 flex-col items-start gap-1 pl-[24px]`,children:o(e,a)})]},`${e.label}-${t}`)})})}function it({section:e,baseIndex:t,isLast:n,renderSectionSteps:r}){let a=Y(e.steps.map(e=>`durationLabel`in e?e.durationLabel:``)),o=X(e.steps),s=e.steps[0]?.kind===`thinking`;return(0,j.jsxs)(`div`,{"data-testid":`phase-section`,"data-phase-label":e.label,className:`relative flex flex-col gap-2`,children:[!n&&(0,j.jsx)(at,{}),(0,j.jsxs)(`div`,{"data-testid":`phase-header`,className:`flex items-center justify-between gap-2 py-[2px]`,children:[(0,j.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,j.jsx)(ot,{status:o,isThinking:s}),(0,j.jsx)(i,{variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:e.label})]}),a?(0,j.jsx)(tt,{durationLabel:a,startedAt:$e(e.steps)}):null]}),(0,j.jsx)(`div`,{className:C(`flex min-w-0 flex-col items-start gap-1 pl-[22px]`,!n&&`pb-3`),children:r(e,t)})]})}function at({className:e}){return(0,j.jsx)(`div`,{"aria-hidden":!0,className:C(`absolute bottom-0 left-[6.5px] top-6 w-px bg-[var(--border-element)]`,e)})}function ot({status:e,isThinking:t}){return t?(0,j.jsx)(d,{"aria-hidden":`true`,"data-testid":`phase-header-status-icon`,"data-status":`thinking`,className:`h-[14px] w-[14px] shrink-0 text-[var(--content-secondary)]`}):(0,j.jsx)(st,{status:e,testId:`phase-header-status-icon`})}function st({status:e,testId:t}){return e===`completed`?(0,j.jsx)(m,{"aria-hidden":`true`,"data-testid":t,"data-status":`completed`,className:`h-[14px] w-[14px] shrink-0 text-[var(--system-positive-strong)]`}):e===`failed`?(0,j.jsx)(p,{"aria-hidden":`true`,"data-testid":t,"data-status":`failed`,className:`h-[14px] w-[14px] shrink-0 text-[var(--system-negative-strong)]`}):(0,j.jsx)(ae,{"data-testid":t,className:`shrink-0`})}function ct(e,t){return e.kind===`tool`&&e.toolCallId?e.toolCallId:`${e.kind}-${t}`}function lt({label:e,durationLabel:t,status:n}){return(0,j.jsxs)(`div`,{"data-testid":`phase-header`,className:`flex items-center justify-between py-[2px]`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-1`,children:[n===`completed`?(0,j.jsx)(f,{"aria-hidden":`true`,"data-testid":`phase-header-status-icon`,"data-status":`completed`,className:`h-[14px] w-[14px] text-[var(--system-positive-strong)]`}):n===`failed`?(0,j.jsx)(ee,{"aria-hidden":`true`,"data-testid":`phase-header-status-icon`,"data-status":`failed`,className:`h-[14px] w-[14px] text-[var(--system-negative-strong)]`}):(0,j.jsx)(ae,{"data-testid":`phase-header-status-icon`,className:`shrink-0`}),(0,j.jsx)(i,{variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:e})]}),t?(0,j.jsx)(i,{variant:`label-medium-default`,className:`text-[var(--content-tertiary)]`,children:t}):null]})}function ut(e){switch(e.kind){case`thinking`:return!0;case`tool`:return e.info.length>0;case`tool_error`:case`web_search_error`:case`web_search`:return!0}}function dt({step:e}){if(e.kind===`thinking`)return(0,j.jsx)(Q,{children:(0,j.jsx)(Z,{children:e.text})});if(e.kind===`tool`){let t=J[e.iconName]??a;return ut(e)?(0,j.jsxs)(Q,{children:[(0,j.jsx)(t,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-secondary)]`}),(0,j.jsx)(Z,{children:e.info})]}):null}return e.kind===`tool_error`?(0,j.jsx)(Q,{tone:`error`,children:(0,j.jsx)(Z,{children:e.message})}):e.kind===`web_search_error`?(0,j.jsx)(Q,{tone:`error`,children:(0,j.jsx)(Z,{children:e.errorMessage})}):(0,j.jsx)(Q,{children:(0,j.jsx)(Z,{children:e.title})})}function Z({children:e}){return(0,j.jsx)(i,{variant:`body-small-default`,className:`min-w-0 truncate text-inherit`,children:e})}function Q({tone:e=`default`,children:t}){return(0,j.jsx)(`div`,{"data-testid":`phase-step-pill`,className:`inline-flex min-w-0 max-w-full items-center gap-1 self-start rounded-full border px-2 py-1 ${e===`error`?`border-[var(--system-negative-weak)] bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`border-[var(--border-element)] bg-transparent text-[var(--content-default)]`}`,children:t})}var $=`inline-flex min-w-0 items-center gap-1 self-start rounded-full px-2 py-1 text-left leading-normal`,ft=`transition-colors cursor-pointer focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--border-focus)]`;function pt(e){return e===`error`?`bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`bg-[var(--surface-overlay)] text-[var(--content-default)]`}function mt({faviconUrl:e,domain:t,label:n}){let[r,i]=(0,w.useState)(!1),a=!!e&&!r,o=(t&&t.length>0?t:n).charAt(0).toUpperCase();return(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center overflow-hidden rounded-[var(--radius-sm)]`,children:a?(0,j.jsx)(`img`,{src:e,alt:``,loading:`lazy`,referrerPolicy:`no-referrer`,className:`h-full w-full object-contain`,onError:()=>i(!0)}):(0,j.jsx)(`span`,{className:`text-[10px] font-medium leading-none text-[var(--content-tertiary)]`,children:o})})}function ht({label:e,url:t,faviconUrl:n,domain:r,tone:a=`default`,ariaLabel:o}){return(0,j.jsxs)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,"data-testid":`tool-step-pill`,"data-variant":`web`,"aria-label":o??`Open ${e}`,className:`${$} ${ft} max-w-[240px] no-underline hover:bg-[var(--surface-active)] ${pt(a)}`,children:[(0,j.jsx)(mt,{faviconUrl:n,domain:r,label:e}),(0,j.jsx)(i,{variant:`body-small-default`,className:`min-w-0 truncate text-inherit leading-normal`,children:e})]})}function gt(e){if(e.variant===`web`)return(0,j.jsx)(ht,{...e});let{iconName:t,label:n,onClick:r,tone:o=`default`,active:s=!1,ariaLabel:c}=e,l=s?o===`error`?`bg-[var(--surface-active)] text-[var(--system-negative-strong)]`:`bg-[var(--surface-active)] text-[var(--content-default)]`:o===`error`?`bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`bg-[var(--surface-overlay)] text-[var(--content-default)]`,u=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(J[t]??a,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 ${o===`error`?`text-[var(--system-negative-strong)]`:`text-[var(--content-tertiary)]`}`}),(0,j.jsx)(i,{variant:`body-small-default`,className:`min-w-0 truncate text-inherit leading-normal`,children:n})]});return r?(0,j.jsx)(`button`,{type:`button`,"data-testid":`tool-step-pill`,"data-active":s?``:void 0,"aria-pressed":s,"aria-label":c??`View details: ${n}`,onClick:r,className:`${$} ${ft} max-w-full hover:bg-[var(--surface-active)] ${l}`,children:u}):(0,j.jsx)(`span`,{"data-testid":`tool-step-pill`,className:`${$} max-w-full ${l}`,children:u})}function _t(e){let t=(e.domain&&e.domain.length>0?e.domain:e.title).charAt(0);return t?t.toUpperCase():``}function vt({item:e}){let[t,n]=(0,w.useState)(!1),r=!!e.faviconUrl&&!t;return(0,j.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 rounded-[var(--radius-md)] px-2 py-1.5 hover:bg-[var(--surface-hover)]`,children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex h-[14px] w-[14px] shrink-0 items-center justify-center overflow-hidden rounded-[var(--radius-sm)] bg-[var(--surface-overlay)]`,children:r?(0,j.jsx)(`img`,{src:e.faviconUrl,alt:``,loading:`lazy`,referrerPolicy:`no-referrer`,className:`h-full w-full object-contain`,onError:()=>n(!0)}):(0,j.jsx)(`span`,{className:`text-[10px] font-medium leading-none text-[var(--content-default)]`,children:_t(e)})}),(0,j.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,j.jsx)(i,{variant:`body-small-default`,className:`truncate text-[var(--content-default)]`,children:e.title}),(0,j.jsx)(i,{variant:`body-small-default`,className:`truncate text-[var(--content-secondary)]`,children:e.domain})]})]})}function yt({results:e}){return(0,j.jsxs)(x.Root,{children:[(0,j.jsx)(x.Trigger,{asChild:!0,children:(0,j.jsx)(`button`,{type:`button`,"data-testid":`web-search-overflow-chip`,className:`inline-flex min-h-[26px] cursor-pointer items-center rounded-[var(--radius-pill)] bg-[var(--surface-base)] px-[10px] py-[6px] outline-none hover:bg-[var(--surface-hover)] focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:(0,j.jsxs)(i,{variant:`body-small-default`,className:`text-[var(--content-default)]`,children:[`+`,e.length,` more`]})})}),(0,j.jsx)(x.Content,{align:`start`,side:`bottom`,className:`flex max-h-[260px] w-[280px] flex-col gap-0.5 overflow-y-auto`,children:e.map(e=>(0,j.jsx)(vt,{item:e},e.rank))})]})}function bt({message:e}){return(0,j.jsxs)(`div`,{"data-testid":`web-search-error-chip`,className:`inline-flex items-center gap-1 rounded-[var(--radius-pill)] border border-[var(--system-negative-weak)] bg-[var(--system-negative-weak)] px-[10px] py-[6px]`,children:[(0,j.jsx)(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center`,children:(0,j.jsx)(p,{className:`h-[14px] w-[14px] text-[var(--system-negative-strong)]`})}),(0,j.jsx)(i,{variant:`body-small-default`,className:`text-[var(--system-negative-strong)]`,children:e})]})}function xt({step:e}){let t=e.overflowResults??[];return(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[(e.results??[]).map(e=>(0,j.jsx)(gt,{variant:`web`,url:e.url,faviconUrl:e.faviconUrl,domain:e.domain,label:e.title},e.rank)),t.length>0?(0,j.jsx)(yt,{results:t}):null]})}function St({step:e}){return(0,j.jsx)(bt,{message:e.errorMessage})}function Ct({faviconUrl:e,domain:t,title:n,className:r}){let[i,a]=(0,w.useState)(!1);(0,w.useEffect)(()=>{a(!1)},[e]);let o=!!e&&!i,s=(t&&t.length>0?t:n).charAt(0).toUpperCase();return(0,j.jsx)(`span`,{"aria-hidden":`true`,"data-testid":`site-favicon`,className:C(`inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center overflow-hidden rounded-[var(--radius-sm)]`,r),children:o?(0,j.jsx)(`img`,{src:e,alt:``,loading:`lazy`,referrerPolicy:`no-referrer`,className:`h-full w-full object-contain`,onError:()=>a(!0)}):(0,j.jsx)(`span`,{className:`text-[10px] font-medium leading-none text-[var(--content-tertiary)]`,children:s})})}export{M as C,we as S,I as _,dt as a,N as b,at as c,X as d,ct as f,Xe as g,je as h,gt as i,ot as l,Y as m,St as n,J as o,ut as p,xt as r,rt as s,Ct as t,nt as u,Be as v,P as x,He as y};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n}from"./button-amTXFI-2.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./typography-D5f7kt80.js";import{gt as a,ht as o,m as s,mt as c,p as l,pt as u}from"./risk-jKF7qGwV.js";import{t as d}from"./brain-BLDXGaUy.js";import{t as f}from"./check-DFNrQERi.js";import{t as p}from"./circle-alert-zOqdmf25.js";import{t as m}from"./circle-check-VSiny8yl.js";import{t as h}from"./code-Czx7d7SK.js";import{t as g}from"./file-text-CYJz-GvF.js";import{t as _}from"./globe-4qSOWE2N.js";import{t as v}from"./monitor-DfbL8_59.js";import{t as y}from"./sparkles-PGiR5v1g.js";import{t as ee}from"./triangle-alert-Z0Gq0IuB.js";import{t as b}from"./user-plus-DMh4_UTz.js";import"./src-B2IjVySQ.js";import{t as x}from"./popover-CFL4WZTr.js";import{T as te,w as S}from"./chat-B8mgARYR.js";import{t as C}from"./misc-BYQPh7vS.js";import{t as ne}from"./proxy-BzlH_XAe.js";import{t as re}from"./AnimatePresence-C8APSgIu.js";import{t as ie}from"./use-reduced-motion-CcGT6CHV.js";import{t as ae}from"./three-dot-indicator-BVtP8eei.js";var w=e(t(),1),oe=.44;function se(e,t){let n=[...e].sort((e,t)=>e.position-t.position),r=n[0]?.color??`white`,i=n[n.length-1]?.color??`white`,a=n.map(e=>{let t=(e.position-.5)*2*oe;return`${e.color} calc(50% + var(--gs-spread-mid) * ${t.toFixed(4)})`}).join(`, `);return[`linear-gradient(${t}deg`,`var(--gs-base) calc(50% - var(--gs-spread))`,`color-mix(in oklab, var(--gs-base) 42%, ${r}) calc(50% - var(--gs-spread-mid))`,a,`color-mix(in oklab, var(--gs-base) 42%, ${i}) calc(50% + var(--gs-spread-mid))`,`var(--gs-base) calc(50% + var(--gs-spread)))`].join(`, `)}var T={sunrise:[{color:`#B6D3EF`,position:0},{color:`#CAD1D7`,position:.153},{color:`#D7CFC8`,position:.252},{color:`#E1CDB9`,position:.341},{color:`#EAC6A5`,position:.424},{color:`#EDB185`,position:.505},{color:`#EF9B62`,position:.586},{color:`#F18F60`,position:.669},{color:`#F48D7A`,position:.758},{color:`#F78A94`,position:.857},{color:`#F888A0`,position:1}],bubble:[{color:`#F5EBD9`,position:0},{color:`#F2D4DB`,position:.31},{color:`#EBBDDE`,position:.5},{color:`#CCBAE3`,position:.65},{color:`#8CBFF0`,position:.82},{color:`#78B0FF`,position:1}],peach:[{color:`#D9F5FA`,position:0},{color:`#FCD9D6`,position:.31},{color:`#FCBAC9`,position:.61},{color:`#F0B3F5`,position:1}],tonic:[{color:`#E3EDF0`,position:0},{color:`#E8EBB8`,position:.27},{color:`#F0DEA3`,position:.43},{color:`#E8B078`,position:.75},{color:`#F29682`,position:1}],mint:[{color:`#DECEE8`,position:0},{color:`#CBBAEE`,position:.21},{color:`#7DC0FB`,position:.46},{color:`#00C7A6`,position:1}],spring:[{color:`#F7D5C5`,position:.07},{color:`#46A8C0`,position:.58},{color:`#43AE7D`,position:1}],twilight:[{color:`#E3CCE6`,position:0},{color:`#4E8CD5`,position:.35},{color:`#6068C2`,position:.64},{color:`#38364E`,position:1}],bay:[{color:`#DBE3D0`,position:0},{color:`#8DB8A7`,position:.23},{color:`#2D8E9A`,position:.42},{color:`#076492`,position:.59},{color:`#154288`,position:.79},{color:`#262C81`,position:1}]},ce={smooth:`cubic-bezier(0.45, 0, 0.55, 1)`,gentle:`cubic-bezier(0.76, 0, 0.24, 1)`,snappy:`cubic-bezier(0.3, 0, 0.2, 1)`};function le(){return typeof window>`u`?!0:typeof window.CSS?.supports==`function`?window.CSS.supports(`background-clip`,`text`)||window.CSS.supports(`-webkit-background-clip`,`text`):!1}function ue(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}var de=`160px`,fe=120;function pe(e,{pauseOnScroll:t,pauseWhenOffscreen:n},r){if(typeof window>`u`)return()=>{};let i=!n||typeof IntersectionObserver>`u`,a=typeof document>`u`?!0:!document.hidden,o=!0,s=()=>r(i&&a&&o),c;n&&typeof IntersectionObserver<`u`&&(c=new IntersectionObserver(e=>{let t=e[e.length-1];t&&(i=t.isIntersecting,s())},{rootMargin:de}),c.observe(e));let l=()=>{a=!document.hidden,s()};document.addEventListener(`visibilitychange`,l);let u,d=()=>{o=!1,s(),clearTimeout(u),u=setTimeout(()=>{o=!0,s()},fe)};return t&&window.addEventListener(`scroll`,d,{passive:!0,capture:!0}),s(),()=>{c?.disconnect(),document.removeEventListener(`visibilitychange`,l),t&&window.removeEventListener(`scroll`,d,{capture:!0}),clearTimeout(u)}}var me=96,E=48,D=.72,O=14,he=1.45,ge=3,k=105;function _e(e){return e?typeof e==`string`?T[e]??T.sunrise:e:T.sunrise}function A(e,t){return Number.isFinite(e)?e:t}function ve(e){e.style.removeProperty(`background-image`),e.style.removeProperty(`-webkit-text-fill-color`)}function ye({children:e,gradient:t,easing:n=`smooth`,duration:r=he,spread:i=ge,angle:a=k,pauseBetween:o=1e3,baseColor:s=`currentColor`,pauseOnScroll:c=!0,pauseWhenOffscreen:l=!0,respectReducedMotion:u=!0,as:d=`span`,className:f,style:p,...m}){let h=(0,w.useRef)(null),g=Math.max(.001,A(r,he)),_=Math.max(0,A(i,ge)),v=A(a,k),y=(0,w.useMemo)(()=>_e(t),[t]),ee=(0,w.useMemo)(()=>se(y,v),[y,v]),b=ce[n]??ce.smooth,x=Math.min(e.length*_,E);(0,w.useEffect)(()=>{let t=h.current;if(!t)return;let n=()=>{let n=t.getBoundingClientRect().width||me,r=(Number.parseFloat(getComputedStyle(t).fontSize)||O)/O,i=Math.min(e.length*_*r,E*r),a=Math.max(1,n+i*2),o=-i-a/2,s=n+i-a/2,c=g*1e3;return t.style.setProperty(`--gs-spread`,`${i}px`),t.style.setProperty(`--gs-spread-mid`,`${i*D}px`),t.style.backgroundSize=`${a}px 100%`,{start:o,end:s,durationMs:c}};if(!le()){ve(t);return}if(n(),u&&ue()||typeof t.animate!=`function`)return;let r=null,i,a=!0,s=!1,d=()=>{if(s)return;let{start:e,end:c,durationMs:l}=n(),u=t.animate([{backgroundPosition:`${e}px center`},{backgroundPosition:`${c}px center`}],{duration:l,easing:b,fill:`forwards`});a||u.pause(),r?.cancel(),r=u,u.onfinish=()=>{i=setTimeout(d,Math.max(0,o))}},f=pe(t,{pauseOnScroll:c,pauseWhenOffscreen:l},e=>{a=e,r&&(a?r.play():r.pause())});return d(),()=>{s=!0,r?.cancel(),clearTimeout(i),f()}},[e,_,g,b,o,c,l,u]);let te={position:`relative`,display:`inline-block`,backgroundImage:ee,backgroundRepeat:`no-repeat`,backgroundSize:`100% 100%`,backgroundColor:`var(--gs-base)`,WebkitBackgroundClip:`text`,backgroundClip:`text`,WebkitTextFillColor:`transparent`,"--gs-base":s,"--gs-spread":`${x}px`,"--gs-spread-mid":`${x*D}px`,...p};return(0,w.createElement)(d,{...m,ref:h,className:f,style:te},e)}var j=r();function be(e){let t=`color-mix(in srgb, ${e} 40%, white)`;return[{position:0,color:t},{position:.5,color:e},{position:1,color:t}]}var xe=`var(--avatar-accent, var(--content-emphasised))`;function M({children:e,colorHex:t,className:n,"data-testid":r}){let i=t??xe;return(0,j.jsx)(ye,{gradient:(0,w.useMemo)(()=>be(i),[i]),easing:`gentle`,duration:1.5,spread:6,angle:106,pauseBetween:0,pauseOnScroll:!1,baseColor:`color-mix(in srgb, currentColor 45%, transparent)`,className:n,"data-testid":r,children:e})}var Se=400;function Ce(e,t,n){let[r,i]=(0,w.useState)(e),a=(0,w.useRef)(null),o=(0,w.useRef)(null),s=(0,w.useRef)(null);return(0,w.useEffect)(()=>{if(Object.is(r,e)){o.current=null;return}if(n){s.current&&=(clearTimeout(s.current),null),o.current=null,i(e),a.current=Date.now();return}o.current=e;let c=Date.now();a.current===null&&(a.current=c);let l=c-a.current,u=Math.max(0,t-l);return s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{o.current!==null&&(i(o.current),a.current=Date.now(),o.current=null),s.current=null},u),()=>{s.current&&=(clearTimeout(s.current),null)}},[e,r,t,n]),r}function we({currentStepTitle:e,currentStepInfo:t,bypassDwell:n=!1,animationKey:r,shimmer:a=!1,inline:o=!1}){let s=ie(),c=Ce((0,w.useMemo)(()=>({title:e,info:t}),[e,t]),Se,n),l=s?{duration:0}:{duration:.25,ease:[.16,1,.3,1]},u=s?{opacity:0}:{y:-16,opacity:0},d=s?{opacity:1}:{y:0,opacity:1},f=s?{opacity:0}:{y:16,opacity:0},p=typeof c.info==`string`||typeof c.info==`number`,m=p?String(c.info):c.info==null?``:`node`,h=r??`${c.title}::${m}`,g=p?c.info!==``:c.info!=null,_=c.title.trim()!==``;return(0,j.jsx)(re,{initial:!1,mode:`popLayout`,children:(0,j.jsxs)(ne.span,{initial:u,animate:d,exit:f,transition:l,className:`flex min-w-0 flex-1 items-center gap-1`,children:[_?o?(0,j.jsx)(`span`,{className:g?`shrink-0 whitespace-nowrap text-[13px] font-medium leading-[16px] text-[var(--content-secondary)]`:`block min-w-0 flex-1 truncate text-left text-[13px] font-medium leading-[16px] text-[var(--content-secondary)]`,children:a?(0,j.jsx)(M,{children:c.title}):c.title}):(0,j.jsx)(i,{variant:`body-medium-default`,className:g?`ml-1 shrink-0 whitespace-nowrap text-[var(--content-emphasised)]`:`ml-1 block min-w-0 flex-1 truncate text-left text-[var(--content-emphasised)]`,children:a?(0,j.jsx)(M,{children:c.title}):c.title}):null,g?(0,j.jsxs)(j.Fragment,{children:[_?(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1 h-3.5 w-px shrink-0 bg-[var(--border-element)]`}):null,p?o&&!_?(0,j.jsx)(`span`,{className:`block min-w-0 flex-1 truncate text-left text-[13px] font-medium leading-[16px] text-[var(--content-secondary)]`,children:a&&typeof c.info==`string`?(0,j.jsx)(M,{children:c.info}):c.info}):(0,j.jsx)(i,{variant:_?`body-small-default`:`body-medium-default`,className:`ml-1 block min-w-0 flex-1 truncate text-left leading-[16px] ${_?`text-[var(--content-tertiary)]`:`text-[var(--content-emphasised)]`}`,children:a&&!_&&typeof c.info==`string`?(0,j.jsx)(M,{children:c.info}):c.info}):(0,j.jsx)(`span`,{className:`ml-1 block min-w-0 flex-1`,children:c.info})]}):null]},h)})}var Te=/^https?:\/\/\S+/,Ee=/^URL:\s*(https?:\/\/\S+)/i,De=/^\[\d+\]\s*(https?:\/\/\S+)/;function N(e){try{return new URL(e).hostname.replace(/^www\./,``)}catch{return``}}function Oe(e){let t=e.trim();return Ee.exec(t)?.[1]??De.exec(t)?.[1]??t}function ke(e){return e.trim().replace(/^\d+\.\s+/,``)}function Ae(e){let t=e.split(/\r?\n/),n=[],r=new Set,i=``;for(let e of t){let t=e.trim();if(!t){i=``;continue}let a=Oe(t);if(Te.test(a)){r.has(a)||(r.add(a),n.push({title:i,url:a})),i=``;continue}/^Web search results for /i.test(t)||/^Sources:?$/i.test(t)||(i=ke(t))}return n}function P(e){return!e||!e.trim()?[]:Ae(e).map((e,t)=>{let n=N(e.url);return{rank:t+1,title:e.title,url:e.url,domain:n}})}var F=5,je=new Set([`web_search`,`web_fetch`]);function I(e){if(!Number.isFinite(e)||e<1e3)return`<1s`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.round(t/60);return n<60?`${n}m`:`${Math.round(n/60)}h`}function L(e){return je.has(e.name)}function R(e){return e?`Searched the web`:`Searching the web`}function z(e){return{visible:e.slice(0,F),overflowResults:e.slice(F)}}function Me(e,t){let{visible:n,overflowResults:r}=z(e.results);return{kind:`web_search`,title:R(t),durationLabel:I(e.durationMs),linkCount:e.resultCount,results:n,overflowResults:r}}function Ne(e){let t=e.title??e.domain;return{kind:`thinking`,durationLabel:I(e.durationMs),text:`Reading ${t}`}}function Pe(){return{kind:`web_search`,title:`Searching the web`,durationLabel:``,linkCount:0,results:[]}}function Fe(){return{kind:`thinking`,durationLabel:``,text:`Reading…`}}function Ie(e){let t=P(e);if(t.length===0)return null;let{visible:n,overflowResults:r}=z(t);return{kind:`web_search`,title:R(!0),durationLabel:``,linkCount:t.length,results:n,overflowResults:r}}function Le(e){return{kind:`web_search_error`,title:`Web search failed`,durationLabel:I(e.durationMs),errorMessage:e.errorMessage??`Search is having trouble right now. You can try again in a moment, continue without web search, or paste the relevant details here and I'll use those.`}}function B(){return{kind:`web_search`,title:R(!0),durationLabel:``,linkCount:0,results:[]}}function V(e,t){return t[e.id]??e.activityMetadata}function H(e){return!S(e)}function U(e,t){return e.results.length>0?!1:!!e.errorMessage||!!t.isError}function W(e){return e.confirmationDecision===`denied`||e.confirmationDecision===`timed_out`?`denied`:e.isError?`error`:S(e)?`running`:`completed`}function G(e,t){return e==null||t==null?null:Math.max(0,t-e)}function K(e,t){let n=G(e,t);return n==null?``:I(n)}function q(e){return K(e.startedAt??void 0,e.completedAt??void 0)}function Re(e){return!l(e)&&S(e)}function ze(e,t){if(e.kind===`thinking`)return e.text?e.completedAt==null?e.startedAt!=null&&t!=null?Math.max(0,t-e.startedAt):null:G(e.startedAt,e.completedAt):null;let n=e.toolCall;if(l(n))return null;let r=te(n);return n.completedAt==null?S(n)&&r!=null&&t!=null?Math.max(0,t-r):null:G(r,n.completedAt)}function Be(e){return e.some(e=>e.kind===`thinking`?!!e.text&&e.startedAt!=null&&e.completedAt==null:Re(e.toolCall))}function Ve(e,t){let n=0,r=!1;for(let i of e){let e=ze(i,t);e!=null&&(r=!0,n+=e)}return r?I(n):``}function He(e){let{title:t,activity:n}=s(e);return{toolCallId:e.id,toolName:e.name,title:t,activity:n,input:e.input??{},result:e.result,streamedOutput:e.streamedOutput,status:W(e),riskLevel:e.riskLevel,riskReason:e.riskReason,durationLabel:q(e)}}function Ue(e){let{title:t,info:n,activity:r,iconName:i}=s(e);return{kind:`tool`,durationLabel:q(e),startedAt:e.startedAt??void 0,title:t,info:n,activity:r,riskLevel:e.riskLevel,iconName:i,toolCallId:e.id,status:W(e)}}function We(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(L(r)){let e=V(r,t),n=H(r);if(e?.webSearch&&U(e.webSearch,r))return`Web search failed`;if(r.name===`web_search`)return R(n);if(r.name===`web_fetch`)return`Thinking`}else return s(r).title}return``}function Ge(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(!L(r)){let{info:e,activity:t}=s(r);return t||e}let i=V(r,t),a=H(r);if(i?.webSearch){let e=i.webSearch;if(U(e,r))return e.errorMessage??`Search is having trouble right now. You can try again in a moment, continue without web search, or paste the relevant details here and I'll use those.`;if(e.results.length>0)return e.results[e.results.length-1].title;if(!a&&e.query)return`Searching ${e.query}`}if(i?.webFetch){let e=i.webFetch;return a?e.title??e.domain:`Reading ${e.domain}`}if(r.name===`web_search`){if(!a){let e=typeof r.input?.query==`string`?r.input.query.trim():``;return e?`Searching ${e}`:``}if(typeof r.result==`string`){let e=P(r.result);if(e.length>0){let t=e[e.length-1].title;if(t)return t}}}if(r.name===`web_fetch`){let e=typeof r.input?.url==`string`?r.input.url:``,t=e?N(e):``;if(t)return a?t:`Reading ${t}`}}return``}function Ke(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.name!==`web_search`)continue;let i=V(r,t)?.webSearch?.results;if(i&&i.length>0)return i}return[]}function qe(e){return e.includes(`denied`)?`denied`:e.includes(`loading`)?`loading`:e.includes(`error`)?`error`:`complete`}function Je(e){return qe(e.map(e=>e.confirmationDecision===`denied`||e.confirmationDecision===`timed_out`?`denied`:S(e)?`loading`:e.isError?`error`:`complete`))}function Ye(e,t){if(l(e))return null;if(!L(e))return Ue(e);let n=V(e,t),r=H(e);if(n?.webSearch){let t=n.webSearch;return U(t,e)?Le(t):Me(t,r)}return n?.webFetch?Ne(n.webFetch):r?e.name===`web_search`&&typeof e.result==`string`?Ie(e.result)??B():B():e.name===`web_search`?Pe():Fe()}function Xe(e,t,n){let r=e.filter(e=>e.kind===`toolCall`).map(e=>e.toolCall).filter(e=>!l(e)),i=[],a=null,o=0;for(let n of e){if(n.kind===`thinking`){n.text&&(i.push({kind:`thinking`,durationLabel:K(n.startedAt,n.completedAt),text:n.text,startedAt:n.startedAt,completedAt:n.completedAt,thinkingItemIndex:o++}),a=n.text);continue}let e=Ye(n.toolCall,t);e&&(i.push(e),a=null)}let s=Je(r),c,u,d;a===null?(c=We(r,t),u=Ge(r,t),d=`tool`):(c=`Thinking`,u=a,d=`thinking`);let f=Ke(r,t),p=`${i.length} step${i.length===1?``:`s`}`,m=Ve(e,n);return{currentStepTitle:c,currentStepInfo:u,currentStepKind:d,stepCount:p,totalDurationLabel:m,steps:i,state:s,carouselItems:f}}var J={code:h,terminal:u,file:g,globe:_,pen:o,monitor:v,plug:c,sparkle:y,"user-plus":b,bolt:a,brain:d};function Ze(e){if(e.kind===`thinking`)return`Thinking`;if(e.kind===`web_search`||e.kind===`web_search_error`)return`Searching the web`;if(e.kind===`tool_error`)return`Error`;let t=e.title;return t.startsWith(`Working`)?t:t===`Reading`||t===`Editing`||t.startsWith(`Running`)?`Working`:t===`Using a skill`?`Using a skill`:(t.startsWith(`Using `),t)}function Qe(e){if(!e||e===`<1s`)return 0;let t=/^(\d+)(s|m|h)$/.exec(e);if(!t)return 0;let n=Number(t[1]);switch(t[2]){case`h`:return n*36e5;case`m`:return n*6e4;default:return n*1e3}}function $e(e){let t=null;for(let n of e)(n.kind===`tool`||n.kind===`thinking`)&&n.startedAt!=null&&(t=t==null?n.startedAt:Math.min(t,n.startedAt));return t}function et(e){return new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`,second:`2-digit`})}function tt({durationLabel:e,startedAt:t}){let r=(0,j.jsx)(i,{variant:`label-medium-default`,className:`text-[var(--content-tertiary)]`,children:e});return t==null?r:(0,j.jsx)(n,{content:`Started at ${et(t)}`,side:`top`,align:`end`,children:(0,j.jsx)(`span`,{className:`cursor-default`,children:r})})}function Y(e){let t=0,n=!1;for(let r of e)r&&(n=!0,t+=Qe(r));return n?I(t):``}function X(e){if(e.length===0)return`running`;let t=!1;for(let n of e){if(n.kind===`tool`){if(n.status===`running`)return`running`;(n.status===`error`||n.status===`denied`)&&(t=!0);continue}if(n.kind===`web_search`){if(n.title===`Searching the web`)return`running`;continue}(n.kind===`tool_error`||n.kind===`web_search_error`)&&(t=!0)}return t?`failed`:`completed`}function nt(e){let t=[];for(let n of e){let e=Ze(n),r=t[t.length-1];r&&r.label===e?r.steps.push(n):t.push({label:e,steps:[n]})}return t}function rt({steps:e,renderStep:t,timeline:n=!1}){if(e.length===0)return null;let r=nt(e),i=[],a=0;for(let e of r)i.push(a),a+=e.steps.length;let o=(e,n)=>e.steps.map((e,r)=>{let i=ct(e,n+r);return(0,j.jsx)(w.Fragment,{children:t?t(e):(0,j.jsx)(dt,{step:e})},i)});return n?(0,j.jsx)(`div`,{className:`flex w-full flex-col`,children:r.map((e,t)=>(0,j.jsx)(it,{section:e,baseIndex:i[t],isLast:t===r.length-1,renderSectionSteps:o},`${e.label}-${t}`))}):(0,j.jsx)(`div`,{className:`flex w-full flex-col gap-3`,children:r.map((e,t)=>{let n=Y(e.steps.map(e=>`durationLabel`in e?e.durationLabel:``)),r=X(e.steps),a=i[t];return(0,j.jsxs)(`div`,{"data-testid":`phase-section`,"data-phase-label":e.label,className:`flex flex-col gap-1`,children:[(0,j.jsx)(lt,{label:e.label,durationLabel:n,status:r}),(0,j.jsx)(`div`,{className:`flex min-w-0 flex-col items-start gap-1 pl-[24px]`,children:o(e,a)})]},`${e.label}-${t}`)})})}function it({section:e,baseIndex:t,isLast:n,renderSectionSteps:r}){let a=Y(e.steps.map(e=>`durationLabel`in e?e.durationLabel:``)),o=X(e.steps),s=e.steps[0]?.kind===`thinking`;return(0,j.jsxs)(`div`,{"data-testid":`phase-section`,"data-phase-label":e.label,className:`relative flex flex-col gap-2`,children:[!n&&(0,j.jsx)(at,{}),(0,j.jsxs)(`div`,{"data-testid":`phase-header`,className:`flex items-center justify-between gap-2 py-[2px]`,children:[(0,j.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,j.jsx)(ot,{status:o,isThinking:s}),(0,j.jsx)(i,{variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:e.label})]}),a?(0,j.jsx)(tt,{durationLabel:a,startedAt:$e(e.steps)}):null]}),(0,j.jsx)(`div`,{className:C(`flex min-w-0 flex-col items-start gap-1 pl-[22px]`,!n&&`pb-3`),children:r(e,t)})]})}function at({className:e}){return(0,j.jsx)(`div`,{"aria-hidden":!0,className:C(`absolute bottom-0 left-[6.5px] top-6 w-px bg-[var(--border-element)]`,e)})}function ot({status:e,isThinking:t}){return t?(0,j.jsx)(d,{"aria-hidden":`true`,"data-testid":`phase-header-status-icon`,"data-status":`thinking`,className:`h-[14px] w-[14px] shrink-0 text-[var(--content-secondary)]`}):(0,j.jsx)(st,{status:e,testId:`phase-header-status-icon`})}function st({status:e,testId:t}){return e===`completed`?(0,j.jsx)(m,{"aria-hidden":`true`,"data-testid":t,"data-status":`completed`,className:`h-[14px] w-[14px] shrink-0 text-[var(--system-positive-strong)]`}):e===`failed`?(0,j.jsx)(p,{"aria-hidden":`true`,"data-testid":t,"data-status":`failed`,className:`h-[14px] w-[14px] shrink-0 text-[var(--system-negative-strong)]`}):(0,j.jsx)(ae,{"data-testid":t,className:`shrink-0`})}function ct(e,t){return e.kind===`tool`&&e.toolCallId?e.toolCallId:`${e.kind}-${t}`}function lt({label:e,durationLabel:t,status:n}){return(0,j.jsxs)(`div`,{"data-testid":`phase-header`,className:`flex items-center justify-between py-[2px]`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-1`,children:[n===`completed`?(0,j.jsx)(f,{"aria-hidden":`true`,"data-testid":`phase-header-status-icon`,"data-status":`completed`,className:`h-[14px] w-[14px] text-[var(--system-positive-strong)]`}):n===`failed`?(0,j.jsx)(ee,{"aria-hidden":`true`,"data-testid":`phase-header-status-icon`,"data-status":`failed`,className:`h-[14px] w-[14px] text-[var(--system-negative-strong)]`}):(0,j.jsx)(ae,{"data-testid":`phase-header-status-icon`,className:`shrink-0`}),(0,j.jsx)(i,{variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:e})]}),t?(0,j.jsx)(i,{variant:`label-medium-default`,className:`text-[var(--content-tertiary)]`,children:t}):null]})}function ut(e){switch(e.kind){case`thinking`:return!0;case`tool`:return e.info.length>0;case`tool_error`:case`web_search_error`:case`web_search`:return!0}}function dt({step:e}){if(e.kind===`thinking`)return(0,j.jsx)(Q,{children:(0,j.jsx)(Z,{children:e.text})});if(e.kind===`tool`){let t=J[e.iconName]??a;return ut(e)?(0,j.jsxs)(Q,{children:[(0,j.jsx)(t,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-secondary)]`}),(0,j.jsx)(Z,{children:e.info})]}):null}return e.kind===`tool_error`?(0,j.jsx)(Q,{tone:`error`,children:(0,j.jsx)(Z,{children:e.message})}):e.kind===`web_search_error`?(0,j.jsx)(Q,{tone:`error`,children:(0,j.jsx)(Z,{children:e.errorMessage})}):(0,j.jsx)(Q,{children:(0,j.jsx)(Z,{children:e.title})})}function Z({children:e}){return(0,j.jsx)(i,{variant:`body-small-default`,className:`min-w-0 truncate text-inherit`,children:e})}function Q({tone:e=`default`,children:t}){return(0,j.jsx)(`div`,{"data-testid":`phase-step-pill`,className:`inline-flex min-w-0 max-w-full items-center gap-1 self-start rounded-full border px-2 py-1 ${e===`error`?`border-[var(--system-negative-weak)] bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`border-[var(--border-element)] bg-transparent text-[var(--content-default)]`}`,children:t})}var $=`inline-flex min-w-0 items-center gap-1 self-start rounded-full px-2 py-1 text-left leading-normal`,ft=`transition-colors cursor-pointer focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--border-focus)]`;function pt(e){return e===`error`?`bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`bg-[var(--surface-overlay)] text-[var(--content-default)]`}function mt({faviconUrl:e,domain:t,label:n}){let[r,i]=(0,w.useState)(!1),a=!!e&&!r,o=(t&&t.length>0?t:n).charAt(0).toUpperCase();return(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center overflow-hidden rounded-[var(--radius-sm)]`,children:a?(0,j.jsx)(`img`,{src:e,alt:``,loading:`lazy`,referrerPolicy:`no-referrer`,className:`h-full w-full object-contain`,onError:()=>i(!0)}):(0,j.jsx)(`span`,{className:`text-[10px] font-medium leading-none text-[var(--content-tertiary)]`,children:o})})}function ht({label:e,url:t,faviconUrl:n,domain:r,tone:a=`default`,ariaLabel:o}){return(0,j.jsxs)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,"data-testid":`tool-step-pill`,"data-variant":`web`,"aria-label":o??`Open ${e}`,className:`${$} ${ft} max-w-[240px] no-underline hover:bg-[var(--surface-active)] ${pt(a)}`,children:[(0,j.jsx)(mt,{faviconUrl:n,domain:r,label:e}),(0,j.jsx)(i,{variant:`body-small-default`,className:`min-w-0 truncate text-inherit leading-normal`,children:e})]})}function gt(e){if(e.variant===`web`)return(0,j.jsx)(ht,{...e});let{iconName:t,label:n,onClick:r,tone:o=`default`,active:s=!1,ariaLabel:c}=e,l=s?o===`error`?`bg-[var(--surface-active)] text-[var(--system-negative-strong)]`:`bg-[var(--surface-active)] text-[var(--content-default)]`:o===`error`?`bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`bg-[var(--surface-overlay)] text-[var(--content-default)]`,u=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(J[t]??a,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 ${o===`error`?`text-[var(--system-negative-strong)]`:`text-[var(--content-tertiary)]`}`}),(0,j.jsx)(i,{variant:`body-small-default`,className:`min-w-0 truncate text-inherit leading-normal`,children:n})]});return r?(0,j.jsx)(`button`,{type:`button`,"data-testid":`tool-step-pill`,"data-active":s?``:void 0,"aria-pressed":s,"aria-label":c??`View details: ${n}`,onClick:r,className:`${$} ${ft} max-w-full hover:bg-[var(--surface-active)] ${l}`,children:u}):(0,j.jsx)(`span`,{"data-testid":`tool-step-pill`,className:`${$} max-w-full ${l}`,children:u})}function _t(e){let t=(e.domain&&e.domain.length>0?e.domain:e.title).charAt(0);return t?t.toUpperCase():``}function vt({item:e}){let[t,n]=(0,w.useState)(!1),r=!!e.faviconUrl&&!t;return(0,j.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 rounded-[var(--radius-md)] px-2 py-1.5 hover:bg-[var(--surface-hover)]`,children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex h-[14px] w-[14px] shrink-0 items-center justify-center overflow-hidden rounded-[var(--radius-sm)] bg-[var(--surface-overlay)]`,children:r?(0,j.jsx)(`img`,{src:e.faviconUrl,alt:``,loading:`lazy`,referrerPolicy:`no-referrer`,className:`h-full w-full object-contain`,onError:()=>n(!0)}):(0,j.jsx)(`span`,{className:`text-[10px] font-medium leading-none text-[var(--content-default)]`,children:_t(e)})}),(0,j.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,j.jsx)(i,{variant:`body-small-default`,className:`truncate text-[var(--content-default)]`,children:e.title}),(0,j.jsx)(i,{variant:`body-small-default`,className:`truncate text-[var(--content-secondary)]`,children:e.domain})]})]})}function yt({results:e}){return(0,j.jsxs)(x.Root,{children:[(0,j.jsx)(x.Trigger,{asChild:!0,children:(0,j.jsx)(`button`,{type:`button`,"data-testid":`web-search-overflow-chip`,className:`inline-flex min-h-[26px] cursor-pointer items-center rounded-[var(--radius-pill)] bg-[var(--surface-base)] px-[10px] py-[6px] outline-none hover:bg-[var(--surface-hover)] focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:(0,j.jsxs)(i,{variant:`body-small-default`,className:`text-[var(--content-default)]`,children:[`+`,e.length,` more`]})})}),(0,j.jsx)(x.Content,{align:`start`,side:`bottom`,className:`flex max-h-[260px] w-[280px] flex-col gap-0.5 overflow-y-auto`,children:e.map(e=>(0,j.jsx)(vt,{item:e},e.rank))})]})}function bt({message:e}){return(0,j.jsxs)(`div`,{"data-testid":`web-search-error-chip`,className:`inline-flex items-center gap-1 rounded-[var(--radius-pill)] border border-[var(--system-negative-weak)] bg-[var(--system-negative-weak)] px-[10px] py-[6px]`,children:[(0,j.jsx)(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center`,children:(0,j.jsx)(p,{className:`h-[14px] w-[14px] text-[var(--system-negative-strong)]`})}),(0,j.jsx)(i,{variant:`body-small-default`,className:`text-[var(--system-negative-strong)]`,children:e})]})}function xt({step:e}){let t=e.overflowResults??[];return(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[(e.results??[]).map(e=>(0,j.jsx)(gt,{variant:`web`,url:e.url,faviconUrl:e.faviconUrl,domain:e.domain,label:e.title},e.rank)),t.length>0?(0,j.jsx)(yt,{results:t}):null]})}function St({step:e}){return(0,j.jsx)(bt,{message:e.errorMessage})}function Ct({faviconUrl:e,domain:t,title:n,className:r}){let[i,a]=(0,w.useState)(!1);(0,w.useEffect)(()=>{a(!1)},[e]);let o=!!e&&!i,s=(t&&t.length>0?t:n).charAt(0).toUpperCase();return(0,j.jsx)(`span`,{"aria-hidden":`true`,"data-testid":`site-favicon`,className:C(`inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center overflow-hidden rounded-[var(--radius-sm)]`,r),children:o?(0,j.jsx)(`img`,{src:e,alt:``,loading:`lazy`,referrerPolicy:`no-referrer`,className:`h-full w-full object-contain`,onError:()=>a(!0)}):(0,j.jsx)(`span`,{className:`text-[10px] font-medium leading-none text-[var(--content-tertiary)]`,children:s})})}export{M as C,we as S,I as _,dt as a,N as b,at as c,X as d,ct as f,Xe as g,je as h,gt as i,ot as l,Y as m,St as n,J as o,ut as p,xt as r,rt as s,Ct as t,nt as u,Be as v,P as x,He as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Dhiismgm.js";import{t as n}from"./react-DJZBPgpf.js";import{F as r,t as i}from"./button-amTXFI-2.js";import{d as a,p as o,r as s,u as c}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as l}from"./QueryClientProvider-DKhXIxGb.js";import{t as u}from"./useQuery-B45lW1Kk.js";import{t as d}from"./jsx-runtime-CVSDxk6A.js";import{t as f}from"./card-Bv5O5juh.js";import{t as p}from"./createLucideIcon-IRfcSUxS.js";import{t as m}from"./arrow-left-DI9551VI.js";import{a as h,i as g,n as _,r as v,s as y,t as b}from"./use-skill-actions-DvXJseoE.js";import{t as x}from"./chevron-down-qD-re7AW.js";import{t as S}from"./menu-Dy5QbnTj.js";import{t as C}from"./code-Czx7d7SK.js";import{t as w}from"./external-link-Dqpx9nRm.js";import{t as T}from"./file-text-CYJz-GvF.js";import{t as E}from"./loader-circle-Cz7opInR.js";import"./src-B2IjVySQ.js";import{n as D}from"./stat-square-CTHnQ1jc.js";import{n as O,t as k}from"./file-markdown-BXUvAQ24.js";import{St as A,bt as j,on as M}from"./react-query.gen-SVZdN1r_.js";import{c as N}from"./routes-BbeIx_F9.js";import{Na as P,ca as F,da as I,vr as L,yi as R}from"./index-6YxiY2Ly.js";import{t as z}from"./use-active-assistant-id-BNRMo_Mi.js";import{n as B,t as V}from"./use-skill-detail-files-DEAuvZ9C.js";import{n as H,r as U,t as ee}from"./skills-cdOwT5VQ.js";import{t as te}from"./use-edge-swipe-back-KZ3UbiGX.js";import{i as W,n as G,r as K,t as q}from"./file-editor-BbrbkQCm.js";import{t as J}from"./skill-icon-CEEEqpSq.js";var Y=p(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),X=e(n(),1),Z=d();function ne({assistantId:e,skill:t,onBack:n,onInstall:r,onRemove:a,isInstalling:o=!1,isRemoving:s=!1,sourceConversationId:c}){let l=h(t),u=H(t),{fileEntries:d,setSelectedPath:p,activePath:g,activeFile:_,isFilesLoading:v,fileContent:b,isBinary:x,isContentLoading:S}=V(e,t.id);return(0,Z.jsxs)(`div`,{className:`flex h-[calc(100vh-14rem)] flex-col`,children:[(0,Z.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,Z.jsx)(i,{type:`button`,variant:`ghost`,iconOnly:(0,Z.jsx)(m,{"aria-hidden":!0}),"aria-label":`Back to skills`,onClick:n}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,Z.jsx)(J,{skill:t,className:`h-8 w-8 text-3xl`}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,Z.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:t.name}),(0,Z.jsx)(y,{origin:t.origin})]}),(0,Z.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}),(0,Z.jsx)(B,{skill:{origin:t.origin,sourceConversationId:c},className:`mt-1`})]})]}),l?o?(0,Z.jsx)(`div`,{className:`flex h-9 items-center px-3`,children:(0,Z.jsx)(E,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):(0,Z.jsx)(i,{type:`button`,onClick:r,disabled:!r,leftIcon:(0,Z.jsx)(P,{"aria-hidden":!0}),children:`Install`}):(0,Z.jsx)(i,{type:`button`,variant:u?`dangerOutline`:`outlined`,onClick:a,disabled:!u||s||!a,leftIcon:s?(0,Z.jsx)(E,{className:`animate-spin`,"aria-hidden":!0}):(0,Z.jsx)(R,{"aria-hidden":!0}),children:`Remove`})]})]}),(0,Z.jsx)(f.Root,{asChild:!0,noPadding:!0,children:(0,Z.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden sm:grid`,style:{gridTemplateColumns:`240px 1fr`},children:[(0,Z.jsx)(`div`,{className:`max-h-40 shrink-0 overflow-y-auto border-b p-2 sm:max-h-none sm:border-b-0 sm:border-r`,style:{borderColor:`var(--border-base)`},children:v?(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Z.jsx)(E,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):d.length===0?(0,Z.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`No files available.`}):d.map(e=>{let t=g===e.path,n=(e.mimeType??``).endsWith(`/directory`);return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>p(e.path),className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:t?`var(--primary-base)`:`var(--content-default)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:void 0},children:[n?(0,Z.jsx)(F,{className:`h-4 w-4 shrink-0`,style:{color:`var(--system-mid-strong)`}}):(0,Z.jsx)(T,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path)})}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:S?(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(E,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):_?(0,Z.jsx)(re,{assistantId:e,skillId:t.id,fileName:_.name,filePath:_.path,content:b,isBinary:x,editable:t.kind===`installed`},`${t.id}/${_.path}`):(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view its contents.`})})]})})]})}function re({assistantId:e,skillId:n,fileName:r,filePath:o,content:s,isBinary:c,editable:u}){let d=a(),f=l(),[p,m]=(0,X.useState)(!1),[h,g]=(0,X.useState)(``),_=`skills/${n}/${o}`,v=M({onSuccess:()=>{m(!1),g(``),f.invalidateQueries({queryKey:[{_id:`skillsByIdFilesContentGet`}]}),f.invalidateQueries({queryKey:[{_id:`skillsByIdFilesGet`}]}),o===`SKILL.md`&&ee(f,e)},onError:e=>{t(e,{context:`skill-file-save`,bestEffort:!0})}}),y=p&&h!==(s??``),b=(0,X.useCallback)(()=>{!y||v.isPending||v.mutate({path:{assistant_id:e},body:{path:_,content:h,encoding:`utf8`}})},[y,v,e,_,h]),x=(0,X.useCallback)(()=>{m(!0),g(s??``),v.reset()},[s,v]),S=(0,X.useCallback)(()=>{m(!1),g(``),v.reset()},[v]);if(c)return(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Binary file — no preview available.`});if(s===null)return(0,Z.jsxs)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[`No preview available for `,r,`.`]});let C=u?(0,Z.jsx)(i,{variant:`ghost`,size:`regular`,iconOnly:(0,Z.jsx)(w,{"aria-hidden":!0}),onClick:()=>d(`${N.workspace}?file=${encodeURIComponent(_)}`),"aria-label":`Open in Workspace`,className:`hover:bg-[var(--surface-base)]`}):void 0;return O(r,void 0)&&!p?(0,Z.jsx)(`div`,{className:`relative flex h-full flex-col`,children:(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:[(0,Z.jsx)(q,{content:s,fileName:r,showEdit:u,isEditing:!1,onToggleEdit:x,extraActions:C}),(0,Z.jsx)(k,{content:s})]})}):(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Z.jsx)(q,{content:p?h:s,fileName:r,showEdit:u,isEditing:p,onToggleEdit:()=>p?S():x(),extraActions:C}),p?(0,Z.jsx)(K,{value:h,onChange:g,onSave:b}):(0,Z.jsx)(W,{content:s,readOnly:!u,onStartEdit:x})]}),p&&(0,Z.jsx)(G,{isDirty:y,isSaving:v.isPending,error:v.isError?`Save failed`:null,onSave:b,onDiscard:S})]})}var ie=e(r(),1);function ae({fileName:e,content:t,isBinary:n,viewMode:r=`preview`}){return n?(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Binary file — no preview available.`}):t===null?(0,Z.jsxs)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[`No preview available for `,e,`.`]}):O(e,void 0)&&r===`preview`?(0,Z.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Z.jsx)(k,{content:t})}):(0,Z.jsx)(`pre`,{className:`h-full overflow-y-auto whitespace-pre-wrap break-words p-4 font-mono text-body-small-default`,style:{color:`var(--content-default)`},children:t})}function oe({assistantId:e,skill:t,onBack:n,onInstall:r,onRemove:a,isInstalling:o=!1,isRemoving:s=!1,swipeContainerRef:c,sourceConversationId:l}){let u=h(t),d=H(t),{fileEntries:p,setSelectedPath:g,activePath:_,activeFile:v,isFilesLoading:b,fileContent:x,isBinary:S,isContentLoading:w}=V(e,t.id),[T,k]=(0,X.useState)(`preview`);(0,X.useEffect)(()=>{k(`preview`)},[_]);let[A,j]=(0,X.useState)(null);(0,X.useEffect)(()=>{j(document.getElementById(`viewport-overlays`))},[]);let M=v?O(v.name,void 0):!1,N=M?T:`raw`,P=(0,Z.jsxs)(`div`,{ref:c,className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(i,{variant:`ghost`,iconOnly:(0,Z.jsx)(m,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Back to skills`,onClick:n,className:`max-md:bg-[var(--surface-active)]`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:t.name}),(0,Z.jsx)(se,{available:u,removable:d,isInstalling:o,isRemoving:s,onInstall:r,onRemove:a})]}),(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(J,{skill:t,className:`h-6 w-6 shrink-0 text-[22px] leading-none`}),(0,Z.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:t.name})]}),(0,Z.jsx)(y,{origin:t.origin})]}),(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:t.description}),(0,Z.jsx)(B,{skill:{origin:t.origin,sourceConversationId:l}})]}),(0,Z.jsx)(f.Root,{asChild:!0,noPadding:!0,children:(0,Z.jsxs)(`div`,{className:`mt-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-[var(--surface-lift)]`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b px-3 py-2`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsx)(ce,{fileEntries:p,activePath:_,activeName:v?.name??null,onSelect:g}),(0,Z.jsx)(D,{iconOnly:!0,ariaLabel:`File view mode`,value:N,onChange:k,items:[{value:`preview`,label:`Preview`,icon:(0,Z.jsx)(I,{"aria-hidden":!0}),disabled:!M},{value:`raw`,label:`Source`,icon:(0,Z.jsx)(C,{"aria-hidden":!0})}]})]}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:b||w?(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(E,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):v?(0,Z.jsx)(ae,{fileName:v.name,content:x,isBinary:S,viewMode:N}):(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view its contents.`})})]})})]});return A?(0,ie.createPortal)(P,A):P}function se({available:e,removable:t,isInstalling:n,isRemoving:r,onInstall:a,onRemove:o}){return n||r?(0,Z.jsx)(i,{variant:`ghost`,iconOnly:(0,Z.jsx)(E,{className:`animate-spin`,"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,"aria-label":`Pending`,className:`max-md:bg-[var(--surface-active)]`}):e?(0,Z.jsx)(i,{variant:`ghost`,iconOnly:(0,Z.jsx)(P,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Install skill`,onClick:a,disabled:!a,className:`max-md:bg-[var(--surface-active)]`}):t?(0,Z.jsx)(i,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(R,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Remove skill`,onClick:o,disabled:!o,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`}):(0,Z.jsx)(i,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(R,{"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,title:`Bundled skills cannot be removed`,"aria-label":`Bundled skill cannot be removed`,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`})}function Q(e){return(e??``).endsWith(`/directory`)}function ce({fileEntries:e,activePath:t,activeName:n,onSelect:r}){let i=n??`Select a file`;return e.length===0?(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)($,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i})]}):(0,Z.jsxs)(S.Root,{children:[(0,Z.jsx)(S.Trigger,{children:(0,Z.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 rounded-md text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)($,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i}),(0,Z.jsx)(x,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})}),(0,Z.jsx)(S.Content,{align:`start`,children:e.map(e=>{let n=Q(e.mimeType);return(0,Z.jsx)(S.Item,{onSelect:()=>r(e.path),leftIcon:n?(0,Z.jsx)(F,{}):(0,Z.jsx)(T,{}),"aria-current":e.path===t?`true`:void 0,children:e.name},e.path)})})]})}function $(){return(0,Z.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-[var(--surface-base)]`,"aria-hidden":!0,children:(0,Z.jsx)(T,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})})}function le(){let e=z(),{skillId:t}=o(),n=a(),r=c(),{pathname:l}=r,d=L(),f=(0,X.useRef)(null),p=r.state,h=typeof p?.listSearch==`string`?p.listSearch:``,y=u({...A({path:{assistant_id:e},query:{include:`catalog`}}),select:e=>e.skills,refetchOnMount:`always`}),x=(0,X.useCallback)(()=>{n(`${N.skills.root}${h}`,{replace:!0})},[n,h]);te({containerRef:f,onBack:x,enabled:d,navKey:l});let{handleInstall:S,handleRemove:C,isInstallingSkill:w,isRemovingSkill:T,skillPendingRemoval:E,confirmRemove:D,cancelRemove:O}=b(e,{onRemoved:x}),k=y.data,M=(0,X.useMemo)(()=>k?.find(e=>e.id===t)??null,[k,t]),P=u({...j({path:{assistant_id:e,id:t??``}}),enabled:!!t&&M?.origin===`assistant-memory`,select:e=>e.skill.origin===`assistant-memory`?e.skill.sourceConversationId??null:null});if(!t)return(0,Z.jsx)(s,{to:N.skills.root,replace:!0});if(y.isLoading)return(0,Z.jsx)(_,{});if(y.isError&&!M)return(0,Z.jsx)(v,{});if(!M&&y.isFetching)return(0,Z.jsx)(_,{});if(!M)return(0,Z.jsx)(g,{icon:Y,title:`Skill not found`,subtitle:`This skill may have been removed, or the link is out of date.`,children:(0,Z.jsx)(i,{type:`button`,variant:`outlined`,className:`mt-4`,leftIcon:(0,Z.jsx)(m,{"aria-hidden":!0}),onClick:x,children:`Back to skills`})});let F={assistantId:e,skill:M,onBack:x,onInstall:()=>S(M),onRemove:()=>C(M),isInstalling:w(M),isRemoving:T(M),sourceConversationId:P.data??void 0};return(0,Z.jsxs)(Z.Fragment,{children:[d?(0,Z.jsx)(oe,{...F,swipeContainerRef:f}):(0,Z.jsx)(ne,{...F}),(0,Z.jsx)(U,{skillName:E?.name??null,onConfirm:D,onCancel:O})]})}export{le as SkillDetailPage};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Dhiismgm.js";import{t as n}from"./react-DJZBPgpf.js";import{F as r,t as i}from"./button-amTXFI-2.js";import{d as a,p as o,r as s,u as c}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as l}from"./QueryClientProvider-DKhXIxGb.js";import{t as u}from"./useQuery-B45lW1Kk.js";import{t as d}from"./jsx-runtime-CVSDxk6A.js";import{t as f}from"./card-Bv5O5juh.js";import{t as p}from"./createLucideIcon-IRfcSUxS.js";import{t as m}from"./arrow-left-DI9551VI.js";import{a as h,i as g,n as _,r as v,s as y,t as b}from"./use-skill-actions-BKfLB9Oe.js";import{t as x}from"./chevron-down-qD-re7AW.js";import{t as S}from"./menu-Dy5QbnTj.js";import{t as C}from"./code-Czx7d7SK.js";import{t as w}from"./external-link-Dqpx9nRm.js";import{t as T}from"./file-text-CYJz-GvF.js";import{t as E}from"./loader-circle-Cz7opInR.js";import"./src-B2IjVySQ.js";import{n as D}from"./stat-square-CTHnQ1jc.js";import{n as O,t as k}from"./file-markdown-BXUvAQ24.js";import{St as A,bt as j,on as M}from"./react-query.gen-DOfazqkL.js";import{c as N}from"./routes-BbeIx_F9.js";import{Na as P,ca as F,da as I,vr as L,yi as R}from"./index-DQjUULFO.js";import{t as z}from"./use-active-assistant-id-BNRMo_Mi.js";import{n as B,t as V}from"./use-skill-detail-files-DmLQiG5u.js";import{n as H,r as U,t as ee}from"./skills-C9wbjXsQ.js";import{t as te}from"./use-edge-swipe-back-U9h8O8rp.js";import{i as W,n as G,r as K,t as q}from"./file-editor-BbrbkQCm.js";import{t as J}from"./skill-icon-CEEEqpSq.js";var Y=p(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),X=e(n(),1),Z=d();function ne({assistantId:e,skill:t,onBack:n,onInstall:r,onRemove:a,isInstalling:o=!1,isRemoving:s=!1,sourceConversationId:c}){let l=h(t),u=H(t),{fileEntries:d,setSelectedPath:p,activePath:g,activeFile:_,isFilesLoading:v,fileContent:b,isBinary:x,isContentLoading:S}=V(e,t.id);return(0,Z.jsxs)(`div`,{className:`flex h-[calc(100vh-14rem)] flex-col`,children:[(0,Z.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,Z.jsx)(i,{type:`button`,variant:`ghost`,iconOnly:(0,Z.jsx)(m,{"aria-hidden":!0}),"aria-label":`Back to skills`,onClick:n}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,Z.jsx)(J,{skill:t,className:`h-8 w-8 text-3xl`}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,Z.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:t.name}),(0,Z.jsx)(y,{origin:t.origin})]}),(0,Z.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}),(0,Z.jsx)(B,{skill:{origin:t.origin,sourceConversationId:c},className:`mt-1`})]})]}),l?o?(0,Z.jsx)(`div`,{className:`flex h-9 items-center px-3`,children:(0,Z.jsx)(E,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):(0,Z.jsx)(i,{type:`button`,onClick:r,disabled:!r,leftIcon:(0,Z.jsx)(P,{"aria-hidden":!0}),children:`Install`}):(0,Z.jsx)(i,{type:`button`,variant:u?`dangerOutline`:`outlined`,onClick:a,disabled:!u||s||!a,leftIcon:s?(0,Z.jsx)(E,{className:`animate-spin`,"aria-hidden":!0}):(0,Z.jsx)(R,{"aria-hidden":!0}),children:`Remove`})]})]}),(0,Z.jsx)(f.Root,{asChild:!0,noPadding:!0,children:(0,Z.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden sm:grid`,style:{gridTemplateColumns:`240px 1fr`},children:[(0,Z.jsx)(`div`,{className:`max-h-40 shrink-0 overflow-y-auto border-b p-2 sm:max-h-none sm:border-b-0 sm:border-r`,style:{borderColor:`var(--border-base)`},children:v?(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Z.jsx)(E,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):d.length===0?(0,Z.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`No files available.`}):d.map(e=>{let t=g===e.path,n=(e.mimeType??``).endsWith(`/directory`);return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>p(e.path),className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:t?`var(--primary-base)`:`var(--content-default)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:void 0},children:[n?(0,Z.jsx)(F,{className:`h-4 w-4 shrink-0`,style:{color:`var(--system-mid-strong)`}}):(0,Z.jsx)(T,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path)})}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:S?(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(E,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):_?(0,Z.jsx)(re,{assistantId:e,skillId:t.id,fileName:_.name,filePath:_.path,content:b,isBinary:x,editable:t.kind===`installed`},`${t.id}/${_.path}`):(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view its contents.`})})]})})]})}function re({assistantId:e,skillId:n,fileName:r,filePath:o,content:s,isBinary:c,editable:u}){let d=a(),f=l(),[p,m]=(0,X.useState)(!1),[h,g]=(0,X.useState)(``),_=`skills/${n}/${o}`,v=M({onSuccess:()=>{m(!1),g(``),f.invalidateQueries({queryKey:[{_id:`skillsByIdFilesContentGet`}]}),f.invalidateQueries({queryKey:[{_id:`skillsByIdFilesGet`}]}),o===`SKILL.md`&&ee(f,e)},onError:e=>{t(e,{context:`skill-file-save`,bestEffort:!0})}}),y=p&&h!==(s??``),b=(0,X.useCallback)(()=>{!y||v.isPending||v.mutate({path:{assistant_id:e},body:{path:_,content:h,encoding:`utf8`}})},[y,v,e,_,h]),x=(0,X.useCallback)(()=>{m(!0),g(s??``),v.reset()},[s,v]),S=(0,X.useCallback)(()=>{m(!1),g(``),v.reset()},[v]);if(c)return(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Binary file — no preview available.`});if(s===null)return(0,Z.jsxs)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[`No preview available for `,r,`.`]});let C=u?(0,Z.jsx)(i,{variant:`ghost`,size:`regular`,iconOnly:(0,Z.jsx)(w,{"aria-hidden":!0}),onClick:()=>d(`${N.workspace}?file=${encodeURIComponent(_)}`),"aria-label":`Open in Workspace`,className:`hover:bg-[var(--surface-base)]`}):void 0;return O(r,void 0)&&!p?(0,Z.jsx)(`div`,{className:`relative flex h-full flex-col`,children:(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:[(0,Z.jsx)(q,{content:s,fileName:r,showEdit:u,isEditing:!1,onToggleEdit:x,extraActions:C}),(0,Z.jsx)(k,{content:s})]})}):(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Z.jsx)(q,{content:p?h:s,fileName:r,showEdit:u,isEditing:p,onToggleEdit:()=>p?S():x(),extraActions:C}),p?(0,Z.jsx)(K,{value:h,onChange:g,onSave:b}):(0,Z.jsx)(W,{content:s,readOnly:!u,onStartEdit:x})]}),p&&(0,Z.jsx)(G,{isDirty:y,isSaving:v.isPending,error:v.isError?`Save failed`:null,onSave:b,onDiscard:S})]})}var ie=e(r(),1);function ae({fileName:e,content:t,isBinary:n,viewMode:r=`preview`}){return n?(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Binary file — no preview available.`}):t===null?(0,Z.jsxs)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[`No preview available for `,e,`.`]}):O(e,void 0)&&r===`preview`?(0,Z.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Z.jsx)(k,{content:t})}):(0,Z.jsx)(`pre`,{className:`h-full overflow-y-auto whitespace-pre-wrap break-words p-4 font-mono text-body-small-default`,style:{color:`var(--content-default)`},children:t})}function oe({assistantId:e,skill:t,onBack:n,onInstall:r,onRemove:a,isInstalling:o=!1,isRemoving:s=!1,swipeContainerRef:c,sourceConversationId:l}){let u=h(t),d=H(t),{fileEntries:p,setSelectedPath:g,activePath:_,activeFile:v,isFilesLoading:b,fileContent:x,isBinary:S,isContentLoading:w}=V(e,t.id),[T,k]=(0,X.useState)(`preview`);(0,X.useEffect)(()=>{k(`preview`)},[_]);let[A,j]=(0,X.useState)(null);(0,X.useEffect)(()=>{j(document.getElementById(`viewport-overlays`))},[]);let M=v?O(v.name,void 0):!1,N=M?T:`raw`,P=(0,Z.jsxs)(`div`,{ref:c,className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(i,{variant:`ghost`,iconOnly:(0,Z.jsx)(m,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Back to skills`,onClick:n,className:`max-md:bg-[var(--surface-active)]`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:t.name}),(0,Z.jsx)(se,{available:u,removable:d,isInstalling:o,isRemoving:s,onInstall:r,onRemove:a})]}),(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(J,{skill:t,className:`h-6 w-6 shrink-0 text-[22px] leading-none`}),(0,Z.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:t.name})]}),(0,Z.jsx)(y,{origin:t.origin})]}),(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:t.description}),(0,Z.jsx)(B,{skill:{origin:t.origin,sourceConversationId:l}})]}),(0,Z.jsx)(f.Root,{asChild:!0,noPadding:!0,children:(0,Z.jsxs)(`div`,{className:`mt-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-[var(--surface-lift)]`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b px-3 py-2`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsx)(ce,{fileEntries:p,activePath:_,activeName:v?.name??null,onSelect:g}),(0,Z.jsx)(D,{iconOnly:!0,ariaLabel:`File view mode`,value:N,onChange:k,items:[{value:`preview`,label:`Preview`,icon:(0,Z.jsx)(I,{"aria-hidden":!0}),disabled:!M},{value:`raw`,label:`Source`,icon:(0,Z.jsx)(C,{"aria-hidden":!0})}]})]}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:b||w?(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(E,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):v?(0,Z.jsx)(ae,{fileName:v.name,content:x,isBinary:S,viewMode:N}):(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view its contents.`})})]})})]});return A?(0,ie.createPortal)(P,A):P}function se({available:e,removable:t,isInstalling:n,isRemoving:r,onInstall:a,onRemove:o}){return n||r?(0,Z.jsx)(i,{variant:`ghost`,iconOnly:(0,Z.jsx)(E,{className:`animate-spin`,"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,"aria-label":`Pending`,className:`max-md:bg-[var(--surface-active)]`}):e?(0,Z.jsx)(i,{variant:`ghost`,iconOnly:(0,Z.jsx)(P,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Install skill`,onClick:a,disabled:!a,className:`max-md:bg-[var(--surface-active)]`}):t?(0,Z.jsx)(i,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(R,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Remove skill`,onClick:o,disabled:!o,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`}):(0,Z.jsx)(i,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(R,{"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,title:`Bundled skills cannot be removed`,"aria-label":`Bundled skill cannot be removed`,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`})}function Q(e){return(e??``).endsWith(`/directory`)}function ce({fileEntries:e,activePath:t,activeName:n,onSelect:r}){let i=n??`Select a file`;return e.length===0?(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)($,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i})]}):(0,Z.jsxs)(S.Root,{children:[(0,Z.jsx)(S.Trigger,{children:(0,Z.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 rounded-md text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)($,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i}),(0,Z.jsx)(x,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})}),(0,Z.jsx)(S.Content,{align:`start`,children:e.map(e=>{let n=Q(e.mimeType);return(0,Z.jsx)(S.Item,{onSelect:()=>r(e.path),leftIcon:n?(0,Z.jsx)(F,{}):(0,Z.jsx)(T,{}),"aria-current":e.path===t?`true`:void 0,children:e.name},e.path)})})]})}function $(){return(0,Z.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-[var(--surface-base)]`,"aria-hidden":!0,children:(0,Z.jsx)(T,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})})}function le(){let e=z(),{skillId:t}=o(),n=a(),r=c(),{pathname:l}=r,d=L(),f=(0,X.useRef)(null),p=r.state,h=typeof p?.listSearch==`string`?p.listSearch:``,y=u({...A({path:{assistant_id:e},query:{include:`catalog`}}),select:e=>e.skills,refetchOnMount:`always`}),x=(0,X.useCallback)(()=>{n(`${N.skills.root}${h}`,{replace:!0})},[n,h]);te({containerRef:f,onBack:x,enabled:d,navKey:l});let{handleInstall:S,handleRemove:C,isInstallingSkill:w,isRemovingSkill:T,skillPendingRemoval:E,confirmRemove:D,cancelRemove:O}=b(e,{onRemoved:x}),k=y.data,M=(0,X.useMemo)(()=>k?.find(e=>e.id===t)??null,[k,t]),P=u({...j({path:{assistant_id:e,id:t??``}}),enabled:!!t&&M?.origin===`assistant-memory`,select:e=>e.skill.origin===`assistant-memory`?e.skill.sourceConversationId??null:null});if(!t)return(0,Z.jsx)(s,{to:N.skills.root,replace:!0});if(y.isLoading)return(0,Z.jsx)(_,{});if(y.isError&&!M)return(0,Z.jsx)(v,{});if(!M&&y.isFetching)return(0,Z.jsx)(_,{});if(!M)return(0,Z.jsx)(g,{icon:Y,title:`Skill not found`,subtitle:`This skill may have been removed, or the link is out of date.`,children:(0,Z.jsx)(i,{type:`button`,variant:`outlined`,className:`mt-4`,leftIcon:(0,Z.jsx)(m,{"aria-hidden":!0}),onClick:x,children:`Back to skills`})});let F={assistantId:e,skill:M,onBack:x,onInstall:()=>S(M),onRemove:()=>C(M),isInstalling:w(M),isRemoving:T(M),sourceConversationId:P.data??void 0};return(0,Z.jsxs)(Z.Fragment,{children:[d?(0,Z.jsx)(oe,{...F,swipeContainerRef:f}):(0,Z.jsx)(ne,{...F}),(0,Z.jsx)(U,{skillName:E?.name??null,onConfirm:D,onCancel:O})]})}export{le as SkillDetailPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Dhiismgm.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-amTXFI-2.js";import{d as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as a}from"./QueryClientProvider-DKhXIxGb.js";import{t as o}from"./useQuery-B45lW1Kk.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./typography-D5f7kt80.js";import{t as l}from"./brain-BLDXGaUy.js";import{t as u}from"./menu-Dy5QbnTj.js";import{t as d}from"./loader-circle-Cz7opInR.js";import"./src-B2IjVySQ.js";import{t as f}from"./file-markdown-BXUvAQ24.js";import{n as p}from"./resolved-assistants-store-BSZbT8Ju.js";import{an as m,bt as h}from"./react-query.gen-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Dhiismgm.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-amTXFI-2.js";import{d as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as a}from"./QueryClientProvider-DKhXIxGb.js";import{t as o}from"./useQuery-B45lW1Kk.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./typography-D5f7kt80.js";import{t as l}from"./brain-BLDXGaUy.js";import{t as u}from"./menu-Dy5QbnTj.js";import{t as d}from"./loader-circle-Cz7opInR.js";import"./src-B2IjVySQ.js";import{t as f}from"./file-markdown-BXUvAQ24.js";import{n as p}from"./resolved-assistants-store-BSZbT8Ju.js";import{an as m,bt as h}from"./react-query.gen-DOfazqkL.js";import{c as g}from"./routes-BbeIx_F9.js";import{pa as _,u as v,yi as y}from"./index-DQjUULFO.js";import{n as b,t as x}from"./use-skill-detail-files-DmLQiG5u.js";import{n as S,r as C,t as w}from"./skills-C9wbjXsQ.js";var T=e(n(),1),E=s();function D({skillId:e,onClose:n}){let s=i(),D=a(),O=p.use.activeAssistantId(),[k,A]=(0,T.useState)(!1),j=o({...h({path:{assistant_id:O??``,id:e}}),select:e=>e.skill,enabled:!!O}),M=j.data,{skillMd:N,fileContent:P,isFilesPending:F,isContentPending:I}=x(O,e),L=m({onSuccess:()=>{O&&w(D,O),n()},onError:e=>{t(e,{context:`skill-detail-panel-remove`})}}),R=()=>{O&&(L.mutate({path:{assistant_id:O,id:e}}),A(!1))},z=j.isPending||F||N!=null&&I,B=M!=null&&S(M);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(v,{icon:M?.emoji?(0,E.jsx)(`span`,{className:`text-xl leading-none`,"aria-hidden":!0,children:M.emoji}):void 0,Glyph:l,title:M?.name??`Skill`,closeLabel:`Close skill details`,onClose:n,headerActions:B?(0,E.jsxs)(u.Root,{children:[(0,E.jsx)(u.Trigger,{asChild:!0,children:(0,E.jsx)(r,{variant:`ghost`,iconOnly:(0,E.jsx)(_,{}),"aria-label":`Skill actions`,className:`shrink-0`})}),(0,E.jsx)(u.Content,{side:`bottom`,align:`end`,children:(0,E.jsx)(u.Item,{leftIcon:(0,E.jsx)(y,{size:14}),onSelect:()=>A(!0),children:`Remove skill`})})]}):void 0,footer:(0,E.jsx)(r,{fullWidth:!0,onClick:()=>s(g.skills.detail(e)),children:`Go to Skill`}),children:j.isError&&!M?(0,E.jsx)(c,{variant:`body-medium-lighter`,as:`p`,className:`py-8 text-center text-[var(--content-tertiary)]`,children:`This skill could not be loaded. It may have been removed.`}):z?(0,E.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,E.jsx)(d,{className:`h-5 w-5 animate-spin text-[var(--content-tertiary)]`})}):(0,E.jsxs)(E.Fragment,{children:[M?.description&&(0,E.jsx)(c,{variant:`body-medium-lighter`,as:`p`,className:`mb-4 text-[var(--content-secondary)]`,children:M.description}),M&&(0,E.jsx)(b,{skill:M,className:`mb-4`,onNavigate:n}),P&&(0,E.jsx)(f,{content:P})]})}),(0,E.jsx)(C,{skillName:k&&M?M.name:null,onConfirm:R,onCancel:()=>A(!1)})]})}export{D as SkillDetailPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-CVSDxk6A.js";import"./src-B2IjVySQ.js";import{t}from"./confirm-dialog-CSkhRFRk.js";import{Ct as n}from"./react-query.gen-
|
|
1
|
+
import{t as e}from"./jsx-runtime-CVSDxk6A.js";import"./src-B2IjVySQ.js";import{t}from"./confirm-dialog-CSkhRFRk.js";import{Ct as n}from"./react-query.gen-DOfazqkL.js";var r=e();function i({skillName:e,onConfirm:n,onCancel:i}){return(0,r.jsx)(t,{open:e!==null,title:`Remove skill`,message:e?`Remove "${e}" from this assistant?`:``,confirmLabel:`Remove`,destructive:!0,onConfirm:n,onCancel:i})}function a(e){return e.kind===`installed`}function o(e,t){e.invalidateQueries({queryKey:n({path:{assistant_id:t}})})}export{a as n,i as r,o as t};
|