@agent-relay/dashboard 2.0.66-beta.1 → 2.0.67

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 (75) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/chunks/118-4c8241b0218335de.js +1 -0
  3. package/out/_next/static/chunks/{202-6cfbf8339f05e5ef.js → 202-fc0763dd7488e58f.js} +1 -1
  4. package/out/_next/static/chunks/259-b560f20df53128e5.js +1 -0
  5. package/out/_next/static/chunks/285-1efcdae8bd9b3272.js +1 -0
  6. package/out/_next/static/chunks/722-85011b58b9caf88b.js +1 -0
  7. package/out/_next/static/chunks/994-0ce5f1d759089504.js +1 -0
  8. package/out/_next/static/chunks/app/app/[[...slug]]/page-589620c567f85400.js +1 -0
  9. package/out/_next/static/chunks/app/{page-ba281b017e148cd6.js → page-5c60a00d938ac40a.js} +1 -1
  10. package/out/_next/static/chunks/app/providers/page-394875a22b5ba7ce.js +1 -0
  11. package/out/_next/static/chunks/app/providers/setup/[provider]/page-f058bf6696242d7b.js +1 -0
  12. package/out/_next/static/css/{fd373f99378195fc.css → 4c58d9cf493aa626.css} +1 -1
  13. package/out/about.html +2 -2
  14. package/out/about.txt +1 -1
  15. package/out/app/onboarding.html +1 -1
  16. package/out/app/onboarding.txt +1 -1
  17. package/out/app.html +1 -1
  18. package/out/app.txt +2 -2
  19. package/out/blog/go-to-bed-wake-up-to-a-finished-product.html +2 -2
  20. package/out/blog/go-to-bed-wake-up-to-a-finished-product.txt +1 -1
  21. package/out/blog/let-them-cook-multi-agent-orchestration.html +2 -2
  22. package/out/blog/let-them-cook-multi-agent-orchestration.txt +1 -1
  23. package/out/blog.html +2 -2
  24. package/out/blog.txt +1 -1
  25. package/out/careers.html +2 -2
  26. package/out/careers.txt +1 -1
  27. package/out/changelog.html +2 -2
  28. package/out/changelog.txt +1 -1
  29. package/out/cloud/link.html +1 -1
  30. package/out/cloud/link.txt +2 -2
  31. package/out/complete-profile.html +2 -2
  32. package/out/complete-profile.txt +1 -1
  33. package/out/connect-repos.html +1 -1
  34. package/out/connect-repos.txt +2 -2
  35. package/out/contact.html +2 -2
  36. package/out/contact.txt +1 -1
  37. package/out/docs.html +2 -2
  38. package/out/docs.txt +1 -1
  39. package/out/history.html +1 -1
  40. package/out/history.txt +2 -2
  41. package/out/index.html +1 -1
  42. package/out/index.txt +2 -2
  43. package/out/login.html +2 -2
  44. package/out/login.txt +2 -2
  45. package/out/metrics.html +1 -1
  46. package/out/metrics.txt +2 -2
  47. package/out/pricing.html +2 -2
  48. package/out/pricing.txt +1 -1
  49. package/out/privacy.html +2 -2
  50. package/out/privacy.txt +1 -1
  51. package/out/providers/setup/claude.html +1 -1
  52. package/out/providers/setup/claude.txt +2 -2
  53. package/out/providers/setup/codex.html +1 -1
  54. package/out/providers/setup/codex.txt +2 -2
  55. package/out/providers/setup/cursor.html +1 -1
  56. package/out/providers/setup/cursor.txt +2 -2
  57. package/out/providers.html +1 -1
  58. package/out/providers.txt +2 -2
  59. package/out/security.html +2 -2
  60. package/out/security.txt +1 -1
  61. package/out/signup.html +2 -2
  62. package/out/signup.txt +2 -2
  63. package/out/terms.html +2 -2
  64. package/out/terms.txt +1 -1
  65. package/package.json +1 -1
  66. package/out/_next/static/chunks/118-b821e49d30a9f6af.js +0 -1
  67. package/out/_next/static/chunks/259-141fb39611979082.js +0 -1
  68. package/out/_next/static/chunks/535-cecb00f34c2ed9ba.js +0 -1
  69. package/out/_next/static/chunks/722-af84568996237c02.js +0 -1
  70. package/out/_next/static/chunks/994-e927457424324a78.js +0 -1
  71. package/out/_next/static/chunks/app/app/[[...slug]]/page-bba8842697e6192c.js +0 -1
  72. package/out/_next/static/chunks/app/providers/page-59e92abba4f8d895.js +0 -1
  73. package/out/_next/static/chunks/app/providers/setup/[provider]/page-c667546c4902f1b0.js +0 -1
  74. /package/out/_next/static/{g8CQjGCOpPwFcSToizDmH → UFF2wGBwSkKsayPv0zus_}/_buildManifest.js +0 -0
  75. /package/out/_next/static/{g8CQjGCOpPwFcSToizDmH → UFF2wGBwSkKsayPv0zus_}/_ssgManifest.js +0 -0
