viba-cli 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +2 -0
- package/.next/build-manifest.json +2 -2
- package/.next/fallback-build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +12 -0
- package/.next/server/app/_global-error/page.js +2 -2
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +2 -2
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/component-source/resolve/route.js +1 -1
- package/.next/server/app/api/component-source/resolve/route.js.nft.json +1 -1
- package/.next/server/app/api/notifications/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/notifications/route/build-manifest.json +11 -0
- package/.next/server/app/api/notifications/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/notifications/route.js +8 -0
- package/.next/server/app/api/notifications/route.js.map +5 -0
- package/.next/server/app/api/notifications/route.js.nft.json +1 -0
- package/.next/server/app/api/notifications/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/notifications/socket/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/notifications/socket/route/build-manifest.json +11 -0
- package/.next/server/app/api/notifications/socket/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/notifications/socket/route.js +8 -0
- package/.next/server/app/api/notifications/socket/route.js.map +5 -0
- package/.next/server/app/api/notifications/socket/route.js.nft.json +1 -0
- package/.next/server/app/api/notifications/socket/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/preview-proxy/start/route.js +2 -2
- package/.next/server/app/api/preview-proxy/start/route.js.nft.json +1 -1
- package/.next/server/app/credentials/page/server-reference-manifest.json +4 -4
- package/.next/server/app/credentials/page.js +1 -1
- package/.next/server/app/credentials/page.js.nft.json +1 -1
- package/.next/server/app/credentials/page_client-reference-manifest.js +1 -1
- package/.next/server/app/credentials.html +1 -1
- package/.next/server/app/credentials.rsc +2 -2
- package/.next/server/app/credentials.segments/_full.segment.rsc +2 -2
- package/.next/server/app/credentials.segments/_head.segment.rsc +1 -1
- package/.next/server/app/credentials.segments/_index.segment.rsc +1 -1
- package/.next/server/app/credentials.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/credentials.segments/credentials/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/credentials.segments/credentials.segment.rsc +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +2 -2
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/new/page/server-reference-manifest.json +25 -25
- package/.next/server/app/new/page.js +1 -1
- package/.next/server/app/new/page.js.nft.json +1 -1
- package/.next/server/app/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page/server-reference-manifest.json +25 -25
- package/.next/server/app/page.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/session/[sessionId]/page/server-reference-manifest.json +20 -20
- package/.next/server/app/session/[sessionId]/page.js +1 -1
- package/.next/server/app/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/server/app/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +2 -0
- package/.next/server/chunks/[externals]__6f5f63a1._.js +3 -0
- package/.next/server/chunks/[externals]__ad3eabe7._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__c6a126af._.js → [root-of-the-server]__1368fab8._.js} +4 -4
- package/.next/server/chunks/{[root-of-the-server]__c6a126af._.js.map → [root-of-the-server]__1368fab8._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__3f327856._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__3f327856._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__d29cc8f7._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__d29cc8f7._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__fe40c3b1._.js +4 -0
- package/.next/server/chunks/[root-of-the-server]__fe40c3b1._.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_notifications_route_actions_850cb780.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_notifications_route_actions_850cb780.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_notifications_socket_route_actions_41c2015d.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_notifications_socket_route_actions_41c2015d.js.map +1 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__999d9da5._.js → [root-of-the-server]__012c2bdd._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__04684e03._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__04684e03._.js.map +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__2e39bbe6._.js → [root-of-the-server]__04bf0b15._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__2e39bbe6._.js.map → [root-of-the-server]__04bf0b15._.js.map} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1c2594e3._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__319c1c59._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__319c1c59._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__352d2b3c._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__2dd6f545._.js → [root-of-the-server]__5afb130a._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__17345fe7._.js → [root-of-the-server]__7cd07782._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__9201693f._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__ff59cd57._.js → [root-of-the-server]__9f8d4cf6._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__a091a4c1._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__a091a4c1._.js.map +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__fcfd6866._.js → [root-of-the-server]__b2c27322._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__fcfd6866._.js.map → [root-of-the-server]__b2c27322._.js.map} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__ba6de807._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__e82329f4._.js.map → [root-of-the-server]__ba6de807._.js.map} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__ca05f4a0._.js +4 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__cb11b5eb._.js.map → [root-of-the-server]__ca05f4a0._.js.map} +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__45281821._.js → [root-of-the-server]__ebb382fb._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__ee9c5185._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__ee9c5185._.js.map +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__0b5bf873._.js → [root-of-the-server]__fbfe5cd5._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__0b5bf873._.js.map → [root-of-the-server]__fbfe5cd5._.js.map} +1 -1
- package/.next/server/chunks/ssr/src_app_session_[sessionId]_SessionPageClient_tsx_dab490d7._.js +1 -1
- package/.next/server/chunks/ssr/src_app_session_[sessionId]_SessionPageClient_tsx_dab490d7._.js.map +1 -1
- package/.next/server/chunks/ssr/src_components_GitRepoSelector_tsx_05c81afa._.js +1 -1
- package/.next/server/chunks/ssr/src_components_GitRepoSelector_tsx_05c81afa._.js.map +1 -1
- package/.next/server/functions-config-manifest.json +2 -0
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +2 -2
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +44 -44
- package/.next/static/chunks/{189028efc5aecd61.js → 2da4ff7bd7ef7984.js} +2 -2
- package/.next/static/chunks/{a6163af501a338a8.js → 4cb45c81c3579aa0.js} +1 -1
- package/.next/static/chunks/{3d5d7d50ca9770e6.js → 68be4ececa8dedfc.js} +1 -1
- package/.next/static/chunks/{2d4fde0bc4cfbe92.js → 8347c7b3b84ae4c2.js} +2 -2
- package/.next/static/chunks/{dda6e85b0f39d21b.js → 8f4ebe93d38185fb.js} +2 -2
- package/.next/static/chunks/{a339217e38d63e7e.js → c814bb803eca5aea.js} +1 -1
- package/package.json +4 -2
- package/.next/server/chunks/[externals]__5d99c4a5._.js +0 -3
- package/.next/server/chunks/[externals]__60650a97._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__cb11b5eb._.js +0 -4
- package/.next/server/chunks/ssr/[root-of-the-server]__e82329f4._.js +0 -3
- /package/.next/server/chunks/{[externals]__5d99c4a5._.js.map → [externals]__6f5f63a1._.js.map} +0 -0
- /package/.next/server/chunks/{[externals]__60650a97._.js.map → [externals]__ad3eabe7._.js.map} +0 -0
- /package/.next/server/chunks/ssr/{[root-of-the-server]__999d9da5._.js.map → [root-of-the-server]__012c2bdd._.js.map} +0 -0
- /package/.next/server/chunks/ssr/{[root-of-the-server]__2dd6f545._.js.map → [root-of-the-server]__5afb130a._.js.map} +0 -0
- /package/.next/server/chunks/ssr/{[root-of-the-server]__17345fe7._.js.map → [root-of-the-server]__7cd07782._.js.map} +0 -0
- /package/.next/server/chunks/ssr/{[root-of-the-server]__ff59cd57._.js.map → [root-of-the-server]__9f8d4cf6._.js.map} +0 -0
- /package/.next/server/chunks/ssr/{[root-of-the-server]__45281821._.js.map → [root-of-the-server]__ebb382fb._.js.map} +0 -0
- /package/.next/static/{qwxuOZqgaZ7EDiFJjudgy → T2HRQ3n5Gcw83spbEWvCi}/_buildManifest.js +0 -0
- /package/.next/static/{qwxuOZqgaZ7EDiFJjudgy → T2HRQ3n5Gcw83spbEWvCi}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{qwxuOZqgaZ7EDiFJjudgy → T2HRQ3n5Gcw83spbEWvCi}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,5951,e=>{"use strict";var t=e.i(43476),a=e.i(71645),s=e.i(75254);let l=(0,s.default)("folder-git-2",[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);var r=e.i(55716),i=e.i(7233);let n=(0,s.default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),c=(0,s.default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),o=(0,s.default)("folder-cog",[["path",{d:"M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3",key:"128dxu"}],["path",{d:"m14.305 19.53.923-.382",key:"3m78fa"}],["path",{d:"m15.228 16.852-.923-.383",key:"npixar"}],["path",{d:"m16.852 15.228-.383-.923",key:"5xggr7"}],["path",{d:"m16.852 20.772-.383.924",key:"dpfhf9"}],["path",{d:"m19.148 15.228.383-.923",key:"1reyyz"}],["path",{d:"m19.53 21.696-.382-.924",key:"1goivc"}],["path",{d:"m20.772 16.852.924-.383",key:"htqkph"}],["path",{d:"m20.772 19.148.924.383",key:"9w9pjp"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]]),d=(0,s.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),m=(0,s.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var u=e.i(27612),p=e.i(31343),h=e.i(65261);let x=(0,s.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var f=e.i(78917);let b=(0,s.default)("cloud-download",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]);var g=e.i(95187);let y=(0,g.createServerReference)("408f296bc4985d8661de81501119d0b7e0613ab521",g.callServer,void 0,g.findSourceMapURL,"checkDirectoryAccessible"),v=(0,g.createServerReference)("4050c3b66bf41fc8b81588f8b5135420e5ea0bdd21",g.callServer,void 0,g.findSourceMapURL,"listDirectories");var j=e.i(77178),w=e.i(27025),N=e.i(71689);let S=(0,s.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var k=e.i(81016),C=e.i(43733);function R({title:e,initialPath:s,onSelect:l,onCancel:r,checkRepo:i}){let[n,c]=(0,a.useState)(""),[o,d]=(0,a.useState)(""),[m,u]=(0,a.useState)([]),[p,h]=(0,a.useState)(!1),[x,f]=(0,a.useState)(null);(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await (0,j.getHomeDirectory)();if(!e)return;d(t),c(s||t)}catch(t){if(console.error("Failed to resolve home directory:",t),!e)return;f("Failed to access your home directory."),c(s||"/")}})(),()=>{e=!1}},[s]),(0,a.useEffect)(()=>{if(!n)return;let e=!0;return(async()=>{h(!0),f(null);try{let t=await v(n);if(!e)return;if(0===t.length&&o&&n!==o){let t=await y(n);if(!e)return;if(!t){f(`Could not access "${n}". Showing home directory.`),c(o);return}}let a=t.map(e=>({name:e.name,path:e.path,isDirectory:e.isDirectory,isGitRepo:e.isGitRepo}));u(a)}catch(t){if(console.error(t),!e)return;if(o&&n!==o){f(`Could not access "${n}". Showing home directory.`),c(o);return}u([]),f("Failed to load directory contents")}finally{e&&h(!1)}})(),()=>{e=!1}},[n,o]);let b=(0,a.useCallback)(async e=>{if(i&&!await i(e)){f("Selected directory is not a valid git repository."),setTimeout(()=>f(null),3e3);return}await l(e)},[i,l]),g=(0,a.useCallback)(async()=>{await b(n)},[n,b]);return(0,C.useDialogKeyboardShortcuts)({onConfirm:g,onDismiss:r,canConfirm:!!n}),(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",children:(0,t.jsxs)("div",{className:"bg-base-200 rounded-lg shadow-xl w-full max-w-3xl h-[80vh] flex flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 border-b border-base-300",children:[(0,t.jsxs)("h2",{className:"text-xl font-bold flex items-center gap-2",children:[(0,t.jsx)(w.Folder,{className:"w-5 h-5"}),e||"Browse Local Repository"]}),(0,t.jsx)("button",{onClick:r,className:"btn btn-sm btn-ghost btn-circle",children:"✕"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-base-300",children:[(0,t.jsx)("button",{onClick:()=>{let e=(0,k.getDirName)(n);e&&e!==n&&c(e)},className:"btn btn-sm btn-square btn-ghost",title:"Go Up",disabled:"/"===n||!n,children:(0,t.jsx)(N.ArrowLeft,{className:"w-4 h-4"})}),(0,t.jsx)("div",{className:"flex-1 overflow-x-auto whitespace-nowrap px-2 font-mono text-sm",children:n}),(0,t.jsx)("button",{onClick:g,className:"btn btn-sm btn-primary",children:"Select Current Folder"})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-2",children:p?(0,t.jsx)("div",{className:"flex justify-center items-center h-full",children:(0,t.jsx)("span",{className:"loading loading-spinner loading-lg"})}):x?(0,t.jsx)("div",{className:"alert alert-error",children:x}):0===m.length?(0,t.jsx)("div",{className:"text-center text-base-content/50 mt-10",children:"Empty directory"}):(0,t.jsx)("div",{className:"grid grid-cols-1 gap-1",children:m.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 hover:bg-base-100 rounded-md cursor-pointer transition-colors",onClick:()=>{c(e.path)},children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 overflow-hidden",children:[(0,t.jsx)(w.Folder,{className:`w-5 h-5 ${e.isGitRepo?"text-primary":"text-base-content/70"}`}),(0,t.jsx)("span",{className:"truncate",children:e.name}),e.isGitRepo&&(0,t.jsx)("span",{className:"badge badge-xs badge-primary",children:"git"})]}),e.isGitRepo&&(0,t.jsxs)("button",{className:"btn btn-xs btn-primary",onClick:t=>{t.stopPropagation(),b(e.path)},title:`Select ${e.name}`,children:[(0,t.jsx)(S,{className:"w-3 h-3"}),"Select"]})]},e.path))})}),(0,t.jsx)("div",{className:"p-3 border-t border-base-300 text-xs text-base-content/50 text-center",children:'Navigate to a folder and click "Select Current Folder" to choose it.'})]})})}let M=(0,g.createServerReference)("408812f375b211f05394c5ce77526f28585501687b",g.callServer,void 0,g.findSourceMapURL,"checkIsGitRepo"),D=(0,g.createServerReference)("404be81c6372f6dfc949f1543b2312d6f5fa1f7ee5",g.callServer,void 0,g.findSourceMapURL,"getBranches"),L=(0,g.createServerReference)("6073f1ea735a024132036166af8964ccb052fa08b0",g.callServer,void 0,g.findSourceMapURL,"checkoutBranch");var P=e.i(94820);let F=(0,g.createServerReference)("7fcb2b72e6985ce782761c3428e83c20251106dad5",g.callServer,void 0,g.findSourceMapURL,"getStartupScript"),E=(0,g.createServerReference)("7f46fc6be6e434a84ac8d967779fe2638dcb75d313",g.callServer,void 0,g.findSourceMapURL,"getDefaultDevServerScript"),$=(0,g.createServerReference)("7fb6d0e563c532109cad1086e9b1e8dc0b8a0acddb",g.callServer,void 0,g.findSourceMapURL,"listRepoFiles");var U=e.i(64663);let A=(0,g.createServerReference)("40891724d17ccb4cf676a0ad0085c465003d1e2d8a",g.callServer,void 0,g.findSourceMapURL,"checkAgentCliInstalled"),T=(0,g.createServerReference)("40dad172d307b8eb7bab159f2bd279c7b74104766d",g.callServer,void 0,g.findSourceMapURL,"installAgentCli"),I=(0,g.createServerReference)("600f37afe387f40ab0af83a41dfe5dffc657d7a666",g.callServer,void 0,g.findSourceMapURL,"cloneRemoteRepository"),K=(0,g.createServerReference)("40e4d5715562b15cafbeaeecb5ee0479d3fa2bd315",g.callServer,void 0,g.findSourceMapURL,"resolveRepositoryByName"),G=(0,g.createServerReference)("70b193bcd416ce881a9e146eda998859ebfed7dca4",g.callServer,void 0,g.findSourceMapURL,"copySessionAttachments"),O=(0,g.createServerReference)("70b649df6ca33821fb3d8e6a61600c9fe75c479704",g.callServer,void 0,g.findSourceMapURL,"createSession"),z=(0,g.createServerReference)("40ea086ada5698dbfb587ad03e8f956d5730e8648b",g.callServer,void 0,g.findSourceMapURL,"deleteSession"),B=(0,g.createServerReference)("40871222a3a91df56678397ebda16a5aca3b7e9fed",g.callServer,void 0,g.findSourceMapURL,"getSessionPrefillContext"),H=(0,g.createServerReference)("4056a481087dbd28a30d67bd7d187f162641389ada",g.callServer,void 0,g.findSourceMapURL,"listSessions"),V=(0,g.createServerReference)("60a61965f2d8723219c09ce8c5a883696cc05ed65e",g.callServer,void 0,g.findSourceMapURL,"saveSessionLaunchContext");var _=e.i(77012),q=e.i(20828);let W=(0,g.createServerReference)("60538e99d859e87dd0440a357b42c595bc4ee7e3fd",g.callServer,void 0,g.findSourceMapURL,"updateRepoSettings");var Y=e.i(64335),J=e.i(18566),Q=e.i(63671),X=e.i(57688);function Z(e){if("github"===e.type)return`GitHub - ${e.username}`;let t=e.serverUrl;try{t=new URL(e.serverUrl).host}catch{}return`GitLab - ${e.username} @ ${t}`}let ee=e.i(35027).default,et="viba:new-session-mode",ea={gemini:"gemini",codex:"codex",agent:"agent"},es={gemini:"Gemini CLI",codex:"Codex CLI",agent:"Cursor Agent CLI"};function el({mode:e="home",repoPath:s=null,fromRepoName:g=null,prefillFromSession:y=null}){let[v,j]=(0,a.useState)(!1),[w,N]=(0,a.useState)(!1),[S,el]=(0,a.useState)(!1),[er,ei]=(0,a.useState)(!1),[en,ec]=(0,a.useState)(""),[eo,ed]=(0,a.useState)("auto"),[em,eu]=(0,a.useState)(null),[ep,eh]=(0,a.useState)(!1),[ex,ef]=(0,a.useState)(!1),[eb,eg]=(0,a.useState)(null),[ey,ev]=(0,a.useState)(null),[ej,ew]=(0,a.useState)(null),[eN,eS]=(0,a.useState)("auto"),[ek,eC]=(0,a.useState)([]),eR=(0,J.useRouter)(),[eM,eD]=(0,a.useState)([]),[eL,eP]=(0,a.useState)(""),[eF,eE]=(0,a.useState)([]),[e$,eU]=(0,a.useState)([]),[eA,eT]=(0,a.useState)(null),[eI,eK]=(0,a.useState)(""),[eG,eO]=(0,a.useState)(""),[ez,eB]=(0,a.useState)(""),[eH,eV]=(0,a.useState)(!1),[e_,eq]=(0,a.useState)(""),[eW,eY]=(0,a.useState)(""),[eJ,eQ]=(0,a.useState)("fast"),[eX,eZ]=(0,a.useState)([]),[e0,e1]=(0,a.useState)([]),[e2,e3]=(0,a.useState)(null),[e4,e6]=(0,a.useState)(!1),[e5,e8]=(0,a.useState)(!1),[e7,e9]=(0,a.useState)(null),[te,tt]=(0,a.useState)(null),[ta,ts]=(0,a.useState)(!1),[tl,tr]=(0,a.useState)(!1),[ti,tn]=(0,a.useState)(!1),[tc,to]=(0,a.useState)(null),[td,tm]=(0,a.useState)(!1),[tu,tp]=(0,a.useState)(null),[th,tx]=(0,a.useState)(""),[tf,tb]=(0,a.useState)(!1),[tg,ty]=(0,a.useState)(null),[tv,tj]=(0,a.useState)(null),[tw,tN]=(0,a.useState)(!1),[tS,tk]=(0,a.useState)(!1),tC=(0,a.useRef)(null),tR=eA&&eI?`Show Session Setup (${eA.name} / ${eI})`:"Show Session Setup",tM=(0,a.useCallback)(()=>{(0,Q.notifySessionsUpdated)()},[]),tD=(0,a.useCallback)(async(e=ey)=>{try{let[t,a]=await Promise.all([H(),e?H(e):Promise.resolve([])]);eU(t),e&&eE(a)}catch(e){console.error("Failed to refresh sessions",e)}},[ey]),tL=(0,a.useCallback)(e=>"gemini"===e||"codex"===e||"agent"===e?e:null,[]),tP=(0,a.useCallback)((e,t=ek)=>{let a=eb?.repoSettings?.[e];if(!a)return"auto";if(a.credentialId)return a.credentialId;let s=a.credentialPreference;if("github"===s||"gitlab"===s){let e=t.find(e=>e.type===s);if(e)return e.id}return"auto"},[eb,ek]),tF=(0,a.useCallback)(e=>{let t=eb?.repoSettings?.[e];if(!t)return"Auto";if(t.credentialId){let e=ek.find(e=>e.id===t.credentialId);return e?Z(e):"Selected credential"}return"github"===t.credentialPreference?"GitHub (legacy)":"gitlab"===t.credentialPreference?"GitLab (legacy)":"Auto"},[eb,ek]),tE=(0,a.useCallback)(()=>{tS||(el(!1),ew(null),eS("auto"),tj(null),tN(!1))},[tS]),t$=(0,a.useCallback)(()=>{ei(!0),ec(""),ed("auto"),eu(null),ef(!0),(async()=>{try{let e=await (0,Y.listCredentials)();if(!e.success)return void eu(e.error);eC(e.credentials)}catch(e){console.error(e),eu("Failed to load credentials.")}finally{ef(!1)}})()},[]),tU=(0,a.useCallback)(()=>{ep||(ei(!1),ec(""),ed("auto"),eu(null),ef(!1))},[ep]);(0,a.useEffect)(()=>{(async()=>{try{let[e,t,a]=await Promise.all([(0,_.getConfig)(),H(),(0,Y.listCredentials)()]);eg(e),eU(t),a.success&&eC(a.credentials)}catch(e){console.error("Failed to load data",e)}finally{tr(!0)}})()},[]),(0,a.useEffect)(()=>{if("new"===e)try{let e=window.localStorage.getItem(et);("fast"===e||"plan"===e)&&eQ(e)}catch{}},[e]),(0,a.useEffect)(()=>{let t=()=>{tD("new"===e?ey:null)},a=e=>{e.key===Q.SESSIONS_UPDATED_STORAGE_KEY&&t()},s=()=>{t()},l=()=>{t()};return window.addEventListener("storage",a),window.addEventListener("focus",s),window.addEventListener(Q.SESSIONS_UPDATED_EVENT,l),()=>{window.removeEventListener("storage",a),window.removeEventListener("focus",s),window.removeEventListener(Q.SESSIONS_UPDATED_EVENT,l)}},[e,tD,ey]);let tA=async e=>{ev(e),t7([]),await tG(e),await tz(e),await tD(e)},tT=async t=>{e8(!0),tt(null);try{if(!await M(t))return tt("Selected directory is not a valid git repository."),!1;let a=[...(eb||await (0,_.getConfig)()).recentRepos];a.includes(t)?a=[t,...a.filter(e=>e!==t)]:a.unshift(t);let s=await (0,q.updateConfig)({recentRepos:a});if(eg(s),j(!1),"home"===e)return eR.push(`/new?repo=${encodeURIComponent(t)}`),!0;return await tA(t),!0}catch(e){return console.error(e),tt("Failed to open repository."),!1}finally{e8(!1)}},tI=async()=>{if(ep)return;let e=en.trim();if(!e)return void eu("Please enter a remote repository URL.");eh(!0),eu(null),tt(null);try{let t=await I(e,"auto"===eo?null:eo);if(!t.success||!t.repoPath)return void eu(t.error||"Failed to clone repository.");if(!await tT(t.repoPath))return void eu("Repository was cloned, but failed to open it.");ei(!1),ec(""),ed("auto"),eu(null)}catch(e){console.error(e),eu("Failed to clone repository.")}finally{eh(!1)}},tK=async t=>{if("new"!==e)return;let a=t.target.value;if(!a||a===ey||!await tT(a))return;let s=new URLSearchParams;s.set("repo",a),y&&s.set("prefillFromSession",y),eR.replace(`/new?${s.toString()}`)};(0,a.useEffect)(()=>{if("new"===e){if(!s){ev(null),eE([]),eD([]),eP("");return}s!==ey&&tT(s)}},[e,s,ey]),(0,a.useEffect)(()=>{if("new"!==e)return;if(s)return void ts(!1);let t=g?.trim()??"";if(!t)return void ts(!1);let a=!1;return(async()=>{tt(null),ts(!0);let e=await K(t);if(a)return;if(!e.success){tt(e.error||"Failed to search repositories."),ts(!1);return}if(!e.repoPath){tt(`Could not find a matching repository for "${t}".`),ts(!1);return}let s=new URLSearchParams;s.set("repo",e.repoPath),y&&s.set("prefillFromSession",y),eR.replace(`/new?${s.toString()}`)})(),()=>{a=!0}},[g,e,y,s,eR]),(0,a.useEffect)(()=>{e6(!1),e1([]),e3(null)},[y]),(0,a.useEffect)(()=>{if("new"!==e||!ey||!y||e4)return;let t=!1;return(async()=>{let e=await B(y);if(t)return;if(!e.success||!e.context){e.error&&tt(e.error),e6(!0);return}let a=e.context;if(a.repoPath!==ey)return e6(!0);let s=ee.find(e=>e.cli===a.agentProvider);s&&(eT(s),a.model&&("auto"===a.model||s.models.some(e=>e.id===a.model))?eK(a.model):eK("auto")),eY(a.title||""),eq(a.initialMessage||""),e1(a.attachmentNames||[]),e3(a.sourceSessionName),eV(!0),e6(!0)})(),()=>{t=!0}},[e4,e,y,ey]);let tG=async e=>{let t=eb||await (0,_.getConfig)();eb||eg(t);let a=t.repoSettings[e]||{},s=a.agentProvider,l=a.agentModel,r=a.startupScript,i=a.devServerScript;if(s){let e=ee.find(e=>e.cli===s);e?(eT(e),l&&("auto"===l||e.models.some(e=>e.id===l))?eK(l):eK("auto")):(eT(ee[0]),eK("auto"))}else eT(ee[0]),eK("auto");null!=r?eO(r):eO(await F(e)),null!=i?eB(i):eB(await E(e))},tO=async e=>{eg(await (0,q.updateConfig)({defaultRoot:e})),N(!1)},tz=async e=>{try{let t=await D(e);eD(t);let a=((eb||await (0,_.getConfig)()).repoSettings[e]||{}).lastBranch,s=t.find(e=>e.current)?.name;if(a&&t.some(e=>e.name===a)){if(eP(a),a!==s)try{await L(e,a);let t=await D(e);eD(t)}catch(e){console.warn("Could not auto-checkout to remembered branch",e),s&&eP(s)}}else s&&eP(s)}catch(e){console.error("Failed to load branches",e),tt("Failed to load branches.")}},tB=async e=>{let t=e.target.value;if(ey){e8(!0);try{await L(ey,t),eP(t);let e=await W(ey,{lastBranch:t});eg(e);let a=await D(ey);eD(a)}catch{tt(`Failed to checkout branch ${t}`)}finally{e8(!1)}}},tH=async e=>{let t=e.target.value,a=ee.find(e=>e.cli===t);if(a&&ey){eT(a);let e="auto";eK(e),eg(await W(ey,{agentProvider:a.cli,agentModel:e}))}},tV=async e=>{let t=e.target.value;eK(t),ey&&eg(await W(ey,{agentModel:t}))},t_=async e=>{eO(e.target.value)},tq=async()=>{ey&&eg(await W(ey,{startupScript:eG}))},tW=async e=>{ey&&eg(await W(ey,{devServerScript:e}))},tY=async()=>{await tW(ez)},tJ=(0,a.useCallback)((e,t)=>{if(e.name&&e.name.trim().length>0)return e;let a=e.type&&e.type.split("/")[1]?.split("+")[0]||"bin";return new File([e],`pasted-file-${Date.now()}-${t+1}.${a}`,{type:e.type,lastModified:e.lastModified||Date.now()})},[]),tQ=(0,a.useCallback)(e=>{0!==e.length&&eZ(t=>{let a=new Map(t.map(e=>[e.name,e]));return e.forEach(e=>{a.set(e.name,e)}),Array.from(a.values())})},[]),[tX,tZ]=(0,a.useState)(!1),[t0,t1]=(0,a.useState)([]),[,t2]=(0,a.useState)(""),[t3,t4]=(0,a.useState)(0),[t6,t5]=(0,a.useState)(0),[t8,t7]=(0,a.useState)([]),t9=async e=>{let t=e.target.value,a=e.target.selectionStart;eq(t),t4(a);let s=t.substring(0,a),l=s.lastIndexOf("@");if(-1!==l){let e=s.substring(l+1);if(!/\s/.test(e)){if(t2(e),tZ(!0),ey){var r;let t,a=t8;0===t8.length&&t7(a=await $(ey)),r=a,t=e.toLowerCase(),t1([...[...eX.map(e=>e.name),...e0].filter(e=>e.toLowerCase().includes(t)),...r.filter(e=>e.toLowerCase().includes(t)).slice(0,20)]),t5(0)}return}}tZ(!1)},ae=e=>{let t=e_.substring(0,t3).lastIndexOf("@");if(-1!==t){let a=e_.substring(0,t),s=e_.substring(t3);eq(`${a}@${e} ${s}`),tZ(!1)}};(0,a.useEffect)(()=>{if("new"!==e||!ey)return;let t=e=>{let t=e.clipboardData;if(!t)return;let a=Array.from(t.items).filter(e=>"file"===e.kind).map(e=>e.getAsFile()).filter(e=>null!==e),s=(a.length>0?a:Array.from(t.files)).map((e,t)=>tJ(e,t));0!==s.length&&(e.preventDefault(),tQ(s))};return window.addEventListener("paste",t),()=>{window.removeEventListener("paste",t)}},[tQ,e,tJ,ey]);let at=async(e,t)=>{if(e.stopPropagation(),eb){let e=eb.recentRepos.filter(e=>e!==t);eg(await (0,q.updateConfig)({recentRepos:e}))}},aa=async(e,t)=>{e.stopPropagation(),ew(t),eS(tP(t)),tj(null),el(!0),tN(!0);try{let e=await (0,Y.listCredentials)();e.success?(eC(e.credentials),eS(tP(t,e.credentials))):(tj(e.error),eC([]))}catch(e){console.error(e),tj("Failed to load credentials."),eC([])}finally{tN(!1)}},as=async()=>{if(!ej)return;let e="auto"===eN?null:eN;if(e&&!ek.some(t=>t.id===e))return void tj("Selected credential no longer exists. Please choose another credential.");tk(!0),tj(null);try{let t=await W(ej,{credentialId:e,credentialPreference:void 0});eg(t),tE()}catch(e){console.error(e),tj("Failed to save repository settings.")}finally{tk(!1)}},al=(0,a.useCallback)(()=>{if(!td||!th||!tC.current)return;let e=tC.current,t=(a=0)=>{if(a>40)return void ty("Timed out while waiting for terminal to initialize.");try{let s=e.contentWindow;if(s?.term){s.term.paste(`${th}\r`),tb(!0),ty(null),s.focus();return}setTimeout(()=>t(a+1),300)}catch(e){console.error("Failed to inject login command into terminal iframe:",e),ty("Could not access ttyd terminal. Ensure ttyd is running and try again.")}};setTimeout(()=>t(),500)},[td,th]),ar=(0,a.useCallback)(async()=>{let e=tL(eA?.cli);if(!e)return!0;let t=await A(e);if(!t.success)return tt(t.error||`Failed to verify ${es[e]} installation status.`),!1;if(t.installed)return!0;tn(!0),to(e),tt(null);let a=await T(e);if(tn(!1),to(null),!a.success)return tt(a.error||`Failed to install ${es[e]}.`),!1;let s=await (0,P.startTtydProcess)();return s.success?(tp(e),tx(ea[e]),tb(!1),ty(null),tm(!0)):tt(s.error||"Failed to start ttyd"),!1},[eA?.cli,tL]),ai=async(e={})=>{if(ey){e8(!0),tt(null);try{if(!e.skipAgentSetup&&!await ar())return void e8(!1);let t=ez.trim();!t&&(t=await E(ey))&&eB(t),await tq(),await tW(t);let a=await (0,P.startTtydProcess)();if(!a.success){tt(a.error||"Failed to start ttyd"),e8(!1);return}let s=await O(ey,eL||"main",{agent:eA?.cli||"agent",model:eI||"",title:eW,devServerScript:t||void 0});if(s.success&&s.sessionName&&s.worktreePath&&s.branchName){let e=[],t=[];if(eX.length>0){let t=new FormData;eX.forEach(e=>t.append(e.name,e)),e=await (0,U.saveAttachments)(s.worktreePath,t)}if(e2&&e0.length>0){let e=await G(e2,s.worktreePath,e0);if(!e.success){tt(e.error||"Failed to carry over attachments from source session"),e8(!1);return}t=e.copiedAttachmentNames}let a=Array.from(new Set([...e,...t])),l=e_.trim(),r=l;r=r.replace(/@(\S+)/g,(e,t)=>a.includes(t)?`${s.worktreePath}-attachments/${t}`:t);let i=await V(s.sessionName,{title:eW||void 0,initialMessage:r||void 0,rawInitialMessage:l||void 0,startupScript:eG||void 0,attachmentNames:a,agentProvider:eA?.cli||"agent",model:eI||"",sessionMode:eJ});if(!i.success){tt(i.error||"Failed to save session context"),e8(!1);return}let n=`/session/${s.sessionName}`;tM(),eR.push(n),e8(!1)}else tt(s.error||"Failed to create session worktree"),e8(!1)}catch(e){console.error(e),tt("Failed to start session"),e8(!1)}}},an=()=>{ai()},ac=(0,a.useCallback)(()=>{tm(!1),tp(null),tx(""),tb(!1),ty(null)},[]),ao=async()=>{ac(),await ai({skipAgentSetup:!0})};(0,C.useDialogKeyboardShortcuts)({enabled:"new"===e&&td&&!!tu,onConfirm:ao,onDismiss:ac,canConfirm:!e5}),(0,C.useDialogKeyboardShortcuts)({enabled:"home"===e&&S&&!!ej,onConfirm:as,onDismiss:tE,canConfirm:!tS}),(0,C.useDialogKeyboardShortcuts)({enabled:"home"===e&&er,onConfirm:tI,onDismiss:tU,canConfirm:!ep&&en.trim().length>0&&!ex});let ad=async e=>{if(ey){e8(!0);try{let t=await (0,P.startTtydProcess)();if(!t.success){tt(t.error||"Failed to start ttyd"),e8(!1);return}let a=`/session/${e.sessionName}`;eR.push(a),e8(!1)}catch(e){console.error(e),tt("Failed to resume session"),e8(!1)}}},am=async e=>{if(ey&&confirm(`Delete session "${e.sessionName}"?
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,5951,e=>{"use strict";var t=e.i(43476),a=e.i(71645),s=e.i(75254);let l=(0,s.default)("folder-git-2",[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);var r=e.i(55716),i=e.i(7233);let n=(0,s.default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),c=(0,s.default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),o=(0,s.default)("folder-cog",[["path",{d:"M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3",key:"128dxu"}],["path",{d:"m14.305 19.53.923-.382",key:"3m78fa"}],["path",{d:"m15.228 16.852-.923-.383",key:"npixar"}],["path",{d:"m16.852 15.228-.383-.923",key:"5xggr7"}],["path",{d:"m16.852 20.772-.383.924",key:"dpfhf9"}],["path",{d:"m19.148 15.228.383-.923",key:"1reyyz"}],["path",{d:"m19.53 21.696-.382-.924",key:"1goivc"}],["path",{d:"m20.772 16.852.924-.383",key:"htqkph"}],["path",{d:"m20.772 19.148.924.383",key:"9w9pjp"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]]),d=(0,s.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),m=(0,s.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var u=e.i(27612),p=e.i(31343),h=e.i(65261);let x=(0,s.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var f=e.i(78917);let b=(0,s.default)("cloud-download",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]);var g=e.i(95187);let y=(0,g.createServerReference)("40e86f65dddc3e4892a55bce7304157ebe1ac298d9",g.callServer,void 0,g.findSourceMapURL,"checkDirectoryAccessible"),v=(0,g.createServerReference)("4071dd27fbdd25bab02b32c1dd7cae0c7aabe1d331",g.callServer,void 0,g.findSourceMapURL,"listDirectories");var j=e.i(48017),w=e.i(27025),N=e.i(71689);let S=(0,s.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var k=e.i(81016),C=e.i(43733);function R({title:e,initialPath:s,onSelect:l,onCancel:r,checkRepo:i}){let[n,c]=(0,a.useState)(""),[o,d]=(0,a.useState)(""),[m,u]=(0,a.useState)([]),[p,h]=(0,a.useState)(!1),[x,f]=(0,a.useState)(null);(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await (0,j.getHomeDirectory)();if(!e)return;d(t),c(s||t)}catch(t){if(console.error("Failed to resolve home directory:",t),!e)return;f("Failed to access your home directory."),c(s||"/")}})(),()=>{e=!1}},[s]),(0,a.useEffect)(()=>{if(!n)return;let e=!0;return(async()=>{h(!0),f(null);try{let t=await v(n);if(!e)return;if(0===t.length&&o&&n!==o){let t=await y(n);if(!e)return;if(!t){f(`Could not access "${n}". Showing home directory.`),c(o);return}}let a=t.map(e=>({name:e.name,path:e.path,isDirectory:e.isDirectory,isGitRepo:e.isGitRepo}));u(a)}catch(t){if(console.error(t),!e)return;if(o&&n!==o){f(`Could not access "${n}". Showing home directory.`),c(o);return}u([]),f("Failed to load directory contents")}finally{e&&h(!1)}})(),()=>{e=!1}},[n,o]);let b=(0,a.useCallback)(async e=>{if(i&&!await i(e)){f("Selected directory is not a valid git repository."),setTimeout(()=>f(null),3e3);return}await l(e)},[i,l]),g=(0,a.useCallback)(async()=>{await b(n)},[n,b]);return(0,C.useDialogKeyboardShortcuts)({onConfirm:g,onDismiss:r,canConfirm:!!n}),(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",children:(0,t.jsxs)("div",{className:"bg-base-200 rounded-lg shadow-xl w-full max-w-3xl h-[80vh] flex flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 border-b border-base-300",children:[(0,t.jsxs)("h2",{className:"text-xl font-bold flex items-center gap-2",children:[(0,t.jsx)(w.Folder,{className:"w-5 h-5"}),e||"Browse Local Repository"]}),(0,t.jsx)("button",{onClick:r,className:"btn btn-sm btn-ghost btn-circle",children:"✕"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-base-300",children:[(0,t.jsx)("button",{onClick:()=>{let e=(0,k.getDirName)(n);e&&e!==n&&c(e)},className:"btn btn-sm btn-square btn-ghost",title:"Go Up",disabled:"/"===n||!n,children:(0,t.jsx)(N.ArrowLeft,{className:"w-4 h-4"})}),(0,t.jsx)("div",{className:"flex-1 overflow-x-auto whitespace-nowrap px-2 font-mono text-sm",children:n}),(0,t.jsx)("button",{onClick:g,className:"btn btn-sm btn-primary",children:"Select Current Folder"})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-2",children:p?(0,t.jsx)("div",{className:"flex justify-center items-center h-full",children:(0,t.jsx)("span",{className:"loading loading-spinner loading-lg"})}):x?(0,t.jsx)("div",{className:"alert alert-error",children:x}):0===m.length?(0,t.jsx)("div",{className:"text-center text-base-content/50 mt-10",children:"Empty directory"}):(0,t.jsx)("div",{className:"grid grid-cols-1 gap-1",children:m.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 hover:bg-base-100 rounded-md cursor-pointer transition-colors",onClick:()=>{c(e.path)},children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 overflow-hidden",children:[(0,t.jsx)(w.Folder,{className:`w-5 h-5 ${e.isGitRepo?"text-primary":"text-base-content/70"}`}),(0,t.jsx)("span",{className:"truncate",children:e.name}),e.isGitRepo&&(0,t.jsx)("span",{className:"badge badge-xs badge-primary",children:"git"})]}),e.isGitRepo&&(0,t.jsxs)("button",{className:"btn btn-xs btn-primary",onClick:t=>{t.stopPropagation(),b(e.path)},title:`Select ${e.name}`,children:[(0,t.jsx)(S,{className:"w-3 h-3"}),"Select"]})]},e.path))})}),(0,t.jsx)("div",{className:"p-3 border-t border-base-300 text-xs text-base-content/50 text-center",children:'Navigate to a folder and click "Select Current Folder" to choose it.'})]})})}let M=(0,g.createServerReference)("40b539ada759c41a4d5b2f94373b454d817b8b5853",g.callServer,void 0,g.findSourceMapURL,"checkIsGitRepo"),D=(0,g.createServerReference)("4070bef6e368a632fdfb8653bf0b2b46771a1537a1",g.callServer,void 0,g.findSourceMapURL,"getBranches"),L=(0,g.createServerReference)("602e4b1ef0f5c65211b613592fcc29fe30dd19ddf2",g.callServer,void 0,g.findSourceMapURL,"checkoutBranch");var P=e.i(44288);let F=(0,g.createServerReference)("7f56e97b91b82b114b2b888f7669f74f3a3919ceef",g.callServer,void 0,g.findSourceMapURL,"getStartupScript"),E=(0,g.createServerReference)("7f6a15dd7e521d79dd61908dc784fd2013c4bc39b0",g.callServer,void 0,g.findSourceMapURL,"getDefaultDevServerScript"),$=(0,g.createServerReference)("7f825383c336ac9922840528e36687b255cb8ad82e",g.callServer,void 0,g.findSourceMapURL,"listRepoFiles");var U=e.i(62833);let A=(0,g.createServerReference)("40b2586fc78398531dbe936975765befa293dfc724",g.callServer,void 0,g.findSourceMapURL,"checkAgentCliInstalled"),T=(0,g.createServerReference)("408d0a7a715dd00211611eafe71c0bd64c256c7d0d",g.callServer,void 0,g.findSourceMapURL,"installAgentCli"),I=(0,g.createServerReference)("605c2869ff7584c223302da590d721c1edb79926cd",g.callServer,void 0,g.findSourceMapURL,"cloneRemoteRepository"),K=(0,g.createServerReference)("402785bac6d7a4ec171604f890489f74aa43e7c664",g.callServer,void 0,g.findSourceMapURL,"resolveRepositoryByName"),G=(0,g.createServerReference)("70e7c32ce12f69479fc1538c2ab2717fd71fd9a046",g.callServer,void 0,g.findSourceMapURL,"copySessionAttachments"),O=(0,g.createServerReference)("704c6db357061b7c99acb44a58eda1bf6d4c865893",g.callServer,void 0,g.findSourceMapURL,"createSession"),z=(0,g.createServerReference)("4074be8f086727129c5a1284fac149576065894991",g.callServer,void 0,g.findSourceMapURL,"deleteSession"),B=(0,g.createServerReference)("40a8fbf268edeeab3bb0b8c6d56461c83f24384eb5",g.callServer,void 0,g.findSourceMapURL,"getSessionPrefillContext"),H=(0,g.createServerReference)("40b0d902b232cda8947813ec2182844c0be8fbe1c9",g.callServer,void 0,g.findSourceMapURL,"listSessions"),V=(0,g.createServerReference)("600c4c4f9bb1a5ab32de387bdbd9d9718fe5ffe1ca",g.callServer,void 0,g.findSourceMapURL,"saveSessionLaunchContext");var _=e.i(97550),q=e.i(80730);let W=(0,g.createServerReference)("602a22c8f189f56968fc888dd45d1b76fe46a65ed1",g.callServer,void 0,g.findSourceMapURL,"updateRepoSettings");var Y=e.i(29031),J=e.i(18566),Q=e.i(63671),X=e.i(57688);function Z(e){if("github"===e.type)return`GitHub - ${e.username}`;let t=e.serverUrl;try{t=new URL(e.serverUrl).host}catch{}return`GitLab - ${e.username} @ ${t}`}let ee=e.i(35027).default,et="viba:new-session-mode",ea={gemini:"gemini",codex:"codex",agent:"agent"},es={gemini:"Gemini CLI",codex:"Codex CLI",agent:"Cursor Agent CLI"};function el({mode:e="home",repoPath:s=null,fromRepoName:g=null,prefillFromSession:y=null}){let[v,j]=(0,a.useState)(!1),[w,N]=(0,a.useState)(!1),[S,el]=(0,a.useState)(!1),[er,ei]=(0,a.useState)(!1),[en,ec]=(0,a.useState)(""),[eo,ed]=(0,a.useState)("auto"),[em,eu]=(0,a.useState)(null),[ep,eh]=(0,a.useState)(!1),[ex,ef]=(0,a.useState)(!1),[eb,eg]=(0,a.useState)(null),[ey,ev]=(0,a.useState)(null),[ej,ew]=(0,a.useState)(null),[eN,eS]=(0,a.useState)("auto"),[ek,eC]=(0,a.useState)([]),eR=(0,J.useRouter)(),[eM,eD]=(0,a.useState)([]),[eL,eP]=(0,a.useState)(""),[eF,eE]=(0,a.useState)([]),[e$,eU]=(0,a.useState)([]),[eA,eT]=(0,a.useState)(null),[eI,eK]=(0,a.useState)(""),[eG,eO]=(0,a.useState)(""),[ez,eB]=(0,a.useState)(""),[eH,eV]=(0,a.useState)(!1),[e_,eq]=(0,a.useState)(""),[eW,eY]=(0,a.useState)(""),[eJ,eQ]=(0,a.useState)("fast"),[eX,eZ]=(0,a.useState)([]),[e0,e2]=(0,a.useState)([]),[e1,e3]=(0,a.useState)(null),[e4,e6]=(0,a.useState)(!1),[e5,e7]=(0,a.useState)(!1),[e8,e9]=(0,a.useState)(null),[te,tt]=(0,a.useState)(null),[ta,ts]=(0,a.useState)(!1),[tl,tr]=(0,a.useState)(!1),[ti,tn]=(0,a.useState)(!1),[tc,to]=(0,a.useState)(null),[td,tm]=(0,a.useState)(!1),[tu,tp]=(0,a.useState)(null),[th,tx]=(0,a.useState)(""),[tf,tb]=(0,a.useState)(!1),[tg,ty]=(0,a.useState)(null),[tv,tj]=(0,a.useState)(null),[tw,tN]=(0,a.useState)(!1),[tS,tk]=(0,a.useState)(!1),tC=(0,a.useRef)(null),tR=eA&&eI?`Show Session Setup (${eA.name} / ${eI})`:"Show Session Setup",tM=(0,a.useCallback)(()=>{(0,Q.notifySessionsUpdated)()},[]),tD=(0,a.useCallback)(async(e=ey)=>{try{let[t,a]=await Promise.all([H(),e?H(e):Promise.resolve([])]);eU(t),e&&eE(a)}catch(e){console.error("Failed to refresh sessions",e)}},[ey]),tL=(0,a.useCallback)(e=>"gemini"===e||"codex"===e||"agent"===e?e:null,[]),tP=(0,a.useCallback)((e,t=ek)=>{let a=eb?.repoSettings?.[e];if(!a)return"auto";if(a.credentialId)return a.credentialId;let s=a.credentialPreference;if("github"===s||"gitlab"===s){let e=t.find(e=>e.type===s);if(e)return e.id}return"auto"},[eb,ek]),tF=(0,a.useCallback)(e=>{let t=eb?.repoSettings?.[e];if(!t)return"Auto";if(t.credentialId){let e=ek.find(e=>e.id===t.credentialId);return e?Z(e):"Selected credential"}return"github"===t.credentialPreference?"GitHub (legacy)":"gitlab"===t.credentialPreference?"GitLab (legacy)":"Auto"},[eb,ek]),tE=(0,a.useCallback)(()=>{tS||(el(!1),ew(null),eS("auto"),tj(null),tN(!1))},[tS]),t$=(0,a.useCallback)(()=>{ei(!0),ec(""),ed("auto"),eu(null),ef(!0),(async()=>{try{let e=await (0,Y.listCredentials)();if(!e.success)return void eu(e.error);eC(e.credentials)}catch(e){console.error(e),eu("Failed to load credentials.")}finally{ef(!1)}})()},[]),tU=(0,a.useCallback)(()=>{ep||(ei(!1),ec(""),ed("auto"),eu(null),ef(!1))},[ep]);(0,a.useEffect)(()=>{(async()=>{try{let[e,t,a]=await Promise.all([(0,_.getConfig)(),H(),(0,Y.listCredentials)()]);eg(e),eU(t),a.success&&eC(a.credentials)}catch(e){console.error("Failed to load data",e)}finally{tr(!0)}})()},[]),(0,a.useEffect)(()=>{if("new"===e)try{let e=window.localStorage.getItem(et);("fast"===e||"plan"===e)&&eQ(e)}catch{}},[e]),(0,a.useEffect)(()=>{let t=()=>{tD("new"===e?ey:null)},a=e=>{e.key===Q.SESSIONS_UPDATED_STORAGE_KEY&&t()},s=()=>{t()},l=()=>{t()};return window.addEventListener("storage",a),window.addEventListener("focus",s),window.addEventListener(Q.SESSIONS_UPDATED_EVENT,l),()=>{window.removeEventListener("storage",a),window.removeEventListener("focus",s),window.removeEventListener(Q.SESSIONS_UPDATED_EVENT,l)}},[e,tD,ey]);let tA=async e=>{ev(e),t8([]),await tG(e),await tz(e),await tD(e)},tT=async t=>{e7(!0),tt(null);try{if(!await M(t))return tt("Selected directory is not a valid git repository."),!1;let a=[...(eb||await (0,_.getConfig)()).recentRepos];a.includes(t)?a=[t,...a.filter(e=>e!==t)]:a.unshift(t);let s=await (0,q.updateConfig)({recentRepos:a});if(eg(s),j(!1),"home"===e)return eR.push(`/new?repo=${encodeURIComponent(t)}`),!0;return await tA(t),!0}catch(e){return console.error(e),tt("Failed to open repository."),!1}finally{e7(!1)}},tI=async()=>{if(ep)return;let e=en.trim();if(!e)return void eu("Please enter a remote repository URL.");eh(!0),eu(null),tt(null);try{let t=await I(e,"auto"===eo?null:eo);if(!t.success||!t.repoPath)return void eu(t.error||"Failed to clone repository.");if(!await tT(t.repoPath))return void eu("Repository was cloned, but failed to open it.");ei(!1),ec(""),ed("auto"),eu(null)}catch(e){console.error(e),eu("Failed to clone repository.")}finally{eh(!1)}},tK=async t=>{if("new"!==e)return;let a=t.target.value;if(!a||a===ey||!await tT(a))return;let s=new URLSearchParams;s.set("repo",a),y&&s.set("prefillFromSession",y),eR.replace(`/new?${s.toString()}`)};(0,a.useEffect)(()=>{if("new"===e){if(!s){ev(null),eE([]),eD([]),eP("");return}s!==ey&&tT(s)}},[e,s,ey]),(0,a.useEffect)(()=>{if("new"!==e)return;if(s)return void ts(!1);let t=g?.trim()??"";if(!t)return void ts(!1);let a=!1;return(async()=>{tt(null),ts(!0);let e=await K(t);if(a)return;if(!e.success){tt(e.error||"Failed to search repositories."),ts(!1);return}if(!e.repoPath){tt(`Could not find a matching repository for "${t}".`),ts(!1);return}let s=new URLSearchParams;s.set("repo",e.repoPath),y&&s.set("prefillFromSession",y),eR.replace(`/new?${s.toString()}`)})(),()=>{a=!0}},[g,e,y,s,eR]),(0,a.useEffect)(()=>{e6(!1),e2([]),e3(null)},[y]),(0,a.useEffect)(()=>{if("new"!==e||!ey||!y||e4)return;let t=!1;return(async()=>{let e=await B(y);if(t)return;if(!e.success||!e.context){e.error&&tt(e.error),e6(!0);return}let a=e.context;if(a.repoPath!==ey)return e6(!0);let s=ee.find(e=>e.cli===a.agentProvider);s&&(eT(s),a.model&&("auto"===a.model||s.models.some(e=>e.id===a.model))?eK(a.model):eK("auto")),eY(a.title||""),eq(a.initialMessage||""),e2(a.attachmentNames||[]),e3(a.sourceSessionName),eV(!0),e6(!0)})(),()=>{t=!0}},[e4,e,y,ey]);let tG=async e=>{let t=eb||await (0,_.getConfig)();eb||eg(t);let a=t.repoSettings[e]||{},s=a.agentProvider,l=a.agentModel,r=a.startupScript,i=a.devServerScript;if(s){let e=ee.find(e=>e.cli===s);e?(eT(e),l&&("auto"===l||e.models.some(e=>e.id===l))?eK(l):eK("auto")):(eT(ee[0]),eK("auto"))}else eT(ee[0]),eK("auto");null!=r?eO(r):eO(await F(e)),null!=i?eB(i):eB(await E(e))},tO=async e=>{eg(await (0,q.updateConfig)({defaultRoot:e})),N(!1)},tz=async e=>{try{let t=await D(e);eD(t);let a=((eb||await (0,_.getConfig)()).repoSettings[e]||{}).lastBranch,s=t.find(e=>e.current)?.name;if(a&&t.some(e=>e.name===a)){if(eP(a),a!==s)try{await L(e,a);let t=await D(e);eD(t)}catch(e){console.warn("Could not auto-checkout to remembered branch",e),s&&eP(s)}}else s&&eP(s)}catch(e){console.error("Failed to load branches",e),tt("Failed to load branches.")}},tB=async e=>{let t=e.target.value;if(ey){e7(!0);try{await L(ey,t),eP(t);let e=await W(ey,{lastBranch:t});eg(e);let a=await D(ey);eD(a)}catch{tt(`Failed to checkout branch ${t}`)}finally{e7(!1)}}},tH=async e=>{let t=e.target.value,a=ee.find(e=>e.cli===t);if(a&&ey){eT(a);let e="auto";eK(e),eg(await W(ey,{agentProvider:a.cli,agentModel:e}))}},tV=async e=>{let t=e.target.value;eK(t),ey&&eg(await W(ey,{agentModel:t}))},t_=async e=>{eO(e.target.value)},tq=async()=>{ey&&eg(await W(ey,{startupScript:eG}))},tW=async e=>{ey&&eg(await W(ey,{devServerScript:e}))},tY=async()=>{await tW(ez)},tJ=(0,a.useCallback)((e,t)=>{if(e.name&&e.name.trim().length>0)return e;let a=e.type&&e.type.split("/")[1]?.split("+")[0]||"bin";return new File([e],`pasted-file-${Date.now()}-${t+1}.${a}`,{type:e.type,lastModified:e.lastModified||Date.now()})},[]),tQ=(0,a.useCallback)(e=>{0!==e.length&&eZ(t=>{let a=new Map(t.map(e=>[e.name,e]));return e.forEach(e=>{a.set(e.name,e)}),Array.from(a.values())})},[]),[tX,tZ]=(0,a.useState)(!1),[t0,t2]=(0,a.useState)([]),[,t1]=(0,a.useState)(""),[t3,t4]=(0,a.useState)(0),[t6,t5]=(0,a.useState)(0),[t7,t8]=(0,a.useState)([]),t9=async e=>{let t=e.target.value,a=e.target.selectionStart;eq(t),t4(a);let s=t.substring(0,a),l=s.lastIndexOf("@");if(-1!==l){let e=s.substring(l+1);if(!/\s/.test(e)){if(t1(e),tZ(!0),ey){var r;let t,a=t7;0===t7.length&&t8(a=await $(ey)),r=a,t=e.toLowerCase(),t2([...[...eX.map(e=>e.name),...e0].filter(e=>e.toLowerCase().includes(t)),...r.filter(e=>e.toLowerCase().includes(t)).slice(0,20)]),t5(0)}return}}tZ(!1)},ae=e=>{let t=e_.substring(0,t3).lastIndexOf("@");if(-1!==t){let a=e_.substring(0,t),s=e_.substring(t3);eq(`${a}@${e} ${s}`),tZ(!1)}};(0,a.useEffect)(()=>{if("new"!==e||!ey)return;let t=e=>{let t=e.clipboardData;if(!t)return;let a=Array.from(t.items).filter(e=>"file"===e.kind).map(e=>e.getAsFile()).filter(e=>null!==e),s=(a.length>0?a:Array.from(t.files)).map((e,t)=>tJ(e,t));0!==s.length&&(e.preventDefault(),tQ(s))};return window.addEventListener("paste",t),()=>{window.removeEventListener("paste",t)}},[tQ,e,tJ,ey]);let at=async(e,t)=>{if(e.stopPropagation(),eb){let e=eb.recentRepos.filter(e=>e!==t);eg(await (0,q.updateConfig)({recentRepos:e}))}},aa=async(e,t)=>{e.stopPropagation(),ew(t),eS(tP(t)),tj(null),el(!0),tN(!0);try{let e=await (0,Y.listCredentials)();e.success?(eC(e.credentials),eS(tP(t,e.credentials))):(tj(e.error),eC([]))}catch(e){console.error(e),tj("Failed to load credentials."),eC([])}finally{tN(!1)}},as=async()=>{if(!ej)return;let e="auto"===eN?null:eN;if(e&&!ek.some(t=>t.id===e))return void tj("Selected credential no longer exists. Please choose another credential.");tk(!0),tj(null);try{let t=await W(ej,{credentialId:e,credentialPreference:void 0});eg(t),tE()}catch(e){console.error(e),tj("Failed to save repository settings.")}finally{tk(!1)}},al=(0,a.useCallback)(()=>{if(!td||!th||!tC.current)return;let e=tC.current,t=(a=0)=>{if(a>40)return void ty("Timed out while waiting for terminal to initialize.");try{let s=e.contentWindow;if(s?.term){s.term.paste(`${th}\r`),tb(!0),ty(null),s.focus();return}setTimeout(()=>t(a+1),300)}catch(e){console.error("Failed to inject login command into terminal iframe:",e),ty("Could not access ttyd terminal. Ensure ttyd is running and try again.")}};setTimeout(()=>t(),500)},[td,th]),ar=(0,a.useCallback)(async()=>{let e=tL(eA?.cli);if(!e)return!0;let t=await A(e);if(!t.success)return tt(t.error||`Failed to verify ${es[e]} installation status.`),!1;if(t.installed)return!0;tn(!0),to(e),tt(null);let a=await T(e);if(tn(!1),to(null),!a.success)return tt(a.error||`Failed to install ${es[e]}.`),!1;let s=await (0,P.startTtydProcess)();return s.success?(tp(e),tx(ea[e]),tb(!1),ty(null),tm(!0)):tt(s.error||"Failed to start ttyd"),!1},[eA?.cli,tL]),ai=async(e={})=>{if(ey){e7(!0),tt(null);try{if(!e.skipAgentSetup&&!await ar())return void e7(!1);let t=ez.trim();!t&&(t=await E(ey))&&eB(t),await tq(),await tW(t);let a=await (0,P.startTtydProcess)();if(!a.success){tt(a.error||"Failed to start ttyd"),e7(!1);return}let s=await O(ey,eL||"main",{agent:eA?.cli||"agent",model:eI||"",title:eW,devServerScript:t||void 0});if(s.success&&s.sessionName&&s.worktreePath&&s.branchName){let e=[],t=[];if(eX.length>0){let t=new FormData;eX.forEach(e=>t.append(e.name,e)),e=await (0,U.saveAttachments)(s.worktreePath,t)}if(e1&&e0.length>0){let e=await G(e1,s.worktreePath,e0);if(!e.success){tt(e.error||"Failed to carry over attachments from source session"),e7(!1);return}t=e.copiedAttachmentNames}let a=Array.from(new Set([...e,...t])),l=e_.trim(),r=l;r=r.replace(/@(\S+)/g,(e,t)=>a.includes(t)?`${s.worktreePath}-attachments/${t}`:t);let i=await V(s.sessionName,{title:eW||void 0,initialMessage:r||void 0,rawInitialMessage:l||void 0,startupScript:eG||void 0,attachmentNames:a,agentProvider:eA?.cli||"agent",model:eI||"",sessionMode:eJ});if(!i.success){tt(i.error||"Failed to save session context"),e7(!1);return}let n=`/session/${s.sessionName}`;tM(),eR.push(n),e7(!1)}else tt(s.error||"Failed to create session worktree"),e7(!1)}catch(e){console.error(e),tt("Failed to start session"),e7(!1)}}},an=()=>{ai()},ac=(0,a.useCallback)(()=>{tm(!1),tp(null),tx(""),tb(!1),ty(null)},[]),ao=async()=>{ac(),await ai({skipAgentSetup:!0})};(0,C.useDialogKeyboardShortcuts)({enabled:"new"===e&&td&&!!tu,onConfirm:ao,onDismiss:ac,canConfirm:!e5}),(0,C.useDialogKeyboardShortcuts)({enabled:"home"===e&&S&&!!ej,onConfirm:as,onDismiss:tE,canConfirm:!tS}),(0,C.useDialogKeyboardShortcuts)({enabled:"home"===e&&er,onConfirm:tI,onDismiss:tU,canConfirm:!ep&&en.trim().length>0&&!ex});let ad=async e=>{if(ey){e7(!0);try{let t=await (0,P.startTtydProcess)();if(!t.success){tt(t.error||"Failed to start ttyd"),e7(!1);return}let a=`/session/${e.sessionName}`;eR.push(a),e7(!1)}catch(e){console.error(e),tt("Failed to resume session"),e7(!1)}}},am=async e=>{if(ey&&confirm(`Delete session "${e.sessionName}"?
|
|
2
2
|
|
|
3
|
-
This will remove the worktree, branch, and session metadata.`)){e9(e.sessionName),tt(null);try{let t=await z(e.sessionName);if(!t.success)return void tt(t.error||"Failed to delete session");let a=await H(ey);eE(a);let s=await H();eU(s),tM()}catch(e){console.error(e),tt("Failed to delete session")}finally{e9(null)}}},au=(0,a.useMemo)(()=>{let e=new Map;for(let t of e$)e.set(t.repoPath,(e.get(t.repoPath)??0)+1);return e},[e$]),ap=eb?.recentRepos??[],ah=ey?ap.includes(ey)?ap:[ey,...ap]:ap;return(0,t.jsxs)(t.Fragment,{children:["home"===e&&(0,t.jsx)("div",{className:"card w-full max-w-4xl bg-base-200 shadow-xl",children:(0,t.jsxs)("div",{className:"card-body",children:[(0,t.jsxs)("h2",{className:"card-title flex justify-between items-center",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(X.default,{src:"/icon.png",alt:"Viba",width:24,height:24,className:"rounded-sm"}),"Viba"]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("button",{className:"btn btn-ghost btn-sm gap-2",onClick:()=>eR.push("/credentials"),title:"Manage GitHub/GitLab credentials",children:[(0,t.jsx)(h.KeyRound,{className:"w-4 h-4"}),"Credentials"]}),(0,t.jsxs)("button",{className:"btn btn-ghost btn-sm gap-2",onClick:()=>N(!0),title:eb?.defaultRoot?`Default: ${eb.defaultRoot}`:"Set default browsing folder",children:[(0,t.jsx)(o,{className:"w-4 h-4"}),eb?.defaultRoot?"Change Default":"Set Default Root"]}),(0,t.jsxs)("button",{className:"btn btn-secondary btn-sm gap-2",onClick:t$,children:[(0,t.jsx)(b,{className:"w-4 h-4"})," Clone Remote Repo"]}),(0,t.jsxs)("button",{className:"btn btn-primary btn-sm gap-2",onClick:()=>j(!0),children:[(0,t.jsx)(i.Plus,{className:"w-4 h-4"})," Open Local Repo"]})]})]}),te&&(0,t.jsx)("div",{className:"alert alert-error text-sm py-2 px-3 mt-2",children:te}),(0,t.jsx)("div",{className:"mt-4 space-y-4",children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold opacity-70 uppercase tracking-wide",children:"Recent Repositories"}),tl?eb&&0!==eb.recentRepos.length?(0,t.jsx)("div",{className:"flex flex-col gap-2",children:eb.recentRepos.map(e=>{let a=tF(e),s=au.get(e)??0;return(0,t.jsxs)("div",{onClick:()=>tT(e),className:"flex items-center justify-between p-3 bg-base-100 hover:bg-base-300 rounded-md cursor-pointer group transition-all border border-base-300",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 overflow-hidden shrink min-w-0",children:[(0,t.jsx)(l,{className:"w-5 h-5 text-secondary shrink-0"}),(0,t.jsxs)("div",{className:"flex flex-col overflow-hidden",children:[(0,t.jsx)("span",{className:"font-medium truncate",children:(0,k.getBaseName)(e)}),(0,t.jsx)("span",{className:"text-xs opacity-50 truncate",children:e}),(0,t.jsxs)("span",{className:"text-[10px] opacity-60 mt-0.5",children:["Credential: ",a]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[s>0&&(0,t.jsx)("span",{className:"badge badge-sm badge-secondary",title:`${s} running session${1===s?"":"s"}`,children:s}),(0,t.jsx)("button",{onClick:t=>{aa(t,e)},className:"btn btn-circle btn-ghost btn-xs opacity-0 group-hover:opacity-100",title:"Repository settings",children:(0,t.jsx)(x,{className:"w-3 h-3"})}),(0,t.jsx)("button",{onClick:t=>at(t,e),className:"btn btn-circle btn-ghost btn-xs opacity-0 group-hover:opacity-100 text-error",title:"Remove from history",children:(0,t.jsx)(n,{className:"w-3 h-3"})}),(0,t.jsx)(c,{className:"w-4 h-4 opacity-30"})]})]},e)})}):(0,t.jsx)("div",{className:"text-center py-8 text-base-content/40 italic bg-base-100 rounded-lg",children:"No recent repositories found."}):(0,t.jsx)("div",{className:"flex items-center justify-center py-8 bg-base-100 rounded-lg",children:(0,t.jsx)("span",{className:"loading loading-spinner loading-md"})})]})})]})}),"home"===e&&S&&ej&&(0,t.jsx)("div",{className:"fixed inset-0 z-[1002] flex items-center justify-center bg-base-content/60 p-4",children:(0,t.jsx)("div",{className:"w-full max-w-xl rounded-xl border border-base-300 bg-base-100 shadow-2xl",children:(0,t.jsxs)("div",{className:"space-y-4 p-5 md:p-6",children:[(0,t.jsx)("h3",{className:"text-xl font-semibold",children:"Repository Settings"}),(0,t.jsx)("p",{className:"text-sm opacity-75",children:"Choose which credential this repository should use for authenticated Git operations."}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-xs uppercase tracking-wide opacity-70",children:"Repository"}),(0,t.jsx)("div",{className:"rounded-md border border-base-300 bg-base-200 px-3 py-2 font-mono text-xs break-all",children:ej})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-xs uppercase tracking-wide opacity-70",children:"Credential"}),(0,t.jsxs)("select",{className:"select select-bordered w-full",value:eN,onChange:e=>eS(e.target.value),disabled:tS,children:[(0,t.jsx)("option",{value:"auto",children:"Auto (match repository remote)"}),ek.map(e=>(0,t.jsx)("option",{value:e.id,children:Z(e)},e.id))]}),0===ek.length&&!tw&&(0,t.jsx)("div",{className:"text-xs opacity-60",children:"No credentials found. Add credentials from the Credentials page."})]}),tw&&(0,t.jsxs)("div",{className:"text-sm opacity-70 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Loading credentials..."]}),tv&&(0,t.jsx)("div",{className:"alert alert-error text-sm py-2",children:tv}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)("button",{className:"btn btn-ghost",onClick:tE,disabled:tS,children:"Cancel"}),(0,t.jsxs)("button",{className:"btn btn-primary",onClick:()=>void as(),disabled:tS||tw,children:[tS?(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}):null,"Save"]})]})]})})}),"home"===e&&er&&(0,t.jsx)("div",{className:"fixed inset-0 z-[1002] flex items-center justify-center bg-base-content/60 p-4",children:(0,t.jsx)("div",{className:"w-full max-w-xl rounded-xl border border-base-300 bg-base-100 shadow-2xl",children:(0,t.jsxs)("div",{className:"space-y-4 p-5 md:p-6",children:[(0,t.jsx)("h3",{className:"text-xl font-semibold",children:"Clone Remote Repository"}),(0,t.jsxs)("p",{className:"text-sm opacity-75",children:["Clone into ",(0,t.jsx)("span",{className:"font-mono",children:"~/.viba/repos"})," and open it as the selected repository."]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-xs uppercase tracking-wide opacity-70",children:"Remote URL"}),(0,t.jsx)("input",{className:"input input-bordered w-full font-mono text-sm",placeholder:"https://github.com/org/repo.git",value:en,onChange:e=>ec(e.target.value),disabled:ep})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-xs uppercase tracking-wide opacity-70",children:"Credential"}),(0,t.jsxs)("select",{className:"select select-bordered w-full",value:eo,onChange:e=>ed(e.target.value),disabled:ep||ex,children:[(0,t.jsx)("option",{value:"auto",children:"Auto (match repository remote)"}),ek.map(e=>(0,t.jsx)("option",{value:e.id,children:Z(e)},e.id))]}),0===ek.length&&!ex&&(0,t.jsx)("div",{className:"text-xs opacity-60",children:"No credentials found. Clone will use anonymous access unless remote auth is otherwise configured."})]}),ex&&(0,t.jsxs)("div",{className:"text-sm opacity-70 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Loading credentials..."]}),ep&&(0,t.jsxs)("div",{className:"alert py-2 text-sm flex items-center gap-2",children:[(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Cloning repository..."]}),em&&(0,t.jsx)("div",{className:"alert alert-error text-sm py-2",children:em}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)("button",{className:"btn btn-ghost",onClick:tU,disabled:ep,children:"Cancel"}),(0,t.jsxs)("button",{className:"btn btn-primary",onClick:()=>void tI(),disabled:ep||!en.trim()||ex,children:[ep?(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}):null,"Clone"]})]})]})})}),"new"===e&&ey&&(0,t.jsxs)("div",{className:"w-full max-w-6xl space-y-4",children:[te&&(0,t.jsx)("div",{className:"alert alert-error text-sm py-2 px-3",children:te}),(0,t.jsxs)("div",{className:"flex flex-col gap-4 w-full",children:[(0,t.jsx)("div",{className:"card w-full bg-base-200 shadow-xl",children:(0,t.jsxs)("div",{className:"card-body",children:[(0,t.jsxs)("h2",{className:"card-title flex justify-between items-center",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l,{className:"w-6 h-6 text-primary"}),"Git Repository Selector"]}),(0,t.jsx)("button",{className:"btn btn-sm btn-ghost",onClick:()=>eR.push("/"),children:"Change Repo"})]}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"bg-base-100 p-4 rounded-lg border border-base-300 space-y-2",children:[(0,t.jsx)("label",{className:"text-xs opacity-50 uppercase tracking-widest",children:"Current Repository"}),(0,t.jsxs)("div",{className:"join w-full",children:[(0,t.jsx)("div",{className:"join-item bg-base-300 flex items-center px-3 border border-base-content/20 border-r-0",children:(0,t.jsx)(l,{className:"w-4 h-4 text-primary"})}),(0,t.jsx)("select",{className:"select select-bordered join-item w-full font-mono focus:outline-none",value:ey,onChange:e=>{tK(e)},disabled:e5||0===ah.length,children:ah.map(e=>(0,t.jsx)("option",{value:e,children:(0,k.getBaseName)(e)},e))})]}),(0,t.jsx)("div",{className:"text-[10px] opacity-50 font-mono truncate px-1",title:ey,children:ey})]}),(0,t.jsxs)("div",{className:"bg-base-100 p-4 rounded-lg border border-base-300 space-y-2",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("label",{className:"text-sm font-medium opacity-70 uppercase tracking-widest",children:"Current Branch"}),e5&&(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"})]}),(0,t.jsxs)("div",{className:"join w-full",children:[(0,t.jsx)("div",{className:"join-item bg-base-300 flex items-center px-3 border border-base-content/20 border-r-0",children:(0,t.jsx)(r.GitBranch,{className:"w-4 h-4"})}),(0,t.jsx)("select",{className:"select select-bordered join-item w-full font-mono focus:outline-none",value:eL,onChange:tB,disabled:e5,children:eM.map(e=>(0,t.jsxs)("option",{value:e.name,children:[e.name," ",e.current?"(checked out)":""]},e.name))})]}),(0,t.jsx)("div",{className:"text-[10px] opacity-50 px-1 italic",children:"Switching branches updates the working directory."})]})]})})]})}),eF.length>0&&(0,t.jsx)("div",{className:"card w-full bg-base-200 shadow-xl",children:(0,t.jsxs)("div",{className:"card-body",children:[(0,t.jsxs)("h2",{className:"card-title flex items-center gap-2",children:[(0,t.jsx)(p.Play,{className:"w-6 h-6 text-success"}),"Continue Existing Session"]}),(0,t.jsx)("div",{className:"flex flex-col gap-2 mt-4 max-h-64 overflow-y-auto",children:eF.map(e=>(0,t.jsx)("div",{className:"flex flex-col gap-2 p-3 bg-base-100 rounded-md border border-base-300",children:(0,t.jsxs)("div",{className:"flex justify-between items-start",children:[(0,t.jsxs)("div",{children:[e.title&&(0,t.jsx)("div",{className:"font-semibold",children:e.title}),(0,t.jsx)("div",{className:"text-xs opacity-60 font-mono",children:e.sessionName}),(0,t.jsxs)("div",{className:"text-xs opacity-60 mt-1",children:["Agent: ",e.agent," • Model: ",e.model]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("button",{className:"btn btn-sm btn-success btn-outline gap-2",onClick:()=>ad(e),disabled:e5||e7===e.sessionName,children:[(0,t.jsx)(f.ExternalLink,{className:"w-3 h-3"})," Open"]}),(0,t.jsxs)("button",{className:"btn btn-sm btn-secondary btn-outline gap-2",onClick:()=>(e=>{if(!ey)return;let t=`/new?repo=${encodeURIComponent(ey)}&prefillFromSession=${encodeURIComponent(e.sessionName)}`;eR.push(t)})(e),disabled:e5||e7===e.sessionName,title:"Start a new attempt prefilled from this session",children:[(0,t.jsx)(i.Plus,{className:"w-3 h-3"})," New Attempt"]}),(0,t.jsxs)("button",{className:"btn btn-sm btn-error btn-outline gap-2",onClick:()=>am(e),disabled:e5||e7===e.sessionName,children:[(0,t.jsx)(u.Trash2,{className:"w-3 h-3"}),e7===e.sessionName?"Deleting...":"Delete"]})]})]})},e.sessionName))})]})}),(0,t.jsx)("div",{className:"card w-full bg-base-200 shadow-xl",children:(0,t.jsxs)("div",{className:"card-body",children:[(0,t.jsxs)("h2",{className:"card-title flex items-center gap-2",children:[(0,t.jsx)(d,{className:"w-6 h-6 text-secondary"}),"Start New Session"]}),(0,t.jsxs)("div",{className:"mt-4 space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{type:"button",className:"btn btn-ghost btn-sm px-2 h-auto min-h-0 normal-case justify-start gap-2",onClick:()=>eV(e=>!e),children:[(0,t.jsx)(c,{className:`w-4 h-4 transition-transform ${eH?"rotate-90":""}`}),eH?"Hide Session Setup":tR]}),eH&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium opacity-70",children:"Agent Provider"}),(0,t.jsxs)("div",{className:"join w-full",children:[(0,t.jsx)("div",{className:"join-item bg-base-300 flex items-center px-3 border border-base-content/20 border-r-0",children:(0,t.jsx)(d,{className:"w-4 h-4"})}),(0,t.jsx)("select",{className:"select select-bordered join-item w-full focus:outline-none",value:eA?.cli||"",onChange:tH,disabled:e5,children:ee.map(e=>(0,t.jsx)("option",{value:e.cli,children:e.name},e.cli))})]}),eA?.description&&(0,t.jsx)("p",{className:"text-[10px] opacity-60 mt-1 pl-1 italic leading-tight",children:eA.description})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium opacity-70",children:"Model"}),(0,t.jsxs)("div",{className:"join w-full",children:[(0,t.jsx)("div",{className:"join-item bg-base-300 flex items-center px-3 border border-base-content/20 border-r-0",children:(0,t.jsx)(m,{className:"w-4 h-4"})}),(0,t.jsxs)("select",{className:"select select-bordered join-item w-full focus:outline-none",value:eI,onChange:tV,disabled:e5||!eA,children:[(0,t.jsx)("option",{value:"auto",children:"Auto"}),eA?.models.map(e=>(0,t.jsx)("option",{value:e.id,children:e.label},e.id))]})]}),eA?.models.find(e=>e.id===eI)?.description&&(0,t.jsx)("p",{className:"text-[10px] opacity-60 mt-1 pl-1 italic leading-tight",children:eA.models.find(e=>e.id===eI)?.description})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium opacity-70",children:"Start up script (Optional)"}),(0,t.jsx)("input",{type:"text",className:"input input-bordered w-full font-mono text-sm",placeholder:"npm i",value:eG,onChange:t_,onBlur:tq,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),an())},disabled:e5}),(0,t.jsx)("div",{className:"text-xs opacity-50 px-1",children:"Script to run in the terminal agent iframe upon startup."})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium opacity-70",children:"Dev server script (Optional)"}),(0,t.jsx)("input",{type:"text",className:"input input-bordered w-full font-mono text-sm",placeholder:"npm run dev",value:ez,onChange:e=>{eB(e.target.value)},onBlur:tY,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),an())},disabled:e5}),(0,t.jsx)("div",{className:"text-xs opacity-50 px-1",children:"Script for the Session View Start Dev Server button in the right terminal."})]})]})]}),(0,t.jsx)("div",{className:"divider"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium opacity-70",children:"Session Mode"}),(0,t.jsxs)("select",{className:"select select-bordered w-full focus:outline-none",value:eJ,onChange:e=>{let t="plan"===e.target.value?"plan":"fast";eQ(t);try{window.localStorage.setItem(et,t)}catch{}},disabled:e5,children:[(0,t.jsx)("option",{value:"fast",children:"Fast Mode (default)"}),(0,t.jsx)("option",{value:"plan",children:"Plan Mode"})]}),(0,t.jsx)("div",{className:"text-xs opacity-50 px-1",children:"plan"===eJ?"Plan mode asks the agent to study the repo, propose a plan, and wait for your approval before implementation.":"Fast mode starts the agent with current behavior."})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium opacity-70",children:"Title (Optional)"}),(0,t.jsx)("input",{type:"text",className:"input input-bordered w-full font-mono text-sm",placeholder:"Task Title",value:eW,onChange:e=>eY(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),an())},disabled:e5})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium opacity-70",children:"Initial Message (Optional)"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("textarea",{className:"textarea textarea-bordered w-full h-64 font-mono text-sm leading-tight resize-none",placeholder:"Describe what you want the agent to do... Type @ to mention files.",value:e_,onChange:t9,onKeyDown:e=>{if((e.metaKey||e.ctrlKey)&&"Enter"===e.key){e.preventDefault(),an();return}tX&&t0.length>0&&("ArrowUp"===e.key?(e.preventDefault(),t5(e=>e>0?e-1:t0.length-1)):"ArrowDown"===e.key?(e.preventDefault(),t5(e=>e<t0.length-1?e+1:0)):"Enter"===e.key||"Tab"===e.key?(e.preventDefault(),ae(t0[t6])):"Escape"===e.key&&(e.preventDefault(),tZ(!1)))},onClick:e=>{t4(e.currentTarget.selectionStart),tZ(!1)},onKeyUp:e=>t4(e.currentTarget.selectionStart),disabled:e5}),tX&&t0.length>0&&(0,t.jsx)("div",{className:"absolute left-0 right-0 z-50 mt-1 max-h-48 overflow-y-auto bg-base-100 border border-base-300 rounded-md shadow-lg",children:t0.map((e,a)=>(0,t.jsx)("button",{className:`w-full text-left px-3 py-2 text-xs border-b border-base-200 last:border-0 truncate ${a===t6?"bg-primary text-primary-content":"hover:bg-primary/10"}`,onMouseDown:t=>{t.preventDefault(),ae(e)},children:e},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium opacity-70",children:"Attachments (Optional)"}),(0,t.jsx)("input",{type:"file",multiple:!0,className:"file-input file-input-bordered w-full",onChange:e=>{e.target.files&&(tQ(Array.from(e.target.files).map((e,t)=>tJ(e,t))),e.target.value="")},disabled:e5}),(0,t.jsx)("div",{className:"text-xs opacity-50 px-1",children:"Paste files from clipboard with Cmd/Ctrl+V anywhere on this page."}),eX.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-2",children:eX.map((e,a)=>(0,t.jsxs)("span",{className:"badge badge-neutral gap-2 p-3",children:[e.name,(0,t.jsx)("button",{onClick:()=>{eZ(e=>e.filter((e,t)=>t!==a))},className:"btn btn-ghost btn-xs btn-circle text-error",children:(0,t.jsx)(n,{className:"w-3 h-3"})})]},`upload-${a}`))}),e0.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-2",children:e0.map((e,a)=>(0,t.jsxs)("span",{className:"badge badge-secondary gap-2 p-3",children:[e,(0,t.jsx)("button",{onClick:()=>{e1(e=>e.filter((e,t)=>t!==a))},className:"btn btn-ghost btn-xs btn-circle text-error",title:"Remove carried attachment",children:(0,t.jsx)(n,{className:"w-3 h-3"})})]},`prefill-${e}-${a}`))})]}),(0,t.jsx)("div",{className:"card-actions justify-end mt-4",children:(0,t.jsx)("button",{className:"btn btn-primary btn-wide shadow-lg",onClick:an,disabled:e5,children:e5?(0,t.jsx)("span",{className:"loading loading-spinner"}):"Start Session"})})]})]})})]})]}),"new"===e&&!ey&&(0,t.jsx)("div",{className:"card w-full max-w-2xl bg-base-200 shadow-xl",children:(0,t.jsxs)("div",{className:"card-body",children:[te&&(0,t.jsx)("div",{className:"alert alert-error text-sm py-2 px-3",children:te}),(0,t.jsx)("h2",{className:"card-title",children:"Select a Repository"}),(0,t.jsx)("p",{className:"opacity-70 text-sm",children:"Choose a repository first, then start or resume a session."}),(0,t.jsx)("div",{className:"card-actions justify-end mt-4",children:(0,t.jsx)("button",{className:"btn btn-primary",onClick:()=>eR.push("/"),children:"Go to Home"})})]})}),"new"===e&&ti&&tc&&(0,t.jsx)("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center bg-base-content/45 px-4",children:(0,t.jsx)("div",{className:"w-full max-w-md rounded-xl border border-base-300 bg-base-100 p-6 shadow-2xl",children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("span",{className:"loading loading-spinner loading-lg text-primary"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("h3",{className:"text-lg font-semibold",children:["Installing ",es[tc]]}),(0,t.jsx)("p",{className:"text-sm opacity-70",children:"Please wait while we install the coding agent CLI."})]})]})})}),"new"===e&&td&&tu&&(0,t.jsx)("div",{className:"fixed inset-0 z-[1001] flex items-center justify-center bg-base-content/60 p-4",children:(0,t.jsx)("div",{className:"w-full max-w-5xl rounded-xl border border-base-300 bg-base-100 shadow-2xl",children:(0,t.jsxs)("div",{className:"space-y-4 p-5 md:p-6",children:[(0,t.jsx)("h3",{className:"text-xl font-semibold",children:"Login Required"}),(0,t.jsxs)("p",{className:"text-sm opacity-80",children:[es[tu]," has been installed. Complete login in the terminal below, then click Done to continue."]}),(0,t.jsxs)("p",{className:"text-xs opacity-60",children:["Command: ",(0,t.jsx)("span",{className:"font-mono",children:th})]}),(0,t.jsx)("div",{className:"h-[420px] overflow-hidden rounded-lg border border-base-300 bg-base-200",children:(0,t.jsx)("iframe",{ref:tC,src:"/terminal",className:"h-full w-full border-none",allow:"clipboard-read; clipboard-write",onLoad:al})}),tg&&(0,t.jsx)("div",{className:"alert alert-error text-sm py-2",children:tg}),!tg&&(0,t.jsx)("div",{className:"text-xs opacity-70",children:tf?"Login command was sent to the terminal automatically.":"Waiting for terminal to initialize..."}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)("button",{className:"btn btn-primary",onClick:()=>void ao(),disabled:e5,children:"Done"})})]})})}),"new"===e&&!ey&&(!s||!!te)&&(0,t.jsx)("div",{className:"card w-full max-w-2xl bg-base-200 shadow-xl",children:(0,t.jsxs)("div",{className:"card-body",children:[(0,t.jsxs)("h2",{className:"card-title flex items-center gap-2",children:[(0,t.jsx)(l,{className:"w-6 h-6 text-primary"}),"Git Repository Selector"]}),ta?(0,t.jsxs)("div",{className:"alert text-sm py-2 px-3 mt-2 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"loading loading-spinner loading-sm"}),g?`Searching for repository "${g}"...`:"Searching for repository..."]}):te?(0,t.jsx)("div",{className:"alert alert-error text-sm py-2 px-3 mt-2",children:te}):(0,t.jsx)("div",{className:"text-sm opacity-70 mt-2",children:"No repository specified."}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)("button",{className:"btn btn-primary btn-sm",onClick:()=>eR.push("/"),children:"Choose Repository"})})]})}),"home"===e&&v&&(0,t.jsx)(R,{initialPath:eb?.defaultRoot||void 0,onSelect:tT,onCancel:()=>j(!1),checkRepo:M}),"home"===e&&w&&(0,t.jsx)(R,{title:"Default Root Folder",initialPath:eb?.defaultRoot||void 0,onSelect:tO,onCancel:()=>N(!1)})]})}e.s(["default",()=>el],5951)}]);
|
|
3
|
+
This will remove the worktree, branch, and session metadata.`)){e9(e.sessionName),tt(null);try{let t=await z(e.sessionName);if(!t.success)return void tt(t.error||"Failed to delete session");let a=await H(ey);eE(a);let s=await H();eU(s),tM()}catch(e){console.error(e),tt("Failed to delete session")}finally{e9(null)}}},au=(0,a.useMemo)(()=>{let e=new Map;for(let t of e$)e.set(t.repoPath,(e.get(t.repoPath)??0)+1);return e},[e$]),ap=eb?.recentRepos??[],ah=ey?ap.includes(ey)?ap:[ey,...ap]:ap;return(0,t.jsxs)(t.Fragment,{children:["home"===e&&(0,t.jsx)("div",{className:"card w-full max-w-4xl bg-base-200 shadow-xl",children:(0,t.jsxs)("div",{className:"card-body",children:[(0,t.jsxs)("h2",{className:"card-title flex justify-between items-center",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(X.default,{src:"/icon.png",alt:"Viba",width:24,height:24,className:"rounded-sm"}),"Viba"]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("button",{className:"btn btn-ghost btn-sm gap-2",onClick:()=>eR.push("/credentials"),title:"Manage GitHub/GitLab credentials",children:[(0,t.jsx)(h.KeyRound,{className:"w-4 h-4"}),"Credentials"]}),(0,t.jsxs)("button",{className:"btn btn-ghost btn-sm gap-2",onClick:()=>N(!0),title:eb?.defaultRoot?`Default: ${eb.defaultRoot}`:"Set default browsing folder",children:[(0,t.jsx)(o,{className:"w-4 h-4"}),eb?.defaultRoot?"Change Default":"Set Default Root"]}),(0,t.jsxs)("button",{className:"btn btn-secondary btn-sm gap-2",onClick:t$,children:[(0,t.jsx)(b,{className:"w-4 h-4"})," Clone Remote Repo"]}),(0,t.jsxs)("button",{className:"btn btn-primary btn-sm gap-2",onClick:()=>j(!0),children:[(0,t.jsx)(i.Plus,{className:"w-4 h-4"})," Open Local Repo"]})]})]}),te&&(0,t.jsx)("div",{className:"alert alert-error text-sm py-2 px-3 mt-2",children:te}),(0,t.jsx)("div",{className:"mt-4 space-y-4",children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold opacity-70 uppercase tracking-wide",children:"Recent Repositories"}),tl?eb&&0!==eb.recentRepos.length?(0,t.jsx)("div",{className:"flex flex-col gap-2",children:eb.recentRepos.map(e=>{let a=tF(e),s=au.get(e)??0;return(0,t.jsxs)("div",{onClick:()=>tT(e),className:"flex items-center justify-between p-3 bg-base-100 hover:bg-base-300 rounded-md cursor-pointer group transition-all border border-base-300",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 overflow-hidden shrink min-w-0",children:[(0,t.jsx)(l,{className:"w-5 h-5 text-secondary shrink-0"}),(0,t.jsxs)("div",{className:"flex flex-col overflow-hidden",children:[(0,t.jsx)("span",{className:"font-medium truncate",children:(0,k.getBaseName)(e)}),(0,t.jsx)("span",{className:"text-xs opacity-50 truncate",children:e}),(0,t.jsxs)("span",{className:"text-[10px] opacity-60 mt-0.5",children:["Credential: ",a]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[s>0&&(0,t.jsx)("span",{className:"badge badge-sm badge-secondary",title:`${s} running session${1===s?"":"s"}`,children:s}),(0,t.jsx)("button",{onClick:t=>{aa(t,e)},className:"btn btn-circle btn-ghost btn-xs opacity-0 group-hover:opacity-100",title:"Repository settings",children:(0,t.jsx)(x,{className:"w-3 h-3"})}),(0,t.jsx)("button",{onClick:t=>at(t,e),className:"btn btn-circle btn-ghost btn-xs opacity-0 group-hover:opacity-100 text-error",title:"Remove from history",children:(0,t.jsx)(n,{className:"w-3 h-3"})}),(0,t.jsx)(c,{className:"w-4 h-4 opacity-30"})]})]},e)})}):(0,t.jsx)("div",{className:"text-center py-8 text-base-content/40 italic bg-base-100 rounded-lg",children:"No recent repositories found."}):(0,t.jsx)("div",{className:"flex items-center justify-center py-8 bg-base-100 rounded-lg",children:(0,t.jsx)("span",{className:"loading loading-spinner loading-md"})})]})})]})}),"home"===e&&S&&ej&&(0,t.jsx)("div",{className:"fixed inset-0 z-[1002] flex items-center justify-center bg-base-content/60 p-4",children:(0,t.jsx)("div",{className:"w-full max-w-xl rounded-xl border border-base-300 bg-base-100 shadow-2xl",children:(0,t.jsxs)("div",{className:"space-y-4 p-5 md:p-6",children:[(0,t.jsx)("h3",{className:"text-xl font-semibold",children:"Repository Settings"}),(0,t.jsx)("p",{className:"text-sm opacity-75",children:"Choose which credential this repository should use for authenticated Git operations."}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-xs uppercase tracking-wide opacity-70",children:"Repository"}),(0,t.jsx)("div",{className:"rounded-md border border-base-300 bg-base-200 px-3 py-2 font-mono text-xs break-all",children:ej})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-xs uppercase tracking-wide opacity-70",children:"Credential"}),(0,t.jsxs)("select",{className:"select select-bordered w-full",value:eN,onChange:e=>eS(e.target.value),disabled:tS,children:[(0,t.jsx)("option",{value:"auto",children:"Auto (match repository remote)"}),ek.map(e=>(0,t.jsx)("option",{value:e.id,children:Z(e)},e.id))]}),0===ek.length&&!tw&&(0,t.jsx)("div",{className:"text-xs opacity-60",children:"No credentials found. Add credentials from the Credentials page."})]}),tw&&(0,t.jsxs)("div",{className:"text-sm opacity-70 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Loading credentials..."]}),tv&&(0,t.jsx)("div",{className:"alert alert-error text-sm py-2",children:tv}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)("button",{className:"btn btn-ghost",onClick:tE,disabled:tS,children:"Cancel"}),(0,t.jsxs)("button",{className:"btn btn-primary",onClick:()=>void as(),disabled:tS||tw,children:[tS?(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}):null,"Save"]})]})]})})}),"home"===e&&er&&(0,t.jsx)("div",{className:"fixed inset-0 z-[1002] flex items-center justify-center bg-base-content/60 p-4",children:(0,t.jsx)("div",{className:"w-full max-w-xl rounded-xl border border-base-300 bg-base-100 shadow-2xl",children:(0,t.jsxs)("div",{className:"space-y-4 p-5 md:p-6",children:[(0,t.jsx)("h3",{className:"text-xl font-semibold",children:"Clone Remote Repository"}),(0,t.jsxs)("p",{className:"text-sm opacity-75",children:["Clone into ",(0,t.jsx)("span",{className:"font-mono",children:"~/.viba/repos"})," and open it as the selected repository."]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-xs uppercase tracking-wide opacity-70",children:"Remote URL"}),(0,t.jsx)("input",{className:"input input-bordered w-full font-mono text-sm",placeholder:"https://github.com/org/repo.git",value:en,onChange:e=>ec(e.target.value),disabled:ep})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-xs uppercase tracking-wide opacity-70",children:"Credential"}),(0,t.jsxs)("select",{className:"select select-bordered w-full",value:eo,onChange:e=>ed(e.target.value),disabled:ep||ex,children:[(0,t.jsx)("option",{value:"auto",children:"Auto (match repository remote)"}),ek.map(e=>(0,t.jsx)("option",{value:e.id,children:Z(e)},e.id))]}),0===ek.length&&!ex&&(0,t.jsx)("div",{className:"text-xs opacity-60",children:"No credentials found. Clone will use anonymous access unless remote auth is otherwise configured."})]}),ex&&(0,t.jsxs)("div",{className:"text-sm opacity-70 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Loading credentials..."]}),ep&&(0,t.jsxs)("div",{className:"alert py-2 text-sm flex items-center gap-2",children:[(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Cloning repository..."]}),em&&(0,t.jsx)("div",{className:"alert alert-error text-sm py-2",children:em}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)("button",{className:"btn btn-ghost",onClick:tU,disabled:ep,children:"Cancel"}),(0,t.jsxs)("button",{className:"btn btn-primary",onClick:()=>void tI(),disabled:ep||!en.trim()||ex,children:[ep?(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}):null,"Clone"]})]})]})})}),"new"===e&&ey&&(0,t.jsxs)("div",{className:"w-full max-w-6xl space-y-4",children:[te&&(0,t.jsx)("div",{className:"alert alert-error text-sm py-2 px-3",children:te}),(0,t.jsxs)("div",{className:"flex flex-col gap-4 w-full",children:[(0,t.jsx)("div",{className:"card w-full bg-base-200 shadow-xl",children:(0,t.jsxs)("div",{className:"card-body",children:[(0,t.jsxs)("h2",{className:"card-title flex justify-between items-center",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l,{className:"w-6 h-6 text-primary"}),"Git Repository Selector"]}),(0,t.jsx)("button",{className:"btn btn-sm btn-ghost",onClick:()=>eR.push("/"),children:"Change Repo"})]}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"bg-base-100 p-4 rounded-lg border border-base-300 space-y-2",children:[(0,t.jsx)("label",{className:"text-xs opacity-50 uppercase tracking-widest",children:"Current Repository"}),(0,t.jsxs)("div",{className:"join w-full",children:[(0,t.jsx)("div",{className:"join-item bg-base-300 flex items-center px-3 border border-base-content/20 border-r-0",children:(0,t.jsx)(l,{className:"w-4 h-4 text-primary"})}),(0,t.jsx)("select",{className:"select select-bordered join-item w-full font-mono focus:outline-none",value:ey,onChange:e=>{tK(e)},disabled:e5||0===ah.length,children:ah.map(e=>(0,t.jsx)("option",{value:e,children:(0,k.getBaseName)(e)},e))})]}),(0,t.jsx)("div",{className:"text-[10px] opacity-50 font-mono truncate px-1",title:ey,children:ey})]}),(0,t.jsxs)("div",{className:"bg-base-100 p-4 rounded-lg border border-base-300 space-y-2",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("label",{className:"text-sm font-medium opacity-70 uppercase tracking-widest",children:"Current Branch"}),e5&&(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"})]}),(0,t.jsxs)("div",{className:"join w-full",children:[(0,t.jsx)("div",{className:"join-item bg-base-300 flex items-center px-3 border border-base-content/20 border-r-0",children:(0,t.jsx)(r.GitBranch,{className:"w-4 h-4"})}),(0,t.jsx)("select",{className:"select select-bordered join-item w-full font-mono focus:outline-none",value:eL,onChange:tB,disabled:e5,children:eM.map(e=>(0,t.jsxs)("option",{value:e.name,children:[e.name," ",e.current?"(checked out)":""]},e.name))})]}),(0,t.jsx)("div",{className:"text-[10px] opacity-50 px-1 italic",children:"Switching branches updates the working directory."})]})]})})]})}),eF.length>0&&(0,t.jsx)("div",{className:"card w-full bg-base-200 shadow-xl",children:(0,t.jsxs)("div",{className:"card-body",children:[(0,t.jsxs)("h2",{className:"card-title flex items-center gap-2",children:[(0,t.jsx)(p.Play,{className:"w-6 h-6 text-success"}),"Continue Existing Session"]}),(0,t.jsx)("div",{className:"flex flex-col gap-2 mt-4 max-h-64 overflow-y-auto",children:eF.map(e=>(0,t.jsx)("div",{className:"flex flex-col gap-2 p-3 bg-base-100 rounded-md border border-base-300",children:(0,t.jsxs)("div",{className:"flex justify-between items-start",children:[(0,t.jsxs)("div",{children:[e.title&&(0,t.jsx)("div",{className:"font-semibold",children:e.title}),(0,t.jsx)("div",{className:"text-xs opacity-60 font-mono",children:e.sessionName}),(0,t.jsxs)("div",{className:"text-xs opacity-60 mt-1",children:["Agent: ",e.agent," • Model: ",e.model]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("button",{className:"btn btn-sm btn-success btn-outline gap-2",onClick:()=>ad(e),disabled:e5||e8===e.sessionName,children:[(0,t.jsx)(f.ExternalLink,{className:"w-3 h-3"})," Open"]}),(0,t.jsxs)("button",{className:"btn btn-sm btn-secondary btn-outline gap-2",onClick:()=>(e=>{if(!ey)return;let t=`/new?repo=${encodeURIComponent(ey)}&prefillFromSession=${encodeURIComponent(e.sessionName)}`;eR.push(t)})(e),disabled:e5||e8===e.sessionName,title:"Start a new attempt prefilled from this session",children:[(0,t.jsx)(i.Plus,{className:"w-3 h-3"})," New Attempt"]}),(0,t.jsxs)("button",{className:"btn btn-sm btn-error btn-outline gap-2",onClick:()=>am(e),disabled:e5||e8===e.sessionName,children:[(0,t.jsx)(u.Trash2,{className:"w-3 h-3"}),e8===e.sessionName?"Deleting...":"Delete"]})]})]})},e.sessionName))})]})}),(0,t.jsx)("div",{className:"card w-full bg-base-200 shadow-xl",children:(0,t.jsxs)("div",{className:"card-body",children:[(0,t.jsxs)("h2",{className:"card-title flex items-center gap-2",children:[(0,t.jsx)(d,{className:"w-6 h-6 text-secondary"}),"Start New Session"]}),(0,t.jsxs)("div",{className:"mt-4 space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{type:"button",className:"btn btn-ghost btn-sm px-2 h-auto min-h-0 normal-case justify-start gap-2",onClick:()=>eV(e=>!e),children:[(0,t.jsx)(c,{className:`w-4 h-4 transition-transform ${eH?"rotate-90":""}`}),eH?"Hide Session Setup":tR]}),eH&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium opacity-70",children:"Agent Provider"}),(0,t.jsxs)("div",{className:"join w-full",children:[(0,t.jsx)("div",{className:"join-item bg-base-300 flex items-center px-3 border border-base-content/20 border-r-0",children:(0,t.jsx)(d,{className:"w-4 h-4"})}),(0,t.jsx)("select",{className:"select select-bordered join-item w-full focus:outline-none",value:eA?.cli||"",onChange:tH,disabled:e5,children:ee.map(e=>(0,t.jsx)("option",{value:e.cli,children:e.name},e.cli))})]}),eA?.description&&(0,t.jsx)("p",{className:"text-[10px] opacity-60 mt-1 pl-1 italic leading-tight",children:eA.description})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium opacity-70",children:"Model"}),(0,t.jsxs)("div",{className:"join w-full",children:[(0,t.jsx)("div",{className:"join-item bg-base-300 flex items-center px-3 border border-base-content/20 border-r-0",children:(0,t.jsx)(m,{className:"w-4 h-4"})}),(0,t.jsxs)("select",{className:"select select-bordered join-item w-full focus:outline-none",value:eI,onChange:tV,disabled:e5||!eA,children:[(0,t.jsx)("option",{value:"auto",children:"Auto"}),eA?.models.map(e=>(0,t.jsx)("option",{value:e.id,children:e.label},e.id))]})]}),eA?.models.find(e=>e.id===eI)?.description&&(0,t.jsx)("p",{className:"text-[10px] opacity-60 mt-1 pl-1 italic leading-tight",children:eA.models.find(e=>e.id===eI)?.description})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium opacity-70",children:"Start up script (Optional)"}),(0,t.jsx)("input",{type:"text",className:"input input-bordered w-full font-mono text-sm",placeholder:"npm i",value:eG,onChange:t_,onBlur:tq,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),an())},disabled:e5}),(0,t.jsx)("div",{className:"text-xs opacity-50 px-1",children:"Script to run in the terminal agent iframe upon startup."})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium opacity-70",children:"Dev server script (Optional)"}),(0,t.jsx)("input",{type:"text",className:"input input-bordered w-full font-mono text-sm",placeholder:"npm run dev",value:ez,onChange:e=>{eB(e.target.value)},onBlur:tY,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),an())},disabled:e5}),(0,t.jsx)("div",{className:"text-xs opacity-50 px-1",children:"Script for the Session View Start Dev Server button in the right terminal."})]})]})]}),(0,t.jsx)("div",{className:"divider"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium opacity-70",children:"Session Mode"}),(0,t.jsxs)("select",{className:"select select-bordered w-full focus:outline-none",value:eJ,onChange:e=>{let t="plan"===e.target.value?"plan":"fast";eQ(t);try{window.localStorage.setItem(et,t)}catch{}},disabled:e5,children:[(0,t.jsx)("option",{value:"fast",children:"Fast Mode (default)"}),(0,t.jsx)("option",{value:"plan",children:"Plan Mode"})]}),(0,t.jsx)("div",{className:"text-xs opacity-50 px-1",children:"plan"===eJ?"Plan mode asks the agent to study the repo, propose a plan, and wait for your approval before implementation.":"Fast mode starts the agent with current behavior."})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium opacity-70",children:"Title (Optional)"}),(0,t.jsx)("input",{type:"text",className:"input input-bordered w-full font-mono text-sm",placeholder:"Task Title",value:eW,onChange:e=>eY(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),an())},disabled:e5})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium opacity-70",children:"Initial Message (Optional)"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("textarea",{className:"textarea textarea-bordered w-full h-64 font-mono text-sm leading-tight resize-none",placeholder:"Describe what you want the agent to do... Type @ to mention files.",value:e_,onChange:t9,onKeyDown:e=>{if((e.metaKey||e.ctrlKey)&&"Enter"===e.key){e.preventDefault(),an();return}tX&&t0.length>0&&("ArrowUp"===e.key?(e.preventDefault(),t5(e=>e>0?e-1:t0.length-1)):"ArrowDown"===e.key?(e.preventDefault(),t5(e=>e<t0.length-1?e+1:0)):"Enter"===e.key||"Tab"===e.key?(e.preventDefault(),ae(t0[t6])):"Escape"===e.key&&(e.preventDefault(),tZ(!1)))},onClick:e=>{t4(e.currentTarget.selectionStart),tZ(!1)},onKeyUp:e=>t4(e.currentTarget.selectionStart),disabled:e5}),tX&&t0.length>0&&(0,t.jsx)("div",{className:"absolute left-0 right-0 z-50 mt-1 max-h-48 overflow-y-auto bg-base-100 border border-base-300 rounded-md shadow-lg",children:t0.map((e,a)=>(0,t.jsx)("button",{className:`w-full text-left px-3 py-2 text-xs border-b border-base-200 last:border-0 truncate ${a===t6?"bg-primary text-primary-content":"hover:bg-primary/10"}`,onMouseDown:t=>{t.preventDefault(),ae(e)},children:e},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium opacity-70",children:"Attachments (Optional)"}),(0,t.jsx)("input",{type:"file",multiple:!0,className:"file-input file-input-bordered w-full",onChange:e=>{e.target.files&&(tQ(Array.from(e.target.files).map((e,t)=>tJ(e,t))),e.target.value="")},disabled:e5}),(0,t.jsx)("div",{className:"text-xs opacity-50 px-1",children:"Paste files from clipboard with Cmd/Ctrl+V anywhere on this page."}),eX.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-2",children:eX.map((e,a)=>(0,t.jsxs)("span",{className:"badge badge-neutral gap-2 p-3",children:[e.name,(0,t.jsx)("button",{onClick:()=>{eZ(e=>e.filter((e,t)=>t!==a))},className:"btn btn-ghost btn-xs btn-circle text-error",children:(0,t.jsx)(n,{className:"w-3 h-3"})})]},`upload-${a}`))}),e0.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-2",children:e0.map((e,a)=>(0,t.jsxs)("span",{className:"badge badge-secondary gap-2 p-3",children:[e,(0,t.jsx)("button",{onClick:()=>{e2(e=>e.filter((e,t)=>t!==a))},className:"btn btn-ghost btn-xs btn-circle text-error",title:"Remove carried attachment",children:(0,t.jsx)(n,{className:"w-3 h-3"})})]},`prefill-${e}-${a}`))})]}),(0,t.jsx)("div",{className:"card-actions justify-end mt-4",children:(0,t.jsx)("button",{className:"btn btn-primary btn-wide shadow-lg",onClick:an,disabled:e5,children:e5?(0,t.jsx)("span",{className:"loading loading-spinner"}):"Start Session"})})]})]})})]})]}),"new"===e&&!ey&&(0,t.jsx)("div",{className:"card w-full max-w-2xl bg-base-200 shadow-xl",children:(0,t.jsxs)("div",{className:"card-body",children:[te&&(0,t.jsx)("div",{className:"alert alert-error text-sm py-2 px-3",children:te}),(0,t.jsx)("h2",{className:"card-title",children:"Select a Repository"}),(0,t.jsx)("p",{className:"opacity-70 text-sm",children:"Choose a repository first, then start or resume a session."}),(0,t.jsx)("div",{className:"card-actions justify-end mt-4",children:(0,t.jsx)("button",{className:"btn btn-primary",onClick:()=>eR.push("/"),children:"Go to Home"})})]})}),"new"===e&&ti&&tc&&(0,t.jsx)("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center bg-base-content/45 px-4",children:(0,t.jsx)("div",{className:"w-full max-w-md rounded-xl border border-base-300 bg-base-100 p-6 shadow-2xl",children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("span",{className:"loading loading-spinner loading-lg text-primary"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("h3",{className:"text-lg font-semibold",children:["Installing ",es[tc]]}),(0,t.jsx)("p",{className:"text-sm opacity-70",children:"Please wait while we install the coding agent CLI."})]})]})})}),"new"===e&&td&&tu&&(0,t.jsx)("div",{className:"fixed inset-0 z-[1001] flex items-center justify-center bg-base-content/60 p-4",children:(0,t.jsx)("div",{className:"w-full max-w-5xl rounded-xl border border-base-300 bg-base-100 shadow-2xl",children:(0,t.jsxs)("div",{className:"space-y-4 p-5 md:p-6",children:[(0,t.jsx)("h3",{className:"text-xl font-semibold",children:"Login Required"}),(0,t.jsxs)("p",{className:"text-sm opacity-80",children:[es[tu]," has been installed. Complete login in the terminal below, then click Done to continue."]}),(0,t.jsxs)("p",{className:"text-xs opacity-60",children:["Command: ",(0,t.jsx)("span",{className:"font-mono",children:th})]}),(0,t.jsx)("div",{className:"h-[420px] overflow-hidden rounded-lg border border-base-300 bg-base-200",children:(0,t.jsx)("iframe",{ref:tC,src:"/terminal",className:"h-full w-full border-none",allow:"clipboard-read; clipboard-write",onLoad:al})}),tg&&(0,t.jsx)("div",{className:"alert alert-error text-sm py-2",children:tg}),!tg&&(0,t.jsx)("div",{className:"text-xs opacity-70",children:tf?"Login command was sent to the terminal automatically.":"Waiting for terminal to initialize..."}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)("button",{className:"btn btn-primary",onClick:()=>void ao(),disabled:e5,children:"Done"})})]})})}),"new"===e&&!ey&&(!s||!!te)&&(0,t.jsx)("div",{className:"card w-full max-w-2xl bg-base-200 shadow-xl",children:(0,t.jsxs)("div",{className:"card-body",children:[(0,t.jsxs)("h2",{className:"card-title flex items-center gap-2",children:[(0,t.jsx)(l,{className:"w-6 h-6 text-primary"}),"Git Repository Selector"]}),ta?(0,t.jsxs)("div",{className:"alert text-sm py-2 px-3 mt-2 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"loading loading-spinner loading-sm"}),g?`Searching for repository "${g}"...`:"Searching for repository..."]}):te?(0,t.jsx)("div",{className:"alert alert-error text-sm py-2 px-3 mt-2",children:te}):(0,t.jsx)("div",{className:"text-sm opacity-70 mt-2",children:"No repository specified."}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)("button",{className:"btn btn-primary btn-sm",onClick:()=>eR.push("/"),children:"Choose Repository"})})]})}),"home"===e&&v&&(0,t.jsx)(R,{initialPath:eb?.defaultRoot||void 0,onSelect:tT,onCancel:()=>j(!1),checkRepo:M}),"home"===e&&w&&(0,t.jsx)(R,{title:"Default Root Folder",initialPath:eb?.defaultRoot||void 0,onSelect:tO,onCancel:()=>N(!1)})]})}e.s(["default",()=>el],5951)}]);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33525,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return a}});let a=e=>{}},95187,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={callServer:function(){return s.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return n.findSourceMapURL}};for(var i in a)Object.defineProperty(r,i,{enumerable:!0,get:a[i]});let s=e.r(32120),n=e.r(92245),l=e.r(35326)},75254,e=>{"use strict";var t=e.i(71645);let r=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),a=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let s=(0,t.forwardRef)(({color:e="currentColor",size:a=24,strokeWidth:s=2,absoluteStrokeWidth:n,className:l="",children:o,iconNode:d,...c},u)=>(0,t.createElement)("svg",{ref:u,...i,width:a,height:a,stroke:e,strokeWidth:n?24*Number(s)/Number(a):s,className:r("lucide",l),...!o&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(c)&&{"aria-hidden":"true"},...c},[...d.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(o)?o:[o]])),n=(e,i)=>{let n=(0,t.forwardRef)(({className:n,...l},o)=>(0,t.createElement)(s,{ref:o,iconNode:i,className:r(`lucide-${a(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...l}));return n.displayName=a(e),n};e.s(["default",()=>n],75254)},71689,e=>{"use strict";let t=(0,e.i(75254).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",()=>t],71689)},27612,e=>{"use strict";let t=(0,e.i(75254).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",()=>t],27612)},88143,(e,t,r)=>{"use strict";function a({widthInt:e,heightInt:t,blurWidth:r,blurHeight:a,blurDataURL:i,objectFit:s}){let n=r?40*r:e,l=a?40*a:t,o=n&&l?`viewBox='0 0 ${n} ${l}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${o}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${o?"none":"contain"===s?"xMidYMid":"cover"===s?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${i}'/%3E%3C/svg%3E`}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getImageBlurSvg",{enumerable:!0,get:function(){return a}})},87690,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={VALID_LOADERS:function(){return s},imageConfigDefault:function(){return n}};for(var i in a)Object.defineProperty(r,i,{enumerable:!0,get:a[i]});let s=["default","imgix","cloudinary","akamai","custom"],n={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1}},8927,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getImgProps",{enumerable:!0,get:function(){return d}}),e.r(33525);let a=e.r(43369),i=e.r(88143),s=e.r(87690),n=["-moz-initial","fill","none","scale-down",void 0];function l(e){return void 0!==e.default}function o(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function d({src:e,sizes:t,unoptimized:r=!1,priority:d=!1,preload:c=!1,loading:u,className:f,quality:p,width:m,height:g,fill:h=!1,style:b,overrideSrc:x,onLoad:v,onLoadingComplete:y,placeholder:j="empty",blurDataURL:w,fetchPriority:_,decoding:N="async",layout:S,objectFit:C,objectPosition:P,lazyBoundary:O,lazyRoot:R,...E},M){var k;let z,$,A,{imgConf:L,showAltText:I,blurComplete:D,defaultLoader:U}=M,T=L||s.imageConfigDefault;if("allSizes"in T)z=T;else{let e=[...T.deviceSizes,...T.imageSizes].sort((e,t)=>e-t),t=T.deviceSizes.sort((e,t)=>e-t),r=T.qualities?.sort((e,t)=>e-t);z={...T,allSizes:e,deviceSizes:t,qualities:r}}if(void 0===U)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let G=E.loader||U;delete E.loader,delete E.srcSet;let B="__next_img_default"in G;if(B){if("custom"===z.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop.
|
|
2
2
|
Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=G;G=t=>{let{config:r,...a}=t;return e(a)}}if(S){"fill"===S&&(h=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[S];e&&(b={...b,...e});let r={responsive:"100vw",fill:"100vw"}[S];r&&!t&&(t=r)}let H="",W=o(m),q=o(g);if((k=e)&&"object"==typeof k&&(l(k)||void 0!==k.src)){let t=l(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if($=t.blurWidth,A=t.blurHeight,w=w||t.blurDataURL,H=t.src,!h)if(W||q){if(W&&!q){let e=W/t.width;q=Math.round(t.height*e)}else if(!W&&q){let e=q/t.height;W=Math.round(t.width*e)}}else W=t.width,q=t.height}let F=!d&&!c&&("lazy"===u||void 0===u);(!(e="string"==typeof e?e:H)||e.startsWith("data:")||e.startsWith("blob:"))&&(r=!0,F=!1),z.unoptimized&&(r=!0),B&&!z.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(r=!0);let V=o(p),X=Object.assign(h?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:C,objectPosition:P}:{},I?{}:{color:"transparent"},b),K=D||"empty"===j?null:"blur"===j?`url("data:image/svg+xml;charset=utf-8,${(0,i.getImageBlurSvg)({widthInt:W,heightInt:q,blurWidth:$,blurHeight:A,blurDataURL:w||"",objectFit:X.objectFit})}")`:`url("${j}")`,J=n.includes(X.objectFit)?"fill"===X.objectFit?"100% 100%":"cover":X.objectFit,Q=K?{backgroundSize:J,backgroundPosition:X.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:K}:{},Y=function({config:e,src:t,unoptimized:r,width:i,quality:s,sizes:n,loader:l}){if(r){let e=(0,a.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//")&&e){let r=t.includes("?")?"&":"?";t=`${t}${r}dpl=${e}`}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:o,kind:d}=function({deviceSizes:e,allSizes:t},r,a){if(a){let r=/(^|\s)(1?\d?\d)vw/g,i=[];for(let e;e=r.exec(a);)i.push(parseInt(e[2]));if(i.length){let r=.01*Math.min(...i);return{widths:t.filter(t=>t>=e[0]*r),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof r?{widths:e,kind:"w"}:{widths:[...new Set([r,2*r].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,i,n),c=o.length-1;return{sizes:n||"w"!==d?n:"100vw",srcSet:o.map((r,a)=>`${l({config:e,src:t,quality:s,width:r})} ${"w"===d?r:a+1}${d}`).join(", "),src:l({config:e,src:t,quality:s,width:o[c]})}}({config:z,src:e,unoptimized:r,width:W,quality:V,sizes:t,loader:G}),Z=F?"lazy":u;return{props:{...E,loading:Z,fetchPriority:_,width:W,height:q,decoding:N,className:f,style:{...X,...Q},sizes:Y.sizes,srcSet:Y.srcSet,src:x||Y.src},meta:{unoptimized:r,preload:c||d,placeholder:j,fill:h}}}},98879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return l}});let a=e.r(71645),i="u"<typeof window,s=i?()=>{}:a.useLayoutEffect,n=i?()=>{}:a.useEffect;function l(e){let{headManager:t,reduceComponentsToState:r}=e;function l(){if(t&&t.mountedInstances){let e=a.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(r(e))}}return i&&(t?.mountedInstances?.add(e.children),l()),s(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),s(()=>(t&&(t._pendingUpdate=l),()=>{t&&(t._pendingUpdate=l)})),n(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},25633,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={default:function(){return g},defaultHead:function(){return u}};for(var i in a)Object.defineProperty(r,i,{enumerable:!0,get:a[i]});let s=e.r(55682),n=e.r(90809),l=e.r(43476),o=n._(e.r(71645)),d=s._(e.r(98879)),c=e.r(42732);function u(){return[(0,l.jsx)("meta",{charSet:"utf-8"},"charset"),(0,l.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function f(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===o.default.Fragment?e.concat(o.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}e.r(33525);let p=["name","httpEquiv","charSet","itemProp"];function m(e){let t,r,a,i;return e.reduce(f,[]).reverse().concat(u().reverse()).filter((t=new Set,r=new Set,a=new Set,i={},e=>{let s=!0,n=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){n=!0;let r=e.key.slice(e.key.indexOf("$")+1);t.has(r)?s=!1:t.add(r)}switch(e.type){case"title":case"base":r.has(e.type)?s=!1:r.add(e.type);break;case"meta":for(let t=0,r=p.length;t<r;t++){let r=p[t];if(e.props.hasOwnProperty(r))if("charSet"===r)a.has(r)?s=!1:a.add(r);else{let t=e.props[r],a=i[r]||new Set;("name"!==r||!n)&&a.has(t)?s=!1:(a.add(t),i[r]=a)}}}return s})).reverse().map((e,t)=>{let r=e.key||t;return o.default.cloneElement(e,{key:r})})}let g=function({children:e}){let t=(0,o.useContext)(c.HeadManagerContext);return(0,l.jsx)(d.default,{reduceComponentsToState:m,headManager:t,children:e})};("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18556,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ImageConfigContext",{enumerable:!0,get:function(){return s}});let a=e.r(55682)._(e.r(71645)),i=e.r(87690),s=a.default.createContext(i.imageConfigDefault)},65856,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"RouterContext",{enumerable:!0,get:function(){return a}});let a=e.r(55682)._(e.r(71645)).default.createContext(null)},70965,(e,t,r)=>{"use strict";function a(e,t){let r=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-r)<Math.abs(e-r)?t:e,0):r}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"findClosestQuality",{enumerable:!0,get:function(){return a}})},1948,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return n}});let a=e.r(70965),i=e.r(43369);function s({config:e,src:t,width:r,quality:s}){if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
|
|
3
|
-
Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let n=(0,a.findClosestQuality)(s,e),l=(0,i.getDeploymentId)();return`${e.path}?url=${encodeURIComponent(t)}&w=${r}&q=${n}${t.startsWith("/")&&l?`&dpl=${l}`:""}`}s.__next_img_default=!0;let n=s},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return i}});let a=e.r(71645);function i(e,t){let r=(0,a.useRef)(null),i=(0,a.useRef)(null);return(0,a.useCallback)(a=>{if(null===a){let e=r.current;e&&(r.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(r.current=s(e,a)),t&&(i.current=s(t,a))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},5500,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"Image",{enumerable:!0,get:function(){return y}});let a=e.r(55682),i=e.r(90809),s=e.r(43476),n=i._(e.r(71645)),l=a._(e.r(74080)),o=a._(e.r(25633)),d=e.r(8927),c=e.r(87690),u=e.r(18556);e.r(33525);let f=e.r(65856),p=a._(e.r(1948)),m=e.r(18581),g={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function h(e,t,r,a,i,s,n){let l=e?.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&i(!0),r?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let a=!1,i=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>a,isPropagationStopped:()=>i,persist:()=>{},preventDefault:()=>{a=!0,t.preventDefault()},stopPropagation:()=>{i=!0,t.stopPropagation()}})}a?.current&&a.current(e)}}))}function b(e){return n.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let x=(0,n.forwardRef)(({src:e,srcSet:t,sizes:r,height:a,width:i,decoding:l,className:o,style:d,fetchPriority:c,placeholder:u,loading:f,unoptimized:p,fill:g,onLoadRef:x,onLoadingCompleteRef:v,setBlurComplete:y,setShowAltText:j,sizesInput:w,onLoad:_,onError:N,...S},C)=>{let P=(0,n.useCallback)(e=>{e&&(N&&(e.src=e.src),e.complete&&h(e,u,x,v,y,p,w))},[e,u,x,v,y,N,p,w]),O=(0,m.useMergedRef)(C,P);return(0,s.jsx)("img",{...S,...b(c),loading:f,width:i,height:a,decoding:l,"data-nimg":g?"fill":"1",className:o,style:d,sizes:r,srcSet:t,src:e,ref:O,onLoad:e=>{h(e.currentTarget,u,x,v,y,p,w)},onError:e=>{j(!0),"empty"!==u&&y(!0),N&&N(e)}})});function v({isAppRouter:e,imgAttributes:t}){let r={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...b(t.fetchPriority)};return e&&l.default.preload?(l.default.preload(t.src,r),null):(0,s.jsx)(o.default,{children:(0,s.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...r},"__nimg-"+t.src+t.srcSet+t.sizes)})}let y=(0,n.forwardRef)((e,t)=>{let r=(0,n.useContext)(f.RouterContext),a=(0,n.useContext)(u.ImageConfigContext),i=(0,n.useMemo)(()=>{let e=g||a||c.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),r=e.deviceSizes.sort((e,t)=>e-t),i=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:r,qualities:i,localPatterns:"u"<typeof window?a?.localPatterns:e.localPatterns}},[a]),{onLoad:l,onLoadingComplete:o}=e,m=(0,n.useRef)(l);(0,n.useEffect)(()=>{m.current=l},[l]);let h=(0,n.useRef)(o);(0,n.useEffect)(()=>{h.current=o},[o]);let[b,y]=(0,n.useState)(!1),[j,w]=(0,n.useState)(!1),{props:_,meta:N}=(0,d.getImgProps)(e,{defaultLoader:p.default,imgConf:i,blurComplete:b,showAltText:j});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x,{..._,unoptimized:N.unoptimized,placeholder:N.placeholder,fill:N.fill,onLoadRef:m,onLoadingCompleteRef:h,setBlurComplete:y,setShowAltText:w,sizesInput:e.sizes,ref:t}),N.preload?(0,s.jsx)(v,{isAppRouter:!r,imgAttributes:_}):null]})});("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},94909,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={default:function(){return c},getImageProps:function(){return d}};for(var i in a)Object.defineProperty(r,i,{enumerable:!0,get:a[i]});let s=e.r(55682),n=e.r(8927),l=e.r(5500),o=s._(e.r(1948));function d(e){let{props:t}=(0,n.getImgProps)(e,{defaultLoader:o.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}}let c=l.Image},57688,(e,t,r)=>{t.exports=e.r(94909)},18566,(e,t,r)=>{t.exports=e.r(76562)},64335,e=>{"use strict";var t=e.i(95187);let r=(0,t.createServerReference)("0058482a3f779e30eb7c7fa78b3ade6cf4b4ab4c3a",t.callServer,void 0,t.findSourceMapURL,"listCredentials");e.s(["listCredentials",()=>r])},65261,e=>{"use strict";let t=(0,e.i(75254).default)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);e.s(["KeyRound",()=>t],65261)},63768,e=>{"use strict";var t=e.i(43476),r=e.i(64335),a=e.i(95187);let i=(0,a.createServerReference)("40fc745be0212884313fc6f7061c3f76f9660b8c0c",a.callServer,void 0,a.findSourceMapURL,"removeCredential"),s=(0,a.createServerReference)("401d840f71fb762b59873335159da54b87dfec2c91",a.callServer,void 0,a.findSourceMapURL,"saveGitHubCredential"),n=(0,a.createServerReference)("604540b835a6556f3083523ddd6fb736c86f0855da",a.callServer,void 0,a.findSourceMapURL,"saveGitLabCredential");var l=e.i(71689),o=e.i(65261),d=e.i(27612),c=e.i(57688),u=e.i(18566),f=e.i(71645);let p="https://gitlab.com",m={github:"https://www.google.com/s2/favicons?domain=github.com&sz=64",gitlab:"https://www.google.com/s2/favicons?domain=gitlab.com&sz=64"};function g(e){return"github"===e?"GitHub":"GitLab"}function h({type:e}){return(0,t.jsx)(c.default,{src:m[e],alt:`${g(e)} icon`,width:20,height:20,className:"h-5 w-5 rounded-sm",unoptimized:!0})}function b(){let e=(0,u.useRouter)(),[a,c]=(0,f.useState)([]),[m,b]=(0,f.useState)(!0),[x,v]=(0,f.useState)(""),[y,j]=(0,f.useState)(""),[w,_]=(0,f.useState)(p),[N,S]=(0,f.useState)(null),[C,P]=(0,f.useState)(null),[O,R]=(0,f.useState)(null),E=(0,f.useMemo)(()=>a.filter(e=>"github"===e.type),[a]),M=(0,f.useMemo)(()=>a.filter(e=>"gitlab"===e.type),[a]),k=async()=>{let e=await (0,r.listCredentials)();if(!e.success){R({tone:"error",text:e.error}),b(!1);return}c(e.credentials),b(!1)};(0,f.useEffect)(()=>{let e=!0;return(async()=>{let t=await (0,r.listCredentials)();if(e){if(!t.success){R({tone:"error",text:t.error}),b(!1);return}c(t.credentials),b(!1)}})(),()=>{e=!1}},[]);let z=async()=>{R(null),S("github");let e=await s(x);if(!e.success){R({tone:"error",text:e.error}),S(null);return}v(""),R({tone:"success",text:"GitHub credential added."}),await k(),S(null)},$=async()=>{R(null),S("gitlab");let e=await n(w,y);if(!e.success){R({tone:"error",text:e.error}),S(null);return}j(""),R({tone:"success",text:"GitLab credential added."}),await k(),S(null)},A=async e=>{let t=g(e.type);if(!confirm(`Delete this ${t} credential for ${"gitlab"===e.type?`${e.username} @ ${e.serverUrl}`:e.username}?`))return;R(null),P(e.id);let r=await i(e.id);if(!r.success){R({tone:"error",text:r.error}),P(null);return}R({tone:"success",text:`${t} credential deleted.`}),await k(),P(null)};return(0,t.jsx)("main",{className:"min-h-screen bg-base-100 p-4 md:p-10",children:(0,t.jsxs)("div",{className:"mx-auto w-full max-w-5xl space-y-5",children:[(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("button",{className:"btn btn-ghost btn-sm",onClick:()=>e.push("/"),children:[(0,t.jsx)(l.ArrowLeft,{className:"h-4 w-4"}),"Back"]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold",children:"Credentials"}),(0,t.jsx)("p",{className:"text-sm opacity-70",children:"GitHub and GitLab API tokens are stored securely in your system keychain."})]})]})}),O&&(0,t.jsx)("div",{className:`alert ${"error"===O.tone?"alert-error":"alert-success"} text-sm`,children:O.text}),m?(0,t.jsx)("div",{className:"card bg-base-200 shadow-xl",children:(0,t.jsxs)("div",{className:"card-body items-center py-10",children:[(0,t.jsx)("span",{className:"loading loading-spinner loading-md"}),(0,t.jsx)("p",{className:"text-sm opacity-70",children:"Loading credentials..."})]})}):(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-2 items-start",children:[(0,t.jsx)("div",{className:"card bg-base-200 shadow-xl",children:(0,t.jsxs)("div",{className:"card-body space-y-4",children:[(0,t.jsxs)("h2",{className:"card-title flex items-center gap-2",children:[(0,t.jsx)(h,{type:"github"}),"GitHub"]}),(0,t.jsxs)("label",{className:"form-control w-full gap-2",children:[(0,t.jsx)("span",{className:"label-text text-xs uppercase tracking-wide opacity-70",children:"Personal Access Token"}),(0,t.jsx)("input",{type:"password",className:"input input-bordered w-full",placeholder:"ghp_xxx",value:x,onChange:e=>v(e.target.value),disabled:"github"===N})]}),(0,t.jsx)("div",{className:"card-actions justify-end pt-1",children:(0,t.jsxs)("button",{className:"btn btn-primary btn-sm",onClick:()=>void z(),disabled:"github"===N,children:["github"===N?(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,t.jsx)(o.KeyRound,{className:"h-4 w-4"}),"Add Credential"]})}),(0,t.jsx)("div",{className:"divider my-0"}),0===E.length?(0,t.jsx)("div",{className:"text-sm opacity-60",children:"No GitHub credentials saved."}):(0,t.jsx)("div",{className:"space-y-2",children:E.map(e=>(0,t.jsx)("div",{className:"rounded-md border border-base-300 bg-base-100 p-3",children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0 flex items-start gap-2",children:[(0,t.jsx)(h,{type:"github"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium truncate",children:e.username}),(0,t.jsxs)("div",{className:"text-xs opacity-60",children:["Updated ",new Date(e.updatedAt).toLocaleString()]})]})]}),(0,t.jsxs)("button",{className:"btn btn-error btn-outline btn-xs",onClick:()=>void A(e),disabled:C===e.id,children:[C===e.id?(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,t.jsx)(d.Trash2,{className:"h-3.5 w-3.5"}),"Delete"]})]})},e.id))})]})}),(0,t.jsx)("div",{className:"card bg-base-200 shadow-xl",children:(0,t.jsxs)("div",{className:"card-body space-y-4",children:[(0,t.jsxs)("h2",{className:"card-title flex items-center gap-2",children:[(0,t.jsx)(h,{type:"gitlab"}),"GitLab"]}),(0,t.jsxs)("label",{className:"form-control w-full gap-2",children:[(0,t.jsx)("span",{className:"label-text text-xs uppercase tracking-wide opacity-70",children:"Server URL"}),(0,t.jsx)("input",{type:"url",className:"input input-bordered w-full",placeholder:p,value:w,onChange:e=>_(e.target.value),disabled:"gitlab"===N})]}),(0,t.jsxs)("label",{className:"form-control w-full gap-2",children:[(0,t.jsx)("span",{className:"label-text text-xs uppercase tracking-wide opacity-70",children:"Personal Access Token"}),(0,t.jsx)("input",{type:"password",className:"input input-bordered w-full",placeholder:"glpat-xxx",value:y,onChange:e=>j(e.target.value),disabled:"gitlab"===N})]}),(0,t.jsx)("div",{className:"card-actions justify-end pt-1",children:(0,t.jsxs)("button",{className:"btn btn-primary btn-sm",onClick:()=>void $(),disabled:"gitlab"===N,children:["gitlab"===N?(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,t.jsx)(o.KeyRound,{className:"h-4 w-4"}),"Add Credential"]})}),(0,t.jsx)("div",{className:"divider my-0"}),0===M.length?(0,t.jsx)("div",{className:"text-sm opacity-60",children:"No GitLab credentials saved."}):(0,t.jsx)("div",{className:"space-y-2",children:M.map(e=>(0,t.jsx)("div",{className:"rounded-md border border-base-300 bg-base-100 p-3",children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0 flex items-start gap-2",children:[(0,t.jsx)(h,{type:"gitlab"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium truncate",children:e.username}),(0,t.jsx)("div",{className:"text-xs opacity-70 truncate",children:e.serverUrl}),(0,t.jsxs)("div",{className:"text-xs opacity-60",children:["Updated ",new Date(e.updatedAt).toLocaleString()]})]})]}),(0,t.jsxs)("button",{className:"btn btn-error btn-outline btn-xs",onClick:()=>void A(e),disabled:C===e.id,children:[C===e.id?(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,t.jsx)(d.Trash2,{className:"h-3.5 w-3.5"}),"Delete"]})]})},e.id))})]})})]})]})})}e.s(["default",()=>b],63768)}]);
|
|
3
|
+
Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let n=(0,a.findClosestQuality)(s,e),l=(0,i.getDeploymentId)();return`${e.path}?url=${encodeURIComponent(t)}&w=${r}&q=${n}${t.startsWith("/")&&l?`&dpl=${l}`:""}`}s.__next_img_default=!0;let n=s},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return i}});let a=e.r(71645);function i(e,t){let r=(0,a.useRef)(null),i=(0,a.useRef)(null);return(0,a.useCallback)(a=>{if(null===a){let e=r.current;e&&(r.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(r.current=s(e,a)),t&&(i.current=s(t,a))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},5500,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"Image",{enumerable:!0,get:function(){return y}});let a=e.r(55682),i=e.r(90809),s=e.r(43476),n=i._(e.r(71645)),l=a._(e.r(74080)),o=a._(e.r(25633)),d=e.r(8927),c=e.r(87690),u=e.r(18556);e.r(33525);let f=e.r(65856),p=a._(e.r(1948)),m=e.r(18581),g={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function h(e,t,r,a,i,s,n){let l=e?.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&i(!0),r?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let a=!1,i=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>a,isPropagationStopped:()=>i,persist:()=>{},preventDefault:()=>{a=!0,t.preventDefault()},stopPropagation:()=>{i=!0,t.stopPropagation()}})}a?.current&&a.current(e)}}))}function b(e){return n.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let x=(0,n.forwardRef)(({src:e,srcSet:t,sizes:r,height:a,width:i,decoding:l,className:o,style:d,fetchPriority:c,placeholder:u,loading:f,unoptimized:p,fill:g,onLoadRef:x,onLoadingCompleteRef:v,setBlurComplete:y,setShowAltText:j,sizesInput:w,onLoad:_,onError:N,...S},C)=>{let P=(0,n.useCallback)(e=>{e&&(N&&(e.src=e.src),e.complete&&h(e,u,x,v,y,p,w))},[e,u,x,v,y,N,p,w]),O=(0,m.useMergedRef)(C,P);return(0,s.jsx)("img",{...S,...b(c),loading:f,width:i,height:a,decoding:l,"data-nimg":g?"fill":"1",className:o,style:d,sizes:r,srcSet:t,src:e,ref:O,onLoad:e=>{h(e.currentTarget,u,x,v,y,p,w)},onError:e=>{j(!0),"empty"!==u&&y(!0),N&&N(e)}})});function v({isAppRouter:e,imgAttributes:t}){let r={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...b(t.fetchPriority)};return e&&l.default.preload?(l.default.preload(t.src,r),null):(0,s.jsx)(o.default,{children:(0,s.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...r},"__nimg-"+t.src+t.srcSet+t.sizes)})}let y=(0,n.forwardRef)((e,t)=>{let r=(0,n.useContext)(f.RouterContext),a=(0,n.useContext)(u.ImageConfigContext),i=(0,n.useMemo)(()=>{let e=g||a||c.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),r=e.deviceSizes.sort((e,t)=>e-t),i=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:r,qualities:i,localPatterns:"u"<typeof window?a?.localPatterns:e.localPatterns}},[a]),{onLoad:l,onLoadingComplete:o}=e,m=(0,n.useRef)(l);(0,n.useEffect)(()=>{m.current=l},[l]);let h=(0,n.useRef)(o);(0,n.useEffect)(()=>{h.current=o},[o]);let[b,y]=(0,n.useState)(!1),[j,w]=(0,n.useState)(!1),{props:_,meta:N}=(0,d.getImgProps)(e,{defaultLoader:p.default,imgConf:i,blurComplete:b,showAltText:j});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x,{..._,unoptimized:N.unoptimized,placeholder:N.placeholder,fill:N.fill,onLoadRef:m,onLoadingCompleteRef:h,setBlurComplete:y,setShowAltText:w,sizesInput:e.sizes,ref:t}),N.preload?(0,s.jsx)(v,{isAppRouter:!r,imgAttributes:_}):null]})});("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},94909,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={default:function(){return c},getImageProps:function(){return d}};for(var i in a)Object.defineProperty(r,i,{enumerable:!0,get:a[i]});let s=e.r(55682),n=e.r(8927),l=e.r(5500),o=s._(e.r(1948));function d(e){let{props:t}=(0,n.getImgProps)(e,{defaultLoader:o.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}}let c=l.Image},57688,(e,t,r)=>{t.exports=e.r(94909)},18566,(e,t,r)=>{t.exports=e.r(76562)},29031,e=>{"use strict";var t=e.i(95187);let r=(0,t.createServerReference)("003ae9a4fbde15f52fabe8519a48c8b6448c94b0f1",t.callServer,void 0,t.findSourceMapURL,"listCredentials");e.s(["listCredentials",()=>r])},65261,e=>{"use strict";let t=(0,e.i(75254).default)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);e.s(["KeyRound",()=>t],65261)},63768,e=>{"use strict";var t=e.i(43476),r=e.i(29031),a=e.i(95187);let i=(0,a.createServerReference)("40ef60f192924d138cb16ffdcc20a6ef23a2d66d3c",a.callServer,void 0,a.findSourceMapURL,"removeCredential"),s=(0,a.createServerReference)("40f308ba83a5cba4832ef38d5a458d9e137d31d07c",a.callServer,void 0,a.findSourceMapURL,"saveGitHubCredential"),n=(0,a.createServerReference)("60dc891c8cd44fc8fccf78cdad1f402b7d26f18a10",a.callServer,void 0,a.findSourceMapURL,"saveGitLabCredential");var l=e.i(71689),o=e.i(65261),d=e.i(27612),c=e.i(57688),u=e.i(18566),f=e.i(71645);let p="https://gitlab.com",m={github:"https://www.google.com/s2/favicons?domain=github.com&sz=64",gitlab:"https://www.google.com/s2/favicons?domain=gitlab.com&sz=64"};function g(e){return"github"===e?"GitHub":"GitLab"}function h({type:e}){return(0,t.jsx)(c.default,{src:m[e],alt:`${g(e)} icon`,width:20,height:20,className:"h-5 w-5 rounded-sm",unoptimized:!0})}function b(){let e=(0,u.useRouter)(),[a,c]=(0,f.useState)([]),[m,b]=(0,f.useState)(!0),[x,v]=(0,f.useState)(""),[y,j]=(0,f.useState)(""),[w,_]=(0,f.useState)(p),[N,S]=(0,f.useState)(null),[C,P]=(0,f.useState)(null),[O,R]=(0,f.useState)(null),E=(0,f.useMemo)(()=>a.filter(e=>"github"===e.type),[a]),M=(0,f.useMemo)(()=>a.filter(e=>"gitlab"===e.type),[a]),k=async()=>{let e=await (0,r.listCredentials)();if(!e.success){R({tone:"error",text:e.error}),b(!1);return}c(e.credentials),b(!1)};(0,f.useEffect)(()=>{let e=!0;return(async()=>{let t=await (0,r.listCredentials)();if(e){if(!t.success){R({tone:"error",text:t.error}),b(!1);return}c(t.credentials),b(!1)}})(),()=>{e=!1}},[]);let z=async()=>{R(null),S("github");let e=await s(x);if(!e.success){R({tone:"error",text:e.error}),S(null);return}v(""),R({tone:"success",text:"GitHub credential added."}),await k(),S(null)},$=async()=>{R(null),S("gitlab");let e=await n(w,y);if(!e.success){R({tone:"error",text:e.error}),S(null);return}j(""),R({tone:"success",text:"GitLab credential added."}),await k(),S(null)},A=async e=>{let t=g(e.type);if(!confirm(`Delete this ${t} credential for ${"gitlab"===e.type?`${e.username} @ ${e.serverUrl}`:e.username}?`))return;R(null),P(e.id);let r=await i(e.id);if(!r.success){R({tone:"error",text:r.error}),P(null);return}R({tone:"success",text:`${t} credential deleted.`}),await k(),P(null)};return(0,t.jsx)("main",{className:"min-h-screen bg-base-100 p-4 md:p-10",children:(0,t.jsxs)("div",{className:"mx-auto w-full max-w-5xl space-y-5",children:[(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("button",{className:"btn btn-ghost btn-sm",onClick:()=>e.push("/"),children:[(0,t.jsx)(l.ArrowLeft,{className:"h-4 w-4"}),"Back"]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold",children:"Credentials"}),(0,t.jsx)("p",{className:"text-sm opacity-70",children:"GitHub and GitLab API tokens are stored securely in your system keychain."})]})]})}),O&&(0,t.jsx)("div",{className:`alert ${"error"===O.tone?"alert-error":"alert-success"} text-sm`,children:O.text}),m?(0,t.jsx)("div",{className:"card bg-base-200 shadow-xl",children:(0,t.jsxs)("div",{className:"card-body items-center py-10",children:[(0,t.jsx)("span",{className:"loading loading-spinner loading-md"}),(0,t.jsx)("p",{className:"text-sm opacity-70",children:"Loading credentials..."})]})}):(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-2 items-start",children:[(0,t.jsx)("div",{className:"card bg-base-200 shadow-xl",children:(0,t.jsxs)("div",{className:"card-body space-y-4",children:[(0,t.jsxs)("h2",{className:"card-title flex items-center gap-2",children:[(0,t.jsx)(h,{type:"github"}),"GitHub"]}),(0,t.jsxs)("label",{className:"form-control w-full gap-2",children:[(0,t.jsx)("span",{className:"label-text text-xs uppercase tracking-wide opacity-70",children:"Personal Access Token"}),(0,t.jsx)("input",{type:"password",className:"input input-bordered w-full",placeholder:"ghp_xxx",value:x,onChange:e=>v(e.target.value),disabled:"github"===N})]}),(0,t.jsx)("div",{className:"card-actions justify-end pt-1",children:(0,t.jsxs)("button",{className:"btn btn-primary btn-sm",onClick:()=>void z(),disabled:"github"===N,children:["github"===N?(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,t.jsx)(o.KeyRound,{className:"h-4 w-4"}),"Add Credential"]})}),(0,t.jsx)("div",{className:"divider my-0"}),0===E.length?(0,t.jsx)("div",{className:"text-sm opacity-60",children:"No GitHub credentials saved."}):(0,t.jsx)("div",{className:"space-y-2",children:E.map(e=>(0,t.jsx)("div",{className:"rounded-md border border-base-300 bg-base-100 p-3",children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0 flex items-start gap-2",children:[(0,t.jsx)(h,{type:"github"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium truncate",children:e.username}),(0,t.jsxs)("div",{className:"text-xs opacity-60",children:["Updated ",new Date(e.updatedAt).toLocaleString()]})]})]}),(0,t.jsxs)("button",{className:"btn btn-error btn-outline btn-xs",onClick:()=>void A(e),disabled:C===e.id,children:[C===e.id?(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,t.jsx)(d.Trash2,{className:"h-3.5 w-3.5"}),"Delete"]})]})},e.id))})]})}),(0,t.jsx)("div",{className:"card bg-base-200 shadow-xl",children:(0,t.jsxs)("div",{className:"card-body space-y-4",children:[(0,t.jsxs)("h2",{className:"card-title flex items-center gap-2",children:[(0,t.jsx)(h,{type:"gitlab"}),"GitLab"]}),(0,t.jsxs)("label",{className:"form-control w-full gap-2",children:[(0,t.jsx)("span",{className:"label-text text-xs uppercase tracking-wide opacity-70",children:"Server URL"}),(0,t.jsx)("input",{type:"url",className:"input input-bordered w-full",placeholder:p,value:w,onChange:e=>_(e.target.value),disabled:"gitlab"===N})]}),(0,t.jsxs)("label",{className:"form-control w-full gap-2",children:[(0,t.jsx)("span",{className:"label-text text-xs uppercase tracking-wide opacity-70",children:"Personal Access Token"}),(0,t.jsx)("input",{type:"password",className:"input input-bordered w-full",placeholder:"glpat-xxx",value:y,onChange:e=>j(e.target.value),disabled:"gitlab"===N})]}),(0,t.jsx)("div",{className:"card-actions justify-end pt-1",children:(0,t.jsxs)("button",{className:"btn btn-primary btn-sm",onClick:()=>void $(),disabled:"gitlab"===N,children:["gitlab"===N?(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,t.jsx)(o.KeyRound,{className:"h-4 w-4"}),"Add Credential"]})}),(0,t.jsx)("div",{className:"divider my-0"}),0===M.length?(0,t.jsx)("div",{className:"text-sm opacity-60",children:"No GitLab credentials saved."}):(0,t.jsx)("div",{className:"space-y-2",children:M.map(e=>(0,t.jsx)("div",{className:"rounded-md border border-base-300 bg-base-100 p-3",children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0 flex items-start gap-2",children:[(0,t.jsx)(h,{type:"gitlab"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium truncate",children:e.username}),(0,t.jsx)("div",{className:"text-xs opacity-70 truncate",children:e.serverUrl}),(0,t.jsxs)("div",{className:"text-xs opacity-60",children:["Updated ",new Date(e.updatedAt).toLocaleString()]})]})]}),(0,t.jsxs)("button",{className:"btn btn-error btn-outline btn-xs",onClick:()=>void A(e),disabled:C===e.id,children:[C===e.id?(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,t.jsx)(d.Trash2,{className:"h-3.5 w-3.5"}),"Delete"]})]})},e.id))})]})})]})]})})}e.s(["default",()=>b],63768)}]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "viba-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Local session manager for AI coding agents.",
|
|
6
6
|
"repository": {
|
|
@@ -51,13 +51,15 @@
|
|
|
51
51
|
"react-dom": "19.2.3",
|
|
52
52
|
"simple-git": "^3.30.0",
|
|
53
53
|
"tailwind-merge": "^3.4.0",
|
|
54
|
-
"uuid": "^13.0.0"
|
|
54
|
+
"uuid": "^13.0.0",
|
|
55
|
+
"ws": "^8.19.0"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
58
|
"@tailwindcss/postcss": "^4",
|
|
58
59
|
"@types/node": "^20",
|
|
59
60
|
"@types/react": "^19",
|
|
60
61
|
"@types/react-dom": "^19",
|
|
62
|
+
"@types/ws": "^8.18.1",
|
|
61
63
|
"eslint": "^9",
|
|
62
64
|
"eslint-config-next": "16.1.6",
|
|
63
65
|
"gfport": "^1.0.1",
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[70406,(e,r,t)=>{r.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,r,t)=>{r.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,r,t)=>{r.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},14747,(e,r,t)=>{r.exports=e.x("path",()=>require("path"))},24361,(e,r,t)=>{r.exports=e.x("util",()=>require("util"))},24868,(e,r,t)=>{r.exports=e.x("fs/promises",()=>require("fs/promises"))},33405,(e,r,t)=>{r.exports=e.x("child_process",()=>require("child_process"))}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Bexternals%5D__5d99c4a5._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[70406,(e,r,t)=>{r.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,r,t)=>{r.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,r,t)=>{r.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},14747,(e,r,t)=>{r.exports=e.x("path",()=>require("path"))},24361,(e,r,t)=>{r.exports=e.x("util",()=>require("util"))},46786,(e,r,t)=>{r.exports=e.x("os",()=>require("os"))},70722,(e,r,t)=>{r.exports=e.x("tty",()=>require("tty"))}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Bexternals%5D__60650a97._.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
module.exports=[20460,(a,b,c)=>{(()=>{"use strict";"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/next/dist/compiled/cookie/");var a,c,d,e,f={};f.parse=function(b,c){if("string"!=typeof b)throw TypeError("argument str must be a string");for(var e={},f=b.split(d),g=(c||{}).decode||a,h=0;h<f.length;h++){var i=f[h],j=i.indexOf("=");if(!(j<0)){var k=i.substr(0,j).trim(),l=i.substr(++j,i.length).trim();'"'==l[0]&&(l=l.slice(1,-1)),void 0==e[k]&&(e[k]=function(a,b){try{return b(a)}catch(b){return a}}(l,g))}}return e},f.serialize=function(a,b,d){var f=d||{},g=f.encode||c;if("function"!=typeof g)throw TypeError("option encode is invalid");if(!e.test(a))throw TypeError("argument name is invalid");var h=g(b);if(h&&!e.test(h))throw TypeError("argument val is invalid");var i=a+"="+h;if(null!=f.maxAge){var j=f.maxAge-0;if(isNaN(j)||!isFinite(j))throw TypeError("option maxAge is invalid");i+="; Max-Age="+Math.floor(j)}if(f.domain){if(!e.test(f.domain))throw TypeError("option domain is invalid");i+="; Domain="+f.domain}if(f.path){if(!e.test(f.path))throw TypeError("option path is invalid");i+="; Path="+f.path}if(f.expires){if("function"!=typeof f.expires.toUTCString)throw TypeError("option expires is invalid");i+="; Expires="+f.expires.toUTCString()}if(f.httpOnly&&(i+="; HttpOnly"),f.secure&&(i+="; Secure"),f.sameSite)switch("string"==typeof f.sameSite?f.sameSite.toLowerCase():f.sameSite){case!0:case"strict":i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"none":i+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return i},a=decodeURIComponent,c=encodeURIComponent,d=/; */,e=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,b.exports=f})()},93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},69726,a=>{a.n(a.i(66114))},71029,(a,b,c)=>{"use strict";c._=function(a){return a&&a.__esModule?a:{default:a}}},25556,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return k}}),a.r(71029);let d=a.r(7997);a.r(717);let e={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"},f={lineHeight:"48px"},g={display:"inline-block",margin:"0 20px 0 0",paddingRight:23,fontSize:24,fontWeight:500,verticalAlign:"top"},h={fontSize:14,fontWeight:400,lineHeight:"28px"},i={display:"inline-block"},j=`body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
|
|
2
|
-
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}`,k=function(){let a="Internal Server Error.",b=`500: ${a}`;return(0,d.jsxs)("html",{id:"__next_error__",children:[(0,d.jsx)("head",{children:(0,d.jsx)("title",{children:b})}),(0,d.jsx)("body",{children:(0,d.jsx)("div",{style:e,children:(0,d.jsxs)("div",{style:f,children:[(0,d.jsx)("style",{dangerouslySetInnerHTML:{__html:j}}),(0,d.jsx)("h1",{className:"next-error-h1",style:g,children:"500"}),(0,d.jsx)("div",{style:i,children:(0,d.jsx)("h2",{style:h,children:a})})]})})})]})};("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)}];
|
|
3
|
-
|
|
4
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__cb11b5eb._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[72131,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].React},38783,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactServerDOMTurbopackClient},35112,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactDOM},9270,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.AppRouterContext},36313,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.HooksClientContext},18341,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.ServerInsertedHtml},18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},42602,(a,b,c)=>{"use strict";b.exports=a.r(18622)},87924,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactJsxRuntime},21186,a=>{"use strict";var b=a.i(5050);let c=(0,b.createServerReference)("0058482a3f779e30eb7c7fa78b3ade6cf4b4ab4c3a",b.callServer,void 0,b.findSourceMapURL,"listCredentials");a.s(["listCredentials",()=>c])},37047,a=>{"use strict";let b=(0,a.i(70106).default)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);a.s(["KeyRound",()=>b],37047)},12465,a=>{"use strict";var b=a.i(87924),c=a.i(21186),d=a.i(5050);let e=(0,d.createServerReference)("40fc745be0212884313fc6f7061c3f76f9660b8c0c",d.callServer,void 0,d.findSourceMapURL,"removeCredential"),f=(0,d.createServerReference)("401d840f71fb762b59873335159da54b87dfec2c91",d.callServer,void 0,d.findSourceMapURL,"saveGitHubCredential"),g=(0,d.createServerReference)("604540b835a6556f3083523ddd6fb736c86f0855da",d.callServer,void 0,d.findSourceMapURL,"saveGitLabCredential");var h=a.i(210),i=a.i(37047),j=a.i(81560),k=a.i(71987),l=a.i(50944),m=a.i(72131);let n="https://gitlab.com",o={github:"https://www.google.com/s2/favicons?domain=github.com&sz=64",gitlab:"https://www.google.com/s2/favicons?domain=gitlab.com&sz=64"};function p(a){return"github"===a?"GitHub":"GitLab"}function q({type:a}){return(0,b.jsx)(k.default,{src:o[a],alt:`${p(a)} icon`,width:20,height:20,className:"h-5 w-5 rounded-sm",unoptimized:!0})}function r(){let a=(0,l.useRouter)(),[d,k]=(0,m.useState)([]),[o,r]=(0,m.useState)(!0),[s,t]=(0,m.useState)(""),[u,v]=(0,m.useState)(""),[w,x]=(0,m.useState)(n),[y,z]=(0,m.useState)(null),[A,B]=(0,m.useState)(null),[C,D]=(0,m.useState)(null),E=(0,m.useMemo)(()=>d.filter(a=>"github"===a.type),[d]),F=(0,m.useMemo)(()=>d.filter(a=>"gitlab"===a.type),[d]),G=async()=>{let a=await (0,c.listCredentials)();if(!a.success){D({tone:"error",text:a.error}),r(!1);return}k(a.credentials),r(!1)};(0,m.useEffect)(()=>{let a=!0;return(async()=>{let b=await (0,c.listCredentials)();if(a){if(!b.success){D({tone:"error",text:b.error}),r(!1);return}k(b.credentials),r(!1)}})(),()=>{a=!1}},[]);let H=async()=>{D(null),z("github");let a=await f(s);if(!a.success){D({tone:"error",text:a.error}),z(null);return}t(""),D({tone:"success",text:"GitHub credential added."}),await G(),z(null)},I=async()=>{D(null),z("gitlab");let a=await g(w,u);if(!a.success){D({tone:"error",text:a.error}),z(null);return}v(""),D({tone:"success",text:"GitLab credential added."}),await G(),z(null)},J=async a=>{let b=p(a.type);if(!confirm(`Delete this ${b} credential for ${"gitlab"===a.type?`${a.username} @ ${a.serverUrl}`:a.username}?`))return;D(null),B(a.id);let c=await e(a.id);if(!c.success){D({tone:"error",text:c.error}),B(null);return}D({tone:"success",text:`${b} credential deleted.`}),await G(),B(null)};return(0,b.jsx)("main",{className:"min-h-screen bg-base-100 p-4 md:p-10",children:(0,b.jsxs)("div",{className:"mx-auto w-full max-w-5xl space-y-5",children:[(0,b.jsx)("div",{className:"flex items-center justify-between",children:(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsxs)("button",{className:"btn btn-ghost btn-sm",onClick:()=>a.push("/"),children:[(0,b.jsx)(h.ArrowLeft,{className:"h-4 w-4"}),"Back"]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-2xl font-semibold",children:"Credentials"}),(0,b.jsx)("p",{className:"text-sm opacity-70",children:"GitHub and GitLab API tokens are stored securely in your system keychain."})]})]})}),C&&(0,b.jsx)("div",{className:`alert ${"error"===C.tone?"alert-error":"alert-success"} text-sm`,children:C.text}),o?(0,b.jsx)("div",{className:"card bg-base-200 shadow-xl",children:(0,b.jsxs)("div",{className:"card-body items-center py-10",children:[(0,b.jsx)("span",{className:"loading loading-spinner loading-md"}),(0,b.jsx)("p",{className:"text-sm opacity-70",children:"Loading credentials..."})]})}):(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-2 items-start",children:[(0,b.jsx)("div",{className:"card bg-base-200 shadow-xl",children:(0,b.jsxs)("div",{className:"card-body space-y-4",children:[(0,b.jsxs)("h2",{className:"card-title flex items-center gap-2",children:[(0,b.jsx)(q,{type:"github"}),"GitHub"]}),(0,b.jsxs)("label",{className:"form-control w-full gap-2",children:[(0,b.jsx)("span",{className:"label-text text-xs uppercase tracking-wide opacity-70",children:"Personal Access Token"}),(0,b.jsx)("input",{type:"password",className:"input input-bordered w-full",placeholder:"ghp_xxx",value:s,onChange:a=>t(a.target.value),disabled:"github"===y})]}),(0,b.jsx)("div",{className:"card-actions justify-end pt-1",children:(0,b.jsxs)("button",{className:"btn btn-primary btn-sm",onClick:()=>void H(),disabled:"github"===y,children:["github"===y?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,b.jsx)(i.KeyRound,{className:"h-4 w-4"}),"Add Credential"]})}),(0,b.jsx)("div",{className:"divider my-0"}),0===E.length?(0,b.jsx)("div",{className:"text-sm opacity-60",children:"No GitHub credentials saved."}):(0,b.jsx)("div",{className:"space-y-2",children:E.map(a=>(0,b.jsx)("div",{className:"rounded-md border border-base-300 bg-base-100 p-3",children:(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsxs)("div",{className:"min-w-0 flex items-start gap-2",children:[(0,b.jsx)(q,{type:"github"}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("div",{className:"text-sm font-medium truncate",children:a.username}),(0,b.jsxs)("div",{className:"text-xs opacity-60",children:["Updated ",new Date(a.updatedAt).toLocaleString()]})]})]}),(0,b.jsxs)("button",{className:"btn btn-error btn-outline btn-xs",onClick:()=>void J(a),disabled:A===a.id,children:[A===a.id?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,b.jsx)(j.Trash2,{className:"h-3.5 w-3.5"}),"Delete"]})]})},a.id))})]})}),(0,b.jsx)("div",{className:"card bg-base-200 shadow-xl",children:(0,b.jsxs)("div",{className:"card-body space-y-4",children:[(0,b.jsxs)("h2",{className:"card-title flex items-center gap-2",children:[(0,b.jsx)(q,{type:"gitlab"}),"GitLab"]}),(0,b.jsxs)("label",{className:"form-control w-full gap-2",children:[(0,b.jsx)("span",{className:"label-text text-xs uppercase tracking-wide opacity-70",children:"Server URL"}),(0,b.jsx)("input",{type:"url",className:"input input-bordered w-full",placeholder:n,value:w,onChange:a=>x(a.target.value),disabled:"gitlab"===y})]}),(0,b.jsxs)("label",{className:"form-control w-full gap-2",children:[(0,b.jsx)("span",{className:"label-text text-xs uppercase tracking-wide opacity-70",children:"Personal Access Token"}),(0,b.jsx)("input",{type:"password",className:"input input-bordered w-full",placeholder:"glpat-xxx",value:u,onChange:a=>v(a.target.value),disabled:"gitlab"===y})]}),(0,b.jsx)("div",{className:"card-actions justify-end pt-1",children:(0,b.jsxs)("button",{className:"btn btn-primary btn-sm",onClick:()=>void I(),disabled:"gitlab"===y,children:["gitlab"===y?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,b.jsx)(i.KeyRound,{className:"h-4 w-4"}),"Add Credential"]})}),(0,b.jsx)("div",{className:"divider my-0"}),0===F.length?(0,b.jsx)("div",{className:"text-sm opacity-60",children:"No GitLab credentials saved."}):(0,b.jsx)("div",{className:"space-y-2",children:F.map(a=>(0,b.jsx)("div",{className:"rounded-md border border-base-300 bg-base-100 p-3",children:(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsxs)("div",{className:"min-w-0 flex items-start gap-2",children:[(0,b.jsx)(q,{type:"gitlab"}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("div",{className:"text-sm font-medium truncate",children:a.username}),(0,b.jsx)("div",{className:"text-xs opacity-70 truncate",children:a.serverUrl}),(0,b.jsxs)("div",{className:"text-xs opacity-60",children:["Updated ",new Date(a.updatedAt).toLocaleString()]})]})]}),(0,b.jsxs)("button",{className:"btn btn-error btn-outline btn-xs",onClick:()=>void J(a),disabled:A===a.id,children:[A===a.id?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,b.jsx)(j.Trash2,{className:"h-3.5 w-3.5"}),"Delete"]})]})},a.id))})]})})]})]})})}a.s(["default",()=>r],12465)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__e82329f4._.js.map
|
/package/.next/server/chunks/{[externals]__5d99c4a5._.js.map → [externals]__6f5f63a1._.js.map}
RENAMED
|
File without changes
|
/package/.next/server/chunks/{[externals]__60650a97._.js.map → [externals]__ad3eabe7._.js.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/.next/static/{qwxuOZqgaZ7EDiFJjudgy → T2HRQ3n5Gcw83spbEWvCi}/_clientMiddlewareManifest.json
RENAMED
|
File without changes
|
|
File without changes
|