@vellumai/web 0.11.2-staging.1 → 0.11.2-staging.2

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.
Files changed (104) hide show
  1. package/dist/assets/{access-DRXEXX07.js → access-CVnesk0m.js} +1 -1
  2. package/dist/assets/{account-page-CX6hJQwg.js → account-page-mMG1nL1O.js} +1 -1
  3. package/dist/assets/{acp-run-detail-panel-CiQqwf32.js → acp-run-detail-panel-SN6NIuW5.js} +1 -1
  4. package/dist/assets/activity-steps-panel-bduSS8_d.js +1 -0
  5. package/dist/assets/{ai-page-DMad1ZuI.js → ai-page-BMqECtJX.js} +1 -1
  6. package/dist/assets/{app-card-CiARsZNb.js → app-card-BJigGog3.js} +1 -1
  7. package/dist/assets/{assistant-status-panel-BcO4L1Ot.js → assistant-status-panel-DyjhJvK6.js} +1 -1
  8. package/dist/assets/auth-store-C9aYqB9U.js +2 -0
  9. package/dist/assets/background-task-actions-DmocXKSr.js +1 -0
  10. package/dist/assets/{background-task-detail-panel-Cwy0aX1X.js → background-task-detail-panel-DCtBOnvF.js} +1 -1
  11. package/dist/assets/{billing-page-DtY1C_1i.js → billing-page-TF_LgX6K.js} +1 -1
  12. package/dist/assets/{bookmarks-page-CR6qlXH4.js → bookmarks-page-Brvj5Jf6.js} +1 -1
  13. package/dist/assets/{build-state-dDRg651i.js → build-state-9uUe0jN5.js} +1 -1
  14. package/dist/assets/{channels-page-route-BkAp7hp5.js → channels-page-route-8vJJE2LN.js} +1 -1
  15. package/dist/assets/{chat-markdown-message-Da34digC.js → chat-markdown-message-B7qvlO44.js} +1 -1
  16. package/dist/assets/{checkout-page-ChHhRSW7.js → checkout-page-MpIPAAgf.js} +1 -1
  17. package/dist/assets/{command-palette-window-page-BYRKvEj-.js → command-palette-window-page-CoweYsZl.js} +1 -1
  18. package/dist/assets/{contacts-page-route-6Pnu98io.js → contacts-page-route-BOpVOsYK.js} +1 -1
  19. package/dist/assets/{conversation-navigation-BqoIExAQ.js → conversation-navigation-Bf3cDRKh.js} +1 -1
  20. package/dist/assets/{conversation-queries-Dcm9S7mz.js → conversation-queries-BBj4FfQn.js} +1 -1
  21. package/dist/assets/{credentials-page-BnxIymyf.js → credentials-page-DBLT8nUI.js} +1 -1
  22. package/dist/assets/{debug-page-Bjdmoc6_.js → debug-page-DfPZPo6D.js} +1 -1
  23. package/dist/assets/{developer-page-CiJvs_Lu.js → developer-page-DwBmhm09.js} +1 -1
  24. package/dist/assets/{document-viewer-page-CsLTrhRq.js → document-viewer-page-CA1ParJ6.js} +1 -1
  25. package/dist/assets/{emails-page-DPdeEAZJ.js → emails-page-Bo0Bwem2.js} +1 -1
  26. package/dist/assets/{first-run-scope-CXWfJKeP.js → first-run-scope-CPJpXaWU.js} +1 -1
  27. package/dist/assets/{general-page-DYnUkwRE.js → general-page-BXeIQDGi.js} +1 -1
  28. package/dist/assets/{hatching-screen-CxSp0qa2.js → hatching-screen-BUpSlvBy.js} +1 -1
  29. package/dist/assets/{home-page-route-dqvJQwjW.js → home-page-route-BPht0PNp.js} +1 -1
  30. package/dist/assets/{hosting-screen-kj-kAK7Q.js → hosting-screen-DxtyBx0I.js} +1 -1
  31. package/dist/assets/index-C7_04HXM.css +2 -0
  32. package/dist/assets/index-CPeIfypI.js +11 -0
  33. package/dist/assets/{inspect-page-BlY6O00x.js → inspect-page-C8aLJOd6.js} +1 -1
  34. package/dist/assets/{integrations-page-49zuLodO.js → integrations-page-Bp2Q81Qt.js} +1 -1
  35. package/dist/assets/{library-detail-page-fsYlOanf.js → library-detail-page-gC4yIWnV.js} +1 -1
  36. package/dist/assets/{library-page-CjJhvK-9.js → library-page-B10gnbXU.js} +1 -1
  37. package/dist/assets/{local-runtime-upgrade-BvHY1msh.js → local-runtime-upgrade-CnY-6TiF.js} +1 -1
  38. package/dist/assets/{login-flow-DmQTk-x9.js → login-flow-CQhvCbQQ.js} +1 -1
  39. package/dist/assets/{login-page-BvisuxEP.js → login-page-CbWRbJDE.js} +1 -1
  40. package/dist/assets/{logout-page-BMKKBE_F.js → logout-page-DCyzi0V6.js} +1 -1
  41. package/dist/assets/{logs-layout-BJe9y8po.js → logs-layout-CYkqau4S.js} +1 -1
  42. package/dist/assets/{memory-page-route-BcZNNNO7.js → memory-page-route-j_3602nh.js} +1 -1
  43. package/dist/assets/{memory-router-playground-page-DTR4Mrw4.js → memory-router-playground-page-x5X662qi.js} +1 -1
  44. package/dist/assets/message-content-B6_GZQl9.js +1 -0
  45. package/dist/assets/{message-files-panel-CKeLnC4N.js → message-files-panel-C8JokH6e.js} +1 -1
  46. package/dist/assets/{messages-QgGSiklY.js → messages-Dyp1xUqz.js} +1 -1
  47. package/dist/assets/{notifications-rSx7pNPi.js → notifications-BTG4cTbF.js} +1 -1
  48. package/dist/assets/{notifications-page-Cu8hoFGy.js → notifications-page-BA2BW5y6.js} +1 -1
  49. package/dist/assets/{open-workspace-file-B_Rft7dd.js → open-workspace-file-CivxJWcw.js} +2 -2
  50. package/dist/assets/{plans-page-BDMR-ZtU.js → plans-page-BfyCgy38.js} +1 -1
  51. package/dist/assets/{platform-login-notice-q7ZuGeuo.js → platform-login-notice-DFmjUE9q.js} +1 -1
  52. package/dist/assets/{platform-loopback-page-e9XVrvYR.js → platform-loopback-page-BGF_H8f_.js} +1 -1
  53. package/dist/assets/{privacy-page-BZSbEQ1K.js → privacy-page-BhEGh78C.js} +1 -1
  54. package/dist/assets/{privacy-screen-BnQiOWl7.js → privacy-screen-CWVCI_KU.js} +1 -1
  55. package/dist/assets/{provider-callback-page-z2Cgryjl.js → provider-callback-page-DP5cKqPE.js} +1 -1
  56. package/dist/assets/{provider-signup-page-B-Li8WKA.js → provider-signup-page-BjiiJWS_.js} +1 -1
  57. package/dist/assets/{research-onboarding-route-C7jtWVgW.js → research-onboarding-route-DZF-B2Rk.js} +1 -1
  58. package/dist/assets/{retire-confirm-dialog-CgvcI85l.js → retire-confirm-dialog-8xlq4bkx.js} +1 -1
  59. package/dist/assets/{review-terms-screen-Bwu6-idm.js → review-terms-screen-C5BAI3Rx.js} +1 -1
  60. package/dist/assets/routes-uGHUgv4F.js +23 -0
  61. package/dist/assets/{runtime-upgrade-banner-BhPmj3_g.js → runtime-upgrade-banner-DjFuJawk.js} +1 -1
  62. package/dist/assets/{schedules-page-CT6myKlW.js → schedules-page-3ZE1nR6I.js} +1 -1
  63. package/dist/assets/{select-assistant-screen-DbeX0PLD.js → select-assistant-screen-D4WHHv61.js} +1 -1
  64. package/dist/assets/{settings-layout-ChyYdGV8.js → settings-layout-BmOglXDq.js} +1 -1
  65. package/dist/assets/{settings-navigation-DNl4C8Cc.js → settings-navigation-CyH-twYD.js} +1 -1
  66. package/dist/assets/{share-feedback-modal-7O61hwO1.js → share-feedback-modal-Rwuho_1S.js} +1 -1
  67. package/dist/assets/{sidebar-tree-CsfghEZ-.js → sidebar-tree-Dxx5qLMQ.js} +1 -1
  68. package/dist/assets/{signup-page-DDuZGMBS.js → signup-page-BAEo45pt.js} +1 -1
  69. package/dist/assets/site-favicon-CDH0mg6Q.js +1 -0
  70. package/dist/assets/{skill-detail-page-u1LBXWn1.js → skill-detail-page-DswXTTyb.js} +1 -1
  71. package/dist/assets/{subagent-detail-panel-8-Z5ZMUL.js → subagent-detail-panel-CidisBCf.js} +1 -1
  72. package/dist/assets/{system-events-page-DLvxCVqo.js → system-events-page-BrvTNeiN.js} +1 -1
  73. package/dist/assets/{tool-detail-panel-BmohMKch.js → tool-detail-panel-B2CIRZkB.js} +2 -2
  74. package/dist/assets/transcript-message-body-shared-BfKwS5qD.js +1 -0
  75. package/dist/assets/{upgrade-cancel-page-DcWOus4Y.js → upgrade-cancel-page-DjeqfvTa.js} +1 -1
  76. package/dist/assets/{upgrade-success-page-BSzX2vWY.js → upgrade-success-page-B4TCn340.js} +1 -1
  77. package/dist/assets/{use-checkout-dismiss-refresh-BcEeQKyP.js → use-checkout-dismiss-refresh-CV_H4uEB.js} +1 -1
  78. package/dist/assets/{use-command-palette-sections-DvMBAWZC.js → use-command-palette-sections-BshFMe0w.js} +1 -1
  79. package/dist/assets/{use-edit-app-DOmv9zsZ.js → use-edit-app-Bd1eXXFq.js} +1 -1
  80. package/dist/assets/{use-is-org-ready-Df3qfx4p.js → use-is-org-ready-3vHDbj4G.js} +1 -1
  81. package/dist/assets/{use-onboarding-login-V-vR-6Zd.js → use-onboarding-login-CiQyxJLM.js} +1 -1
  82. package/dist/assets/{use-platform-assistant-id-y2pWr9on.js → use-platform-assistant-id-DgrNmSy2.js} +1 -1
  83. package/dist/assets/{use-platform-gate-B_3hHMqw.js → use-platform-gate-C5bNA5Pn.js} +1 -1
  84. package/dist/assets/{use-return-to-short-circuit-DzCxe5P0.js → use-return-to-short-circuit-g88hMnN8.js} +1 -1
  85. package/dist/assets/{use-sticky-profiles-DamFnjb1.js → use-sticky-profiles-D5TVHOgw.js} +1 -1
  86. package/dist/assets/use-subagent-card-data-bjGydvhR.js +1 -0
  87. package/dist/assets/{use-transcript-message-by-id-BxaY6TIY.js → use-transcript-message-by-id-BgyP3Ki5.js} +1 -1
  88. package/dist/assets/{use-transcript-messages-CgESPWZ3.js → use-transcript-messages-C2uwkjKL.js} +1 -1
  89. package/dist/assets/{viewer-store-Cp5tMX-G.js → viewer-store-DbIS4l8d.js} +1 -1
  90. package/dist/assets/{voice-list-yvKUrPIf.js → voice-list-D26Lzbpv.js} +1 -1
  91. package/dist/assets/{voice-page-C8EoRpvD.js → voice-page-CQ2Vp8p4.js} +1 -1
  92. package/dist/assets/{welcome-screen-DzQAH74J.js → welcome-screen-CdsjDVfi.js} +1 -1
  93. package/dist/index.html +34 -34
  94. package/package.json +1 -1
  95. package/dist/assets/activity-steps-panel-Ds6C3Jf0.js +0 -1
  96. package/dist/assets/auth-store-CWJoXmMk.js +0 -2
  97. package/dist/assets/background-task-actions-762wxVkT.js +0 -1
  98. package/dist/assets/index-DQqBZlYO.js +0 -11
  99. package/dist/assets/index-OYTmjL3q.css +0 -2
  100. package/dist/assets/risk-Bnj8QXuk.js +0 -1
  101. package/dist/assets/routes-SchRo2Ae.js +0 -23
  102. package/dist/assets/site-favicon-FokoB0J2.js +0 -1
  103. package/dist/assets/transcript-message-body-shared-DkwwIkg0.js +0 -1
  104. package/dist/assets/use-subagent-card-data-B31LofB3.js +0 -1