package/out/404.html CHANGED
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/fd373f99378195fc.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-dd93b81e2659669c.js"/><script src="/_next/static/chunks/1dd3208c-40ab0fc0f60392b8.js" async=""></script><script src="/_next/static/chunks/528-d375bc8b46912d2c.js" async=""></script><script src="/_next/static/chunks/main-app-7f73a939a312a228.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Agent Relay Dashboard</title><meta name="description" content="Fleet control dashboard for Agent Relay"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-dd93b81e2659669c.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/fd373f99378195fc.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[1815,[],\"\"]\n4:I[5092,[],\"\"]\n5:I[2023,[],\"\"]\nb:I[1584,[],\"\"]\n6:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n7:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n8:{\"display\":\"inline-block\"}\n9:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"g8CQjGCOpPwFcSToizDmH\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/fd373f99378195fc.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$6\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$7\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$8\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$9\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Agent Relay Dashboard\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Fleet control dashboard for Agent Relay\"}]]\n3:null\n"])</script></body></html>
1
+ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/4c58d9cf493aa626.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-dd93b81e2659669c.js"/><script src="/_next/static/chunks/1dd3208c-40ab0fc0f60392b8.js" async=""></script><script src="/_next/static/chunks/528-d375bc8b46912d2c.js" async=""></script><script src="/_next/static/chunks/main-app-7f73a939a312a228.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Agent Relay Dashboard</title><meta name="description" content="Fleet control dashboard for Agent Relay"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-dd93b81e2659669c.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/4c58d9cf493aa626.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[1815,[],\"\"]\n4:I[5092,[],\"\"]\n5:I[2023,[],\"\"]\nb:I[1584,[],\"\"]\n6:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n7:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n8:{\"display\":\"inline-block\"}\n9:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"UFF2wGBwSkKsayPv0zus_\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/4c58d9cf493aa626.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$6\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$7\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$8\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$9\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Agent Relay Dashboard\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Fleet control dashboard for Agent Relay\"}]]\n3:null\n"])</script></body></html>
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[118],{5118:function(e,r,t){t.d(r,{$3:function(){return w},J$:function(){return l},XP:function(){return k},_V:function(){return u},aM:function(){return i},hc:function(){return d},hi:function(){return f},kG:function(){return y}});let s=(0,t(2446).bR)(),a="agentrelay_workspace_id",c=null,o="agentrelay_csrf_token",n=null;function i(e){n=e,window.sessionStorage&&(e?sessionStorage.setItem(o,e):sessionStorage.removeItem(o))}function u(){return n}function d(e){c=e,e?localStorage.setItem(a,e):localStorage.removeItem(a)}function l(){return c}function w(){if(c)return c;{let e=localStorage.getItem(a);if(e)return c=e,e}return null}window.sessionStorage&&(n=sessionStorage.getItem(o));let p=["/api/daemons/","/api/workspaces/","/api/providers/","/api/auth/","/api/billing/","/api/usage/","/api/admin/","/api/onboarding/","/api/repos/","/api/project-groups/","/api/github-app/","/api/channels","/api/bridge"];function y(e){if(c){if(p.some(r=>e.startsWith(r)))return"".concat(s).concat(e);let r=e.startsWith("/api/")?e.substring(5):e.replace(/^\//,"");return"/api/workspaces/".concat(c,"/proxy/").concat(r)}return"".concat(s).concat(e)}async function h(e){var r;let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=(null===(r=t.method)||void 0===r?void 0:r.toUpperCase())||"GET",a={...t.headers};"GET"!==s&&"HEAD"!==s&&"OPTIONS"!==s&&(n&&(a["X-CSRF-Token"]=n),t.body&&!a["Content-Type"]&&(a["Content-Type"]="application/json"));let c=await fetch(e,{...t,headers:a,credentials:"include"});return!function(e){let r=e.headers.get("X-CSRF-Token");r&&i(r)}(c),c}let f={async get(e){let r=await h(y(e),{method:"GET"});if(!r.ok)throw Error("HTTP ".concat(r.status,": ").concat(r.statusText));return await r.json()},async post(e,r){let t=await h(y(e),{method:"POST",body:r?JSON.stringify(r):void 0});if(!t.ok)throw Error("HTTP ".concat(t.status,": ").concat(t.statusText));return await t.json()},async patch(e,r){let t=await h(y(e),{method:"PATCH",body:r?JSON.stringify(r):void 0});if(!t.ok)throw Error("HTTP ".concat(t.status,": ").concat(t.statusText));return await t.json()},async delete(e){let r=await h(y(e),{method:"DELETE"});if(!r.ok)throw Error("HTTP ".concat(r.status,": ").concat(r.statusText));return await r.json()},async sendMessage(e){try{let r=await h(y("/api/send"),{method:"POST",body:JSON.stringify(e)}),t=await r.json();if(r.ok&&t.success)return{success:!0};return{success:!1,error:t.error||"Failed to send message"}}catch(e){return{success:!1,error:"Network error"}}},async uploadAttachment(e){try{let r,t,s;e instanceof File?(r=e.name,t=e.type,s=await new Promise((r,t)=>{let s=new FileReader;s.onload=()=>r(s.result),s.onerror=t,s.readAsDataURL(e)})):(r=e.filename,t=e.mimeType,s=e.data);let a=await h(y("/api/upload"),{method:"POST",body:JSON.stringify({filename:r,mimeType:t,data:s})}),c=await a.json();if(a.ok&&c.success&&c.attachment)return{success:!0,data:{attachment:c.attachment}};return{success:!1,error:c.error||"Failed to upload attachment"}}catch(e){return{success:!1,error:"Network error"}}},async spawnAgent(e){try{let r=await h(y("/api/spawn"),{method:"POST",body:JSON.stringify(e)});return await r.json()}catch(r){return{success:!1,name:e.name,error:"Network error"}}},async getSpawnedAgents(){try{let e=await h(y("/api/spawned")),r=await e.json();if(e.ok&&r.success)return{success:!0,data:{agents:r.agents||[]}};return{success:!1,error:r.error}}catch(e){return{success:!1,error:"Network error"}}},async releaseAgent(e){try{let r=await h(y("/api/spawned/".concat(encodeURIComponent(e))),{method:"DELETE"}),t=await r.json();if(r.ok&&t.success)return{success:!0};return{success:!1,error:t.error}}catch(e){return{success:!1,error:"Network error"}}},async interruptAgent(e){try{let r=await h(y("/api/agents/by-name/".concat(encodeURIComponent(e),"/interrupt")),{method:"POST"}),t=await r.json();if(r.ok&&t.success)return{success:!0};return{success:!1,error:t.error||"Failed to interrupt agent"}}catch(e){return{success:!1,error:"Network error"}}},async getData(e){try{let r=e||c,t=r?y("/api/data?workspaceId=".concat(encodeURIComponent(r))):y("/api/data"),s=await h(t),a=await s.json();if(s.ok)return{success:!0,data:a};return{success:!1,error:"Failed to fetch data"}}catch(e){return{success:!1,error:"Network error"}}},async getBridgeData(e){try{let r=e||c,t=r?"".concat(s,"/api/bridge?workspaceId=").concat(encodeURIComponent(r)):"".concat(s,"/api/bridge"),a=await h(t),o=await a.json();if(a.ok)return{success:!0,data:o};return{success:!1,error:"Failed to fetch bridge data"}}catch(e){return{success:!1,error:"Network error"}}},async getMetrics(){try{let e=await h(y("/api/metrics")),r=await e.json();if(e.ok)return{success:!0,data:r};return{success:!1,error:"Failed to fetch metrics"}}catch(e){return{success:!1,error:"Network error"}}},async getHistorySessions(e){try{let r=new URLSearchParams;(null==e?void 0:e.agent)&&r.set("agent",e.agent),(null==e?void 0:e.since)&&r.set("since",String(e.since)),(null==e?void 0:e.limit)&&r.set("limit",String(e.limit));let t=await h(y("/api/history/sessions?".concat(r))),s=await t.json();if(t.ok)return{success:!0,data:s};return{success:!1,error:"Failed to fetch sessions"}}catch(e){return{success:!1,error:"Network error"}}},async getHistoryMessages(e){try{let r=new URLSearchParams;(null==e?void 0:e.from)&&r.set("from",e.from),(null==e?void 0:e.to)&&r.set("to",e.to),(null==e?void 0:e.thread)&&r.set("thread",e.thread),(null==e?void 0:e.since)&&r.set("since",String(e.since)),(null==e?void 0:e.limit)&&r.set("limit",String(e.limit)),(null==e?void 0:e.order)&&r.set("order",e.order),(null==e?void 0:e.search)&&r.set("search",e.search);let t=await h(y("/api/history/messages?".concat(r))),s=await t.json();if(t.ok)return{success:!0,data:s};return{success:!1,error:"Failed to fetch messages"}}catch(e){return{success:!1,error:"Network error"}}},async getHistoryConversations(){try{let e=await h(y("/api/history/conversations")),r=await e.json();if(e.ok)return{success:!0,data:r};return{success:!1,error:"Failed to fetch conversations"}}catch(e){return{success:!1,error:"Network error"}}},async getHistoryMessage(e){try{let r=await h(y("/api/history/message/".concat(encodeURIComponent(e)))),t=await r.json();if(r.ok)return{success:!0,data:t};return{success:!1,error:t.error||"Failed to fetch message"}}catch(e){return{success:!1,error:"Network error"}}},async getHistoryStats(){try{let e=await h(y("/api/history/stats")),r=await e.json();if(e.ok)return{success:!0,data:r};return{success:!1,error:"Failed to fetch stats"}}catch(e){return{success:!1,error:"Network error"}}},async searchFiles(e){try{let r=new URLSearchParams;(null==e?void 0:e.query)&&r.set("q",e.query),(null==e?void 0:e.limit)&&r.set("limit",String(e.limit));let t=await h(y("/api/files?".concat(r))),s=await t.json();if(t.ok)return{success:!0,data:s};return{success:!1,error:"Failed to search files"}}catch(e){return{success:!1,error:"Network error"}}},async getDecisions(){try{let e=await h(y("/api/decisions")),r=await e.json();if(e.ok&&r.success)return{success:!0,data:{decisions:r.decisions||[]}};return{success:!1,error:r.error||"Failed to fetch decisions"}}catch(e){return{success:!1,error:"Network error"}}},async approveDecision(e,r,t){try{let s=await h(y("/api/decisions/".concat(encodeURIComponent(e),"/approve")),{method:"POST",body:JSON.stringify({optionId:r,response:t})}),a=await s.json();if(s.ok&&a.success)return{success:!0};return{success:!1,error:a.error||"Failed to approve decision"}}catch(e){return{success:!1,error:"Network error"}}},async rejectDecision(e,r){try{let t=await h(y("/api/decisions/".concat(encodeURIComponent(e),"/reject")),{method:"POST",body:JSON.stringify({reason:r})}),s=await t.json();if(t.ok&&s.success)return{success:!0};return{success:!1,error:s.error||"Failed to reject decision"}}catch(e){return{success:!1,error:"Network error"}}},async dismissDecision(e){try{let r=await h(y("/api/decisions/".concat(encodeURIComponent(e))),{method:"DELETE"}),t=await r.json();if(r.ok&&t.success)return{success:!0};return{success:!1,error:t.error||"Failed to dismiss decision"}}catch(e){return{success:!1,error:"Network error"}}},async getFleetServers(){try{let e=await h(y("/api/fleet/servers")),r=await e.json();if(e.ok&&r.success)return{success:!0,data:{servers:r.servers||[]}};return{success:!1,error:r.error||"Failed to fetch fleet servers"}}catch(e){return{success:!1,error:"Network error"}}},async getFleetStats(){try{let e=await h(y("/api/fleet/stats")),r=await e.json();if(e.ok&&r.success)return{success:!0,data:{stats:r.stats}};return{success:!1,error:r.error||"Failed to fetch fleet stats"}}catch(e){return{success:!1,error:"Network error"}}},async getTasks(e){try{let r=new URLSearchParams;(null==e?void 0:e.status)&&r.set("status",e.status),(null==e?void 0:e.agent)&&r.set("agent",e.agent);let t=await h(y("/api/tasks?".concat(r))),s=await t.json();if(t.ok&&s.success)return{success:!0,data:{tasks:s.tasks||[]}};return{success:!1,error:s.error||"Failed to fetch tasks"}}catch(e){return{success:!1,error:"Network error"}}},async createTask(e){try{let r=await h(y("/api/tasks"),{method:"POST",body:JSON.stringify(e)}),t=await r.json();if(r.ok&&t.success)return{success:!0,data:{task:t.task}};return{success:!1,error:t.error||"Failed to create task"}}catch(e){return{success:!1,error:"Network error"}}},async updateTask(e,r){try{let t=await h(y("/api/tasks/".concat(encodeURIComponent(e))),{method:"PATCH",body:JSON.stringify(r)}),s=await t.json();if(t.ok&&s.success)return{success:!0,data:{task:s.task}};return{success:!1,error:s.error||"Failed to update task"}}catch(e){return{success:!1,error:"Network error"}}},async cancelTask(e){try{let r=await h(y("/api/tasks/".concat(encodeURIComponent(e))),{method:"DELETE"}),t=await r.json();if(r.ok&&t.success)return{success:!0};return{success:!1,error:t.error||"Failed to cancel task"}}catch(e){return{success:!1,error:"Network error"}}},async createBead(e){try{let r=await h(y("/api/beads"),{method:"POST",body:JSON.stringify(e)}),t=await r.json();if(r.ok&&t.success)return{success:!0,data:{bead:t.bead}};return{success:!1,error:t.error||"Failed to create bead"}}catch(e){return{success:!1,error:"Network error"}}},async sendRelayMessage(e){try{let r=await h(y("/api/relay/send"),{method:"POST",body:JSON.stringify(e)}),t=await r.json();if(r.ok&&t.success)return{success:!0,data:{messageId:t.messageId}};return{success:!1,error:t.error||"Failed to send message"}}catch(e){return{success:!1,error:"Network error"}}}};function k(e){return{id:e.id,agentName:e.agentName,timestamp:e.createdAt,type:e.category,title:e.title,description:e.description,options:e.options,priority:e.urgency,context:e.context,expiresAt:e.expiresAt}}},2446:function(e,r,t){t.d(r,{HE:function(){return a},bR:function(){return c}});var s=t(4859);function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/ws",r=s.env.NEXT_PUBLIC_WS_URL;if(r)return r.endsWith("/")?"".concat(r.slice(0,-1)).concat(e):"".concat(r).concat(e);window.location.hostname;let t="https:"===window.location.protocol?"wss:":"ws:";return"".concat(t,"//").concat(window.location.host).concat(e)}function c(){return s.env.NEXT_PUBLIC_API_URL||""}s.env.NEXT_PUBLIC_DEV_SERVER_PORT}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[202],{5888:function(e,t,i){i.d(t,{ZP:function(){return h}});let s="[nango]";class n{baseURL;debug;swClient;errorHandler;modal;isProcessingMessage=!1;constructor({baseUrl:e,debug:t,webSocketUrl:i,successHandler:s,errorHandler:n}){this.baseURL=e,this.debug=t,this.swClient=new WebSocket(i),this.errorHandler=n,this.swClient.onmessage=e=>{this.isProcessingMessage=!0,this.handleMessage(e,s),this.isProcessingMessage=!1}}setModal(e){this.modal=e}handleMessage(e,t){let i=JSON.parse(e.data);switch(i.message_type){case"connection_ack":this.debug&&console.log(s,"Connection ack received. Opening modal..."),this.baseURL.searchParams.set("ws_client_id",i.ws_client_id),this.open();break;case"error":this.debug&&console.log(s,"Error received. Rejecting authorization..."),this.errorHandler(i.error_type,i.error_desc),this.swClient.close();break;case"success":this.debug&&console.log(s,"Success received. Resolving authorization..."),t({providerConfigKey:i.provider_config_key,connectionId:i.connection_id,isPending:i.is_pending}),this.swClient.close();break;default:this.debug&&console.log(s,"Unknown message type received from Nango server. Ignoring...");return}}open(){if(this.modal&&(this.debug&&console.log(s,"opening",this.baseURL.href),this.modal.location=this.baseURL.href,!this.modal||this.modal.closed||void 0===this.modal.closed)){this.errorHandler("blocked_by_browser","Modal blocked by browser");return}}close(){this.modal&&!this.modal.closed&&(this.modal.close(),delete this.modal),this.swClient.close(),delete this.swClient}}class r{iframe=null;isReady=!1;listener=null;sessionToken;baseURL;apiURL;onEvent;detectClosedAuthWindow;lang;themeOverride;constructor({sessionToken:e,baseURL:t="https://connect.nango.dev",apiURL:i="https://api.nango.dev",detectClosedAuthWindow:s,onEvent:n,lang:r,themeOverride:o}){this.sessionToken=e,this.baseURL=t,this.apiURL=i,this.onEvent=n,this.detectClosedAuthWindow=s,this.lang=r,this.themeOverride=o}open(){this.iframe=this.createIframe(),document.body.append(this.iframe),document.body.style.overflow="hidden",this.setupEventListeners()}createIframe(){let e=new URL(this.baseURL);this.apiURL&&e.searchParams.append("apiURL",this.apiURL),this.detectClosedAuthWindow&&e.searchParams.append("detectClosedAuthWindow",String(this.detectClosedAuthWindow)),this.lang&&e.searchParams.append("lang",this.lang),this.themeOverride&&e.searchParams.append("theme",this.themeOverride);let t=document.createElement("iframe");return t.src=e.href,t.id="connect-ui",t.style.position="fixed",t.style.zIndex="9999",t.style.top="0",t.style.left="0",t.style.right="0",t.style.bottom="0",t.style.width="100vw",t.style.height="100vh",t.style.backgroundColor="transparent",t}setupEventListeners(){this.listener=e=>{if(e.origin!==new URL(this.baseURL).origin||"object"!=typeof e.data||!e.data||!e.data.type)return;let t=e.data;switch(t.type){case"ready":this.isReady=!0,this.sendSessionToken();break;case"close":this.close()}this.onEvent&&this.onEvent(t)},window.addEventListener("message",this.listener,!1)}setSessionToken(e){this.sessionToken=e,this.isReady&&this.sendSessionToken()}close(){this.listener&&window.removeEventListener("message",this.listener),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null,document.body.style.overflow="")}sendSessionToken(){if(!this.sessionToken)return;let e={type:"session_token",sessionToken:this.sessionToken};this.iframe?.contentWindow?.postMessage(e,"*")}}let o="NANGO DEBUG LOG: ";class a extends Error{type;constructor(e,t){super(e),this.type=t}}class h{hostBaseUrl;websocketsBaseUrl;publicKey;connectSessionToken;debug=!1;width=500;height=600;tm=null;win=null;constructor(e={}){e.host=e.host||"https://api.nango.dev",e.websocketsPath=e.websocketsPath||"/",this.debug=e.debug||!1,this.debug&&(console.log(o,"Debug mode is enabled."),console.log(o,`Using host: ${e.host}.`)),e.width&&(this.width=e.width),e.height&&(this.height=e.height),this.hostBaseUrl=e.host.replace(/\/+$/,""),this.publicKey=e.publicKey,this.connectSessionToken=e.connectSessionToken;try{let t=new URL(this.hostBaseUrl),i=new URL(e.websocketsPath,t);this.websocketsBaseUrl=i.toString().replace("https://","wss://").replace("http://","ws://")}catch{throw new a("Invalid URL provided for the Nango host.","invalid_host_url")}}async create(e,t,i){this.ensureCredentials();let s=null,n=i;"string"==typeof t?s=t:n=t;let r=this.hostBaseUrl+`/auth/unauthenticated/${e}${this.toQueryString(s,n)}`;return await this.triggerAuth({authUrl:r})}auth(e,t,i){this.ensureCredentials();let s=null,r=i;if("string"==typeof t?s=t:r={...r,...t},r&&("installation"in r&&"outbound"===r.installation||"credentials"in r&&("token_id"in r.credentials&&"token_secret"in r.credentials||!("oauth_client_id_override"in r.credentials)||!("oauth_client_secret_override"in r.credentials))&&Object.keys(r.credentials).length>0)){let t=r.credentials;if(!t)throw new a("Credentials are required for custom auth","missing_credentials");let{credentials:i,...n}=r;return this.customAuth(e,s,this.convertCredentialsToConfig(t),n,r.installation)}let o=window.open("","_blank",function(e){let t={...e,scrollbars:"yes",resizable:"yes",status:"no",toolbar:"no",location:"no",copyhistory:"no",menubar:"no",directories:"no"},i=[];for(let e in t)i.push(`${e}=${t[e]}`);return i.join(",")}(function({expectedWidth:e,expectedHeight:t}){let i=window.screen.width,s=window.screen.height;return{left:Math.max(i/2-e/2,0),top:Math.max(s/2-t/2,0),width:Math.min(e,i),height:Math.min(t,s)}}({expectedWidth:this.width,expectedHeight:this.height})));return new Promise((t,i)=>{let h;let l=(e,t)=>{i(new a(t,e))};if(this.win&&this.clear(),!o||o.closed||void 0===o.closed){l("blocked_by_browser","Modal blocked by browser");return}try{h=new URL(`${this.hostBaseUrl}/oauth/connect/${e}${this.toQueryString(s,r)}`)}catch{l("invalid_host_url","Invalid URL provided for the Nango host.");return}this.win=new n({baseUrl:h,debug:this.debug,webSocketUrl:this.websocketsBaseUrl,successHandler:e=>{t(e)},errorHandler:l}),this.win.setModal(o),this.tm=setInterval(()=>{this.win&&this.win.modal&&this.win.modal.closed&&!this.win.isProcessingMessage&&r?.detectClosedAuthWindow&&(clearInterval(this.tm),this.win.close(),this.win=null,i(new a("The authorization window was closed before the authorization flow was completed","window_closed")))},500)}).finally(()=>{this.clear()})}reconnect(e,t){if(!this.connectSessionToken)throw new a("Reconnect requires a session token","missing_connect_session_token");return this.auth(e,t)}clear(){if(this.tm&&clearInterval(this.tm),this.win){try{this.win.close()}catch(e){console.log("err",e)}this.win=null}}openConnectUI(e){let t=new r({sessionToken:this.connectSessionToken,...e});return t.open(),t}convertCredentialsToConfig(e){let t={};if("type"in e&&"username"in e&&"password"in e&&"SIGNATURE"===e.type)return{params:{type:e.type,username:e.username,password:e.password}};if("username"in e&&(t.username=e.username||""),"password"in e&&(t.password=e.password||""),"apiKey"in e&&(t.apiKey=e.apiKey||""),"privateKey"in e||"type"in e&&"JWT"===e.type){let{privateKey:t,...i}=e,s={...i};return t&&"object"==typeof t&&"id"in t&&"secret"in t&&(s.privateKey=t),{params:e}}if("privateKeyId"in e&&"issuerId"in e&&"privateKey"in e){let t={params:{privateKeyId:e.privateKeyId,issuerId:e.issuerId,privateKey:e.privateKey}};return"scope"in e&&("string"==typeof e.scope||Array.isArray(e.scope))&&(t.params.scope=e.scope),t}if("client_id"in e&&"client_secret"in e)return{params:{client_id:e.client_id,client_secret:e.client_secret,client_certificate:e.client_certificate,client_private_key:e.client_private_key}};if("token_id"in e&&"token_secret"in e){let t={token_id:e.token_id,token_secret:e.token_secret};return"oauth_client_id_override"in e&&(t.oauth_client_id_override=e.oauth_client_id_override),"oauth_client_secret_override"in e&&(t.oauth_client_secret_override=e.oauth_client_secret_override),{params:t}}return"username"in e&&"password"in e&&"organization_id"in e&&"dev_key"in e?{params:{username:e.username,password:e.password,organization_id:e.organization_id,dev_key:e.dev_key}}:"type"in e&&"TWO_STEP"===e.type?{params:{...e}}:{params:t}}async triggerAuth({authUrl:e,credentials:t}){let i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},...t?{body:JSON.stringify(t)}:{}});if(!i.ok){let e=await i.json();throw new a(e.error.message,e.error.code)}return i.json()}async customAuth(e,t,i,s,n){let{params:r}=i;if(!r)throw new a("You must specify credentials.","missing_credentials");return"type"in r&&"TWO_STEP"===r.type?await this.triggerAuth({authUrl:this.hostBaseUrl+`/auth/two-step/${e}${this.toQueryString(t,s)}`,credentials:r}):"type"in r&&"SIGNATURE"===r.type&&"username"in r&&"password"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/auth/signature/${e}${this.toQueryString(t,s)}`,credentials:r}):"username"in r&&"password"in r&&"organization_id"in r&&"dev_key"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/auth/bill/${e}${this.toQueryString(t,s)}`,credentials:r}):"apiKey"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/api-auth/api-key/${e}${this.toQueryString(t,s)}`,credentials:r}):"username"in r||"password"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/api-auth/basic/${e}${this.toQueryString(t,s)}`,credentials:r}):"privateKey"in r||"type"in r&&"JWT"===r.type?await this.triggerAuth({authUrl:this.hostBaseUrl+`/auth/jwt/${e}${this.toQueryString(t,s)}`,credentials:r}):"privateKeyId"in r&&"issuerId"in r&&"privateKey"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/app-store-auth/${e}${this.toQueryString(t,s)}`,credentials:r}):"token_id"in r&&"token_secret"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/auth/tba/${e}${this.toQueryString(t,s)}`,credentials:r}):"client_id"in r&&"client_secret"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/oauth2/auth/${e}${this.toQueryString(t,s)}`,credentials:r}):"outbound"===n?await this.triggerAuth({authUrl:this.hostBaseUrl+`/auth/oauth-outbound/${e}${this.toQueryString(t,s)}`}):Promise.reject(Error("Something went wrong with the authorization"))}toQueryString(e,t){let i=[];if(e&&i.push(`connection_id=${e}`),this.publicKey&&i.push(`public_key=${this.publicKey}`),this.connectSessionToken&&i.push(`connect_session_token=${this.connectSessionToken}`),t){for(let e in t.params){let s=t.params[e];"string"==typeof s&&i.push(`params[${encodeURIComponent(e)}]=${encodeURIComponent(s)}`)}if(t.hmac&&i.push(`hmac=${t.hmac}`),t.user_scope&&i.push(`user_scope=${t.user_scope.join(",")}`),t.credentials){let e=t.credentials;"oauth_client_id_override"in e&&i.push(`credentials[oauth_client_id_override]=${encodeURIComponent(e.oauth_client_id_override)}`),"oauth_client_secret_override"in e&&i.push(`credentials[oauth_client_secret_override]=${encodeURIComponent(e.oauth_client_secret_override)}`),"token_id"in e&&i.push(`token_id=${encodeURIComponent(e.token_id)}`),"token_secret"in e&&i.push(`token_secret=${encodeURIComponent(e.token_secret)}`)}for(let e in t.authorization_params){let s=t.authorization_params[e];"string"==typeof s?i.push(`authorization_params[${e}]=${s}`):void 0===s&&i.push(`authorization_params[${e}]=undefined`)}}return 0===i.length?"":"?"+i.join("&")}ensureCredentials(){if(!this.publicKey&&!this.connectSessionToken)throw new a("You must specify a public key OR a connect session token (cf. documentation).","missing_auth_token")}}}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[202],{5888:function(e,t,i){i.d(t,{ZP:function(){return h}});let s="[nango]";class n{baseURL;debug;swClient;errorHandler;modal;isProcessingMessage=!1;constructor({baseUrl:e,debug:t,webSocketUrl:i,successHandler:s,errorHandler:n}){this.baseURL=e,this.debug=t,this.swClient=new WebSocket(i),this.errorHandler=n,this.swClient.onmessage=e=>{this.isProcessingMessage=!0,this.handleMessage(e,s),this.isProcessingMessage=!1}}setModal(e){this.modal=e}handleMessage(e,t){let i=JSON.parse(e.data);switch(i.message_type){case"connection_ack":this.debug&&console.log(s,"Connection ack received. Opening modal..."),this.baseURL.searchParams.set("ws_client_id",i.ws_client_id),this.open();break;case"error":this.debug&&console.log(s,"Error received. Rejecting authorization..."),this.errorHandler(i.error_type,i.error_desc),this.swClient.close();break;case"success":this.debug&&console.log(s,"Success received. Resolving authorization..."),t({providerConfigKey:i.provider_config_key,connectionId:i.connection_id,isPending:i.is_pending}),this.swClient.close();break;default:this.debug&&console.log(s,"Unknown message type received from Nango server. Ignoring...");return}}open(){if(this.modal&&(this.debug&&console.log(s,"opening",this.baseURL.href),this.modal.location=this.baseURL.href,!this.modal||this.modal.closed||void 0===this.modal.closed)){this.errorHandler("blocked_by_browser","Modal blocked by browser");return}}close(){this.modal&&!this.modal.closed&&(this.modal.close(),delete this.modal),this.swClient.close(),delete this.swClient}}class r{iframe=null;isReady=!1;listener=null;sessionToken;baseURL;apiURL;onEvent;detectClosedAuthWindow;lang;themeOverride;constructor({sessionToken:e,baseURL:t="https://connect.nango.dev",apiURL:i="https://api.nango.dev",detectClosedAuthWindow:s,onEvent:n,lang:r,themeOverride:o}){this.sessionToken=e,this.baseURL=t,this.apiURL=i,this.onEvent=n,this.detectClosedAuthWindow=s,this.lang=r,this.themeOverride=o}open(){this.iframe=this.createIframe(),document.body.append(this.iframe),document.body.style.overflow="hidden",this.setupEventListeners()}createIframe(){let e=new URL(this.baseURL);this.apiURL&&e.searchParams.append("apiURL",this.apiURL),this.detectClosedAuthWindow&&e.searchParams.append("detectClosedAuthWindow",String(this.detectClosedAuthWindow)),this.lang&&e.searchParams.append("lang",this.lang),this.themeOverride&&e.searchParams.append("theme",this.themeOverride);let t=document.createElement("iframe");return t.src=e.href,t.id="connect-ui",t.style.position="fixed",t.style.zIndex="9999",t.style.top="0",t.style.left="0",t.style.right="0",t.style.bottom="0",t.style.width="100vw",t.style.height="100vh",t.style.backgroundColor="transparent",t}setupEventListeners(){this.listener=e=>{if(e.origin!==new URL(this.baseURL).origin||"object"!=typeof e.data||!e.data||!e.data.type)return;let t=e.data;switch(t.type){case"ready":this.isReady=!0,this.sendSessionToken();break;case"close":this.close()}this.onEvent&&this.onEvent(t)},window.addEventListener("message",this.listener,!1)}setSessionToken(e){this.sessionToken=e,this.isReady&&this.sendSessionToken()}close(){this.listener&&window.removeEventListener("message",this.listener),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null,document.body.style.overflow="")}sendSessionToken(){if(!this.sessionToken)return;let e={type:"session_token",sessionToken:this.sessionToken};this.iframe?.contentWindow?.postMessage(e,"*")}}let o="NANGO DEBUG LOG: ";class a extends Error{type;constructor(e,t){super(e),this.type=t}}class h{hostBaseUrl;websocketsBaseUrl;publicKey;connectSessionToken;debug=!1;width=500;height=600;tm=null;win=null;constructor(e={}){e.host=e.host||"https://api.nango.dev",e.websocketsPath=e.websocketsPath||"/",this.debug=e.debug||!1,this.debug&&(console.log(o,"Debug mode is enabled."),console.log(o,`Using host: ${e.host}.`)),e.width&&(this.width=e.width),e.height&&(this.height=e.height),this.hostBaseUrl=e.host.replace(/\/+$/,""),this.publicKey=e.publicKey,this.connectSessionToken=e.connectSessionToken;try{let t=new URL(this.hostBaseUrl),i=new URL(e.websocketsPath,t);this.websocketsBaseUrl=i.toString().replace("https://","wss://").replace("http://","ws://")}catch{throw new a("Invalid URL provided for the Nango host.","invalid_host_url")}}async create(e,t,i){this.ensureCredentials();let s=null,n=i;"string"==typeof t?s=t:n=t;let r=this.hostBaseUrl+`/auth/unauthenticated/${e}${this.toQueryString(s,n)}`;return await this.triggerAuth({authUrl:r})}auth(e,t,i){this.ensureCredentials();let s=null,r=i;if("string"==typeof t?s=t:r={...r,...t},r&&("installation"in r&&"outbound"===r.installation||"credentials"in r&&("token_id"in r.credentials&&"token_secret"in r.credentials||!("oauth_client_id_override"in r.credentials)||!("oauth_client_secret_override"in r.credentials))&&Object.keys(r.credentials).length>0)){let t=r.credentials;if(!t)throw new a("Credentials are required for custom auth","missing_credentials");let{credentials:i,...n}=r;return this.customAuth(e,s,this.convertCredentialsToConfig(t),n,r.installation)}let o=window.open("","_blank",function(e){let t={...e,scrollbars:"yes",resizable:"yes",status:"no",toolbar:"no",location:"no",copyhistory:"no",menubar:"no",directories:"no"},i=[];for(let e in t)i.push(`${e}=${t[e]}`);return i.join(",")}(function({expectedWidth:e,expectedHeight:t}){let i=window.screen.width,s=window.screen.height;return{left:Math.max(i/2-e/2,0),top:Math.max(s/2-t/2,0),width:Math.min(e,i),height:Math.min(t,s)}}({expectedWidth:this.width,expectedHeight:this.height})));return new Promise((t,i)=>{let h;let l=(e,t)=>{i(new a(t,e))};if(this.win&&this.clear(),!o||o.closed||void 0===o.closed){l("blocked_by_browser","Modal blocked by browser");return}try{h=new URL(`${this.hostBaseUrl}/oauth/connect/${e}${this.toQueryString(s,r)}`)}catch{l("invalid_host_url","Invalid URL provided for the Nango host.");return}this.win=new n({baseUrl:h,debug:this.debug,webSocketUrl:this.websocketsBaseUrl,successHandler:e=>{t(e)},errorHandler:l}),this.win.setModal(o),this.tm=setInterval(()=>{this.win&&this.win.modal&&this.win.modal.closed&&!this.win.isProcessingMessage&&r?.detectClosedAuthWindow&&(clearInterval(this.tm),this.win.close(),this.win=null,i(new a("The authorization window was closed before the authorization flow was completed","window_closed")))},500)}).finally(()=>{this.clear()})}reconnect(e,t){if(!this.connectSessionToken)throw new a("Reconnect requires a session token","missing_connect_session_token");return this.auth(e,t)}clear(){if(this.tm&&clearInterval(this.tm),this.win){try{this.win.close()}catch(e){console.log("err",e)}this.win=null}}openConnectUI(e){let t=new r({sessionToken:this.connectSessionToken,...e});return t.open(),t}convertCredentialsToConfig(e){let t={};if("type"in e&&"username"in e&&"password"in e&&"SIGNATURE"===e.type)return{params:{type:e.type,username:e.username,password:e.password}};if("username"in e&&(t.username=e.username||""),"password"in e&&(t.password=e.password||""),"apiKey"in e&&(t.apiKey=e.apiKey||""),"privateKey"in e||"type"in e&&"JWT"===e.type){let{privateKey:t,...i}=e,s={...i};return t&&"object"==typeof t&&"id"in t&&"secret"in t&&(s.privateKey=t),{params:e}}if("privateKeyId"in e&&"issuerId"in e&&"privateKey"in e){let t={params:{privateKeyId:e.privateKeyId,issuerId:e.issuerId,privateKey:e.privateKey}};return"scope"in e&&("string"==typeof e.scope||Array.isArray(e.scope))&&(t.params.scope=e.scope),t}if("client_id"in e&&"client_secret"in e)return{params:{client_id:e.client_id,client_secret:e.client_secret,client_certificate:e.client_certificate,client_private_key:e.client_private_key}};if("token_id"in e&&"token_secret"in e){let t={token_id:e.token_id,token_secret:e.token_secret};return"oauth_client_id_override"in e&&(t.oauth_client_id_override=e.oauth_client_id_override),"oauth_client_secret_override"in e&&(t.oauth_client_secret_override=e.oauth_client_secret_override),{params:t}}return"username"in e&&"password"in e&&"organization_id"in e&&"dev_key"in e?{params:{username:e.username,password:e.password,organization_id:e.organization_id,dev_key:e.dev_key}}:"type"in e&&"TWO_STEP"===e.type?{params:{...e}}:{params:t}}async triggerAuth({authUrl:e,credentials:t,assertionOption:i}){let s={};t&&Object.assign(s,t),i&&Object.keys(i).length>0&&(s.assertionOption=i);let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},...Object.keys(s).length>0?{body:JSON.stringify(s)}:{}});if(!n.ok){let e=await n.json();throw new a(e.error.message,e.error.code)}return n.json()}async customAuth(e,t,i,s,n){let{params:r}=i;if(!r)throw new a("You must specify credentials.","missing_credentials");if("type"in r&&"TWO_STEP"===r.type){let i=s?.assertionOption;return await this.triggerAuth({authUrl:this.hostBaseUrl+`/auth/two-step/${e}${this.toQueryString(t,s)}`,credentials:r,...i?{assertionOption:i}:{}})}return"type"in r&&"SIGNATURE"===r.type&&"username"in r&&"password"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/auth/signature/${e}${this.toQueryString(t,s)}`,credentials:r}):"username"in r&&"password"in r&&"organization_id"in r&&"dev_key"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/auth/bill/${e}${this.toQueryString(t,s)}`,credentials:r}):"apiKey"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/api-auth/api-key/${e}${this.toQueryString(t,s)}`,credentials:r}):"username"in r||"password"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/api-auth/basic/${e}${this.toQueryString(t,s)}`,credentials:r}):"privateKey"in r||"type"in r&&"JWT"===r.type?await this.triggerAuth({authUrl:this.hostBaseUrl+`/auth/jwt/${e}${this.toQueryString(t,s)}`,credentials:r}):"privateKeyId"in r&&"issuerId"in r&&"privateKey"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/app-store-auth/${e}${this.toQueryString(t,s)}`,credentials:r}):"token_id"in r&&"token_secret"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/auth/tba/${e}${this.toQueryString(t,s)}`,credentials:r}):"client_id"in r&&"client_secret"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/oauth2/auth/${e}${this.toQueryString(t,s)}`,credentials:r}):"outbound"===n?await this.triggerAuth({authUrl:this.hostBaseUrl+`/auth/oauth-outbound/${e}${this.toQueryString(t,s)}`}):Promise.reject(Error("Something went wrong with the authorization"))}toQueryString(e,t){let i=[];if(e&&i.push(`connection_id=${e}`),this.publicKey&&i.push(`public_key=${this.publicKey}`),this.connectSessionToken&&i.push(`connect_session_token=${this.connectSessionToken}`),t){for(let e in t.params){let s=t.params[e];"string"==typeof s&&i.push(`params[${encodeURIComponent(e)}]=${encodeURIComponent(s)}`)}if(t.hmac&&i.push(`hmac=${t.hmac}`),t.user_scope&&i.push(`user_scope=${t.user_scope.join(",")}`),t.credentials){let e=t.credentials;"oauth_client_id_override"in e&&i.push(`credentials[oauth_client_id_override]=${encodeURIComponent(e.oauth_client_id_override)}`),"oauth_client_secret_override"in e&&i.push(`credentials[oauth_client_secret_override]=${encodeURIComponent(e.oauth_client_secret_override)}`),"oauth_refresh_token_override"in e&&i.push(`credentials[oauth_refresh_token_override]=${encodeURIComponent(e.oauth_refresh_token_override)}`),"token_id"in e&&i.push(`token_id=${encodeURIComponent(e.token_id)}`),"token_secret"in e&&i.push(`token_secret=${encodeURIComponent(e.token_secret)}`)}for(let e in t.authorization_params){let s=t.authorization_params[e];"string"==typeof s?i.push(`authorization_params[${e}]=${s}`):void 0===s&&i.push(`authorization_params[${e}]=undefined`)}}return 0===i.length?"":"?"+i.join("&")}ensureCredentials(){if(!this.publicKey&&!this.connectSessionToken)throw new a("You must specify a public key OR a connect session token (cf. documentation).","missing_auth_token")}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[259],{5634:function(e,t,r){r.d(t,{K7:function(){return n}});var o=r(7573);function n(e){let{size:t=24,className:r="",withGlow:n=!1}=e;return(0,o.jsxs)("svg",{width:t,height:t,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"\n transition-all duration-300\n ".concat(n?"drop-shadow-[0_0_8px_rgba(0,217,255,0.3)]":"","\n ").concat(r,"\n "),"aria-label":"Agent Relay Logo",role:"img",children:[(0,o.jsx)("path",{d:"M30 80 L 50 20 L 70 80",stroke:"#00d9ff",strokeWidth:"5",strokeLinejoin:"round",strokeLinecap:"round",fill:"none"}),(0,o.jsx)("line",{x1:"40",y1:"50",x2:"60",y2:"50",stroke:"#00d9ff",strokeWidth:"5",strokeLinecap:"round"}),(0,o.jsx)("path",{d:"M50 20 L 50 80",stroke:"#00ffc8",strokeWidth:"2.5",strokeLinecap:"round",opacity:"0.7"}),(0,o.jsx)("path",{d:"M50 20 C 80 20 80 50 50 50 L 80 80",stroke:"#00ffc8",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",opacity:"0.7"})]})}r(7653)},9175:function(e,t,r){r.d(t,{c:function(){return a}});var o=r(7573),n=r(7653),s=r(1994),l=r(4722);let i={anthropic:{authMethod:"terminal"},codex:{authMethod:"oauth",requiresUrlCopy:!0,supportsDeviceFlow:!0},openai:{authMethod:"oauth",requiresUrlCopy:!0,supportsDeviceFlow:!0},google:{authMethod:"terminal"},opencode:{authMethod:"terminal"},droid:{authMethod:"terminal"},cursor:{authMethod:"terminal"}};function a(e){let{providers:t,connectedProviders:r,workspaceId:a,csrfToken:d,onProviderConnected:c,onConnectAnother:u,onContinue:h,showDetailedInfo:m=!0}=e,[x,p]=(0,n.useState)(null),[b,g]=(0,n.useState)("select"),[f,j]=(0,n.useState)(null),N=e=>{let t=i[e.id];(null==t?void 0:t.authMethod)==="terminal"?(p(e.id),g("terminal")):(null==t?void 0:t.authMethod)==="oauth"?(p(e.id),g("oauth")):(p(e.id),g("terminal")),j(null)},k=e=>{c(e),p(null),g("select")},v=()=>{p(null),g("select")},w=e=>{j(e),p(null),g("select")},y=e=>"codex"===e?r.includes("codex")||r.includes("openai"):r.includes(e);if(x&&"select"!==b){let e=t.find(e=>e.id===x);if(!e)return null;let r=i[e.id];return(0,o.jsxs)("div",{className:"bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-6",children:[(0,o.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,o.jsx)("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center text-white font-bold",style:{backgroundColor:e.color},children:e.displayName[0]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)("h3",{className:"text-lg font-semibold text-white",children:[e.displayName," Setup"]}),(0,o.jsx)("p",{className:"text-sm text-text-muted",children:"terminal"===b?"Interactive terminal":"OAuth authentication"})]}),(0,o.jsx)("button",{onClick:v,className:"ml-auto p-2 text-text-muted hover:text-white transition-colors","aria-label":"Close",children:(0,o.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f&&(0,o.jsx)("div",{className:"mb-4 p-3 bg-error/10 border border-error/20 rounded-lg",children:(0,o.jsx)("p",{className:"text-error text-sm",children:f})}),"terminal"===b&&(0,o.jsx)(s.$,{provider:{id:e.cliCommand||e.id,name:e.id,displayName:e.displayName,color:e.color},workspaceId:a,csrfToken:d,maxHeight:"400px",showHeader:!1,onSuccess:()=>k(e.id),onCancel:v,onConnectAnother:()=>{k(e.id),null==u||u()},onError:w}),"oauth"===b&&r&&(0,o.jsx)(l.j,{provider:{id:e.id,name:e.cliCommand||e.id,displayName:e.displayName,color:e.color,requiresUrlCopy:r.requiresUrlCopy,supportsDeviceFlow:r.supportsDeviceFlow},workspaceId:a,csrfToken:d,onSuccess:()=>k(e.id),onCancel:v,onError:w}),(0,o.jsx)("button",{onClick:v,className:"mt-4 text-sm text-text-muted hover:text-white transition-colors",children:"← Back to provider list"})]})}return(0,o.jsxs)("div",{className:"bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-6",children:[(0,o.jsx)("h2",{className:"text-lg font-semibold text-white mb-4",children:"Choose an AI Provider"}),f&&(0,o.jsx)("div",{className:"mb-4 p-3 bg-error/10 border border-error/20 rounded-lg",children:(0,o.jsx)("p",{className:"text-error text-sm",children:f})}),(0,o.jsx)("div",{className:"space-y-3",children:t.map(e=>{let t=y(e.id),r=i[e.id],n=(null==r?void 0:r.authMethod)==="terminal";return(null==r||r.authMethod,m&&("anthropic"===e.id||"codex"===e.id))?(0,o.jsxs)("div",{className:"p-4 bg-bg-tertiary rounded-xl border space-y-4 ".concat(t?"border-green-500/50":"border-border-subtle"),children:[(0,o.jsxs)("div",{className:"flex items-center gap-3",children:[(0,o.jsxs)("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center text-white font-bold flex-shrink-0 relative",style:{backgroundColor:e.color},children:[e.displayName[0],t&&(0,o.jsx)("div",{className:"absolute -top-1 -right-1 w-5 h-5 bg-green-500 rounded-full flex items-center justify-center",children:(0,o.jsx)("svg",{className:"w-3 h-3 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})})]}),(0,o.jsxs)("div",{className:"flex-1",children:[(0,o.jsx)("p",{className:"text-white font-medium",children:e.displayName}),(0,o.jsx)("p",{className:"text-text-muted text-sm",children:e.name})]}),t&&(0,o.jsx)("span",{className:"text-green-400 text-sm font-medium",children:"Connected"})]}),!t&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"p-3 bg-accent-cyan/10 border border-accent-cyan/30 rounded-lg",children:[(0,o.jsx)("p",{className:"text-sm text-accent-cyan font-medium mb-1",children:n?"Interactive terminal setup":"CLI-assisted authentication"}),(0,o.jsx)("p",{className:"text-xs text-accent-cyan/80",children:n?"Connect ".concat(e.displayName," using an interactive terminal. You'll see the CLI start up and can complete the OAuth login directly in the terminal."):"".concat(e.displayName," auth uses a CLI command to capture the OAuth callback locally. Click the button below and we'll show you a command with a unique session token to run in your terminal.")})]}),(0,o.jsxs)("button",{onClick:()=>N(e),className:"w-full flex items-center justify-center gap-2 p-3 bg-gradient-to-r from-accent-cyan to-[#00b8d9] text-bg-deep font-semibold rounded-xl hover:shadow-glow-cyan transition-all",children:[(0,o.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Connect with ",e.displayName]})]})]},e.id):(0,o.jsxs)("button",{onClick:()=>!t&&!e.comingSoon&&N(e),disabled:t||e.comingSoon,className:"w-full flex items-center gap-3 p-4 bg-bg-tertiary rounded-xl border transition-colors text-left ".concat(e.comingSoon?"border-border-subtle opacity-60 cursor-not-allowed":t?"border-green-500/50 cursor-default":"border-border-subtle hover:border-accent-cyan/50"),children:[(0,o.jsxs)("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center text-white font-bold flex-shrink-0 relative ".concat(e.comingSoon?"grayscale":""),style:{backgroundColor:e.color},children:[e.displayName[0],t&&(0,o.jsx)("div",{className:"absolute -top-1 -right-1 w-5 h-5 bg-green-500 rounded-full flex items-center justify-center",children:(0,o.jsx)("svg",{className:"w-3 h-3 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})})]}),(0,o.jsxs)("div",{className:"flex-1",children:[(0,o.jsxs)("p",{className:"text-white font-medium flex items-center gap-2",children:[e.displayName,e.comingSoon&&(0,o.jsx)("span",{className:"px-2 py-0.5 bg-amber-400/20 text-amber-400 text-xs font-medium rounded-full",children:"Coming Soon"})]}),(0,o.jsx)("p",{className:"text-text-muted text-sm",children:e.description||e.name})]}),e.comingSoon?(0,o.jsx)("span",{className:"text-text-muted text-sm",children:"Not available yet"}):t?(0,o.jsx)("span",{className:"text-green-400 text-sm font-medium",children:"Connected"}):(0,o.jsx)("svg",{className:"w-5 h-5 text-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]},e.id)})}),(u||h)&&r.length>0&&(0,o.jsxs)("div",{className:"mt-6 pt-4 border-t border-border-subtle space-y-3",children:[u&&(0,o.jsx)("button",{onClick:u,className:"w-full py-3 px-4 bg-bg-tertiary border border-border-subtle text-white rounded-xl text-center hover:border-accent-cyan/50 transition-colors",children:"Connect Another Provider"}),h&&(0,o.jsx)("button",{onClick:h,className:"w-full py-3 px-4 bg-gradient-to-r from-accent-cyan to-[#00b8d9] text-bg-deep font-semibold rounded-xl text-center hover:shadow-glow-cyan transition-all",children:"Continue to Dashboard"})]}),0===r.length&&h&&(0,o.jsx)("div",{className:"mt-6 text-center",children:(0,o.jsx)("button",{onClick:h,className:"text-text-muted hover:text-white transition-colors text-sm",children:"Skip for now - I'll connect later"})})]})}}}]);