@@ -1 +1 @@
1
- import{t as e}from"./capture-error-CqtAGHQu.js";import"./src-Da9g8qsW.js";import{n as t}from"./toast-BtFgiPe3.js";import{n,t as r}from"./create-selectors-BfxF8Sx_.js";import{t as i}from"./api-errors-BRGPPSWw.js";import{Ct as a,n as o,xt as s}from"./sdk.gen-CjtCuSlS.js";import{t as c}from"./open-workspace-file-B_Rft7dd.js";import{o as l}from"./workspace-path-links-vDBIljq_.js";var u=new Map;function d(e,t){return`${e}::${t}`}function f(e,t){let n=d(e,t),r=u.get(n);return r??(r=o({path:{assistant_id:e,id:t},throwOnError:!0}).then(e=>e.data.html).catch(e=>{throw u.delete(n),e}),u.set(n,r)),r}function p(e,t,n){u.set(d(e,t),Promise.resolve(n))}function m(e,t){u.delete(d(e,t))}function h(e){if(typeof e!=`object`||!e)return!1;let t=e.error;if(typeof t!=`object`||!t||t.code!==`NOT_FOUND`)return!1;let n=t.message;return typeof n==`string`&&n.startsWith(`App not found`)}function g(e){return e instanceof i&&e.status<500&&e.message?e.message:`Couldn't open this file`}var _=[`File not found`,`The file backing this document no longer exists`];function v(e){return!(e instanceof i)||e.status!==404?!1:!_.some(t=>e.message.startsWith(t))}function y(e,t){let n=e.mainView;return n===`document`||n===`subagent-detail`||n===`tool-detail`||n===`activity-steps`||n===`message-files`||n===`workflow-detail`||n===`acp-run-detail`||n===`background-task-detail`||n===`skill-detail`||n===`channel-setup`?e[t]:n}function b(e,t){return e===null||e.source!==t.source?!1:e.source===`document`&&t.source===`document`?e.surfaceId===t.surfaceId:e.source===`document`||t.source===`document`?!1:e.workspacePath===t.workspacePath}function x(e,t){return e.messageId!=null||t.messageId!=null?e.messageId===t.messageId&&e.groupIndex===t.groupIndex:e.toolCalls[0]?.id===t.toolCalls[0]?.id}function S(e,t){return e.messageId===t.messageId}function C(e,t){return t.messageId==null?e.thinkingText===t.thinkingText:e.messageId===t.messageId&&e.thinkingGroupIndex===t.thinkingGroupIndex&&e.thinkingItemIndex===t.thinkingItemIndex}var w={mainView:`chat`,activeAppId:null,openedAppState:null,activeDocumentTarget:null,openedDocumentState:null,isAppMinimized:!1,intelligenceTab:`identity`,assetsRefreshKey:0,viewBeforeDocument:`chat`,activeSubagentId:null,viewBeforeSubagentDetail:`chat`,activeToolDetail:null,viewBeforeToolDetail:`chat`,activeActivitySteps:null,viewBeforeActivitySteps:`chat`,activeMessageFiles:null,viewBeforeMessageFiles:`chat`,activeWorkflowRunId:null,viewBeforeWorkflowDetail:`chat`,activeAcpRunId:null,viewBeforeAcpRunDetail:`chat`,activeBackgroundTaskId:null,viewBeforeBackgroundTaskDetail:`chat`,activeSkillDetailId:null,viewBeforeSkillDetail:`chat`,activeChannelSetup:null,viewBeforeChannelSetup:`chat`,ruleEditorRequestSeq:0,ruleEditorRequestToolCallId:null},T=r(n()((n,r)=>({...w,setMainView:e=>{r().mainView!==e&&n({mainView:e})},setIntelligenceTab:e=>{r().intelligenceTab!==e&&n({intelligenceTab:e})},openApp:e=>{n({mainView:`app`,activeAppId:e,openedAppState:null,isAppMinimized:!1})},loadApp:async(t,i)=>{n({mainView:`app`,activeAppId:i,openedAppState:null,isAppMinimized:!1});try{let{data:e}=await o({path:{assistant_id:t,id:i},throwOnError:!0});if(r().activeAppId!==i)return;n({openedAppState:{appId:e.appId,dirName:e.dirName,name:e.name,html:e.html}}),p(t,e.appId,e.html)}catch(t){if(r().activeAppId!==i)return;h(t)||e(t,{context:`openApp`}),n({mainView:`chat`,activeAppId:null,openedAppState:null})}},setLoadedApp:e=>{n({openedAppState:e})},handleAppLoadFailed:()=>{n({mainView:`chat`,activeAppId:null,openedAppState:null})},closeApp:()=>{n({mainView:`chat`,activeAppId:null,openedAppState:null,isAppMinimized:!1})},toggleAppMinimized:()=>{n({isAppMinimized:!r().isAppMinimized})},minimizeApp:()=>{n({isAppMinimized:!0})},handleAppUnpinned:e=>{let t=r();return t.activeAppId!==e||t.mainView!==`app`&&t.mainView!==`app-editing`?!1:(r().closeApp(),!0)},enterAppEditing:()=>{n({mainView:`app-editing`})},exitAppEditing:()=>{n({mainView:`app`})},openSubagentDetail:e=>{n({mainView:`subagent-detail`,activeSubagentId:e,viewBeforeSubagentDetail:y(r(),`viewBeforeSubagentDetail`)})},closeSubagentDetail:()=>{n({mainView:r().viewBeforeSubagentDetail,activeSubagentId:null})},openWorkflowDetail:e=>{n({mainView:`workflow-detail`,activeWorkflowRunId:e,viewBeforeWorkflowDetail:y(r(),`viewBeforeWorkflowDetail`)})},closeWorkflowDetail:()=>{n({mainView:r().viewBeforeWorkflowDetail,activeWorkflowRunId:null})},openAcpRunDetail:e=>{n({mainView:`acp-run-detail`,activeAcpRunId:e,viewBeforeAcpRunDetail:y(r(),`viewBeforeAcpRunDetail`)})},closeAcpRunDetail:()=>{n({mainView:r().viewBeforeAcpRunDetail,activeAcpRunId:null})},openBackgroundTaskDetail:e=>{n({mainView:`background-task-detail`,activeBackgroundTaskId:e,viewBeforeBackgroundTaskDetail:y(r(),`viewBeforeBackgroundTaskDetail`)})},closeBackgroundTaskDetail:()=>{n({mainView:r().viewBeforeBackgroundTaskDetail,activeBackgroundTaskId:null})},openSkillDetail:e=>{n({mainView:`skill-detail`,activeSkillDetailId:e,viewBeforeSkillDetail:y(r(),`viewBeforeSkillDetail`)})},closeSkillDetail:()=>{n({mainView:r().viewBeforeSkillDetail,activeSkillDetailId:null})},openProcessDetail:({kind:e,id:t})=>{switch(e){case`subagent`:r().openSubagentDetail(t);return;case`workflow`:r().openWorkflowDetail(t);return;case`acp-run`:r().openAcpRunDetail(t);return;case`background-task`:r().openBackgroundTaskDetail(t);return;default:}},closeActiveOverlay:()=>{switch(r().mainView){case`document`:return r().closeDocument(),!0;case`subagent-detail`:return r().closeSubagentDetail(),!0;case`tool-detail`:return r().closeToolDetail(),!0;case`activity-steps`:return r().closeActivitySteps(),!0;case`message-files`:return r().closeMessageFiles(),!0;case`workflow-detail`:return r().closeWorkflowDetail(),!0;case`acp-run-detail`:return r().closeAcpRunDetail(),!0;case`background-task-detail`:return r().closeBackgroundTaskDetail(),!0;case`skill-detail`:return r().closeSkillDetail(),!0;case`channel-setup`:return r().closeChannelSetup(),!0;default:return!1}},openChannelSetup:e=>{n({mainView:`channel-setup`,activeChannelSetup:e,viewBeforeChannelSetup:y(r(),`viewBeforeChannelSetup`)})},closeChannelSetup:()=>{n({mainView:r().viewBeforeChannelSetup,activeChannelSetup:null})},openToolDetail:e=>{n({mainView:`tool-detail`,activeToolDetail:e,viewBeforeToolDetail:y(r(),`viewBeforeToolDetail`)})},toggleToolDetail:e=>{let t=r(),n=t.activeToolDetail;t.mainView===`tool-detail`&&n!=null&&(e.kind===`thinking`?n.kind===`thinking`&&C(n,e):n.kind!==`thinking`&&n.toolCallId===e.toolCallId)?r().closeToolDetail():r().openToolDetail(e)},closeToolDetail:()=>{n({mainView:r().viewBeforeToolDetail,activeToolDetail:null})},requestRuleEditor:e=>{e&&n(t=>({ruleEditorRequestSeq:t.ruleEditorRequestSeq+1,ruleEditorRequestToolCallId:e}))},openActivitySteps:e=>{n({mainView:`activity-steps`,activeActivitySteps:e,viewBeforeActivitySteps:y(r(),`viewBeforeActivitySteps`)})},toggleActivitySteps:e=>{let t=r(),n=t.activeActivitySteps;t.mainView===`activity-steps`&&n!=null&&x(n,e)?r().closeActivitySteps():r().openActivitySteps(e)},closeActivitySteps:()=>{n({mainView:r().viewBeforeActivitySteps,activeActivitySteps:null})},openMessageFiles:e=>{n({mainView:`message-files`,activeMessageFiles:e,viewBeforeMessageFiles:y(r(),`viewBeforeMessageFiles`)})},toggleMessageFiles:e=>{let t=r(),n=t.activeMessageFiles;t.mainView===`message-files`&&n!=null&&S(n,e)?r().closeMessageFiles():r().openMessageFiles(e)},closeMessageFiles:()=>{n({mainView:r().viewBeforeMessageFiles,activeMessageFiles:null})},clearTranscriptPanelPayloads:()=>{n({activeMessageFiles:null,activeActivitySteps:null,activeToolDetail:null})},openDocument:()=>{n({mainView:`document`,openedDocumentState:null,viewBeforeDocument:y(r(),`viewBeforeDocument`)})},loadDocument:async(e,t)=>{let i=y(r(),`viewBeforeDocument`),a={source:`document`,surfaceId:t};n({mainView:`document`,activeDocumentTarget:a,openedDocumentState:null,viewBeforeDocument:i});try{let{data:o}=await s({path:{assistant_id:e,id:t},throwOnError:!0});if(!b(r().activeDocumentTarget,a))return;if(!o){n({mainView:i,activeDocumentTarget:null,openedDocumentState:null});return}n({openedDocumentState:{source:`document`,surfaceId:o.surfaceId,conversationId:o.conversationId,documentName:o.title??`Untitled`,content:o.content??``,workspacePath:o.workspacePath}})}catch{if(!b(r().activeDocumentTarget,a))return;n({mainView:i,activeDocumentTarget:null,openedDocumentState:null})}},loadWorkspaceFileDocument:async(e,i,o)=>{let s=y(r(),`viewBeforeDocument`),l={source:`workspace-file`,workspacePath:i};n({mainView:`document`,activeDocumentTarget:l,openedDocumentState:null,viewBeforeDocument:s});let u=e=>{if(b(r().activeDocumentTarget,l)){if(n({mainView:s,activeDocumentTarget:null,openedDocumentState:null}),v(e)){c(i);return}t.error(g(e))}};try{let{data:t}=await a({path:{assistant_id:e},body:{path:i,conversationId:o},throwOnError:!0});if(!b(r().activeDocumentTarget,l))return;if(!t){u(null);return}n({activeDocumentTarget:{source:`document`,surfaceId:t.surfaceId},openedDocumentState:{source:`document`,surfaceId:t.surfaceId,conversationId:t.conversationId,documentName:t.title||`Untitled`,content:t.content??``,workspacePath:t.workspacePath}})}catch(e){u(e)}},openWorkspaceFilePreview:(e,t)=>{n({mainView:`document`,activeDocumentTarget:{source:`workspace-file-preview`,workspacePath:e},openedDocumentState:{source:`workspace-file-preview`,workspacePath:e,documentName:l(e),previewKind:t},viewBeforeDocument:y(r(),`viewBeforeDocument`)})},setLoadedDocument:e=>{n({openedDocumentState:e})},updateDocumentContent:(e,t,i)=>{let a=r().openedDocumentState;if(!a||a.source!==`document`||a.surfaceId!==e)return;let o=i===`append`?a.content+t:t;n({openedDocumentState:{...a,content:o}})},handleDocumentLoadFailed:()=>{n({mainView:r().viewBeforeDocument,activeDocumentTarget:null,openedDocumentState:null})},closeDocument:()=>{n({mainView:r().viewBeforeDocument,activeDocumentTarget:null,openedDocumentState:null})},refreshAssets:()=>{n({assetsRefreshKey:r().assetsRefreshKey+1})},reset:()=>n({...w})})));export{m as a,T as i,S as n,f as o,C as r,p as s,x as t};
1
+ import{t as e}from"./capture-error-CqtAGHQu.js";import"./src-Da9g8qsW.js";import{n as t}from"./toast-BtFgiPe3.js";import{n,t as r}from"./create-selectors-BfxF8Sx_.js";import{t as i}from"./api-errors-BRGPPSWw.js";import{Ct as a,n as o,xt as s}from"./sdk.gen-CjtCuSlS.js";import{t as c}from"./open-workspace-file-CivxJWcw.js";import{o as l}from"./workspace-path-links-vDBIljq_.js";var u=new Map;function d(e,t){return`${e}::${t}`}function f(e,t){let n=d(e,t),r=u.get(n);return r??(r=o({path:{assistant_id:e,id:t},throwOnError:!0}).then(e=>e.data.html).catch(e=>{throw u.delete(n),e}),u.set(n,r)),r}function p(e,t,n){u.set(d(e,t),Promise.resolve(n))}function m(e,t){u.delete(d(e,t))}function h(e){if(typeof e!=`object`||!e)return!1;let t=e.error;if(typeof t!=`object`||!t||t.code!==`NOT_FOUND`)return!1;let n=t.message;return typeof n==`string`&&n.startsWith(`App not found`)}function g(e){return e instanceof i&&e.status<500&&e.message?e.message:`Couldn't open this file`}var _=[`File not found`,`The file backing this document no longer exists`];function v(e){return!(e instanceof i)||e.status!==404?!1:!_.some(t=>e.message.startsWith(t))}function y(e,t){let n=e.mainView;return n===`document`||n===`subagent-detail`||n===`tool-detail`||n===`activity-steps`||n===`message-files`||n===`workflow-detail`||n===`acp-run-detail`||n===`background-task-detail`||n===`skill-detail`||n===`channel-setup`?e[t]:n}function b(e,t){return e===null||e.source!==t.source?!1:e.source===`document`&&t.source===`document`?e.surfaceId===t.surfaceId:e.source===`document`||t.source===`document`?!1:e.workspacePath===t.workspacePath}function x(e,t){return e.messageId!=null||t.messageId!=null?e.messageId===t.messageId&&e.groupIndex===t.groupIndex:e.toolCalls[0]?.id===t.toolCalls[0]?.id}function S(e,t){return e.messageId===t.messageId}function C(e,t){return t.messageId==null?e.thinkingText===t.thinkingText:e.messageId===t.messageId&&e.thinkingGroupIndex===t.thinkingGroupIndex&&e.thinkingItemIndex===t.thinkingItemIndex}var w={mainView:`chat`,activeAppId:null,openedAppState:null,activeDocumentTarget:null,openedDocumentState:null,isAppMinimized:!1,intelligenceTab:`identity`,assetsRefreshKey:0,viewBeforeDocument:`chat`,activeSubagentId:null,viewBeforeSubagentDetail:`chat`,activeToolDetail:null,viewBeforeToolDetail:`chat`,activeActivitySteps:null,viewBeforeActivitySteps:`chat`,activeMessageFiles:null,viewBeforeMessageFiles:`chat`,activeWorkflowRunId:null,viewBeforeWorkflowDetail:`chat`,activeAcpRunId:null,viewBeforeAcpRunDetail:`chat`,activeBackgroundTaskId:null,viewBeforeBackgroundTaskDetail:`chat`,activeSkillDetailId:null,viewBeforeSkillDetail:`chat`,activeChannelSetup:null,viewBeforeChannelSetup:`chat`,ruleEditorRequestSeq:0,ruleEditorRequestToolCallId:null},T=r(n()((n,r)=>({...w,setMainView:e=>{r().mainView!==e&&n({mainView:e})},setIntelligenceTab:e=>{r().intelligenceTab!==e&&n({intelligenceTab:e})},openApp:e=>{n({mainView:`app`,activeAppId:e,openedAppState:null,isAppMinimized:!1})},loadApp:async(t,i)=>{n({mainView:`app`,activeAppId:i,openedAppState:null,isAppMinimized:!1});try{let{data:e}=await o({path:{assistant_id:t,id:i},throwOnError:!0});if(r().activeAppId!==i)return;n({openedAppState:{appId:e.appId,dirName:e.dirName,name:e.name,html:e.html}}),p(t,e.appId,e.html)}catch(t){if(r().activeAppId!==i)return;h(t)||e(t,{context:`openApp`}),n({mainView:`chat`,activeAppId:null,openedAppState:null})}},setLoadedApp:e=>{n({openedAppState:e})},handleAppLoadFailed:()=>{n({mainView:`chat`,activeAppId:null,openedAppState:null})},closeApp:()=>{n({mainView:`chat`,activeAppId:null,openedAppState:null,isAppMinimized:!1})},toggleAppMinimized:()=>{n({isAppMinimized:!r().isAppMinimized})},minimizeApp:()=>{n({isAppMinimized:!0})},handleAppUnpinned:e=>{let t=r();return t.activeAppId!==e||t.mainView!==`app`&&t.mainView!==`app-editing`?!1:(r().closeApp(),!0)},enterAppEditing:()=>{n({mainView:`app-editing`})},exitAppEditing:()=>{n({mainView:`app`})},openSubagentDetail:e=>{n({mainView:`subagent-detail`,activeSubagentId:e,viewBeforeSubagentDetail:y(r(),`viewBeforeSubagentDetail`)})},closeSubagentDetail:()=>{n({mainView:r().viewBeforeSubagentDetail,activeSubagentId:null})},openWorkflowDetail:e=>{n({mainView:`workflow-detail`,activeWorkflowRunId:e,viewBeforeWorkflowDetail:y(r(),`viewBeforeWorkflowDetail`)})},closeWorkflowDetail:()=>{n({mainView:r().viewBeforeWorkflowDetail,activeWorkflowRunId:null})},openAcpRunDetail:e=>{n({mainView:`acp-run-detail`,activeAcpRunId:e,viewBeforeAcpRunDetail:y(r(),`viewBeforeAcpRunDetail`)})},closeAcpRunDetail:()=>{n({mainView:r().viewBeforeAcpRunDetail,activeAcpRunId:null})},openBackgroundTaskDetail:e=>{n({mainView:`background-task-detail`,activeBackgroundTaskId:e,viewBeforeBackgroundTaskDetail:y(r(),`viewBeforeBackgroundTaskDetail`)})},closeBackgroundTaskDetail:()=>{n({mainView:r().viewBeforeBackgroundTaskDetail,activeBackgroundTaskId:null})},openSkillDetail:e=>{n({mainView:`skill-detail`,activeSkillDetailId:e,viewBeforeSkillDetail:y(r(),`viewBeforeSkillDetail`)})},closeSkillDetail:()=>{n({mainView:r().viewBeforeSkillDetail,activeSkillDetailId:null})},openProcessDetail:({kind:e,id:t})=>{switch(e){case`subagent`:r().openSubagentDetail(t);return;case`workflow`:r().openWorkflowDetail(t);return;case`acp-run`:r().openAcpRunDetail(t);return;case`background-task`:r().openBackgroundTaskDetail(t);return;default:}},closeActiveOverlay:()=>{switch(r().mainView){case`document`:return r().closeDocument(),!0;case`subagent-detail`:return r().closeSubagentDetail(),!0;case`tool-detail`:return r().closeToolDetail(),!0;case`activity-steps`:return r().closeActivitySteps(),!0;case`message-files`:return r().closeMessageFiles(),!0;case`workflow-detail`:return r().closeWorkflowDetail(),!0;case`acp-run-detail`:return r().closeAcpRunDetail(),!0;case`background-task-detail`:return r().closeBackgroundTaskDetail(),!0;case`skill-detail`:return r().closeSkillDetail(),!0;case`channel-setup`:return r().closeChannelSetup(),!0;default:return!1}},openChannelSetup:e=>{n({mainView:`channel-setup`,activeChannelSetup:e,viewBeforeChannelSetup:y(r(),`viewBeforeChannelSetup`)})},closeChannelSetup:()=>{n({mainView:r().viewBeforeChannelSetup,activeChannelSetup:null})},openToolDetail:e=>{n({mainView:`tool-detail`,activeToolDetail:e,viewBeforeToolDetail:y(r(),`viewBeforeToolDetail`)})},toggleToolDetail:e=>{let t=r(),n=t.activeToolDetail;t.mainView===`tool-detail`&&n!=null&&(e.kind===`thinking`?n.kind===`thinking`&&C(n,e):n.kind!==`thinking`&&n.toolCallId===e.toolCallId)?r().closeToolDetail():r().openToolDetail(e)},closeToolDetail:()=>{n({mainView:r().viewBeforeToolDetail,activeToolDetail:null})},requestRuleEditor:e=>{e&&n(t=>({ruleEditorRequestSeq:t.ruleEditorRequestSeq+1,ruleEditorRequestToolCallId:e}))},openActivitySteps:e=>{n({mainView:`activity-steps`,activeActivitySteps:e,viewBeforeActivitySteps:y(r(),`viewBeforeActivitySteps`)})},toggleActivitySteps:e=>{let t=r(),n=t.activeActivitySteps;t.mainView===`activity-steps`&&n!=null&&x(n,e)?r().closeActivitySteps():r().openActivitySteps(e)},closeActivitySteps:()=>{n({mainView:r().viewBeforeActivitySteps,activeActivitySteps:null})},openMessageFiles:e=>{n({mainView:`message-files`,activeMessageFiles:e,viewBeforeMessageFiles:y(r(),`viewBeforeMessageFiles`)})},toggleMessageFiles:e=>{let t=r(),n=t.activeMessageFiles;t.mainView===`message-files`&&n!=null&&S(n,e)?r().closeMessageFiles():r().openMessageFiles(e)},closeMessageFiles:()=>{n({mainView:r().viewBeforeMessageFiles,activeMessageFiles:null})},clearTranscriptPanelPayloads:()=>{n({activeMessageFiles:null,activeActivitySteps:null,activeToolDetail:null})},openDocument:()=>{n({mainView:`document`,openedDocumentState:null,viewBeforeDocument:y(r(),`viewBeforeDocument`)})},loadDocument:async(e,t)=>{let i=y(r(),`viewBeforeDocument`),a={source:`document`,surfaceId:t};n({mainView:`document`,activeDocumentTarget:a,openedDocumentState:null,viewBeforeDocument:i});try{let{data:o}=await s({path:{assistant_id:e,id:t},throwOnError:!0});if(!b(r().activeDocumentTarget,a))return;if(!o){n({mainView:i,activeDocumentTarget:null,openedDocumentState:null});return}n({openedDocumentState:{source:`document`,surfaceId:o.surfaceId,conversationId:o.conversationId,documentName:o.title??`Untitled`,content:o.content??``,workspacePath:o.workspacePath}})}catch{if(!b(r().activeDocumentTarget,a))return;n({mainView:i,activeDocumentTarget:null,openedDocumentState:null})}},loadWorkspaceFileDocument:async(e,i,o)=>{let s=y(r(),`viewBeforeDocument`),l={source:`workspace-file`,workspacePath:i};n({mainView:`document`,activeDocumentTarget:l,openedDocumentState:null,viewBeforeDocument:s});let u=e=>{if(b(r().activeDocumentTarget,l)){if(n({mainView:s,activeDocumentTarget:null,openedDocumentState:null}),v(e)){c(i);return}t.error(g(e))}};try{let{data:t}=await a({path:{assistant_id:e},body:{path:i,conversationId:o},throwOnError:!0});if(!b(r().activeDocumentTarget,l))return;if(!t){u(null);return}n({activeDocumentTarget:{source:`document`,surfaceId:t.surfaceId},openedDocumentState:{source:`document`,surfaceId:t.surfaceId,conversationId:t.conversationId,documentName:t.title||`Untitled`,content:t.content??``,workspacePath:t.workspacePath}})}catch(e){u(e)}},openWorkspaceFilePreview:(e,t)=>{n({mainView:`document`,activeDocumentTarget:{source:`workspace-file-preview`,workspacePath:e},openedDocumentState:{source:`workspace-file-preview`,workspacePath:e,documentName:l(e),previewKind:t},viewBeforeDocument:y(r(),`viewBeforeDocument`)})},setLoadedDocument:e=>{n({openedDocumentState:e})},updateDocumentContent:(e,t,i)=>{let a=r().openedDocumentState;if(!a||a.source!==`document`||a.surfaceId!==e)return;let o=i===`append`?a.content+t:t;n({openedDocumentState:{...a,content:o}})},handleDocumentLoadFailed:()=>{n({mainView:r().viewBeforeDocument,activeDocumentTarget:null,openedDocumentState:null})},closeDocument:()=>{n({mainView:r().viewBeforeDocument,activeDocumentTarget:null,openedDocumentState:null})},refreshAssets:()=>{n({assetsRefreshKey:r().assetsRefreshKey+1})},reset:()=>n({...w})})));export{m as a,T as i,S as n,f as o,C as r,p as s,x as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./useQuery-Bz-fbQ-m.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";import{t as o}from"./cn-CJf7MmLX.js";import{t as s}from"./check-Dt2rQhdg.js";import"./src-Da9g8qsW.js";import{t as c}from"./square-DTFrgbZb.js";import{t as l}from"./volume-2-BXDl4IEg.js";import{n as u}from"./toast-BtFgiPe3.js";import{t as d}from"./dropdown-B3FHWc_n.js";import{j as f}from"./sdk.gen-CjtCuSlS.js";import{r as p}from"./use-is-org-ready-Df3qfx4p.js";import{Lt as m,Rt as h,c as g,l as _}from"./react-query.gen-C7om930f.js";var v=e(t(),1);function y(e,t={}){let n=p(),{data:r}=i({...m({path:{assistant_id:e??``}}),enabled:n&&!!e&&(t.enabled??!0),staleTime:6e4,retry:!1});return{voices:r?.voices??[],defaultModel:r?.defaultModel??null,fetched:!!r}}function b({assistantId:e,configuredValue:t,buildPatchBody:n,failureMessage:i}){let a=r(),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),d=c??t,p=(0,v.useRef)(Promise.resolve()),m=(0,v.useRef)(0);return{currentValue:d,selecting:o,select:(0,v.useCallback)(t=>{if(!e||t===d)return;let r=++m.current;l(t),s(!0),p.current=p.current.then(async()=>{try{let{response:r}=await f({path:{assistant_id:e},body:n(t),throwOnError:!1});if(!r?.ok){u.error(i);return}await a.invalidateQueries({queryKey:_({path:{assistant_id:e}})})}catch{u.error(i)}finally{r===m.current&&(l(null),s(!1))}})},[e,d,n,i,a])}}var x=e=>({services:{tts:{providers:{vellum:{model:e}}}}});function S(e){let t=p()&&!!e,{data:n}=i({...h({path:{assistant_id:e??``}}),enabled:t,staleTime:1/0,retry:!1}),{data:r}=i({...g({path:{assistant_id:e??``}}),enabled:t,staleTime:3e4}),a=r?.services?.tts,o=a?.mode===`managed`||a?.provider===`vellum`,s=n?.providers?.find(e=>e.id===`vellum`)?.supportsVoiceSelection===!0,{voices:c,defaultModel:l}=y(e,{enabled:t&&o}),u=t&&o&&s&&c.length>0,d=t&&!!r&&!o,{currentValue:f,selecting:m,select:_}=b({assistantId:e,configuredValue:a?.providers?.vellum?.model??l??c[0]?.model??``,buildPatchBody:x,failureMessage:`Couldn't change the voice just now. Try again.`});return{available:u,isByok:d,voices:c,currentModel:f,defaultModel:l??``,selectModel:_,selecting:m}}var C={deepgram:`Deepgram`,elevenlabs:`ElevenLabs`},w=`Uses Vellum credits, through providers like ElevenLabs and Deepgram.`;function T(e){let t=e.indexOf(` · `);return t===-1?{traits:e,accent:``}:{accent:e.slice(0,t),traits:e.slice(t+3)}}function E(e){let{traits:t}=T(e);return t.charAt(0).toUpperCase()+t.slice(1)}function D(e){let t=new Map;for(let n of e){let{accent:e}=T(n.description),r=e||`Other`,i=t.get(r);i?i.push(n):t.set(r,[n])}return[...t.entries()].sort((e,t)=>e[0].localeCompare(t[0])).map(([e,t])=>({accent:e,voices:[...t].sort((e,t)=>T(e.description).traits.localeCompare(T(t.description).traits))}))}var O=a();function k({description:e,className:t}){let{accent:n}=T(e);return(0,O.jsxs)(`span`,{className:o(`truncate`,t),children:[E(e),n&&(0,O.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:` · ${n}`})]})}function A(){let[e,t]=(0,v.useState)(null),n=(0,v.useRef)(null),r=(0,v.useRef)(0),i=()=>{r.current++,n.current?.pause(),n.current=null,t(null)};(0,v.useEffect)(()=>()=>{r.current++,n.current?.pause(),n.current=null},[]);function a(e){if(!e.sampleUrl)return;n.current?.pause();let i=++r.current,a=new Audio(e.sampleUrl);n.current=a,t(e.model);let o=()=>{r.current===i&&t(null)};a.onended=o,a.onerror=o,a.play().catch(()=>{r.current===i&&(u.error(`Could not play the voice sample.`),t(null))})}return{previewingModel:e,play:a,stop:i}}function j({assistantId:e,heading:t,className:r,onSelect:i,value:a,onChange:u,showSource:f=!1,filterBySource:p=!1}){let{available:m,voices:h,currentModel:g,defaultModel:_,selectModel:y,selecting:b}=S(e),x=a!==void 0&&u!==void 0,w=x?a:g,T=e=>{x?u(e):y(e),i?.()},k=(0,v.useMemo)(()=>{let e=new Set,t=[];for(let n of h)e.has(n.source)||(e.add(n.source),t.push(n.source));return t.sort((e,t)=>(C[e]??e).localeCompare(C[t]??t))},[h]),[j,M]=(0,v.useState)(null),N=h.find(e=>e.model===w)?.source,P=p?j??N??k[0]??null:null,F=p&&k.length>1,I=(0,v.useMemo)(()=>D(P?h.filter(e=>e.source===P):h),[h,P]),{previewingModel:L,play:R,stop:z}=A(),B=(0,v.useRef)(null);(0,v.useEffect)(()=>{B.current?.scrollIntoView?.({block:`nearest`})},[]);let V=h.length>0;return(x?!V:!m)?null:(0,O.jsxs)(`div`,{className:o(`flex flex-col gap-2`,t&&`border-t border-[var(--border-subtle)] pt-3`,r),children:[t&&(0,O.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-secondary)]`,children:t}),F&&(0,O.jsx)(`div`,{className:`px-1 pb-1`,children:(0,O.jsx)(d,{value:P??``,onChange:M,options:k.map(e=>({value:e,label:C[e]??e})),"aria-label":`Voice provider`})}),(0,O.jsx)(`div`,{role:`listbox`,"aria-label":`Assistant voice`,className:o(`flex flex-col overflow-y-auto`,p?`max-h-[60vh]`:`max-h-80`,b&&`pointer-events-none opacity-70`),children:I.map(e=>(0,O.jsxs)(`div`,{role:`group`,"aria-label":e.accent,children:[(0,O.jsx)(`div`,{className:`px-3 pb-1 pt-3 text-label-small-default text-[var(--content-tertiary)]`,children:e.accent}),e.voices.map(e=>{let t=e.model===w,r=L===e.model,i=e.model===_;return(0,O.jsxs)(`div`,{ref:t?B:void 0,role:`option`,"aria-selected":t,onClick:()=>T(e.model),className:o(`group flex cursor-pointer items-center gap-2 rounded-md px-3 py-2.5 transition-colors`,t?`bg-[var(--surface-active)]`:`hover:bg-[var(--surface-hover)]`),children:[(0,O.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-body-medium-default text-[var(--content-default)]`,children:[E(e.description),i&&(0,O.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` `,`(default)`]})]}),f&&!p&&(0,O.jsx)(`span`,{className:`shrink-0 text-body-small-default text-[var(--content-tertiary)]`,children:C[e.source]??e.source}),(0,O.jsxs)(`div`,{className:`relative flex size-7 shrink-0 items-center justify-center`,children:[e.sampleUrl!==``&&(0,O.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:r?(0,O.jsx)(c,{}):(0,O.jsx)(l,{}),"aria-label":r?`Stop preview`:`Preview ${e.description}`,className:o(`absolute inset-0 transition-opacity`,r?`opacity-100`:`opacity-0 group-hover:opacity-100 focus-visible:opacity-100 touch-mobile:opacity-100`),onClick:t=>{t.stopPropagation(),r?z():R(e)}}),t&&(0,O.jsx)(s,{"aria-hidden":!0,className:o(`pointer-events-none size-4 text-[var(--system-positive-strong)] transition-opacity`,r?`opacity-0`:e.sampleUrl===``?`opacity-100`:`opacity-100 group-hover:opacity-0 group-focus-within:opacity-0`)})]})]},e.model)})]},e.accent))})]})}export{S as a,E as i,j as n,b as o,w as r,y as s,k as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./useQuery-Bz-fbQ-m.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";import{t as o}from"./cn-CJf7MmLX.js";import{t as s}from"./check-Dt2rQhdg.js";import"./src-Da9g8qsW.js";import{t as c}from"./square-DTFrgbZb.js";import{t as l}from"./volume-2-BXDl4IEg.js";import{n as u}from"./toast-BtFgiPe3.js";import{t as d}from"./dropdown-B3FHWc_n.js";import{j as f}from"./sdk.gen-CjtCuSlS.js";import{r as p}from"./use-is-org-ready-3vHDbj4G.js";import{Lt as m,Rt as h,c as g,l as _}from"./react-query.gen-C7om930f.js";var v=e(t(),1);function y(e,t={}){let n=p(),{data:r}=i({...m({path:{assistant_id:e??``}}),enabled:n&&!!e&&(t.enabled??!0),staleTime:6e4,retry:!1});return{voices:r?.voices??[],defaultModel:r?.defaultModel??null,fetched:!!r}}function b({assistantId:e,configuredValue:t,buildPatchBody:n,failureMessage:i}){let a=r(),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),d=c??t,p=(0,v.useRef)(Promise.resolve()),m=(0,v.useRef)(0);return{currentValue:d,selecting:o,select:(0,v.useCallback)(t=>{if(!e||t===d)return;let r=++m.current;l(t),s(!0),p.current=p.current.then(async()=>{try{let{response:r}=await f({path:{assistant_id:e},body:n(t),throwOnError:!1});if(!r?.ok){u.error(i);return}await a.invalidateQueries({queryKey:_({path:{assistant_id:e}})})}catch{u.error(i)}finally{r===m.current&&(l(null),s(!1))}})},[e,d,n,i,a])}}var x=e=>({services:{tts:{providers:{vellum:{model:e}}}}});function S(e){let t=p()&&!!e,{data:n}=i({...h({path:{assistant_id:e??``}}),enabled:t,staleTime:1/0,retry:!1}),{data:r}=i({...g({path:{assistant_id:e??``}}),enabled:t,staleTime:3e4}),a=r?.services?.tts,o=a?.mode===`managed`||a?.provider===`vellum`,s=n?.providers?.find(e=>e.id===`vellum`)?.supportsVoiceSelection===!0,{voices:c,defaultModel:l}=y(e,{enabled:t&&o}),u=t&&o&&s&&c.length>0,d=t&&!!r&&!o,{currentValue:f,selecting:m,select:_}=b({assistantId:e,configuredValue:a?.providers?.vellum?.model??l??c[0]?.model??``,buildPatchBody:x,failureMessage:`Couldn't change the voice just now. Try again.`});return{available:u,isByok:d,voices:c,currentModel:f,defaultModel:l??``,selectModel:_,selecting:m}}var C={deepgram:`Deepgram`,elevenlabs:`ElevenLabs`},w=`Uses Vellum credits, through providers like ElevenLabs and Deepgram.`;function T(e){let t=e.indexOf(` · `);return t===-1?{traits:e,accent:``}:{accent:e.slice(0,t),traits:e.slice(t+3)}}function E(e){let{traits:t}=T(e);return t.charAt(0).toUpperCase()+t.slice(1)}function D(e){let t=new Map;for(let n of e){let{accent:e}=T(n.description),r=e||`Other`,i=t.get(r);i?i.push(n):t.set(r,[n])}return[...t.entries()].sort((e,t)=>e[0].localeCompare(t[0])).map(([e,t])=>({accent:e,voices:[...t].sort((e,t)=>T(e.description).traits.localeCompare(T(t.description).traits))}))}var O=a();function k({description:e,className:t}){let{accent:n}=T(e);return(0,O.jsxs)(`span`,{className:o(`truncate`,t),children:[E(e),n&&(0,O.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:` · ${n}`})]})}function A(){let[e,t]=(0,v.useState)(null),n=(0,v.useRef)(null),r=(0,v.useRef)(0),i=()=>{r.current++,n.current?.pause(),n.current=null,t(null)};(0,v.useEffect)(()=>()=>{r.current++,n.current?.pause(),n.current=null},[]);function a(e){if(!e.sampleUrl)return;n.current?.pause();let i=++r.current,a=new Audio(e.sampleUrl);n.current=a,t(e.model);let o=()=>{r.current===i&&t(null)};a.onended=o,a.onerror=o,a.play().catch(()=>{r.current===i&&(u.error(`Could not play the voice sample.`),t(null))})}return{previewingModel:e,play:a,stop:i}}function j({assistantId:e,heading:t,className:r,onSelect:i,value:a,onChange:u,showSource:f=!1,filterBySource:p=!1}){let{available:m,voices:h,currentModel:g,defaultModel:_,selectModel:y,selecting:b}=S(e),x=a!==void 0&&u!==void 0,w=x?a:g,T=e=>{x?u(e):y(e),i?.()},k=(0,v.useMemo)(()=>{let e=new Set,t=[];for(let n of h)e.has(n.source)||(e.add(n.source),t.push(n.source));return t.sort((e,t)=>(C[e]??e).localeCompare(C[t]??t))},[h]),[j,M]=(0,v.useState)(null),N=h.find(e=>e.model===w)?.source,P=p?j??N??k[0]??null:null,F=p&&k.length>1,I=(0,v.useMemo)(()=>D(P?h.filter(e=>e.source===P):h),[h,P]),{previewingModel:L,play:R,stop:z}=A(),B=(0,v.useRef)(null);(0,v.useEffect)(()=>{B.current?.scrollIntoView?.({block:`nearest`})},[]);let V=h.length>0;return(x?!V:!m)?null:(0,O.jsxs)(`div`,{className:o(`flex flex-col gap-2`,t&&`border-t border-[var(--border-subtle)] pt-3`,r),children:[t&&(0,O.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-secondary)]`,children:t}),F&&(0,O.jsx)(`div`,{className:`px-1 pb-1`,children:(0,O.jsx)(d,{value:P??``,onChange:M,options:k.map(e=>({value:e,label:C[e]??e})),"aria-label":`Voice provider`})}),(0,O.jsx)(`div`,{role:`listbox`,"aria-label":`Assistant voice`,className:o(`flex flex-col overflow-y-auto`,p?`max-h-[60vh]`:`max-h-80`,b&&`pointer-events-none opacity-70`),children:I.map(e=>(0,O.jsxs)(`div`,{role:`group`,"aria-label":e.accent,children:[(0,O.jsx)(`div`,{className:`px-3 pb-1 pt-3 text-label-small-default text-[var(--content-tertiary)]`,children:e.accent}),e.voices.map(e=>{let t=e.model===w,r=L===e.model,i=e.model===_;return(0,O.jsxs)(`div`,{ref:t?B:void 0,role:`option`,"aria-selected":t,onClick:()=>T(e.model),className:o(`group flex cursor-pointer items-center gap-2 rounded-md px-3 py-2.5 transition-colors`,t?`bg-[var(--surface-active)]`:`hover:bg-[var(--surface-hover)]`),children:[(0,O.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-body-medium-default text-[var(--content-default)]`,children:[E(e.description),i&&(0,O.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` `,`(default)`]})]}),f&&!p&&(0,O.jsx)(`span`,{className:`shrink-0 text-body-small-default text-[var(--content-tertiary)]`,children:C[e.source]??e.source}),(0,O.jsxs)(`div`,{className:`relative flex size-7 shrink-0 items-center justify-center`,children:[e.sampleUrl!==``&&(0,O.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:r?(0,O.jsx)(c,{}):(0,O.jsx)(l,{}),"aria-label":r?`Stop preview`:`Preview ${e.description}`,className:o(`absolute inset-0 transition-opacity`,r?`opacity-100`:`opacity-0 group-hover:opacity-100 focus-visible:opacity-100 touch-mobile:opacity-100`),onClick:t=>{t.stopPropagation(),r?z():R(e)}}),t&&(0,O.jsx)(s,{"aria-hidden":!0,className:o(`pointer-events-none size-4 text-[var(--system-positive-strong)] transition-opacity`,r?`opacity-0`:e.sampleUrl===``?`opacity-100`:`opacity-100 group-hover:opacity-0 group-focus-within:opacity-0`)})]})]},e.model)})]},e.accent))})]})}export{S as a,E as i,j as n,b as o,w as r,y as s,k as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,l as n,o as r}from"./local-settings-Bx7FsNo5.js";import{t as i}from"./react-BFJW0bSv.js";import{t as a}from"./button-Dy5001j6.js";import{m as o,n as s,t as c}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as l}from"./jsx-runtime-D3ZM-ToX.js";import{r as u}from"./middleware-Bxr-mmHu.js";import{M as d,P as f}from"./src-Da9g8qsW.js";import{t as p}from"./info-DkhVkzmK.js";import{t as m}from"./toggle-BEPV0rQM.js";import{t as h}from"./modal-xr_vw1ZO.js";import{t as g}from"./dropdown-B3FHWc_n.js";import{t as _}from"./assistant-identity-store-B51BX78j.js";import{d as v}from"./routes-DrfnNoYS.js";import{C as y,S as ee,b,d as x,f as S,h as C,i as w,m as te,o as T,p as E,s as D,t as O,w as k,x as A,y as j}from"./voice-providers-note-Ck7hNTfp.js";import{a as M,n as ne,r as re,t as ie}from"./voice-list-yvKUrPIf.js";import{t as N}from"./use-active-assistant-id-JLsAfn3e.js";import{t as P}from"./detail-card-BElAV1cp.js";var F=e(i(),1),I=l();function L({assistantId:e,open:t,onOpenChange:n}){return(0,I.jsx)(h.Root,{open:t,onOpenChange:n,children:(0,I.jsx)(h.Content,{size:`md`,children:(0,I.jsx)(R,{assistantId:e,onDone:()=>n(!1)})})})}function R({assistantId:e,onDone:t}){let{available:n,currentModel:r,selectModel:i,selecting:o}=M(e);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(h.Header,{children:[(0,I.jsx)(h.Title,{children:`Voices`}),n&&(0,I.jsx)(h.Description,{children:`Uses Vellum credits, through providers like ElevenLabs and Deepgram.`})]}),(0,I.jsx)(h.Body,{children:(0,I.jsx)(ne,{assistantId:e,filterBySource:!0,value:r,onChange:i})}),(0,I.jsxs)(h.Footer,{className:`items-center justify-between gap-3`,children:[(0,I.jsx)(O,{}),(0,I.jsx)(a,{variant:`primary`,onClick:t,disabled:o,className:`shrink-0`,children:`Done`})]})]})}function z(){let e=N(),{available:t,voices:n,currentModel:r}=M(e),i=n.find(e=>e.model===r)??n[0],[o,s]=(0,F.useState)(!1),l=_.use.name(),u=l?`${l}’s Voice`:`Voice`;return t&&i?(0,I.jsxs)(P,{title:u,subtitle:re,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(ie,{description:i.description,className:`min-w-0 text-body-medium-lighter text-[var(--content-default)]`}),(0,I.jsx)(a,{variant:`outlined`,onClick:()=>s(!0),className:`shrink-0`,children:`Change`})]}),(0,I.jsx)(L,{assistantId:e,open:o,onOpenChange:s})]}):(0,I.jsx)(P,{title:u,children:(0,I.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[`Your assistant speaks through a provider you configured yourself. Set its voice on`,` `,(0,I.jsx)(c,{to:`${v.settings.ai}#text-to-speech`,className:`text-[var(--primary-base)] hover:underline`,children:`Models & Services`}),`.`]})})}var B=[{prefKey:`showUserTranscript`,label:`Show the words you say`,description:`Live transcription while you speak.`},{prefKey:`showAssistantTranscript`,label:`Show the words the assistant says`,description:`Text alongside the spoken response.`}],V=`We recommend keeping both off to start. It feels more like a real conversation.`;function H(){return(0,I.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--surface-active)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`Recommended off`})}function U({label:e,description:t,showBadge:n,checked:r,onChange:i}){return(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`truncate text-body-medium-lighter text-[var(--content-default)]`,children:e}),n?(0,I.jsx)(H,{}):null]}),t?(0,I.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t}):null]}),(0,I.jsx)(m,{checked:r,onChange:i,"aria-label":e})]})}function W({showDescription:e=!1,showRecommendedBadge:t=!1}){let n=T.use.showUserTranscript(),r=T.use.showAssistantTranscript(),i=T.use.setShowUserTranscript(),a=T.use.setShowAssistantTranscript(),o={showUserTranscript:{checked:n,onChange:i},showAssistantTranscript:{checked:r,onChange:a}};return(0,I.jsx)(I.Fragment,{children:B.map(n=>{let r=o[n.prefKey];return(0,I.jsx)(U,{label:n.label,description:e?n.description:void 0,showBadge:t,checked:r.checked,onChange:r.onChange},n.prefKey)})})}var G=[{label:`Ctrl`,activator:{kind:`modifierOnly`,modifiers:[`control`]}},{label:`Alt`,activator:{kind:`modifierOnly`,modifiers:[`option`]}},{label:`Ctrl+Shift`,activator:{kind:`modifierOnly`,modifiers:[`control`,`shift`]}}],K={label:`Fn`,activator:S},q=`text-body-small-default text-[var(--content-tertiary)]`;function J(){let[e]=o(),t=e.get(`tab`);return t===`sounds`?(0,I.jsx)(s,{replace:!0,to:v.settings.sounds}):t===`services`?(0,I.jsx)(s,{replace:!0,to:v.settings.ai}):(0,I.jsx)(ae,{})}function ae(){return(0,I.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,I.jsxs)(Y,{heading:`Output`,description:`How your assistant sounds.`,children:[(0,I.jsx)(z,{}),(0,I.jsx)(oe,{})]}),(0,I.jsxs)(Y,{heading:`Input`,description:`How you talk to your assistant.`,children:[(0,I.jsx)(ce,{}),(0,I.jsx)(le,{}),(0,I.jsx)(Q,{})]}),(0,I.jsx)(Y,{heading:`Captions`,children:(0,I.jsx)(se,{})})]})}function oe(){let{available:e}=M(N());return e?(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 px-1 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,I.jsx)(p,{className:`h-3.5 w-3.5 shrink-0 text-[var(--content-quiet)]`}),(0,I.jsx)(`span`,{children:`Want to use your own API key for STT or TTS, or set a custom voice?`}),(0,I.jsxs)(c,{to:`${v.settings.ai}#text-to-speech`,className:`inline-flex items-center gap-1 text-[var(--content-secondary)] underline decoration-[var(--border-element)] underline-offset-2 hover:text-[var(--content-default)]`,children:[`Set it up in Models & Services`,(0,I.jsx)(u,{className:`h-3 w-3`})]})]}):null}function Y({heading:e,description:t,children:n}){return(0,I.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`h2`,{className:`text-label-medium-default uppercase tracking-wide text-[var(--content-tertiary)]`,children:e}),t&&(0,I.jsx)(`p`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:t})]}),n]})}function se(){return(0,I.jsx)(P,{title:`Captions`,subtitle:`Show live text of what you and the assistant say during a voice conversation.`,children:(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsx)(W,{showDescription:!0}),(0,I.jsx)(`p`,{className:`${q} pt-1`,children:V})]})})}var X=``;function ce(){let[e,t]=(0,F.useState)([]),[i,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(()=>k()),l=(0,F.useCallback)(async()=>{if(navigator.mediaDevices?.enumerateDevices)try{let e=(await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`audioinput`);o(e.length>0&&e.every(e=>!e.label)),t(e.filter(e=>e.deviceId!==``&&e.deviceId!==`default`&&e.deviceId!==`communications`))}catch{t([]),o(!1)}},[]),u=(0,F.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop()}catch{}l()},[l]);(0,F.useEffect)(()=>{l();let e=navigator.mediaDevices;if(!e?.addEventListener)return;let t=()=>void l();return e.addEventListener(`devicechange`,t),()=>e.removeEventListener(`devicechange`,t)},[l]);let d=(0,F.useMemo)(()=>[{value:X,label:`System Default`},...e.map((e,t)=>({value:e.deviceId,label:e.label||`Microphone ${t+1}`}))],[e]),f=(0,F.useCallback)(e=>{c(e),e===X?r(y):n(y,e)},[]);return(0,I.jsx)(P,{title:`Microphone`,subtitle:`Which input device is used for dictation and voice conversations.`,children:(0,I.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,I.jsx)(`div`,{className:`max-w-xs`,children:(0,I.jsx)(g,{options:d,value:d.some(e=>e.value===s)?s:X,onChange:f,"aria-label":`Microphone`})}),i&&(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(a,{variant:`outlined`,onClick:u,children:`Allow Microphone Access`}),(0,I.jsx)(`span`,{className:q,children:`Grant microphone access to list your available input devices.`})]})]})})}function le(){let e=D(),[r,i]=(0,F.useState)(()=>{let n=t(E,``);return n?b(n,{preserveFunction:e}):e?K.activator:{kind:`off`}}),[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)([]),l=(0,F.useRef)(null),u=(0,F.useRef)(!1),d=(0,F.useMemo)(()=>e?[K,...G]:G,[e]),f=r.kind!==`off`,h=f&&!e,g=(0,F.useCallback)(e=>{i(e),n(E,A(e)),o(!1),c([])},[]),_=(0,F.useCallback)(()=>{o(!0),c([]),u.current=!1,requestAnimationFrame(()=>{l.current?.focus()})},[]),v=(0,F.useCallback)(()=>{o(!1),c([]),u.current=!1},[]),y=(0,F.useCallback)(t=>{let n=[];return e&&t.getModifierState(`Fn`)&&n.push(`function`),t.ctrlKey&&n.push(`control`),t.altKey&&n.push(`option`),t.shiftKey&&n.push(`shift`),t.metaKey&&n.push(`command`),n},[e]),w=(0,F.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){v();return}let t=y(e),n=e.key;if(n===`Control`||n===`Alt`||n===`Shift`||n===`Meta`||n===`Fn`){c(t.includes(`function`)?S.modifiers:ee(t));return}if(t.includes(`function`)){g(S);return}u.current=!0,g({kind:`key`,label:n.length===1?n.toUpperCase():n,modifiers:t})},[v,y,g]),T=(0,F.useCallback)(e=>{if(!a)return;e.preventDefault(),e.stopPropagation();let t=e.key;if(t===`Control`||t===`Alt`||t===`Shift`||t===`Meta`||t===`Fn`){if(u.current){u.current=!1,c([]);return}y(e).length===0&&s.length>0&&g({kind:`modifierOnly`,modifiers:s})}},[y,a,s,g]);(0,F.useEffect)(()=>{if(!a)return;let e=e=>{l.current&&!l.current.contains(e.target)&&v()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[v,a]);let O=f&&!d.some(e=>C(e.activator,r));return(0,I.jsx)(P,{title:`Push to Talk`,subtitle:`Hold the activation key to dictate text or start a voice conversation.`,children:(0,I.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,I.jsx)(m,{checked:f,onChange:t=>{t?r.kind===`off`&&g(e?K.activator:x):g({kind:`off`})},label:`Enable Push to Talk`}),f&&(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsx)(`span`,{className:q,children:`Activation Key:`}),(0,I.jsxs)(`div`,{ref:l,tabIndex:a?0:-1,onKeyDown:a?w:void 0,onKeyUp:a?T:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[d.map(e=>{let t=C(e.activator,r);return(0,I.jsx)(Z,{label:e.label,selected:t,onClick:()=>g(e.activator)},e.label)}),a?(0,I.jsx)(Z,{label:s.length>0?j(s):`Press any key…`,selected:!0,recording:!0,onClick:v}):(0,I.jsx)(Z,{label:O?te(r):`Custom`,selected:O,onClick:_})]}),h&&(0,I.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-default text-[var(--content-quiet)]`,children:[(0,I.jsx)(p,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,I.jsx)(`span`,{children:`Push-to-Talk only works while this tab is focused, and browsers may intercept some shortcuts (e.g. Ctrl+T) before the page can see them. For always-on PTT, use the Vellum desktop app.`})]})]})]})})}function Z({label:e,selected:t,recording:n=!1,onClick:r}){return(0,I.jsxs)(`button`,{type:`button`,onClick:r,className:[`inline-flex items-center gap-2 rounded-lg border px-3 py-1.5 text-body-medium-lighter transition-colors`,`border-[var(--border-subtle)]`,t?`bg-[var(--surface-active)]`:`bg-[var(--surface-lift)] hover:bg-[var(--surface-hover)]`,n?`animate-pulse`:``].filter(Boolean).join(` `),children:[(0,I.jsx)(`span`,{className:[`inline-block h-2.5 w-2.5 rounded-full border`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)]`].join(` `)}),(0,I.jsx)(`span`,{className:`text-[var(--content-default)]`,children:e})]})}var ue=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`}];function Q(){let e=T.use.pauseBeforeReplyMs(),t=T.use.setPauseBeforeReplyMs(),n=T.use.interruptSensitivity(),r=T.use.setInterruptSensitivity(),i=e!==null||n!==null;return(0,I.jsx)(P,{title:`Turn taking`,subtitle:`Where your turn ends and the assistant's begins. Applies to hands-free conversations — under push to talk, the key decides.`,children:(0,I.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,I.jsx)($,{label:`Pause before reply`,description:`How long the assistant waits after you stop speaking before it replies. A longer pause lets you gather your thoughts mid-sentence without being cut off.`,isDefault:e===null,children:(0,I.jsx)(`div`,{className:`max-w-xs`,children:(0,I.jsx)(d,{value:(e??1200)/1e3,onValueChange:e=>{typeof e==`number`&&t(Math.round(e*1e3))},min:500/1e3,max:w/1e3,step:.1,showValue:!0,formatValue:e=>`${(typeof e==`number`?e:e[0]).toFixed(1)}s`,"aria-label":`Pause before reply`})})}),(0,I.jsx)($,{label:`Interrupt sensitivity`,description:`How easily talking over the assistant interrupts it. Lower it if the assistant cuts itself off on background noise or filler words; raise it to interrupt more quickly.`,isDefault:n===null,children:(0,I.jsx)(`div`,{className:`max-w-xs`,children:(0,I.jsx)(f,{items:ue,value:n??`medium`,onChange:r,ariaLabel:`Interrupt sensitivity`})})}),i&&(0,I.jsx)(`div`,{children:(0,I.jsx)(a,{variant:`outlined`,onClick:()=>{t(null),r(null)},children:`Reset to defaults`})})]})})}function $({label:e,description:t,isDefault:n,children:r}){return(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),n&&(0,I.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--surface-active)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`Default`})]}),(0,I.jsx)(`p`,{className:q,children:t}),r]})}export{J as VoicePage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,l as n,o as r}from"./local-settings-Bx7FsNo5.js";import{t as i}from"./react-BFJW0bSv.js";import{t as a}from"./button-Dy5001j6.js";import{m as o,n as s,t as c}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as l}from"./jsx-runtime-D3ZM-ToX.js";import{r as u}from"./middleware-Bxr-mmHu.js";import{M as d,P as f}from"./src-Da9g8qsW.js";import{t as p}from"./info-DkhVkzmK.js";import{t as m}from"./toggle-BEPV0rQM.js";import{t as h}from"./modal-xr_vw1ZO.js";import{t as g}from"./dropdown-B3FHWc_n.js";import{t as _}from"./assistant-identity-store-B51BX78j.js";import{d as v}from"./routes-DrfnNoYS.js";import{C as y,S as ee,b,d as x,f as S,h as C,i as w,m as te,o as T,p as E,s as D,t as O,w as k,x as A,y as j}from"./voice-providers-note-Ck7hNTfp.js";import{a as M,n as ne,r as re,t as ie}from"./voice-list-D26Lzbpv.js";import{t as N}from"./use-active-assistant-id-JLsAfn3e.js";import{t as P}from"./detail-card-BElAV1cp.js";var F=e(i(),1),I=l();function L({assistantId:e,open:t,onOpenChange:n}){return(0,I.jsx)(h.Root,{open:t,onOpenChange:n,children:(0,I.jsx)(h.Content,{size:`md`,children:(0,I.jsx)(R,{assistantId:e,onDone:()=>n(!1)})})})}function R({assistantId:e,onDone:t}){let{available:n,currentModel:r,selectModel:i,selecting:o}=M(e);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(h.Header,{children:[(0,I.jsx)(h.Title,{children:`Voices`}),n&&(0,I.jsx)(h.Description,{children:`Uses Vellum credits, through providers like ElevenLabs and Deepgram.`})]}),(0,I.jsx)(h.Body,{children:(0,I.jsx)(ne,{assistantId:e,filterBySource:!0,value:r,onChange:i})}),(0,I.jsxs)(h.Footer,{className:`items-center justify-between gap-3`,children:[(0,I.jsx)(O,{}),(0,I.jsx)(a,{variant:`primary`,onClick:t,disabled:o,className:`shrink-0`,children:`Done`})]})]})}function z(){let e=N(),{available:t,voices:n,currentModel:r}=M(e),i=n.find(e=>e.model===r)??n[0],[o,s]=(0,F.useState)(!1),l=_.use.name(),u=l?`${l}’s Voice`:`Voice`;return t&&i?(0,I.jsxs)(P,{title:u,subtitle:re,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(ie,{description:i.description,className:`min-w-0 text-body-medium-lighter text-[var(--content-default)]`}),(0,I.jsx)(a,{variant:`outlined`,onClick:()=>s(!0),className:`shrink-0`,children:`Change`})]}),(0,I.jsx)(L,{assistantId:e,open:o,onOpenChange:s})]}):(0,I.jsx)(P,{title:u,children:(0,I.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[`Your assistant speaks through a provider you configured yourself. Set its voice on`,` `,(0,I.jsx)(c,{to:`${v.settings.ai}#text-to-speech`,className:`text-[var(--primary-base)] hover:underline`,children:`Models & Services`}),`.`]})})}var B=[{prefKey:`showUserTranscript`,label:`Show the words you say`,description:`Live transcription while you speak.`},{prefKey:`showAssistantTranscript`,label:`Show the words the assistant says`,description:`Text alongside the spoken response.`}],V=`We recommend keeping both off to start. It feels more like a real conversation.`;function H(){return(0,I.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--surface-active)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`Recommended off`})}function U({label:e,description:t,showBadge:n,checked:r,onChange:i}){return(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`truncate text-body-medium-lighter text-[var(--content-default)]`,children:e}),n?(0,I.jsx)(H,{}):null]}),t?(0,I.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t}):null]}),(0,I.jsx)(m,{checked:r,onChange:i,"aria-label":e})]})}function W({showDescription:e=!1,showRecommendedBadge:t=!1}){let n=T.use.showUserTranscript(),r=T.use.showAssistantTranscript(),i=T.use.setShowUserTranscript(),a=T.use.setShowAssistantTranscript(),o={showUserTranscript:{checked:n,onChange:i},showAssistantTranscript:{checked:r,onChange:a}};return(0,I.jsx)(I.Fragment,{children:B.map(n=>{let r=o[n.prefKey];return(0,I.jsx)(U,{label:n.label,description:e?n.description:void 0,showBadge:t,checked:r.checked,onChange:r.onChange},n.prefKey)})})}var G=[{label:`Ctrl`,activator:{kind:`modifierOnly`,modifiers:[`control`]}},{label:`Alt`,activator:{kind:`modifierOnly`,modifiers:[`option`]}},{label:`Ctrl+Shift`,activator:{kind:`modifierOnly`,modifiers:[`control`,`shift`]}}],K={label:`Fn`,activator:S},q=`text-body-small-default text-[var(--content-tertiary)]`;function J(){let[e]=o(),t=e.get(`tab`);return t===`sounds`?(0,I.jsx)(s,{replace:!0,to:v.settings.sounds}):t===`services`?(0,I.jsx)(s,{replace:!0,to:v.settings.ai}):(0,I.jsx)(ae,{})}function ae(){return(0,I.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,I.jsxs)(Y,{heading:`Output`,description:`How your assistant sounds.`,children:[(0,I.jsx)(z,{}),(0,I.jsx)(oe,{})]}),(0,I.jsxs)(Y,{heading:`Input`,description:`How you talk to your assistant.`,children:[(0,I.jsx)(ce,{}),(0,I.jsx)(le,{}),(0,I.jsx)(Q,{})]}),(0,I.jsx)(Y,{heading:`Captions`,children:(0,I.jsx)(se,{})})]})}function oe(){let{available:e}=M(N());return e?(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 px-1 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,I.jsx)(p,{className:`h-3.5 w-3.5 shrink-0 text-[var(--content-quiet)]`}),(0,I.jsx)(`span`,{children:`Want to use your own API key for STT or TTS, or set a custom voice?`}),(0,I.jsxs)(c,{to:`${v.settings.ai}#text-to-speech`,className:`inline-flex items-center gap-1 text-[var(--content-secondary)] underline decoration-[var(--border-element)] underline-offset-2 hover:text-[var(--content-default)]`,children:[`Set it up in Models & Services`,(0,I.jsx)(u,{className:`h-3 w-3`})]})]}):null}function Y({heading:e,description:t,children:n}){return(0,I.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`h2`,{className:`text-label-medium-default uppercase tracking-wide text-[var(--content-tertiary)]`,children:e}),t&&(0,I.jsx)(`p`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:t})]}),n]})}function se(){return(0,I.jsx)(P,{title:`Captions`,subtitle:`Show live text of what you and the assistant say during a voice conversation.`,children:(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsx)(W,{showDescription:!0}),(0,I.jsx)(`p`,{className:`${q} pt-1`,children:V})]})})}var X=``;function ce(){let[e,t]=(0,F.useState)([]),[i,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(()=>k()),l=(0,F.useCallback)(async()=>{if(navigator.mediaDevices?.enumerateDevices)try{let e=(await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`audioinput`);o(e.length>0&&e.every(e=>!e.label)),t(e.filter(e=>e.deviceId!==``&&e.deviceId!==`default`&&e.deviceId!==`communications`))}catch{t([]),o(!1)}},[]),u=(0,F.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop()}catch{}l()},[l]);(0,F.useEffect)(()=>{l();let e=navigator.mediaDevices;if(!e?.addEventListener)return;let t=()=>void l();return e.addEventListener(`devicechange`,t),()=>e.removeEventListener(`devicechange`,t)},[l]);let d=(0,F.useMemo)(()=>[{value:X,label:`System Default`},...e.map((e,t)=>({value:e.deviceId,label:e.label||`Microphone ${t+1}`}))],[e]),f=(0,F.useCallback)(e=>{c(e),e===X?r(y):n(y,e)},[]);return(0,I.jsx)(P,{title:`Microphone`,subtitle:`Which input device is used for dictation and voice conversations.`,children:(0,I.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,I.jsx)(`div`,{className:`max-w-xs`,children:(0,I.jsx)(g,{options:d,value:d.some(e=>e.value===s)?s:X,onChange:f,"aria-label":`Microphone`})}),i&&(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(a,{variant:`outlined`,onClick:u,children:`Allow Microphone Access`}),(0,I.jsx)(`span`,{className:q,children:`Grant microphone access to list your available input devices.`})]})]})})}function le(){let e=D(),[r,i]=(0,F.useState)(()=>{let n=t(E,``);return n?b(n,{preserveFunction:e}):e?K.activator:{kind:`off`}}),[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)([]),l=(0,F.useRef)(null),u=(0,F.useRef)(!1),d=(0,F.useMemo)(()=>e?[K,...G]:G,[e]),f=r.kind!==`off`,h=f&&!e,g=(0,F.useCallback)(e=>{i(e),n(E,A(e)),o(!1),c([])},[]),_=(0,F.useCallback)(()=>{o(!0),c([]),u.current=!1,requestAnimationFrame(()=>{l.current?.focus()})},[]),v=(0,F.useCallback)(()=>{o(!1),c([]),u.current=!1},[]),y=(0,F.useCallback)(t=>{let n=[];return e&&t.getModifierState(`Fn`)&&n.push(`function`),t.ctrlKey&&n.push(`control`),t.altKey&&n.push(`option`),t.shiftKey&&n.push(`shift`),t.metaKey&&n.push(`command`),n},[e]),w=(0,F.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){v();return}let t=y(e),n=e.key;if(n===`Control`||n===`Alt`||n===`Shift`||n===`Meta`||n===`Fn`){c(t.includes(`function`)?S.modifiers:ee(t));return}if(t.includes(`function`)){g(S);return}u.current=!0,g({kind:`key`,label:n.length===1?n.toUpperCase():n,modifiers:t})},[v,y,g]),T=(0,F.useCallback)(e=>{if(!a)return;e.preventDefault(),e.stopPropagation();let t=e.key;if(t===`Control`||t===`Alt`||t===`Shift`||t===`Meta`||t===`Fn`){if(u.current){u.current=!1,c([]);return}y(e).length===0&&s.length>0&&g({kind:`modifierOnly`,modifiers:s})}},[y,a,s,g]);(0,F.useEffect)(()=>{if(!a)return;let e=e=>{l.current&&!l.current.contains(e.target)&&v()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[v,a]);let O=f&&!d.some(e=>C(e.activator,r));return(0,I.jsx)(P,{title:`Push to Talk`,subtitle:`Hold the activation key to dictate text or start a voice conversation.`,children:(0,I.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,I.jsx)(m,{checked:f,onChange:t=>{t?r.kind===`off`&&g(e?K.activator:x):g({kind:`off`})},label:`Enable Push to Talk`}),f&&(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsx)(`span`,{className:q,children:`Activation Key:`}),(0,I.jsxs)(`div`,{ref:l,tabIndex:a?0:-1,onKeyDown:a?w:void 0,onKeyUp:a?T:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[d.map(e=>{let t=C(e.activator,r);return(0,I.jsx)(Z,{label:e.label,selected:t,onClick:()=>g(e.activator)},e.label)}),a?(0,I.jsx)(Z,{label:s.length>0?j(s):`Press any key…`,selected:!0,recording:!0,onClick:v}):(0,I.jsx)(Z,{label:O?te(r):`Custom`,selected:O,onClick:_})]}),h&&(0,I.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-default text-[var(--content-quiet)]`,children:[(0,I.jsx)(p,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,I.jsx)(`span`,{children:`Push-to-Talk only works while this tab is focused, and browsers may intercept some shortcuts (e.g. Ctrl+T) before the page can see them. For always-on PTT, use the Vellum desktop app.`})]})]})]})})}function Z({label:e,selected:t,recording:n=!1,onClick:r}){return(0,I.jsxs)(`button`,{type:`button`,onClick:r,className:[`inline-flex items-center gap-2 rounded-lg border px-3 py-1.5 text-body-medium-lighter transition-colors`,`border-[var(--border-subtle)]`,t?`bg-[var(--surface-active)]`:`bg-[var(--surface-lift)] hover:bg-[var(--surface-hover)]`,n?`animate-pulse`:``].filter(Boolean).join(` `),children:[(0,I.jsx)(`span`,{className:[`inline-block h-2.5 w-2.5 rounded-full border`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)]`].join(` `)}),(0,I.jsx)(`span`,{className:`text-[var(--content-default)]`,children:e})]})}var ue=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`}];function Q(){let e=T.use.pauseBeforeReplyMs(),t=T.use.setPauseBeforeReplyMs(),n=T.use.interruptSensitivity(),r=T.use.setInterruptSensitivity(),i=e!==null||n!==null;return(0,I.jsx)(P,{title:`Turn taking`,subtitle:`Where your turn ends and the assistant's begins. Applies to hands-free conversations — under push to talk, the key decides.`,children:(0,I.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,I.jsx)($,{label:`Pause before reply`,description:`How long the assistant waits after you stop speaking before it replies. A longer pause lets you gather your thoughts mid-sentence without being cut off.`,isDefault:e===null,children:(0,I.jsx)(`div`,{className:`max-w-xs`,children:(0,I.jsx)(d,{value:(e??1200)/1e3,onValueChange:e=>{typeof e==`number`&&t(Math.round(e*1e3))},min:500/1e3,max:w/1e3,step:.1,showValue:!0,formatValue:e=>`${(typeof e==`number`?e:e[0]).toFixed(1)}s`,"aria-label":`Pause before reply`})})}),(0,I.jsx)($,{label:`Interrupt sensitivity`,description:`How easily talking over the assistant interrupts it. Lower it if the assistant cuts itself off on background noise or filler words; raise it to interrupt more quickly.`,isDefault:n===null,children:(0,I.jsx)(`div`,{className:`max-w-xs`,children:(0,I.jsx)(f,{items:ue,value:n??`medium`,onChange:r,ariaLabel:`Interrupt sensitivity`})})}),i&&(0,I.jsx)(`div`,{children:(0,I.jsx)(a,{variant:`outlined`,onClick:()=>{t(null),r(null)},children:`Reset to defaults`})})]})})}function $({label:e,description:t,isDefault:n,children:r}){return(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),n&&(0,I.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--surface-active)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`Default`})]}),(0,I.jsx)(`p`,{className:q,children:t}),r]})}export{J as VoicePage};
@@ -1 +1 @@
1
- import{t as e}from"./button-Dy5001j6.js";import{u as t}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{l as r}from"./local-mode-DHueA-BJ.js";import{d as i}from"./routes-DrfnNoYS.js";import{t as a}from"./use-onboarding-login-V-vR-6Zd.js";import{t as o}from"./onboarding-layout-iPzXbZk1.js";var s=n();function c(){let n=t(),{loading:c,error:l,login:u,cancel:d}=a();return(0,s.jsx)(o,{children:(0,s.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center px-6 pb-40 text-[var(--content-default)]`,children:(0,s.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center`,children:[(0,s.jsx)(`h1`,{className:`text-5xl font-normal tracking-tight`,style:{fontFamily:`var(--font-serif)`,animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Welcome to Vellum`}),(0,s.jsx)(`p`,{className:`mt-3 text-body-medium-lighter text-[var(--content-tertiary)]`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Your own personal intelligence is just a step away.`}),l&&(0,s.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:l}),(0,s.jsxs)(`div`,{className:`mt-15 flex w-full max-w-sm flex-col gap-3`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,s.jsx)(e,{variant:`primary`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:c?d:()=>void u(),children:c?`Cancel`:`Log In`}),(0,s.jsx)(e,{variant:`ghost`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:()=>{c&&d(),r()?n(i.selectAssistant):n(i.onboarding.hosting)},children:`Continue without account`})]})]})})})}export{c as WelcomeScreen};
1
+ import{t as e}from"./button-Dy5001j6.js";import{u as t}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{l as r}from"./local-mode-DHueA-BJ.js";import{d as i}from"./routes-DrfnNoYS.js";import{t as a}from"./use-onboarding-login-CiQyxJLM.js";import{t as o}from"./onboarding-layout-iPzXbZk1.js";var s=n();function c(){let n=t(),{loading:c,error:l,login:u,cancel:d}=a();return(0,s.jsx)(o,{children:(0,s.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center px-6 pb-40 text-[var(--content-default)]`,children:(0,s.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center`,children:[(0,s.jsx)(`h1`,{className:`text-5xl font-normal tracking-tight`,style:{fontFamily:`var(--font-serif)`,animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Welcome to Vellum`}),(0,s.jsx)(`p`,{className:`mt-3 text-body-medium-lighter text-[var(--content-tertiary)]`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Your own personal intelligence is just a step away.`}),l&&(0,s.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:l}),(0,s.jsxs)(`div`,{className:`mt-15 flex w-full max-w-sm flex-col gap-3`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,s.jsx)(e,{variant:`primary`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:c?d:()=>void u(),children:c?`Cancel`:`Log In`}),(0,s.jsx)(e,{variant:`ghost`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:()=>{c&&d(),r()?n(i.selectAssistant):n(i.onboarding.hosting)},children:`Continue without account`})]})]})})})}export{c as WelcomeScreen};
package/dist/index.html CHANGED
@@ -51,7 +51,7 @@
51
51
  <meta name="twitter:image:alt" content="Vellum: Your Personal Intelligence" />
52
52
 
53
53
  <script src="/assistant/theme-init.js"></script>
54
- <script type="module" crossorigin src="/assistant/assets/index-DQqBZlYO.js"></script>
54
+ <script type="module" crossorigin src="/assistant/assets/index-CPeIfypI.js"></script>
55
55
  <link rel="modulepreload" crossorigin href="/assistant/assets/chunk-jRWAZmH_.js">
56
56
  <link rel="modulepreload" crossorigin href="/assistant/assets/preload-helper-Cv2QeVDK.js">
57
57
  <link rel="modulepreload" crossorigin href="/assistant/assets/is-electron-DIlIrdJX.js">
@@ -132,17 +132,17 @@
132
132
  <link rel="modulepreload" crossorigin href="/assistant/assets/remote-gateway-session-C8pRadB2.js">
133
133
  <link rel="modulepreload" crossorigin href="/assistant/assets/capture-error-CqtAGHQu.js">
134
134
  <link rel="modulepreload" crossorigin href="/assistant/assets/resolved-assistants-store-C6oDdTxB.js">
135
- <link rel="modulepreload" crossorigin href="/assistant/assets/auth-store-CWJoXmMk.js">
136
- <link rel="modulepreload" crossorigin href="/assistant/assets/use-is-org-ready-Df3qfx4p.js">
135
+ <link rel="modulepreload" crossorigin href="/assistant/assets/auth-store-C9aYqB9U.js">
136
+ <link rel="modulepreload" crossorigin href="/assistant/assets/use-is-org-ready-3vHDbj4G.js">
137
137
  <link rel="modulepreload" crossorigin href="/assistant/assets/square-DTFrgbZb.js">
138
138
  <link rel="modulepreload" crossorigin href="/assistant/assets/volume-2-BXDl4IEg.js">
139
- <link rel="modulepreload" crossorigin href="/assistant/assets/voice-list-yvKUrPIf.js">
140
- <link rel="modulepreload" crossorigin href="/assistant/assets/use-platform-gate-B_3hHMqw.js">
139
+ <link rel="modulepreload" crossorigin href="/assistant/assets/voice-list-D26Lzbpv.js">
140
+ <link rel="modulepreload" crossorigin href="/assistant/assets/use-platform-gate-C5bNA5Pn.js">
141
141
  <link rel="modulepreload" crossorigin href="/assistant/assets/search-DL-2uX3K.js">
142
- <link rel="modulepreload" crossorigin href="/assistant/assets/use-sticky-profiles-DamFnjb1.js">
142
+ <link rel="modulepreload" crossorigin href="/assistant/assets/use-sticky-profiles-D5TVHOgw.js">
143
143
  <link rel="modulepreload" crossorigin href="/assistant/assets/identity-BplXBnQ5.js">
144
144
  <link rel="modulepreload" crossorigin href="/assistant/assets/react-query.gen-BtYBixpk.js">
145
- <link rel="modulepreload" crossorigin href="/assistant/assets/local-runtime-upgrade-BvHY1msh.js">
145
+ <link rel="modulepreload" crossorigin href="/assistant/assets/local-runtime-upgrade-CnY-6TiF.js">
146
146
  <link rel="modulepreload" crossorigin href="/assistant/assets/diagnostics-DykDXmF3.js">
147
147
  <link rel="modulepreload" crossorigin href="/assistant/assets/misc-BBsGq1IU.js">
148
148
  <link rel="modulepreload" crossorigin href="/assistant/assets/cloud-off-BFACQbO0.js">
@@ -150,11 +150,11 @@
150
150
  <link rel="modulepreload" crossorigin href="/assistant/assets/refresh-cw-EZQqnaxp.js">
151
151
  <link rel="modulepreload" crossorigin href="/assistant/assets/wrench-DhynFba1.js">
152
152
  <link rel="modulepreload" crossorigin href="/assistant/assets/chunk-5KNZJZUH-Bsoom5--.js">
153
- <link rel="modulepreload" crossorigin href="/assistant/assets/runtime-upgrade-banner-BhPmj3_g.js">
153
+ <link rel="modulepreload" crossorigin href="/assistant/assets/runtime-upgrade-banner-DjFuJawk.js">
154
154
  <link rel="modulepreload" crossorigin href="/assistant/assets/navigation-resolver-CzEY-5nE.js">
155
155
  <link rel="modulepreload" crossorigin href="/assistant/assets/research-onboarding-persistence-DwV372yy.js">
156
- <link rel="modulepreload" crossorigin href="/assistant/assets/build-state-dDRg651i.js">
157
- <link rel="modulepreload" crossorigin href="/assistant/assets/retire-confirm-dialog-CgvcI85l.js">
156
+ <link rel="modulepreload" crossorigin href="/assistant/assets/build-state-9uUe0jN5.js">
157
+ <link rel="modulepreload" crossorigin href="/assistant/assets/retire-confirm-dialog-8xlq4bkx.js">
158
158
  <link rel="modulepreload" crossorigin href="/assistant/assets/chat-Dy2BC2i1.js">
159
159
  <link rel="modulepreload" crossorigin href="/assistant/assets/haptics-C4p_Rjba.js">
160
160
  <link rel="modulepreload" crossorigin href="/assistant/assets/calendar-qrPKlf1H.js">
@@ -163,26 +163,26 @@
163
163
  <link rel="modulepreload" crossorigin href="/assistant/assets/message-square-CHUvAEY9.js">
164
164
  <link rel="modulepreload" crossorigin href="/assistant/assets/monitor-RX4oi4Nj.js">
165
165
  <link rel="modulepreload" crossorigin href="/assistant/assets/settings-6_RIT4kT.js">
166
- <link rel="modulepreload" crossorigin href="/assistant/assets/use-command-palette-sections-DvMBAWZC.js">
166
+ <link rel="modulepreload" crossorigin href="/assistant/assets/use-command-palette-sections-BshFMe0w.js">
167
167
  <link rel="modulepreload" crossorigin href="/assistant/assets/use-active-assistant-id-JLsAfn3e.js">
168
168
  <link rel="modulepreload" crossorigin href="/assistant/assets/key-round-BFkuiQGH.js">
169
169
  <link rel="modulepreload" crossorigin href="/assistant/assets/add-credential-modal-4zzd0MPK.js">
170
170
  <link rel="modulepreload" crossorigin href="/assistant/assets/edge-swipe-arbiter-store-BwC23ScO.js">
171
171
  <link rel="modulepreload" crossorigin href="/assistant/assets/workspace-path-links-vDBIljq_.js">
172
- <link rel="modulepreload" crossorigin href="/assistant/assets/open-workspace-file-B_Rft7dd.js">
173
- <link rel="modulepreload" crossorigin href="/assistant/assets/viewer-store-Cp5tMX-G.js">
172
+ <link rel="modulepreload" crossorigin href="/assistant/assets/open-workspace-file-CivxJWcw.js">
173
+ <link rel="modulepreload" crossorigin href="/assistant/assets/viewer-store-DbIS4l8d.js">
174
174
  <link rel="modulepreload" crossorigin href="/assistant/assets/pointer-CQ4DXHXb.js">
175
175
  <link rel="modulepreload" crossorigin href="/assistant/assets/sandbox-bridge-B5H4c27m.js">
176
176
  <link rel="modulepreload" crossorigin href="/assistant/assets/external-link-GPGZ1LGU.js">
177
177
  <link rel="modulepreload" crossorigin href="/assistant/assets/puzzle-4NgH5snP.js">
178
- <link rel="modulepreload" crossorigin href="/assistant/assets/app-card-CiARsZNb.js">
178
+ <link rel="modulepreload" crossorigin href="/assistant/assets/app-card-BJigGog3.js">
179
179
  <link rel="modulepreload" crossorigin href="/assistant/assets/use-is-mobile-MmHo-OM6.js">
180
180
  <link rel="modulepreload" crossorigin href="/assistant/assets/conversation-store-CTMy9QPV.js">
181
181
  <link rel="modulepreload" crossorigin href="/assistant/assets/edit-chat-session-DVzLQLWl.js">
182
182
  <link rel="modulepreload" crossorigin href="/assistant/assets/chevron-up-DofScvyy.js">
183
183
  <link rel="modulepreload" crossorigin href="/assistant/assets/minimize-2-Dj9FY4aF.js">
184
184
  <link rel="modulepreload" crossorigin href="/assistant/assets/pencil-Cm5DdeRM.js">
185
- <link rel="modulepreload" crossorigin href="/assistant/assets/use-edit-app-DOmv9zsZ.js">
185
+ <link rel="modulepreload" crossorigin href="/assistant/assets/use-edit-app-Bd1eXXFq.js">
186
186
  <link rel="modulepreload" crossorigin href="/assistant/assets/avatar-svg-compositor-axSwKFvf.js">
187
187
  <link rel="modulepreload" crossorigin href="/assistant/assets/avatar-renderer-TpNgmnU1.js">
188
188
  <link rel="modulepreload" crossorigin href="/assistant/assets/proxy-DrtKRLtr.js">
@@ -209,10 +209,10 @@
209
209
  <link rel="modulepreload" crossorigin href="/assistant/assets/arrow-left-W84B6oJL.js">
210
210
  <link rel="modulepreload" crossorigin href="/assistant/assets/sparkles-DfEFn3Bh.js">
211
211
  <link rel="modulepreload" crossorigin href="/assistant/assets/not-found-Bh7ZsdAo.js">
212
- <link rel="modulepreload" crossorigin href="/assistant/assets/login-flow-DmQTk-x9.js">
213
- <link rel="modulepreload" crossorigin href="/assistant/assets/use-onboarding-login-V-vR-6Zd.js">
212
+ <link rel="modulepreload" crossorigin href="/assistant/assets/login-flow-CQhvCbQQ.js">
213
+ <link rel="modulepreload" crossorigin href="/assistant/assets/use-onboarding-login-CiQyxJLM.js">
214
214
  <link rel="modulepreload" crossorigin href="/assistant/assets/log-in-D4nsqRbG.js">
215
- <link rel="modulepreload" crossorigin href="/assistant/assets/platform-login-notice-q7ZuGeuo.js">
215
+ <link rel="modulepreload" crossorigin href="/assistant/assets/platform-login-notice-DFmjUE9q.js">
216
216
  <link rel="modulepreload" crossorigin href="/assistant/assets/use-copy-to-clipboard-RUBxQIiE.js">
217
217
  <link rel="modulepreload" crossorigin href="/assistant/assets/clipboard-copy-BYpgEh2O.js">
218
218
  <link rel="modulepreload" crossorigin href="/assistant/assets/slack-setup-wizard-DPzdheN0.js">
@@ -227,29 +227,29 @@
227
227
  <link rel="modulepreload" crossorigin href="/assistant/assets/prechat-C4MZwKWX.js">
228
228
  <link rel="modulepreload" crossorigin href="/assistant/assets/browser-timezone-Br-HawKV.js">
229
229
  <link rel="modulepreload" crossorigin href="/assistant/assets/effective-timezone-BX46fWmk.js">
230
- <link rel="modulepreload" crossorigin href="/assistant/assets/messages-QgGSiklY.js">
230
+ <link rel="modulepreload" crossorigin href="/assistant/assets/messages-Dyp1xUqz.js">
231
231
  <link rel="modulepreload" crossorigin href="/assistant/assets/background-task-store-DpOSZFT8.js">
232
232
  <link rel="modulepreload" crossorigin href="/assistant/assets/file-markdown-DnVLY_b_.js">
233
233
  <link rel="modulepreload" crossorigin href="/assistant/assets/pdf-preview-pscVmtvX.js">
234
234
  <link rel="modulepreload" crossorigin href="/assistant/assets/chevron-left-CrxnPze-.js">
235
235
  <link rel="modulepreload" crossorigin href="/assistant/assets/file-DOePafLU.js">
236
236
  <link rel="modulepreload" crossorigin href="/assistant/assets/use-attachment-preview-CQjpDfsc.js">
237
- <link rel="modulepreload" crossorigin href="/assistant/assets/use-transcript-messages-CgESPWZ3.js">
237
+ <link rel="modulepreload" crossorigin href="/assistant/assets/use-transcript-messages-C2uwkjKL.js">
238
238
  <link rel="modulepreload" crossorigin href="/assistant/assets/code-D6SOwRrI.js">
239
239
  <link rel="modulepreload" crossorigin href="/assistant/assets/acp-run-actions-zSUs8U3N.js">
240
- <link rel="modulepreload" crossorigin href="/assistant/assets/risk-Bnj8QXuk.js">
241
- <link rel="modulepreload" crossorigin href="/assistant/assets/background-task-actions-762wxVkT.js">
240
+ <link rel="modulepreload" crossorigin href="/assistant/assets/message-content-B6_GZQl9.js">
241
+ <link rel="modulepreload" crossorigin href="/assistant/assets/background-task-actions-DmocXKSr.js">
242
242
  <link rel="modulepreload" crossorigin href="/assistant/assets/three-dot-indicator-CeTxs9-J.js">
243
243
  <link rel="modulepreload" crossorigin href="/assistant/assets/AnimatePresence-CHo6D7IH.js">
244
244
  <link rel="modulepreload" crossorigin href="/assistant/assets/brain-CN4zzNgU.js">
245
245
  <link rel="modulepreload" crossorigin href="/assistant/assets/user-plus-DjxxnQ8G.js">
246
- <link rel="modulepreload" crossorigin href="/assistant/assets/site-favicon-FokoB0J2.js">
246
+ <link rel="modulepreload" crossorigin href="/assistant/assets/site-favicon-CDH0mg6Q.js">
247
247
  <link rel="modulepreload" crossorigin href="/assistant/assets/subagent-store-DibRR9Ij.js">
248
248
  <link rel="modulepreload" crossorigin href="/assistant/assets/copy-to-clipboard-DgY-nZpm.js">
249
249
  <link rel="modulepreload" crossorigin href="/assistant/assets/circle-x-DTjJzoQl.js">
250
250
  <link rel="modulepreload" crossorigin href="/assistant/assets/file-plus-DjC7wnGp.js">
251
251
  <link rel="modulepreload" crossorigin href="/assistant/assets/terminal-BucMVaPU.js">
252
- <link rel="modulepreload" crossorigin href="/assistant/assets/transcript-message-body-shared-DkwwIkg0.js">
252
+ <link rel="modulepreload" crossorigin href="/assistant/assets/transcript-message-body-shared-BfKwS5qD.js">
253
253
  <link rel="modulepreload" crossorigin href="/assistant/assets/archive-BQ3zdIPv.js">
254
254
  <link rel="modulepreload" crossorigin href="/assistant/assets/use-attachment-squares-8Hx-p8ls.js">
255
255
  <link rel="modulepreload" crossorigin href="/assistant/assets/native-file-B71h3csB.js">
@@ -259,16 +259,16 @@
259
259
  <link rel="modulepreload" crossorigin href="/assistant/assets/ellipsis-C5fQnusC.js">
260
260
  <link rel="modulepreload" crossorigin href="/assistant/assets/eye-off-DQ4xakzN.js">
261
261
  <link rel="modulepreload" crossorigin href="/assistant/assets/eye-B_jBDDRn.js">
262
- <link rel="modulepreload" crossorigin href="/assistant/assets/chat-markdown-message-Da34digC.js">
262
+ <link rel="modulepreload" crossorigin href="/assistant/assets/chat-markdown-message-B7qvlO44.js">
263
263
  <link rel="modulepreload" crossorigin href="/assistant/assets/preview-skeleton-Biw3dosM.js">
264
264
  <link rel="modulepreload" crossorigin href="/assistant/assets/surface-parse-helpers-iPHZ9D7N.js">
265
265
  <link rel="modulepreload" crossorigin href="/assistant/assets/workflow-status-D0bBEpGp.js">
266
266
  <link rel="modulepreload" crossorigin href="/assistant/assets/workflow-store-zCcRcvi8.js">
267
267
  <link rel="modulepreload" crossorigin href="/assistant/assets/conversation-selection-CJs3Fnse.js">
268
- <link rel="modulepreload" crossorigin href="/assistant/assets/conversation-navigation-BqoIExAQ.js">
269
- <link rel="modulepreload" crossorigin href="/assistant/assets/use-subagent-card-data-B31LofB3.js">
268
+ <link rel="modulepreload" crossorigin href="/assistant/assets/conversation-navigation-Bf3cDRKh.js">
269
+ <link rel="modulepreload" crossorigin href="/assistant/assets/use-subagent-card-data-bjGydvhR.js">
270
270
  <link rel="modulepreload" crossorigin href="/assistant/assets/assistant-feature-flag-store-BvLDPeej.js">
271
- <link rel="modulepreload" crossorigin href="/assistant/assets/access-DRXEXX07.js">
271
+ <link rel="modulepreload" crossorigin href="/assistant/assets/access-CVnesk0m.js">
272
272
  <link rel="modulepreload" crossorigin href="/assistant/assets/research-facts-BUfgocIh.js">
273
273
  <link rel="modulepreload" crossorigin href="/assistant/assets/ban-BKp90l-0.js">
274
274
  <link rel="modulepreload" crossorigin href="/assistant/assets/research-results-view-BFZFPpev.js">
@@ -284,7 +284,7 @@
284
284
  <link rel="modulepreload" crossorigin href="/assistant/assets/invalidate-plugin-queries-B0OpJSUW.js">
285
285
  <link rel="modulepreload" crossorigin href="/assistant/assets/oauth-connection-utils-BrGz4Zc5.js">
286
286
  <link rel="modulepreload" crossorigin href="/assistant/assets/oauth-popup-DAMkjCsP.js">
287
- <link rel="modulepreload" crossorigin href="/assistant/assets/first-run-scope-CXWfJKeP.js">
287
+ <link rel="modulepreload" crossorigin href="/assistant/assets/first-run-scope-CPJpXaWU.js">
288
288
  <link rel="modulepreload" crossorigin href="/assistant/assets/onboarding-layout-iPzXbZk1.js">
289
289
  <link rel="modulepreload" crossorigin href="/assistant/assets/hard-navigate-BYoBFmE4.js">
290
290
  <link rel="modulepreload" crossorigin href="/assistant/assets/use-supports-bookmarks-DwTpI8uM.js">
@@ -293,10 +293,10 @@
293
293
  <link rel="modulepreload" crossorigin href="/assistant/assets/sliders-horizontal-BwdOIxz8.js">
294
294
  <link rel="modulepreload" crossorigin href="/assistant/assets/mic-BZZo0R22.js">
295
295
  <link rel="modulepreload" crossorigin href="/assistant/assets/users-OcC3p9Jn.js">
296
- <link rel="modulepreload" crossorigin href="/assistant/assets/settings-navigation-DNl4C8Cc.js">
296
+ <link rel="modulepreload" crossorigin href="/assistant/assets/settings-navigation-CyH-twYD.js">
297
297
  <link rel="modulepreload" crossorigin href="/assistant/assets/workspace-theme-tokens-dJKcMIdP.js">
298
298
  <link rel="modulepreload" crossorigin href="/assistant/assets/conversation-list-fetchers-C6W8PkvR.js">
299
- <link rel="modulepreload" crossorigin href="/assistant/assets/conversation-queries-Dcm9S7mz.js">
299
+ <link rel="modulepreload" crossorigin href="/assistant/assets/conversation-queries-BBj4FfQn.js">
300
300
  <link rel="modulepreload" crossorigin href="/assistant/assets/use-app-theme-yiZ38i4_.js">
301
301
  <link rel="modulepreload" crossorigin href="/assistant/assets/use-assistant-capability-CnI3VItU.js">
302
302
  <link rel="modulepreload" crossorigin href="/assistant/assets/avatar-bundled-components-BvKt7I7O.js">
@@ -313,7 +313,7 @@
313
313
  <link rel="modulepreload" crossorigin href="/assistant/assets/trust-rules-api-Dbyz25hE.js">
314
314
  <link rel="modulepreload" crossorigin href="/assistant/assets/dictation-overlay-CnPWVnXc.js">
315
315
  <link rel="modulepreload" crossorigin href="/assistant/assets/esm-Jw5qNk7q.js">
316
- <link rel="modulepreload" crossorigin href="/assistant/assets/notifications-rSx7pNPi.js">
316
+ <link rel="modulepreload" crossorigin href="/assistant/assets/notifications-BTG4cTbF.js">
317
317
  <link rel="modulepreload" crossorigin href="/assistant/assets/deploy-store-BDIOP-i9.js">
318
318
  <link rel="modulepreload" crossorigin href="/assistant/assets/avatar-subagent-tkmKhEWI.js">
319
319
  <link rel="modulepreload" crossorigin href="/assistant/assets/avatar-tone-D99t9DAP.js">
@@ -348,9 +348,9 @@
348
348
  <link rel="modulepreload" crossorigin href="/assistant/assets/smartphone-CIrxb2NM.js">
349
349
  <link rel="modulepreload" crossorigin href="/assistant/assets/sun-BauGiwdK.js">
350
350
  <link rel="modulepreload" crossorigin href="/assistant/assets/workflow-Bsy5y3W0.js">
351
- <link rel="modulepreload" crossorigin href="/assistant/assets/routes-SchRo2Ae.js">
351
+ <link rel="modulepreload" crossorigin href="/assistant/assets/routes-uGHUgv4F.js">
352
352
  <link rel="stylesheet" crossorigin href="/assistant/assets/src-CfUWwwYf.css">
353
- <link rel="stylesheet" crossorigin href="/assistant/assets/index-OYTmjL3q.css">
353
+ <link rel="stylesheet" crossorigin href="/assistant/assets/index-C7_04HXM.css">
354
354
  <script>window.__VELLUM_CONFIG__={"webUrl":"https://www.vellum.ai","platformUrl":"https://platform.vellum.ai"}</script></head>
355
355
  <body>
356
356
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/web",
3
- "version": "0.11.2-staging.1",
3
+ "version": "0.11.2-staging.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Pre-built web SPA for the Vellum Assistant",
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{t as r}from"./jsx-runtime-D3ZM-ToX.js";import{t as i}from"./typography-DEI9Ra9z.js";import{c as a,l as o,x as s}from"./risk-Bnj8QXuk.js";import{_ as c,a as l,f as u,g as d,i as f,r as p,v as m,y as h}from"./transcript-message-body-shared-DkwwIkg0.js";import{t as g}from"./chevron-left-CrxnPze-.js";import"./src-Da9g8qsW.js";import{t as _}from"./chat-markdown-message-Da34digC.js";import{t as v}from"./workflow-store-zCcRcvi8.js";import{t as y}from"./background-task-store-DpOSZFT8.js";import{r as b}from"./acp-run-store-DdzY8U9Y.js";import{a as x,g as S,i as C,n as w,r as T,s as E,w as D,x as O}from"./site-favicon-FokoB0J2.js";import{t as k}from"./detail-shell-BjqibXNX.js";import{t as A}from"./use-transcript-message-by-id-BxaY6TIY.js";import{ToolDetailBody as j,t as M}from"./tool-detail-panel-BmohMKch.js";var N=e(t(),1);function P(e,t,n){let r=f(t,n.workflow),i=e=>{let t=u(e,n.workflow.byToolUseId);if(t!==null&&r.has(t))return!0;let i=p(e,n.acpByToolUseId);if(i!==null&&n.acpById[i]!==void 0)return!0;let a=l(e);return a!==void 0&&n.backgroundTaskById[a]!==void 0},a=t.filter(e=>!i(e));if(a.length===t.length)return{items:e,toolCalls:t};let o=new Set(a.map(e=>e.id));return{items:e.filter(e=>e.kind!==`toolCall`||o.has(e.toolCall.id)),toolCalls:a}}function F(e,t){let n=A(e),r=v.use.byId(),i=v.use.byToolUseId(),s=v.use.notFoundRunIds(),c=v.use.hydrationFailedRunIds(),l=b.use.byId(),u=b.use.byToolUseId(),d=y.use.byId();return(0,N.useMemo)(()=>{if(!n||t==null)return null;let e=o(n.contentBlocks??[],{splitInlineThinking:n.role!==`user`})[t];if(!e||e.type!==`activity`)return null;let{cardItems:f,toolCalls:p}=a(e.items);return P(f,p,{workflow:{byId:r,byToolUseId:i,notFoundRunIds:s,hydrationFailedRunIds:c},acpById:l,acpByToolUseId:u,backgroundTaskById:d})},[n,t,r,i,s,c,l,u,d])}var I=r(),L=60;function R({payload:e,onClose:t,assistantId:r}){let[a,o]=(0,N.useState)(null),s=F(e.messageId,e.groupIndex),l=s?.items??e.items,u=s?.toolCalls??e.toolCalls,f=h(l),p=c(f.steps),_=m(f.state,f.steps),v=_===`loading`,y=d(_,f.totalDurationLabel??``,p.failed),b=v&&f.currentStepTitle||y,x=new Map(u.map(e=>[e.id,e])),C=a?a.kind===`thinking`?`Thinking`:a.activity||a.title:``;return(0,I.jsx)(k,{titleNode:a?(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 py-0.5`,children:[(0,I.jsx)(n,{variant:`ghost`,iconOnly:(0,I.jsx)(g,{}),"aria-label":`Back to all steps`,tooltip:`All steps`,onClick:()=>o(null),className:`-ml-2.5 shrink-0`}),(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:C})]}):(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 py-0.5`,children:[(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:v?(0,I.jsx)(S,{children:b}):b}),f.stepCount?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{"aria-hidden":!0,className:`size-[3px] shrink-0 rounded-full bg-[var(--content-tertiary)]`}),(0,I.jsx)(i,{variant:`title-medium`,className:`shrink-0 whitespace-nowrap leading-snug text-[var(--content-secondary)]`,children:f.stepCount})]}):null]}),closeLabel:`Close steps`,onClose:t,children:a?(0,I.jsx)(B,{detail:a,assistantId:r}):(0,I.jsx)(E,{steps:f.steps,timeline:!0,renderStep:t=>(0,I.jsx)(z,{step:t,activeDetail:a,onOpenDetail:o,lookupToolCall:e=>x.get(e),messageId:e.messageId,groupIndex:e.groupIndex})})})}function z({step:e,activeDetail:t,onOpenDetail:n,lookupToolCall:r,messageId:i,groupIndex:a}){if(e.kind===`thinking`){let t=i!=null&&e.thinkingItemIndex!=null?{messageId:i,thinkingGroupIndex:a,thinkingItemIndex:e.thinkingItemIndex}:{};return(0,I.jsx)(C,{iconName:`brain`,label:s(D(e.text),L),ariaLabel:`View thinking`,active:!1,onClick:()=>n({kind:`thinking`,toolCallId:``,toolName:``,title:`Thinking`,activity:``,input:{},status:`completed`,thinkingText:e.text,...t})})}if(e.kind===`web_search`)return(0,I.jsx)(T,{step:e});if(e.kind===`web_search_error`)return(0,I.jsx)(w,{step:e});if(e.kind!==`tool`)return(0,I.jsx)(x,{step:e});let o=r(e.toolCallId);return(0,I.jsx)(C,{iconName:e.iconName,label:e.activity||e.info||e.title,active:t?.toolCallId===e.toolCallId,onClick:()=>{o&&n(O(o))}})}function B({detail:e,assistantId:t}){let n=M(e.kind===`thinking`?e.messageId:void 0,e.thinkingGroupIndex,e.thinkingItemIndex);return(0,I.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.kind===`thinking`?(0,I.jsx)(_,{content:n??e.thinkingText??``,hardLineBreaks:!0,assistantId:t}):(0,I.jsx)(j,{detail:e})})}export{R as ActivityStepsPanel};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-UxVM8v-Z.js","assets/preload-helper-Cv2QeVDK.js","assets/dist-an0Z446E.js","assets/esm-Jw5qNk7q.js","assets/chunk-jRWAZmH_.js","assets/esm-S7iZcDlp.js"])))=>i.map(i=>d[i]);
2
- import{i as e,l as t,o as n,t as r}from"./local-settings-Bx7FsNo5.js";import{a as i,n as a,r as o}from"./device-settings-CUIsZfaf.js";import{o as s,t as c}from"./capture-error-CqtAGHQu.js";import{t as l}from"./preload-helper-Cv2QeVDK.js";import{t as u}from"./useQuery-Bz-fbQ-m.js";import{n as d,t as f}from"./create-selectors-BfxF8Sx_.js";import{A as ee,D as te,E as ne,O as re,T as ie,at as ae,c as oe,ct as se,d as ce,dt as p,f as m,h,i as le,it as g,lt as ue,m as de,n as fe,nt as pe,ot as me,r as he,rt as ge,s as _e,st as ve,ut as _,v as ye,y as be}from"./local-mode-DHueA-BJ.js";import{t as v}from"./is-electron-DIlIrdJX.js";import{n as y,t as xe}from"./resolved-assistants-store-C6oDdTxB.js";import{n as Se,r as b,t as Ce}from"./api-errors-BRGPPSWw.js";import{t as we}from"./client.gen-Dq2brHDV.js";import{Bt as Te,D as Ee,E as De,F as Oe,I as ke,Vt as Ae,jt as je}from"./sdk.gen-ies09CqM.js";import{a as Me,c as Ne,r as Pe}from"./api-CGsj1Pig.js";import{n as Fe,t as Ie}from"./event-bus-CbDg1VDt.js";import{t as Le}from"./client-feature-flag-store-Cw39NfCq.js";import{D as Re,N as ze,O as Be,c as Ve,h as He,i as Ue,j as x,k as We,l as Ge,r as Ke,t as qe,u as Je}from"./native-biometric-DetUqtjl.js";import{o as Ye}from"./remote-gateway-session-C8pRadB2.js";import{i as Xe,t as S}from"./dist-an0Z446E.js";import{i as Ze,t as Qe}from"./typed-storage-OO7emDaU.js";import{o as $e}from"./platform-detection-AHYibqOx.js";import{t as C}from"./onboarding-store-BiTZenvP.js";import{s as et,t as tt}from"./use-assistant-avatar-Bjqx8JUy.js";var w=f(d(()=>({assistantState:{kind:`loading`},operationalStatusAssistantId:null,expectingFirstMessage:!1}))),nt=new Set;function rt(e){return nt.add(e),()=>{nt.delete(e)}}function it(){for(let e of nt)try{e()}catch{}}var at=new Set([502,503,504]),ot=`Connection interrupted. Reconnecting…`;function st(e){return e.code===`proxy_network_error`?!0:(typeof e.detail==`string`?e.detail:``).includes(`net::ERR_`)}function ct(e){if(e.ok)switch(e.data.status){case`active`:return e.data.is_local?{kind:`self_hosted`}:{kind:`active`};case`initializing`:return{kind:`initializing`};case`to_be_deleted`:return{kind:`cleaning_up`};default:return{kind:`error`,message:`Unexpected assistant status: ${e.data.status}`}}return e.status===404?{kind:`auto_hatch`}:st(e.error)?{kind:`error`,transient:!0,message:ot}:{kind:`error`,message:b(e.error,void 0,`Failed to check assistant status.`)}}function lt(e){return e===void 0||e>=500}var ut=`platform_hosted_disabled`,dt=`We are at capacity for Vellum Managed Assistants, more will be available soon!`;function ft(e,t){return e===503?t?.code===ut:!1}var pt=2e3,mt=3e4;function ht(e){return Math.min(pt*2**e,mt)}var gt=3e5;function _t(){return{kind:`error`,message:`Your assistant is taking longer than expected to start. Please try again, or check the community for help.`}}var vt=[`assistant`,`current`],yt=3e3,bt=new Set([`initializing`,`cleaning_up`]);function xt(e){if(!e)return!1;let t=ct(e);return bt.has(t.kind)?yt:!1}function St(e){return e?[...vt,e]:vt}function Ct(e){let t=e.selectedPlatformAssistantId??null;return u({queryKey:St(t),queryFn:()=>Pe(t??void 0),enabled:e.enabled,retry:!1,refetchInterval:e=>xt(e.state.data),refetchOnWindowFocus:!1})}var wt=new Set([`healthy`,`ok`]);function Tt(e){if(!e.ok)return`unreachable`;let t=e.data?.status;return t===`MIGRATING`?`migrating`:t!==void 0&&!wt.has(t)?`unhealthy`:`healthy`}function Et(){let e=w.use.assistantState();return e.kind===`self_hosted`||e.kind===`active`&&e.isLocal?e.health??null:null}var T=e=>e===`authenticated`,Dt=e=>e!==`initializing`,E=e=>e===`present`,Ot=e=>e!==`unknown`,kt=(e,t)=>e===`present`&&!t,At=new Set([401,403,410]),jt=e=>!e.ok&&e.status!==void 0&&At.has(e.status),Mt=4e3,Nt=6e4,Pt=5e3;function Ft(){let e=/\/assistant(?:\/|$)/.exec(window.location.pathname),t=e&&e.index>0?window.location.pathname.slice(0,e.index).replace(/\/+$/,``):``;return`${window.location.origin}${t}`}var It=new class{state={kind:`loading`};generation=0;initializingTimeout=null;ready=!1;inputs={sessionStatus:`initializing`,hasPlatformSession:!1,queryClient:null,selectedPlatformAssistantId:null};probeTimer=null;healthHeartbeatTimer=null;healthHeartbeatId=null;healthHeartbeatToken=0;reachabilityProbeInFlightIds=new Set;probeLoopAssistantId=null;errorRetryTimer=null;errorRetryAttempt=0;constructor(){rt(()=>this.onUnreachable()),Fe(`app.online`,()=>this.onNetworkOnline()),y.subscribe((e,t)=>{e.selectedAssistantId!==t.selectedAssistantId&&(!p()||this.state.kind===`loading`||this.applyGatewayAuthShortCircuit())})}setInputs(e){this.inputs=e,this.ready=!0}resetForLogout(){y.getState().activeAssistantId!==null&&y.getState().setActiveAssistantId(null),this.setOperationalStatusAssistantId(null),this.cancelProbeTimer(),this.probeLoopAssistantId=null,this.reachabilityProbeInFlightIds.clear(),this.state.kind!==`loading`&&this.transition({kind:`loading`}),this.clearExpectingFirstMessage()}async respondToInputs(){if(this.ready){if(p()){this.applyGatewayAuthShortCircuit();return}if(!T(this.inputs.sessionStatus)){this.resetForLogout();return}this.inputs.hasPlatformSession&&g(null),this.inputs.isOrgReady&&await this.checkAssistant()}}async applyServerResult(e){this.ready&&(this.state.kind!==`initializing`&&this.state.kind!==`cleaning_up`||await this.applyServerStateUpdate(e))}async checkAssistant(e){if(!this.ready)return;if(p()){this.applyGatewayAuthShortCircuit();return}let t=this.generation;try{let n=e??this.inputs.selectedPlatformAssistantId??null,r=await this.inputs.queryClient.fetchQuery({queryKey:St(n),queryFn:()=>Pe(n??void 0),staleTime:0});if(t!==this.generation||n&&!r.ok&&r.status===404&&(y.getState().setSelectedAssistant(null),r=await this.inputs.queryClient.fetchQuery({queryKey:vt,queryFn:()=>Pe(),staleTime:0}),t!==this.generation))return;await this.applyServerStateUpdate(r)}catch(e){if(console.error(`Error checking assistant status:`,e),c(e,{context:`check_assistant`}),t!==this.generation||this.degradeOnTransportFailure())return;this.transition({kind:`error`,transient:!0,message:ot})}}degradeOnTransportFailure(){return this.state.kind===`active`?(this.triggerReachabilityProbe(),!0):this.state.kind===`initializing`||this.state.kind===`cleaning_up`}retryAssistant(){this.ready&&this.checkAssistant()}markExpectingFirstMessage(){w.getState().expectingFirstMessage||w.setState({expectingFirstMessage:!0})}clearExpectingFirstMessage(){w.getState().expectingFirstMessage&&w.setState({expectingFirstMessage:!1})}transition(e){let t=this.state.kind;this.state=e,w.setState({assistantState:e}),e.kind===`initializing`?t!==`initializing`&&this.armInitializingWatchdog():this.initializingTimeout&&=(clearTimeout(this.initializingTimeout),null),e.kind!==`initializing`&&e.kind!==`active`&&this.clearExpectingFirstMessage(),!(e.kind===`self_hosted`||e.kind===`active`&&e.isLocal)&&this.healthHeartbeatId!==null&&this.cancelHealthHeartbeat(),e.kind===`error`&&e.transient?this.armErrorRetry():this.clearErrorRetry(e.kind!==`error`)}clearErrorRetry(e){this.errorRetryTimer&&=(clearTimeout(this.errorRetryTimer),null),e&&(this.errorRetryAttempt=0)}armErrorRetry(){this.errorRetryTimer&&clearTimeout(this.errorRetryTimer);let e=ht(this.errorRetryAttempt);this.errorRetryAttempt+=1,this.errorRetryTimer=setTimeout(()=>{this.errorRetryTimer=null,this.checkAssistant()},e)}onNetworkOnline(){if(this.ready){if(this.state.kind===`error`&&this.state.transient){this.clearErrorRetry(!0),this.checkAssistant();return}this.state.kind===`active`&&this.state.reachable===!1&&this.checkAssistant()}}armInitializingWatchdog(){this.initializingTimeout&&clearTimeout(this.initializingTimeout),this.initializingTimeout=setTimeout(()=>{this.generation++,s(`Assistant stuck in initializing state`,{level:`warning`,extra:{timeoutMs:gt}}),this.transition(_t())},gt)}projectActive(e){let t=e.data.maintenance_mode,n=e.data.is_local??!1;g(null),this.setOperationalStatusAssistantId(e.data.id);let r=y.getState();r.upsertFromApi(e.data),r.setActiveAssistantId(e.data.id),this.transition({kind:`active`,isLocal:n,maintenanceMode:{enabled:t?.enabled}}),n?this.startHealthHeartbeat(e.data.id):this.probeReachability(e.data.id)}projectSelfHosted(e){this.setOperationalStatusAssistantId(null),g({url:e.data.ingress_url,token:e.data.platform_actor_token});let t=y.getState();t.upsertFromApi(e.data),t.setActiveAssistantId(e.data.id),this.transition({kind:`self_hosted`}),this.startHealthHeartbeat(e.data.id)}applyGatewayAuthShortCircuit(){let e=window.location.origin,t=`self`,n=le();if(h())e=Ft();else if(n){let r=oe();e=`${window.location.origin}${n}`,t=r?.assistantId??t}g({url:e,token:se()}),this.setOperationalStatusAssistantId(null),y.getState().setActiveAssistantId(t),this.transition({kind:`active`,isLocal:!0}),this.startHealthHeartbeat(t)}async applyServerStateUpdate(e){let t=this.generation,n=ct(e);if(!(n.kind===`error`&&n.transient&&this.degradeOnTransportFailure())&&(e.ok?this.setOperationalStatusAssistantId(e.data.id):this.setOperationalStatusAssistantId(null),n.kind!==`auto_hatch`)){if(n.kind===`active`&&e.ok){this.projectActive(e);return}if(n.kind===`self_hosted`&&e.ok){this.projectSelfHosted(e);return}t===this.generation&&n.kind!==`active`&&this.transition(n)}}async probeReachability(e){if(!this.reachabilityProbeInFlightIds.has(e)){this.reachabilityProbeInFlightIds.add(e);try{let t=this.generation,n=this.state.kind===`self_hosted`||this.state.kind===`active`&&this.state.isLocal,r=n?oe()?.assistantId??e:e,i=!h()&&n?await ee(r).catch(()=>null):null,a=i?.ok&&i.state===`upgrading`?`upgrading`:`unreachable`;if(a!==`upgrading`)try{a=Tt(await Me(e))}catch{a=`unreachable`}if(a===`unreachable`&&!i&&!h()&&(i=await ee(r).catch(()=>null)),a===`unreachable`&&i?.ok)switch(i.state){case`healthy`:a=`healthy`;break;case`sleeping`:case`starting`:case`upgrading`:case`unhealthy`:case`crashed`:a=i.state;break;case`unknown`:break}if(t!==this.generation||y.getState().activeAssistantId!==e)return;if(this.state.kind===`self_hosted`){this.state.health!==a&&this.transition({...this.state,health:a});return}if(this.state.kind!==`active`)return;let o=a===`healthy`||a===`unhealthy`;if(this.state.reachable===o&&this.state.health===a)return;this.transition({...this.state,reachable:o,health:a})}finally{this.reachabilityProbeInFlightIds.delete(e)}}}cancelProbeTimer(){this.probeTimer&&=(clearTimeout(this.probeTimer),null)}startProbeLoop(e){if(this.probeLoopAssistantId===e)return;this.cancelProbeTimer(),this.probeLoopAssistantId=e;let t=Date.now(),n=()=>{this.probeLoopAssistantId=null},r=async()=>{if(this.state.kind!==`active`||this.state.reachable===!0){n();return}if(Date.now()-t>Nt){n();return}await this.probeReachability(e);let i=this.state;if(i.kind!==`active`||i.reachable===!0){n();return}if(Date.now()-t>Nt){n();return}this.probeTimer=setTimeout(()=>void r(),Mt)};this.probeTimer=setTimeout(()=>void r(),Mt)}startHealthHeartbeat(e){if(this.healthHeartbeatId===e)return;this.cancelHealthHeartbeat(),this.healthHeartbeatId=e;let t=this.healthHeartbeatToken,n=async()=>{t===this.healthHeartbeatToken&&(await this.probeReachability(e),t===this.healthHeartbeatToken&&(this.healthHeartbeatTimer=setTimeout(()=>void n(),Pt)))};n()}cancelHealthHeartbeat(){this.healthHeartbeatToken++,this.healthHeartbeatId=null,this.healthHeartbeatTimer&&=(clearTimeout(this.healthHeartbeatTimer),null)}onUnreachable(){this.triggerReachabilityProbe()}triggerReachabilityProbe(){if(this.state.kind!==`active`)return;let e=y.getState().activeAssistantId;if(e){if(this.transition({...this.state,reachable:!1}),this.healthHeartbeatId===e){this.probeReachability(e);return}this.startProbeLoop(e)}}setLocalAssistantUpgradeInProgress(e,t){if(y.getState().activeAssistantId===e){if(!t){this.probeReachability(e);return}if(this.state.kind===`self_hosted`){this.transition({...this.state,health:`upgrading`});return}this.state.kind===`active`&&this.state.isLocal&&this.transition({...this.state,reachable:!1,health:`upgrading`})}}__resetForTesting(){this.initializingTimeout&&=(clearTimeout(this.initializingTimeout),null),this.cancelProbeTimer(),this.cancelHealthHeartbeat(),this.probeLoopAssistantId=null,this.reachabilityProbeInFlightIds.clear(),this.clearErrorRetry(!0),this.state={kind:`loading`},this.generation=0,this.ready=!1,w.setState({expectingFirstMessage:!1,operationalStatusAssistantId:null}),this.inputs={sessionStatus:`initializing`,hasPlatformSession:!1,queryClient:null},w.setState({assistantState:this.state}),y.setState({activeAssistantId:null})}setOperationalStatusAssistantId(e){w.getState().operationalStatusAssistantId!==e&&w.setState({operationalStatusAssistantId:e})}},Lt=`vellum_active_organization_id`;function Rt(){return globalThis.sessionStorage===void 0?null:globalThis.sessionStorage}function zt(){let e=Rt();if(!e)return null;try{return e.getItem(Lt)}catch{return null}}function Bt(e){let t=Rt();if(t)try{t.setItem(Lt,e)}catch{}}function Vt(){let e=Rt();if(e)try{e.removeItem(Lt)}catch{}}function Ht(e,t){return e.length===0?null:t&&e.some(e=>e.id===t)?t:e[0].id}var D=f(d()((e,t)=>({organizations:[],currentOrganizationId:null,persistedOrganizationId:zt(),status:`idle`,error:null,fetchOrganizations:async()=>{e({status:`loading`,error:null});try{let n=(await je()).data?.results??[],r=Ht(n,t().currentOrganizationId??t().persistedOrganizationId);r&&Bt(r),e({organizations:n,currentOrganizationId:r,persistedOrganizationId:r??t().persistedOrganizationId,status:r?`ready`:`error`,error:r?null:`No organization available for this user.`})}catch(t){e({status:`error`,error:t instanceof Error&&t.message?t.message:`Failed to load organizations.`})}},setCurrentOrganizationId:n=>{let{organizations:r}=t();r.some(e=>e.id===n)&&(Bt(n),e({currentOrganizationId:n,persistedOrganizationId:n,status:`ready`}))},clearOrganization:()=>{Vt(),e({organizations:[],currentOrganizationId:null,persistedOrganizationId:null,status:`idle`,error:null})}})));function Ut(e){return e.currentOrganizationId??e.persistedOrganizationId}function O(){return Ut(D.getState())}function Wt(){return D(Ut)}function Gt(){D.getState().clearOrganization()}function Kt(){let e=0,t=D.subscribe(t=>{(t.status===`ready`||t.status===`error`)&&(e=Date.now())}),n=$.subscribe((e,t)=>{let n=E(e.platformSession),r=E(t.platformSession);n&&(!r||e.user?.id!==t.user?.id)&&D.getState().fetchOrganizations()}),r=()=>{if(!E($.getState().platformSession))return;let{status:t}=D.getState();(t===`ready`||t===`error`)&&Date.now()-e>1e4&&D.getState().fetchOrganizations()},i=Fe(`app.resume`,()=>{r()});return()=>{t(),n(),i()}}function qt(e){let{assistants:t,selectedAssistantId:n,assistantsHydrated:r}=y.getState(),i=xe(t,e),a=e=>i.some(t=>t.id===e);if(n!==null){let e=t.some(e=>e.id===n);if(a(n)||!e&&!r)return n}let o=fe()?.assistantId??null;return o!==null&&a(o)?o:i[0]?.id??null}function Jt(){let e=Wt(),t=Le.use.multiPlatformAssistant(),n=Le.use.assistantSwitcher();return y.use.selectedAssistantId(),y.use.assistants(),y.use.assistantsHydrated(),(t||n&&m())&&!p()&&e?qt(e):null}async function k(e){y.getState().setSelectedAssistant(e),e!==null&&await ie(e)}var Yt=`vellum:auth:userSnapshot`;function Xt(e){if(e)try{localStorage.setItem(Yt,JSON.stringify(e))}catch{}}function Zt(){try{let e=localStorage.getItem(Yt);if(!e)return null;let t=JSON.parse(e);return!t||typeof t!=`object`?null:{kind:`platform`,id:typeof t.id==`string`?t.id:null,username:typeof t.username==`string`?t.username:null,email:typeof t.email==`string`?t.email:null,isStaff:t.isStaff===!0,firstName:typeof t.firstName==`string`?t.firstName:``,lastName:typeof t.lastName==`string`?t.lastName:``}}catch{return null}}function A(){try{localStorage.removeItem(Yt)}catch{}}function Qt(e,t={}){let n={...e??{}},r=t.includeSelfHostedActorToken===!1?null:pe();if(r)return n.Authorization=`Bearer ${r}`,n;let i=t.organizationId??O();i&&(n[`Vellum-Organization-Id`]=i);let a=We();return a&&(n[`X-Session-Token`]=a),n}async function $t(e,t={}){let n=Qt(e,t);if(n.Authorization||v())return n;await Re();let r=Be();return r&&(n[`X-CSRFToken`]=r),n}var en;function tn(){return v()?(en===void 0&&(en=window.__VELLUM_CONFIG__?.deviceId??null),en):null}var nn=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,rn=`X-Vellum-Electron-Renderer-Origin`,an=new Map,on=[2e3,5e3,15e3,3e4,6e4],sn=new Set;async function cn(e,t={}){if(!m()||h()||de()||wn(e))return e;let n=un(e);if(!n)return e;let r=an.get(n.assistantId);if(r)return r;let i=dn(n,{allowGatewayRepair:t.allowGatewayRepair??!0});an.set(n.assistantId,i);try{return await i}catch(e){throw an.delete(n.assistantId),e}}function ln(e,t={}){if(!m()||h()||de())return;let n=e;if(!n){let e=oe();if(!e||!ce(e))return;n=e.assistantId}if(sn.has(n))return;sn.add(n);let r=n;(async()=>{try{for(let e=0;;e++)try{await cn(r,{allowGatewayRepair:t.allowGatewayRepair??!1});return}catch(n){let r=on[e];if(r===void 0){(t.onError??(e=>{console.warn(`local assistant platform bootstrap failed`,e)}))(n);return}console.warn(`local assistant platform bootstrap attempt ${e+1} failed, retrying in ${r}ms`,n),await new Promise(e=>setTimeout(e,r))}}finally{sn.delete(r)}})()}function un(e){let t=fe();if(t?.assistantId===e&&ce(t))return t;let n=oe();return n?.assistantId===e&&ce(n)?n:null}async function dn(e,t){let n=await pn(e,t),r=await mn(n,e.assistantId),i=r?.assistantId&&wn(r.assistantId)?r.assistantId:null;if(i&&r?.hasAssistantApiKey!==!1){let t=r?.organizationId??e.platformOrganizationId??null;return t&&await fn(e,{platformAssistantId:i,platformBaseUrl:r?.baseUrl??ae(),organizationId:t}),i}let a=await hn(r?.organizationId??null,e);if(!a)throw Error(`Sign in to Vellum and select an organization to register this local assistant.`);let o=r?.clientInstallationId??tn()??null;if(!o)throw Error(`Unable to identify this local assistant host for platform registration.`);let s=await gn(e,a,o),c=j(s.assistant?.id,s.assistant_id,s.id),l=i??c;if(!l||!wn(l))throw Error(`The platform registration response did not include an assistant UUID.`);let u=M(s.assistant_api_key);!u&&r?.hasAssistantApiKey!==!0&&(u=await _n(e,a,o));let d=r?.baseUrl??ae();return await yn(n,{assistantApiKey:u,platformAssistantId:l,platformBaseUrl:d,organizationId:a,webhookSecret:M(s.webhook_secret)}),await fn(e,{platformAssistantId:l,platformBaseUrl:d,organizationId:a}),l}async function fn(e,t){await te({...e,platformAssistantId:t.platformAssistantId,platformBaseUrl:t.platformBaseUrl,platformOrganizationId:t.organizationId}).catch(e=>{console.warn(`local assistant platform lockfile update failed`,e)})}async function pn(e,t){let n=ge(),r=pe();if(t.allowGatewayRepair&&(!n||!r)&&(await ye(e),n=ge(),r=pe()),!n||!r){let t=le(e);t&&(n=`${window.location.origin}${t}`)}if(!n||!r)throw Error(`Unable to reach the local assistant for platform identity setup.`);return{gatewayUrl:n,actorToken:r}}async function mn(e,t){let n=Cn(e.gatewayUrl,`/v1/assistants/${encodeURIComponent(t)}/platform/status`),r=await fetch(n,{headers:{Accept:`application/json`,Authorization:`Bearer ${e.actorToken}`},credentials:`omit`}).catch(()=>null);if(!r?.ok)return null;let i=await r.json().catch(()=>null);return{assistantId:j(i?.assistantId,i?.assistant_id),baseUrl:j(i?.baseUrl,i?.base_url),organizationId:j(i?.organizationId,i?.organization_id),hasAssistantApiKey:Tn(i?.hasAssistantApiKey,i?.has_assistant_api_key),clientInstallationId:j(i?.clientInstallationId,i?.client_installation_id)}}async function hn(e,t){return(e??t.platformOrganizationId??O()??t.organizationId??null)||(await D.getState().fetchOrganizations().catch(()=>{}),O()??t.platformOrganizationId??t.organizationId??null)}async function gn(e,t,n){return await vn(`/v1/assistants/self-hosted-local/ensure-registration/`,e,t,n)}async function _n(e,t,n){return M((await vn(`/v1/assistants/self-hosted-local/reprovision-api-key/`,e,t,n)).provisioning?.assistant_api_key)}async function vn(e,t,n,r){let i=new Headers({...await $t({Accept:`application/json`,"Content-Type":`application/json`},{includeSelfHostedActorToken:!1,organizationId:n})}),a=We();if(v()){if(!a)throw Error(`Sign in to Vellum to register this local assistant.`);i.set(rn,`${window.location.protocol}//${window.location.host}`)}let o=await fetch(new URL(e,window.location.origin).toString(),{method:`POST`,headers:i,credentials:v()?`omit`:`same-origin`,body:JSON.stringify({client_installation_id:r,runtime_assistant_id:t.assistantId,client_platform:v()?`macos`:`web`})}).catch(e=>{throw Error(`Unable to reach the platform registration endpoint: ${Sn(e)}`)});if(!o.ok){let e=await xn(o);throw Error(`Unable to register the local assistant with the platform (HTTP ${o.status})${e?`: ${e}`:`.`}`)}try{return await o.json()}catch(e){throw Error(`Unable to read the platform registration response: ${Sn(e)}`)}}async function yn(e,t){let n=[[`vellum:platform_assistant_id`,t.platformAssistantId],[`vellum:platform_base_url`,t.platformBaseUrl],[`vellum:platform_organization_id`,t.organizationId],[`vellum:webhook_secret`,t.webhookSecret]];await Promise.all(n.filter(e=>!!e[1]).map(([t,n])=>bn(e,t,n))),t.assistantApiKey&&await bn(e,`vellum:assistant_api_key`,t.assistantApiKey)}async function bn(e,t,n){let r=await fetch(Cn(e.gatewayUrl,`/v1/secrets`),{method:`POST`,headers:{Accept:`application/json`,Authorization:`Bearer ${e.actorToken}`,"Content-Type":`application/json`},credentials:`omit`,body:JSON.stringify({type:`credential`,name:t,value:n})}).catch(e=>{throw Error(`Unable to reach the local assistant while storing ${t}: ${Sn(e)}`)});if(!r.ok){let e=await xn(r);throw Error(`Unable to store ${t} on the local assistant (HTTP ${r.status})${e?`: ${e}`:`.`}`)}return!0}async function xn(e){if((e.headers.get(`content-type`)??``).includes(`application/json`)){let t=await e.json().catch(()=>null),n=t&&typeof t==`object`&&`detail`in t?M(t.detail):null,r=t&&typeof t==`object`&&`code`in t?M(t.code):null;return n&&r?`${n} (${r})`:n||r||JSON.stringify(t)}return(await e.text().catch(()=>``)).slice(0,300)}function Sn(e){return e instanceof Error?e.message:String(e)}function Cn(e,t){let n=new URL(e);return n.pathname=`${n.pathname.replace(/\/$/,``)}${t}`,n.toString()}function wn(e){return nn.test(e)}function j(...e){for(let t of e){let e=M(t);if(e)return e}return null}function M(e){return typeof e==`string`&&e.trim()?e.trim():null}function Tn(...e){for(let t of e)if(typeof t==`boolean`)return t;return null}var En={idle:``,connecting:`Connecting…`,listening:`Listening…`,transcribing:`Transcribing…`,thinking:`Thinking…`,speaking:`Speaking…`,ending:`Ending…`,failed:``};function Dn(e,t){return t&&e===`connecting`?`Reconnecting…`:En[e]}function On(e,t,n){return Dn(e===`speaking`&&!n?`thinking`:e,t)}function N(e){return e!==`idle`&&e!==`failed`}function kn(e){return e===`listening`||e===`transcribing`||e===`thinking`||e===`speaking`}function An(e,t){if(!N(e.state))return!1;let n=t??null;return n===e.conversationId||n===e.startedConversationId}var jn={state:`idle`,assistantAudioActive:!1,activityLabel:``,reconnecting:!1,assistantId:null,conversationId:null,startedConversationId:null,controls:null,partialTranscript:``,finalTranscript:``,assistantTranscript:``,inputAmplitude:0,muted:!1,outputMuted:!1,handsFree:!1,roomMinimized:!1,entryOrigin:null,lastTurnLatency:null,outputAmplitudeProvider:null,playbackProgressProvider:null,error:null},P=f(d()(e=>({...jn,starter:null,setState:t=>e({state:t}),setAssistantAudioActive:t=>e({assistantAudioActive:t}),setActivityLabel:t=>e({activityLabel:t}),setReconnecting:t=>e({reconnecting:t}),setSessionContext:(t,n)=>e({assistantId:t,conversationId:n,startedConversationId:n,muted:!1,outputMuted:!1}),setConversationId:t=>e({conversationId:t}),setControls:t=>e({controls:t}),setStarter:t=>e({starter:t}),setPartialTranscript:t=>e({partialTranscript:t}),setFinalTranscript:t=>e({finalTranscript:t}),appendAssistantTranscript:t=>e(e=>({assistantTranscript:e.assistantTranscript+t})),clearAssistantTranscript:()=>e({assistantTranscript:``}),clearUserTranscripts:()=>e({partialTranscript:``,finalTranscript:``}),setInputAmplitude:t=>e({inputAmplitude:t}),setMuted:t=>e({muted:t}),setOutputMuted:t=>e({outputMuted:t}),setHandsFree:t=>e({handsFree:t}),setRoomMinimized:t=>e({roomMinimized:t}),setEntryOrigin:t=>e({entryOrigin:t}),setLastTurnLatency:t=>e({lastTurnLatency:t}),setOutputAmplitudeProvider:t=>e({outputAmplitudeProvider:t}),setPlaybackProgressProvider:t=>e({playbackProgressProvider:t}),fail:t=>e({state:`failed`,error:t}),reset:()=>e({...jn})})));function Mn(e){let t=!1,n=!1,r=P.subscribe(()=>{t||(t=!0,queueMicrotask(()=>{t=!1,!n&&e(P.getState())}))});return()=>{n=!0,r()}}function Nn(){return P.getState().inputAmplitude}function Pn(){return P.getState().outputAmplitudeProvider?.()??0}function Fn(){return P.getState().playbackProgressProvider?.()??null}function In(){P.getState().controls?.stop()}function Ln(){let{state:e,setRoomMinimized:t}=P.getState();N(e)&&t(!0)}function Rn(){let{state:e,setRoomMinimized:t}=P.getState();N(e)&&t(!1)}function zn(e){P.getState().controls?.setMuted(e)}function Bn(e){P.getState().controls?.setOutputMuted(e)}function Vn(e){P.getState().setEntryOrigin(e)}function Hn(){P.getState().reset()}function Un(e){return P(t=>An(t,e))}var Wn=Xe(`ApnsEnvironment`),Gn=`.dev`;function Kn(e){return e.endsWith(Gn)?`development`:`production`}async function qn(e){try{let{environment:e}=await Wn.get();if(e===`development`||e===`production`)return e;console.debug(`[apns-environment] unreadable APNs entitlement, using bundle-id heuristic:`,e)}catch(e){console.debug(`[apns-environment] ApnsEnvironment bridge unavailable, using bundle-id heuristic:`,e)}return Kn(e)}function Jn(){let e={},t=Object.keys(En).filter(N);for(let n of t)e[n]=On(n,!1,!0);return e}function Yn(e){let t=JSON.parse(e);return typeof t.token==`string`&&typeof t.assistantId==`string`?{token:t.token,assistantId:t.assistantId}:null}var Xn=Ze({key:`vellum:live_activity_registration`,scope:`user`,parse:Yn,serialize:JSON.stringify,fallback:null}),F=null,I=new Set;function Zn(e){I.add(e),e.finally(()=>{I.delete(e)})}var Qn=Promise.resolve();async function $n(e){let t=Qn.then(()=>er(e));Qn=t.catch(()=>void 0),Zn(t),await t}async function er({token:e,assistantId:t,conversationId:n,accentHex:r,muted:i}){try{let{App:a}=await l(async()=>{let{App:e}=await import(`./esm-UxVM8v-Z.js`);return{App:e}},__vite__mapDeps([0,1,2])),{id:o}=await a.getInfo(),s=await qn(o),u=await Ee({path:{assistant_id:t},body:{token:e,bundle_id:o,apns_environment:s,conversation_id:n,labels:Jn(),accent_hex:r,muted:i},throwOnError:!1});if(u.error){c(u.error,{context:`live_activity_push_registration`,level:`warning`,bestEffort:!0});return}F={token:e,assistantId:t},Xn.save(F)}catch(e){c(e,{context:`live_activity_push_registration`,level:`warning`,bestEffort:!0})}}async function tr(){I.size>0&&await Promise.allSettled([...I]);let e=F??Xn.load();if(e!==null){F=null,Xn.remove();try{await De({path:{assistant_id:e.assistantId,token:e.token},throwOnError:!1})}catch(e){c(e,{context:`live_activity_push_unregistration`,level:`warning`,bestEffort:!0})}}}var nr=`vellum-alerts`,rr=null;async function ir(){$e()&&(rr||=(async()=>{let{LocalNotifications:e}=await l(async()=>{let{LocalNotifications:e}=await import(`./esm-Jw5qNk7q.js`).then(e=>e.n);return{LocalNotifications:e}},__vite__mapDeps([3,4,1,2]));await e.createChannel({id:nr,name:`Alerts`,importance:3})})().catch(e=>{throw rr=null,e}),await rr)}function ar(e){let t=JSON.parse(e);return typeof t.token==`string`&&typeof t.bundleId==`string`&&typeof t.assistantId==`string`?{token:t.token,bundleId:t.bundleId,assistantId:t.assistantId}:null}var L=Ze({key:`vellum:push_registration`,scope:`user`,parse:ar,serialize:JSON.stringify,fallback:null}),or=!1,sr=null,R=null,cr=null,lr=new Set,ur=Promise.resolve();function dr(e){lr.add(e),e.finally(()=>{lr.delete(e)})}function fr(e,t){dr(S.getPlatform()===`android`?ur=ur.then(()=>mr(e,t)):mr(e,t))}function pr(){let e=S.getPlatform();return Ge()&&(e===`ios`||e===`android`)}async function mr(e,t){try{let{App:n}=await l(async()=>{let{App:e}=await import(`./esm-UxVM8v-Z.js`);return{App:e}},__vite__mapDeps([0,1,2])),{id:r}=await n.getInfo(),i=S.getPlatform(),a=i===`android`?{token:e,platform:`android`,bundle_id:r}:{token:e,platform:`ios`,bundle_id:r,apns_environment:await qn(r)},o=await ke({path:{assistant_id:t},body:a,throwOnError:!1});if(o.error){c(o.error,{context:`push_registration_upsert`,level:`warning`,bestEffort:!0});return}let s=R??L.load();R={token:e,bundleId:r,assistantId:t},L.save(R),s&&s.bundleId===r&&s.token!==e&&i===`android`&&await gr(s)}catch(e){c(e,{context:`push_registration_upsert`,level:`warning`,bestEffort:!0})}}function hr(e){if(typeof e!=`object`||!e)return;let t=e,n=t.deep_link;if(typeof n==`string`)try{n=JSON.parse(n)}catch{n=null}if(typeof n==`object`&&n){let e=n.conversationId;if(typeof e==`string`)return e}return typeof t.conversationId==`string`?t.conversationId:void 0}async function gr(e){let t=await Oe({path:{assistant_id:e.assistantId,token:e.token},query:{bundle_id:e.bundleId},throwOnError:!1});t.error&&c(t.error,{context:`push_registration_delete`,level:`warning`,bestEffort:!0,extra:{assistantId:e.assistantId,bundleId:e.bundleId}})}function _r(e){cr=e}async function vr(){if(!or){or=!0;try{let{PushNotifications:e}=await l(async()=>{let{PushNotifications:e}=await import(`./esm-S7iZcDlp.js`);return{PushNotifications:e}},__vite__mapDeps([5,2]));await e.addListener(`registration`,e=>{let t=sr;t&&fr(e.value,t)}),await e.addListener(`registrationError`,e=>{c(e,{context:`push_registration_native`,level:`warning`})}),S.getPlatform()===`android`&&await e.addListener(`pushNotificationReceived`,e=>cr?.(e)),await e.addListener(`pushNotificationActionPerformed`,e=>{let t=hr(e.notification.data);t&&Ie(`deeplink.openThread`,{threadId:t})})}catch(e){or=!1,c(e,{context:`push_registration_listeners`,level:`warning`})}}}async function yr(e){if(pr()){sr=e,R&&R.assistantId!==e&&fr(R.token,e);try{let{PushNotifications:e}=await l(async()=>{let{PushNotifications:e}=await import(`./esm-S7iZcDlp.js`);return{PushNotifications:e}},__vite__mapDeps([5,2]));if(await vr(),await ir(),(await e.requestPermissions()).receive!==`granted`)return;await e.register()}catch(e){c(e,{context:`push_registration_register`,level:`warning`})}}}async function br(){for(sr=null;lr.size>0;)await Promise.allSettled([...lr]);let e=R??L.load();if(R=null,L.remove(),pr()){if(e)try{await gr(e)}catch(e){c(e,{context:`push_registration_delete`,level:`warning`,bestEffort:!0})}if(S.getPlatform()===`android`)try{let{PushNotifications:e}=await l(async()=>{let{PushNotifications:e}=await import(`./esm-S7iZcDlp.js`);return{PushNotifications:e}},__vite__mapDeps([5,2]));await e.unregister()}catch(e){c(e,{context:`push_registration_unregister`,level:`warning`})}}}function xr(e){return R?.assistantId===e}function Sr(e){return e}function Cr(e,t,n){if(!e||typeof e!=`object`||Array.isArray(e))return{code:null,message:n};let r=Sr(e),i=r[t];if(Array.isArray(i)&&i.length>0){let e=i[0];if(typeof e==`string`)return{code:null,message:e};if(e&&typeof e==`object`&&!Array.isArray(e)){let t=Sr(e),r=t.code,i=t.string??t.message;return{code:typeof r==`string`?r:null,message:typeof i==`string`?i:n}}}return typeof r.detail==`string`?{code:null,message:r.detail}:{code:null,message:n}}var wr={too_short:`Must be at least 3 characters.`,too_long:`Must be at most 30 characters.`,invalid_chars:`Use only lowercase letters, digits, hyphens, and underscores.`,leading_underscore:`Cannot start with an underscore.`,trailing_underscore:`Cannot end with an underscore.`,leading_hyphen:`Cannot start with a hyphen.`,trailing_hyphen:`Cannot end with a hyphen.`,all_digits:`Cannot be all digits.`,reserved:`This handle is reserved.`,taken:`This handle is already taken.`};async function Tr(){let{data:e,error:t,response:n}=await we.get({url:`/v1/user/me/`,throwOnError:!1});if(Se(n,t,`Failed to load profile.`),!n.ok||!e)throw new Ce(n.status,b(t,n,`Failed to load profile.`));return e}var Er=`Please choose a different handle.`;async function Dr(e){let{data:t,error:n,response:r}=await we.patch({url:`/v1/user/me/`,body:e,throwOnError:!1});if(!r)return{kind:`error`,message:b(n,void 0,`Failed to save profile.`)??`Failed to save profile.`};if(r.ok&&t)return{kind:`ok`,data:t};if(r.status===409){let{message:e}=Cr(n,`username`,wr.taken);return{kind:`taken`,message:e}}if(r.status===400){let{code:e,message:t}=Cr(n,`username`,Er);return{kind:`invalid`,code:e,message:t}}return{kind:`error`,message:b(n,r,`Failed to save profile.`)}}async function Or(){let{data:e,error:t,response:n}=await Te({throwOnError:!1});if(Se(n,t,`Failed to load consent.`),!n.ok||!e)throw new Ce(n.status,b(t,n,`Failed to load consent.`));return e}async function kr(e){await Ae({body:e,throwOnError:!0})}async function Ar(e,t){let{data:n,error:r,response:i}=await we.get({url:`/v1/user/username-available/`,query:{username:e},signal:t,throwOnError:!1});if(Se(i,r,`Failed to check handle availability.`),!i.ok||!n)throw new Ce(i.status,i.status===429?`Too many checks — try again in a moment.`:b(r,i,`Failed to check handle availability.`));return n}function jr(e){i(`diagnosticsReporting`,e)}function Mr(e,t){let n=Ir(e);return n!==null&&t(n),jr(Nr(n,e)),n}function Nr(e,t){return e??a(`shareDiagnostics`,!0)?t.hasServerRecord?t.diagnosticsEffective:!0:!1}function Pr(e,t){Mr({shareDiagnostics:e,diagnosticsEffective:e,hasServerRecord:!0},t)}function Fr(){o(`diagnosticsReporting`,``)===``&&jr(!1)}function Ir(e){let{shareDiagnostics:t,hasServerRecord:n}=e;return t===!1?!1:n&&t===!0?!0:null}var Lr=`2026-06-08`,Rr=`2026-06-22`,zr=`2026-06-18`,Br=`2026-06-18`,Vr=`2026-06-08`,z={tos:Lr,privacyPolicy:Rr,aiDataSharing:Rr,shareAnalytics:zr,shareDiagnostics:Br};function Hr(e){return{tos:e?.tos||`2026-06-08`,privacyPolicy:e?.privacy_policy||`2026-06-22`,aiDataSharing:e?.ai_data_sharing||`2026-06-22`,shareAnalytics:e?.share_analytics||`2026-06-18`,shareDiagnostics:e?.share_diagnostics||`2026-06-18`}}function Ur(){return{...z}}function B(e,t){return`device:consent:${e}:${t}`}function V(e){switch(e){case`tos`:return z.tos;case`privacy_policy`:return z.privacyPolicy;case`ai_data_sharing`:return z.aiDataSharing;case`share_diagnostics`:return z.shareDiagnostics}}var Wr=/^\d{4}-\d{2}-\d{2}$/;function Gr(t,n){let r=e(B(t,n),``);return Wr.test(r)?r:``}function H(e,t){return W(Gr(e,t),V(e))}function Kr(e){return`device:consent:ai:v${Vr}:${e}`}function U(e,i,a){let o=`device:consent:${e}:v`,s=`:${i}`,c=[],l=``;for(let e=0;e<localStorage.length;e++){let t=localStorage.key(e);if(!t||!t.startsWith(o)||!t.endsWith(s))continue;let n=t.slice(o.length,t.length-s.length);Wr.test(n)&&(c.push(t),r(t,!1)&&n>l&&(l=n))}if(l)for(let e of a)Gr(e,i)||t(B(e,i),l);for(let e of c)n(e)}function qr(e){if(typeof window>`u`||!e)return{tos:!1,privacy:!1,diagnosticsCurrent:!1};try{U(`tos`,e,[`tos`]),U(`privacy`,e,[`privacy_policy`,`ai_data_sharing`]),U(`share_diagnostics`,e,[`share_diagnostics`]),U(`share_analytics`,e,[]),r(Kr(e),!1)&&n(Kr(e));let i=H(`tos`,e),a=H(`privacy_policy`,e)&&H(`ai_data_sharing`,e),o=H(`share_diagnostics`,e);if(i||a)return{tos:i,privacy:a,diagnosticsCurrent:o};let s=r(`vellum:onboarding:tosAccepted`,!1),c=r(`vellum:onboarding:aiDataConsent`,!1);return s||c?(s&&t(B(`tos`,e),Lr),{tos:s&&H(`tos`,e),privacy:!1,diagnosticsCurrent:o}):{tos:!1,privacy:!1,diagnosticsCurrent:o}}catch{return{tos:!1,privacy:!1,diagnosticsCurrent:!1}}}function Jr(e,r,i){if(!(typeof window>`u`||!e))try{r?t(B(`tos`,e),V(`tos`)):n(B(`tos`,e)),i?(t(B(`privacy_policy`,e),V(`privacy_policy`)),t(B(`ai_data_sharing`,e),V(`ai_data_sharing`))):(n(B(`privacy_policy`,e)),n(B(`ai_data_sharing`,e)))}catch{}}function Yr(e){if(!(typeof window>`u`||!e))try{t(B(`share_diagnostics`,e),V(`share_diagnostics`))}catch{}}function Xr(e){if(n(`vellum:onboarding:tosAccepted`),n(`vellum:onboarding:aiDataConsent`),n(`vellum:onboarding:selectedVersion`),!(typeof window>`u`||!e))try{n(B(`tos`,e)),n(B(`privacy_policy`,e)),n(B(`ai_data_sharing`,e)),n(B(`share_diagnostics`,e)),n(Kr(e)),U(`tos`,e,[]),U(`privacy`,e,[]),U(`share_diagnostics`,e,[]),U(`share_analytics`,e,[])}catch{}}function W(e,t){return e>=t}function Zr(e){if(!e)return{tos:!1,privacy:!1,shareAnalytics:null,shareDiagnostics:null,analyticsEffective:!0,diagnosticsEffective:!0,analyticsCurrent:!1,diagnosticsCurrent:!1,analyticsVersionCurrent:!1,diagnosticsVersionCurrent:!1,hasServerRecord:!1};let t=Hr(e.required_versions);z=t;let n=W(e.share_analytics_accepted_version,t.shareAnalytics),r=W(e.share_diagnostics_accepted_version,t.shareDiagnostics),i=!!e.tos_accepted_version||!!e.privacy_policy_accepted_version||!!e.ai_data_sharing_accepted_version||!!e.share_analytics_accepted_version||!!e.share_diagnostics_accepted_version||e.share_analytics===!1||e.share_diagnostics===!1||e.share_analytics_effective===!1||e.share_diagnostics_effective===!1;return{tos:W(e.tos_accepted_version,t.tos),privacy:W(e.privacy_policy_accepted_version,t.privacyPolicy)&&W(e.ai_data_sharing_accepted_version,t.aiDataSharing),shareAnalytics:e.share_analytics,shareDiagnostics:e.share_diagnostics,analyticsEffective:e.share_analytics_effective??e.share_analytics!==!1,diagnosticsEffective:e.share_diagnostics_effective??e.share_diagnostics!==!1,analyticsCurrent:e.share_analytics===null||n,diagnosticsCurrent:e.share_diagnostics===null||r,analyticsVersionCurrent:n,diagnosticsVersionCurrent:r,hasServerRecord:i}}function Qr(e,t){let{legal:n,shareAnalytics:r,shareDiagnostics:i}=e,a=C.getState();n&&(a.setTosAccepted(n.tos),a.setPrivacyConsent(n.privacy),Jr(t.userId,n.tos,n.privacy)),r!==void 0&&(a.setShareAnalytics(r),a.setPendingAnalyticsOptIn(r===!0)),i!==void 0&&Pr(i,a.setShareDiagnostics),n?(a.setAnalyticsConsentCurrent(!0),a.setDiagnosticsConsentCurrent(!0),a.setHasConsentRecord(!0),a.setConsentHydrated(!0)):t.hasPlatformSession&&(r!==void 0&&a.setAnalyticsConsentCurrent(!0),i!==void 0&&a.setDiagnosticsConsentCurrent(!0)),i!==void 0&&(n||t.hasPlatformSession)&&Yr(t.userId),t.hasPlatformSession&&kr({...n?{tos_accepted_version:n.tos?z.tos:``,privacy_policy_accepted_version:n.privacy?z.privacyPolicy:``,ai_data_sharing_accepted_version:n.privacy?z.aiDataSharing:``}:{},...r===void 0?{}:{share_analytics:r,share_analytics_accepted_version:z.shareAnalytics},...i===void 0?{}:{share_diagnostics:i,share_diagnostics_accepted_version:z.shareDiagnostics}}).catch(()=>{})}function $r(e){Qr({legal:{tos:e.tos,privacy:e.privacy},...e.shareAnalytics===null?{}:{shareAnalytics:e.shareAnalytics},...e.shareDiagnostics===null?{}:{shareDiagnostics:e.shareDiagnostics}},{userId:e.userId,hasPlatformSession:e.hasPlatformSession})}function ei(e,t,n){Qr(e===`share_analytics`?{shareAnalytics:t}:{shareDiagnostics:t},n)}var ti=`vellum.pro-takeover-avatar`,ni=1800*1e3,G=null,ri=!1,ii=0;function ai(){return ii}function oi(e){let t={...e,savedAt:Date.now()};G=t,ii+=1;try{sessionStorage.setItem(ti,JSON.stringify(t)),ri=!1}catch{ri=!0}}function si(){if(ri)return ui();let e;try{if(typeof sessionStorage>`u`)return ui();e=sessionStorage.getItem(ti)}catch{return ui()}if(!e)return G=null,null;let t;try{t=JSON.parse(e)}catch{return K(),null}return!fi(t)||Date.now()-t.savedAt>ni?(K(),null):t}function K(){G=null,ri=!1,ii+=1;try{sessionStorage.removeItem(ti)}catch{}}function ci(e){let{activeAssistantId:t,assistants:n,assistantsHydrated:r}=y.getState();if(!t||!r||n.length!==1||n[0]?.id!==t){K();return}let i=li(e,t);if(!i||i.customImageUrl!=null||i.components==null){K();return}oi({assistantId:t,components:i.components,traits:i.traits})}function li(e,t){let n=e.getQueryCache().findAll({queryKey:tt(t)}),r,i=-1/0;for(let e of n){let t=e.state.data;t===void 0||e.state.dataUpdatedAt<i||(r=t,i=e.state.dataUpdatedAt)}return r}function ui(){return G?Date.now()-G.savedAt>ni?(G=null,null):G:null}function di(e){return Date.now()-e.savedAt<=ni}function fi(e){if(typeof e!=`object`||!e)return!1;let t=e;if(typeof t.assistantId!=`string`||typeof t.savedAt!=`number`||t.traits!==null&&!et(t.traits))return!1;let n=t.components;if(typeof n!=`object`||!n)return!1;let r=n;if(!mi(r.bodyShapes,_i)||!mi(r.eyeStyles,vi)||!mi(r.colors,yi)||!Array.isArray(r.faceCenterOverrides)||!r.faceCenterOverrides.every(bi))return!1;if(t.traits!==null){let e=t.traits;return pi(r.bodyShapes,e.bodyShape)&&pi(r.eyeStyles,e.eyeStyle)&&pi(r.colors,e.color)}return!0}function pi(e,t){return e.some(e=>e.id===t)}function mi(e,t){return Array.isArray(e)&&e.length>0&&e.every(t)}function hi(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.x==`number`&&typeof t.y==`number`}function gi(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.width==`number`&&typeof t.height==`number`}function _i(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&typeof t.svgPath==`string`&&gi(t.viewBox)&&hi(t.faceCenter)}function vi(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id!=`string`||!gi(t.sourceViewBox)||!hi(t.eyeCenter)||!Array.isArray(t.paths)?!1:t.paths.every(e=>{if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.svgPath==`string`&&typeof t.color==`string`})}function yi(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&typeof t.hex==`string`}function bi(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.bodyShape==`string`&&typeof t.eyeStyle==`string`&&hi(t.faceCenter)}var xi=`vellum:`,Si=[`onboarding.`,`voice:`,`gw:`,`ff:client:`,`local:`,`integrations.`,`vellumDebug.`,`vellum_`],Ci=new Set([`vellum_theme`,`vellum_share_analytics`,`vellum_share_diagnostics`,`vellum_biometric_enabled`,`vellum_llm_log_retention`,`vellum_timezone`,`vellum_media_embeds_enabled`,`vellum_media_embed_domains`,`onboarding.lastUserId`]);function wi(e){return e.startsWith(xi)?!0:Ci.has(e)?!1:Si.some(t=>e.startsWith(t))}function Ti(){K(),Qe();try{sessionStorage.clear()}catch{}try{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n&&wi(n)&&e.push(n)}e.forEach(e=>localStorage.removeItem(e))}catch{}}function Ei(e){return e?.id??e?.email??e?.username??null}function q(e){return e?{kind:`platform`,id:Ei(e),username:e.username??null,email:e.email??null,isStaff:e.is_staff??!1,firstName:e.first_name??``,lastName:e.last_name??``}:null}var Di=null,J=null,Oi=!1,ki={kind:`local`,id:`gateway-local`,username:`local`,email:null,isStaff:!1,firstName:`Local`,lastName:`User`},Y=e=>(Xt(e),{sessionStatus:`authenticated`,user:e,platformSession:`present`,platformSessionRestoredOffline:!1}),X=()=>({sessionStatus:`authenticated`,user:ki}),Z=()=>({sessionStatus:`unauthenticated`,user:null,platformSession:`absent`}),Ai=e=>e===null||!e.ok&&!jt(e);async function ji(e){if(!We())return!1;let t=Zt();return t?(await Q(t.id),e({...Y(t),platformSessionRestoredOffline:!0}),!0):!1}function Mi(e){(!e||Di&&Di!==e)&&Gt(),Di=e}function Ni(){J?.postMessage(`auth-changed`)}function Pi(e){let t=Ur();return{...e.tos?{tos_accepted_version:t.tos}:{},...e.privacy?{privacy_policy_accepted_version:t.privacyPolicy,ai_data_sharing_accepted_version:t.aiDataSharing}:{},...e.shareValues&&e.shareValues.analytics!==null?{share_analytics:e.shareValues.analytics,share_analytics_accepted_version:zr}:{},...e.diagnostics?{share_diagnostics_accepted_version:t.shareDiagnostics,...e.shareValues&&e.shareValues.diagnostics!==null?{share_diagnostics:e.shareValues.diagnostics}:{}}:{}}}var Fi;async function Q(e){if(Fi!==void 0&&Fi!==e){let e=C.getState();e.setPendingAnalyticsOptIn(!1),e.setServerAnalyticsEffective(null),e.setServerDiagnosticsEffective(null)}if(Fi=e,e)try{let t=Zr(await Or()),n=C.getState(),r=n.shareAnalytics,i=n.shareDiagnostics;t.shareAnalytics===!0&&n.setPendingAnalyticsOptIn(!1),n.setServerAnalyticsEffective(t.analyticsEffective),n.setServerDiagnosticsEffective(t.diagnosticsEffective),t.hasServerRecord&&(t.shareAnalytics!==null||r!==!1)&&!(t.shareAnalytics===!1&&C.getState().pendingAnalyticsOptIn)&&n.setShareAnalytics(t.shareAnalytics),Mr({shareDiagnostics:t.shareDiagnostics,diagnosticsEffective:t.diagnosticsEffective,hasServerRecord:t.hasServerRecord},n.setShareDiagnostics);let a=t.tos,o=t.privacy,s=t.analyticsCurrent,c=t.diagnosticsCurrent,l=t.hasServerRecord,u=t.shareDiagnostics!==null&&t.diagnosticsVersionCurrent;if(!t.hasServerRecord){let t=qr(e);s=!0,c=!0,u=t.diagnosticsCurrent,t.tos&&t.privacy&&(a=!0,o=!0,l=!0,kr(Pi({tos:!0,privacy:!0,diagnostics:u,shareValues:{analytics:r,diagnostics:i}})).catch(()=>{}))}else if(!a||!o||!c){let t=qr(e),n=!a&&t.tos,r=!o&&t.privacy,i=!c&&t.diagnosticsCurrent;n&&(a=!0),r&&(o=!0),i&&(c=!0,u=!0),(n||r||i)&&kr(Pi({tos:n,privacy:r,diagnostics:i})).catch(()=>{})}n.setTosAccepted(a),n.setPrivacyConsent(o),n.setAnalyticsConsentCurrent(s),n.setDiagnosticsConsentCurrent(c),n.setHasConsentRecord(l),Jr(e,a,o),u&&Yr(e),Mi(e),n.setConsentHydrated(!0);return}catch{}let t=qr(e),n=C.getState();e?Fr():(n.setPendingAnalyticsOptIn(!1),n.setServerAnalyticsEffective(null),n.setServerDiagnosticsEffective(null)),n.setTosAccepted(t.tos),n.setPrivacyConsent(t.privacy),n.setAnalyticsConsentCurrent(!0),n.setDiagnosticsConsentCurrent(!0),n.setHasConsentRecord(t.tos&&t.privacy),Mi(e),n.setConsentHydrated(!0)}var Ii=0;Promise.resolve();function Li(e,t={}){let n=++Ii,r=()=>n!==Ii;x().then(async n=>{if(!r())if(n.ok&&n.data.user){let i=q(n.data.user),a=t.setUserOnSuccess?{user:i}:{};if(t.setUserOnSuccess&&Xt(i),m()){let e=!1,t=()=>!e&&!r();try{await Promise.race([(async()=>{await D.getState().fetchOrganizations();let e=await Ne();t()&&e.ok&&await ne(e.data,D.getState().currentOrganizationId??void 0,t)})(),new Promise((t,n)=>setTimeout(()=>{e=!0,n(Error(`sync timeout`))},3e3))])}catch{}}if(r())return;e({platformSession:`present`,platformSessionRestoredOffline:!1,...a}),ln()}else t.clearOnFailure&&e({platformSession:`absent`})}).catch(()=>{r()||t.clearOnFailure&&e({platformSession:`absent`})}).finally(()=>{r()||e(e=>e.platformSession===`unknown`?{platformSession:`absent`}:{})})}function Ri(e,t){!m()||_()||_e().length>0?Li(e,t):e({platformSession:`absent`})}async function zi(){try{if(await Ye())return!0}catch{}return se()!==null}var $=f(d()((e,t)=>({sessionStatus:`initializing`,user:null,platformSession:`unknown`,platformSessionRestoredOffline:!1,initSession:async()=>{if(h()){await zi()?e({...X(),platformSession:`absent`}):e(Z());return}if(_()){try{await be(),e(X())}catch{e({sessionStatus:`unauthenticated`,user:null})}Ri(e);return}if(m()&&!_()){if(_e().length>0){let t=null;try{if(t=await x(),t.ok&&t.data.user){let n=q(t.data.user);await Q(n?.id??null);try{await D.getState().fetchOrganizations();let e=await Ne();e.ok&&await ne(e.data,D.getState().currentOrganizationId??void 0)}catch{}e(Y(n));return}}catch{}if(Ai(t)){if(await ji(e))return}else A();e(Z());return}e(X()),Oi?e({platformSession:`absent`}):Li(e,{setUserOnSuccess:!0}),Oi=!1;return}let t=null;try{if(t=await x(),t.ok&&t.data.user){let n=q(t.data.user);await Q(n?.id??null),e(Y(n));return}}catch(e){console.error(`auth.initSession failed`,e)}if(!(Ai(t)&&await ji(e))){if(Ge()&&Ke())try{let t=await Ue();if(t){Ve(t),await He();let n=await x();if(n.ok&&n.data.user){let t=q(n.data.user);await Q(t?.id??null),e(Y(t));return}}}catch(e){console.warn(`auth.initSession biometric recovery failed`,e)}await Q(null),Ai(t)||A(),e(Z())}},connectLocalAssistant:async n=>{await ye(he().find(e=>e.assistantId===n)),await k(n),e(X()),await It.checkAssistant(),kt(t().platformSession,t().platformSessionRestoredOffline)&&ln(n),Ri(e)},connectPlatformAssistant:async t=>{await k(t);let n=await x();if(!n.ok||!n.data.user)throw Error(`Platform authentication required`);let r=q(n.data.user);await Q(r?.id??null),await D.getState().fetchOrganizations(),e(Y(r))},refreshSession:async()=>{if(h())return await zi()?(e({...X(),platformSession:`absent`}),!0):(e(Z()),!1);if(p()){try{await ve(ue()),e({sessionStatus:`authenticated`})}catch{return e(Z()),!1}return Ri(e,{clearOnFailure:!0}),!0}let n=null;try{if(n=await x(),n.ok&&n.data.user){let t=q(n.data.user);if(await Q(t?.id??null),m())try{await D.getState().fetchOrganizations();let e=await Ne();e.ok&&await ne(e.data,D.getState().currentOrganizationId??void 0)}catch{}return e(Y(t)),!0}}catch(e){console.warn(`auth.refreshSession failed`,e)}if(Ai(n))return T(t().sessionStatus);if(_()){let n=T(t().sessionStatus);return n&&(A(),e({...X(),platformSession:`absent`})),n}return A(),await Q(null),e(Z()),!1},logout:async()=>{if(p()){It.resetForLogout(),await k(null),me(),Gt(),Ti(),e(Z()),Ni();return}Oi=!0,await br(),await tr();try{await ze()}finally{v()&&await window.vellum?.auth?.signOut?.(),m()&&!v()&&await re(),qe(),Gt(),Ti(),It.resetForLogout(),await k(null),e(Z()),Ni()}}}))),Bi=()=>T($.use.sessionStatus()),Vi=()=>!Dt($.use.sessionStatus()),Hi=()=>E($.use.platformSession()),Ui=()=>Ot($.use.platformSession()),Wi=()=>kt($.use.platformSession(),$.use.platformSessionRestoredOffline());function Gi(){let{refreshSession:e}=$.getState(),t=[],n=()=>e().catch(e=>console.warn(`auth.refreshSession failed`,e)),r=Fe(`app.resume`,()=>{Je()||n()});return t.push(r),typeof BroadcastChannel<`u`&&(J=new BroadcastChannel(`auth`),J.onmessage=()=>{Ti(),window.location.reload()},t.push(()=>{J?.close(),J=null})),()=>t.forEach(e=>e())}export{tn as $,nr as A,kn as B,Tr as C,xr as D,hr as E,Hn as F,Vn as G,On as H,In as I,Mn as J,zn as K,Nn as L,$n as M,tr as N,yr as O,En as P,cn as Q,Pn as R,Or as S,Cr as T,Ln as U,N as V,Rn as W,P as X,Un as Y,ln as Z,$r as _,ct as _t,Bi as a,D as at,wr as b,it as bt,ci as c,E as ct,si as d,Dt as dt,qt as et,ai as f,jt as ft,Zr as g,ft as gt,Xr as h,dt as ht,Hi as i,Kt as it,ir as j,_r as k,K as l,T as lt,Lr as m,Ct as mt,$ as n,Jt as nt,Ui as o,Wt as ot,Rr as p,Et as pt,Bn as q,Wi as r,O as rt,Vi as s,It as st,Gi as t,k as tt,di as u,kt as ut,ei as v,lt as vt,Dr as w,Ar as x,w as xt,Mr as y,at as yt,Fn as z};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./createLucideIcon-CAM1RhH8.js";import{S as r}from"./risk-Bnj8QXuk.js";import{n as i}from"./resolved-assistants-store-C6oDdTxB.js";import{h as a}from"./sdk.gen-CjtCuSlS.js";import{t as o}from"./background-task-store-DpOSZFT8.js";var s=n(`file-terminal`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m8 16 2-2-2-2`,key:`10vzyd`}],[`path`,{d:`M12 18h4`,key:`1wd2n7`}]]),c=e(t(),1);function l(e){return e===`host_bash`?s:r}function u({toolName:e,className:t}){return(0,c.createElement)(l(e),{className:t,"aria-hidden":!0})}function d(){let e=i.getState().activeAssistantId;if(!e)throw Error(`No active assistant`);return e}async function f(e){let t=d(),n=o.getState(),r=n.byId[e]?.status;n.cancelTask(e);try{let{data:n,response:r}=await a({path:{assistant_id:t},body:{id:e},throwOnError:!1});if(!r?.ok||n?.cancelled===!1)throw Error(`Failed to stop background task: ${r?.status} (cancelled=${n?.cancelled})`)}catch(t){throw r!==void 0&&o.getState().restoreTaskStatus(e,r),t}}export{u as n,l as r,f as t};