commandmate 0.2.12 → 0.3.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/.env.example +21 -2
- package/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +30 -22
- package/.next/app-path-routes-manifest.json +1 -1
- package/.next/build-manifest.json +7 -7
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/1.pack +0 -0
- package/.next/cache/webpack/client-production/2.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/react-loadable-manifest.json +2 -2
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +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/api/app/update-check/route.js +1 -1
- package/.next/server/app/api/auth/login/route.js +1 -0
- package/.next/server/app/api/auth/login/route.js.nft.json +1 -0
- package/.next/server/app/api/auth/logout/route.js +1 -0
- package/.next/server/app/api/auth/logout/route.js.nft.json +1 -0
- package/.next/server/app/api/auth/status/route.js +1 -0
- package/.next/server/app/api/auth/status/route.js.nft.json +1 -0
- package/.next/server/app/api/hooks/claude-done/route.js +1 -1
- package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/route.js +2 -2
- package/.next/server/app/api/repositories/route.js.nft.json +1 -1
- package/.next/server/app/api/slash-commands/route.js +1 -1
- package/.next/server/app/api/slash-commands/route.js.nft.json +1 -1
- package/.next/server/app/api/slash-commands.body +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/start-polling/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/start-polling/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/route.js +1 -1
- package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
- package/.next/server/app/login/page.js +1 -0
- package/.next/server/app/login/page.js.nft.json +1 -0
- package/.next/server/app/login/page_client-reference-manifest.js +1 -0
- package/.next/server/app/page.js +2 -2
- 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/worktrees/[id]/files/[...path]/page.js +1 -1
- package/.next/server/app/worktrees/[id]/files/[...path]/page.js.nft.json +1 -1
- package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/page.js +3 -3
- package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
- package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page.js +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page.js.nft.json +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +13 -9
- package/.next/server/chunks/3013.js +1 -0
- package/.next/server/chunks/3074.js +1 -0
- package/.next/server/chunks/{1287.js → 3294.js} +2 -2
- package/.next/server/chunks/3860.js +1 -1
- package/.next/server/chunks/4893.js +2 -2
- package/.next/server/chunks/539.js +35 -0
- package/.next/server/chunks/5795.js +1 -0
- package/.next/server/chunks/7536.js +1 -1
- package/.next/server/chunks/7566.js +19 -0
- package/.next/server/chunks/8693.js +1 -1
- package/.next/server/edge-runtime-webpack.js +2 -0
- package/.next/server/edge-runtime-webpack.js.map +1 -0
- package/.next/server/functions-config-manifest.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-manifest.json +28 -2
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/server/src/middleware.js +14 -0
- package/.next/server/src/middleware.js.map +1 -0
- package/.next/static/chunks/{2626.2125083a1ff3b80a.js → 6163.f672451d4575decf.js} +1 -1
- package/.next/static/chunks/{656.d72f25ce819bd77e.js → 656.5e2de0173f5a06bd.js} +1 -1
- package/.next/static/chunks/8091-925542bdfc843dce.js +1 -0
- package/.next/static/chunks/8528-4d554d3b94d4cf9b.js +1 -0
- package/.next/static/chunks/app/{layout-07755491d5d57242.js → layout-9110f9a5e41c6bf4.js} +1 -1
- package/.next/static/chunks/app/login/page-2d42204ba87cd136.js +1 -0
- package/.next/static/chunks/app/page-238b5a70d8c101e9.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/page-9418e49bdc1de02c.js +1 -0
- package/.next/static/chunks/main-db79434ee4a6c931.js +1 -0
- package/.next/static/chunks/webpack-3c0ee3ce5b546818.js +1 -0
- package/.next/static/css/b9ea6a4fad17dc32.css +3 -0
- package/.next/trace +5 -5
- package/.next/types/app/api/auth/login/route.ts +343 -0
- package/.next/types/app/api/auth/logout/route.ts +343 -0
- package/.next/types/app/api/auth/status/route.ts +343 -0
- package/.next/types/app/login/page.ts +79 -0
- package/README.md +6 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +2 -0
- package/dist/cli/commands/start.d.ts +2 -0
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +159 -14
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +4 -0
- package/dist/cli/config/security-messages.d.ts +3 -1
- package/dist/cli/config/security-messages.d.ts.map +1 -1
- package/dist/cli/config/security-messages.js +6 -2
- package/dist/cli/index.js +17 -0
- package/dist/cli/types/index.d.ts +17 -0
- package/dist/cli/types/index.d.ts.map +1 -1
- package/dist/cli/utils/daemon.d.ts.map +1 -1
- package/dist/cli/utils/daemon.js +16 -3
- package/dist/config/auth-config.d.ts +43 -0
- package/dist/config/auth-config.d.ts.map +1 -0
- package/dist/config/auth-config.js +112 -0
- package/dist/lib/auth.d.ts +104 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/auth.js +250 -0
- package/dist/server/server.js +123 -12
- package/dist/server/src/config/auth-config.js +112 -0
- package/dist/server/src/lib/auth.js +250 -0
- package/dist/server/src/lib/auto-yes-manager.js +180 -96
- package/dist/server/src/lib/ip-restriction.js +241 -0
- package/dist/server/src/lib/response-poller.js +92 -39
- package/dist/server/src/lib/ws-server.js +63 -33
- package/dist/server/src/types/slash-commands.js +1 -0
- package/package.json +2 -2
- package/.next/server/chunks/9238.js +0 -35
- package/.next/server/chunks/9367.js +0 -19
- package/.next/static/chunks/5970-2e18108d0cabd8af.js +0 -1
- package/.next/static/chunks/816-af44cb865b0c980e.js +0 -1
- package/.next/static/chunks/app/page-a6593b9640df66a6.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/page-c99258f57461962c.js +0 -1
- package/.next/static/chunks/main-f00f82f1cf18dd99.js +0 -1
- package/.next/static/chunks/webpack-af8567a485ade35a.js +0 -1
- package/.next/static/css/897ffb669f47c97b.css +0 -3
- /package/.next/static/{ym6mA6Dl9wX62h3AoYO45 → clTo9tuAoPMLcGRuVENfO}/_buildManifest.js +0 -0
- /package/.next/static/{ym6mA6Dl9wX62h3AoYO45 → clTo9tuAoPMLcGRuVENfO}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var e={};e.id=4931,e.ids=[4931],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},98216:e=>{e.exports=require("net")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},82452:e=>{e.exports=require("tls")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},46769:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>k,patchFetch:()=>q,requestAsyncStorage:()=>x,routeModule:()=>f,serverHooks:()=>v,staticGenerationAsyncStorage:()=>w});var i={};r.r(i),r.d(i,{GET:()=>m,PATCH:()=>h});var o=r(49303),n=r(88716),s=r(60670),a=r(87070),u=r(97425),p=r(75748),c=r(43839),d=r(89194),l=r(13561),g=r(3979);async function m(e,{params:t}){try{let e;let r=(0,u.n)(),i=(0,p.gU)(r,t.id);if(!i)return a.NextResponse.json({error:`Worktree '${t.id}' not found`},{status:404});let o=c.g.getInstance(),n={},s=!1,m=!1,h=!1;for(let e of["claude","codex","gemini"]){let i=o.getTool(e),a=await i.isRunning(t.id),u=!1,c=!1;if(a)try{let i=await (0,d.NA)(t.id,e,100),o=(0,l._)(i,e);u="waiting"===o.status,c="running"===o.status,!o.hasActivePrompt&&(0,p._U)(r,t.id,void 0,10,e).some(e=>"prompt"===e.messageType&&e.promptData?.status!=="answered")&&(0,p.GP)(r,t.id,e)}catch{c=!0}n[e]={isRunning:a,isWaitingForResponse:u,isProcessing:c},a&&(s=!0),u&&(m=!0),c&&(h=!0)}try{let o=(0,p.Q7)(r,t.id);e=await (0,g.v)(i.path,o)}catch(e){console.error("[GET /api/worktrees/:id] Failed to get git status:",e)}return a.NextResponse.json({...i,gitStatus:e,isSessionRunning:s,isWaitingForResponse:m,isProcessing:h,sessionStatusByCli:n},{status:200})}catch(e){return console.error("Error fetching worktree:",e),a.NextResponse.json({error:"Failed to fetch worktree"},{status:500})}}async function h(e,{params:t}){try{let r=(0,u.n)();if(!(0,p.gU)(r,t.id))return a.NextResponse.json({error:`Worktree '${t.id}' not found`},{status:404});let i=await e.json();"description"in i&&(0,p.xr)(r,t.id,i.description),"link"in i&&(0,p.y)(r,t.id,i.link),"favorite"in i&&"boolean"==typeof i.favorite&&(0,p.R3)(r,t.id,i.favorite),"status"in i&&["todo","doing","done",null].includes(i.status)&&(0,p.Nf)(r,t.id,i.status),"cliToolId"in i&&["claude","codex","gemini"].includes(i.cliToolId)&&(0,p.VW)(r,t.id,i.cliToolId);let o=(0,p.gU)(r,t.id),n=c.g.getInstance(),s=o?.cliToolId||"claude",d=n.getTool(s),l=await d.isRunning(t.id);return a.NextResponse.json({...o,isSessionRunning:l},{status:200})}catch(e){return console.error("Error updating worktree:",e),a.NextResponse.json({error:"Failed to update worktree"},{status:500})}}let f=new o.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/worktrees/[id]/route",pathname:"/api/worktrees/[id]",filename:"route",bundlePath:"app/api/worktrees/[id]/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/route.ts",nextConfigOutput:"",userland:i}),{requestAsyncStorage:x,staticGenerationAsyncStorage:w,serverHooks:v}=f,k="/api/worktrees/[id]/route";function q(){return(0,s.patchFetch)({serverHooks:v,staticGenerationAsyncStorage:w})}},3979:(e,t,r)=>{r.d(t,{v:()=>s});var i=r(61282);let o=(0,r(21764).promisify)(i.execFile);async function n(e,t){try{let{stdout:r}=await o("git",e,{cwd:t,timeout:1e3});return r.trim()}catch(t){return console.error("[git-utils] Git command failed:",{args:e,error:t instanceof Error?t.message:"Unknown error"}),null}}async function s(e,t){let r;let i=await n(["rev-parse","--abbrev-ref","HEAD"],e);r=null===i?"(unknown)":"HEAD"===i?"(detached HEAD)":i;let o=await n(["rev-parse","--short","HEAD"],e),s=await n(["status","--porcelain"],e);return{currentBranch:r,initialBranch:t,isBranchMismatch:null!==t&&"(unknown)"!==r&&"(detached HEAD)"!==r&&r!==t,commitHash:o??"(unknown)",isDirty:null!==s&&s.length>0}}},13561:(e,t,r)=>{r.d(t,{_:()=>n});var i=r(19377),o=r(63661);function n(e,t,r){let n=(0,i.vp)(e),s=n.split("\n"),a=s.length-1;for(;a>=0&&""===s[a].trim();)a--;let u=s.slice(0,a+1),p=u.slice(-15).join("\n"),c=u.slice(-5).join("\n"),d=(0,i.Sg)(t);if((0,o.F)(n,d).isPrompt)return{status:"waiting",confidence:"high",reason:"prompt_detected",hasActivePrompt:!0};if((0,i.Wg)(t,c))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1};let{promptPattern:l}=(0,i.bs)(t);return l.test(p)?{status:"ready",confidence:"high",reason:"input_prompt",hasActivePrompt:!1}:r&&Date.now()-r.getTime()>5e3?{status:"ready",confidence:"low",reason:"no_recent_output",hasActivePrompt:!1}:{status:"running",confidence:"low",reason:"default",hasActivePrompt:!1}}}};var t=require("../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),i=t.X(0,[8948,5972,3853,4893,7425,
|
|
1
|
+
"use strict";(()=>{var e={};e.id=4931,e.ids=[4931],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},98216:e=>{e.exports=require("net")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},82452:e=>{e.exports=require("tls")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},46769:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>k,patchFetch:()=>q,requestAsyncStorage:()=>x,routeModule:()=>f,serverHooks:()=>v,staticGenerationAsyncStorage:()=>w});var i={};r.r(i),r.d(i,{GET:()=>m,PATCH:()=>h});var o=r(49303),n=r(88716),s=r(60670),a=r(87070),u=r(97425),p=r(75748),c=r(43839),d=r(89194),l=r(13561),g=r(3979);async function m(e,{params:t}){try{let e;let r=(0,u.n)(),i=(0,p.gU)(r,t.id);if(!i)return a.NextResponse.json({error:`Worktree '${t.id}' not found`},{status:404});let o=c.g.getInstance(),n={},s=!1,m=!1,h=!1;for(let e of["claude","codex","gemini"]){let i=o.getTool(e),a=await i.isRunning(t.id),u=!1,c=!1;if(a)try{let i=await (0,d.NA)(t.id,e,100),o=(0,l._)(i,e);u="waiting"===o.status,c="running"===o.status,!o.hasActivePrompt&&(0,p._U)(r,t.id,void 0,10,e).some(e=>"prompt"===e.messageType&&e.promptData?.status!=="answered")&&(0,p.GP)(r,t.id,e)}catch{c=!0}n[e]={isRunning:a,isWaitingForResponse:u,isProcessing:c},a&&(s=!0),u&&(m=!0),c&&(h=!0)}try{let o=(0,p.Q7)(r,t.id);e=await (0,g.v)(i.path,o)}catch(e){console.error("[GET /api/worktrees/:id] Failed to get git status:",e)}return a.NextResponse.json({...i,gitStatus:e,isSessionRunning:s,isWaitingForResponse:m,isProcessing:h,sessionStatusByCli:n},{status:200})}catch(e){return console.error("Error fetching worktree:",e),a.NextResponse.json({error:"Failed to fetch worktree"},{status:500})}}async function h(e,{params:t}){try{let r=(0,u.n)();if(!(0,p.gU)(r,t.id))return a.NextResponse.json({error:`Worktree '${t.id}' not found`},{status:404});let i=await e.json();"description"in i&&(0,p.xr)(r,t.id,i.description),"link"in i&&(0,p.y)(r,t.id,i.link),"favorite"in i&&"boolean"==typeof i.favorite&&(0,p.R3)(r,t.id,i.favorite),"status"in i&&["todo","doing","done",null].includes(i.status)&&(0,p.Nf)(r,t.id,i.status),"cliToolId"in i&&["claude","codex","gemini"].includes(i.cliToolId)&&(0,p.VW)(r,t.id,i.cliToolId);let o=(0,p.gU)(r,t.id),n=c.g.getInstance(),s=o?.cliToolId||"claude",d=n.getTool(s),l=await d.isRunning(t.id);return a.NextResponse.json({...o,isSessionRunning:l},{status:200})}catch(e){return console.error("Error updating worktree:",e),a.NextResponse.json({error:"Failed to update worktree"},{status:500})}}let f=new o.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/worktrees/[id]/route",pathname:"/api/worktrees/[id]",filename:"route",bundlePath:"app/api/worktrees/[id]/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/route.ts",nextConfigOutput:"",userland:i}),{requestAsyncStorage:x,staticGenerationAsyncStorage:w,serverHooks:v}=f,k="/api/worktrees/[id]/route";function q(){return(0,s.patchFetch)({serverHooks:v,staticGenerationAsyncStorage:w})}},3979:(e,t,r)=>{r.d(t,{v:()=>s});var i=r(61282);let o=(0,r(21764).promisify)(i.execFile);async function n(e,t){try{let{stdout:r}=await o("git",e,{cwd:t,timeout:1e3});return r.trim()}catch(t){return console.error("[git-utils] Git command failed:",{args:e,error:t instanceof Error?t.message:"Unknown error"}),null}}async function s(e,t){let r;let i=await n(["rev-parse","--abbrev-ref","HEAD"],e);r=null===i?"(unknown)":"HEAD"===i?"(detached HEAD)":i;let o=await n(["rev-parse","--short","HEAD"],e),s=await n(["status","--porcelain"],e);return{currentBranch:r,initialBranch:t,isBranchMismatch:null!==t&&"(unknown)"!==r&&"(detached HEAD)"!==r&&r!==t,commitHash:o??"(unknown)",isDirty:null!==s&&s.length>0}}},13561:(e,t,r)=>{r.d(t,{_:()=>n});var i=r(19377),o=r(63661);function n(e,t,r){let n=(0,i.vp)(e),s=n.split("\n"),a=s.length-1;for(;a>=0&&""===s[a].trim();)a--;let u=s.slice(0,a+1),p=u.slice(-15).join("\n"),c=u.slice(-5).join("\n"),d=(0,i.Sg)(t);if((0,o.F)(n,d).isPrompt)return{status:"waiting",confidence:"high",reason:"prompt_detected",hasActivePrompt:!0};if((0,i.Wg)(t,c))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1};let{promptPattern:l}=(0,i.bs)(t);return l.test(p)?{status:"ready",confidence:"high",reason:"input_prompt",hasActivePrompt:!1}:r&&Date.now()-r.getTime()>5e3?{status:"ready",confidence:"low",reason:"no_recent_output",hasActivePrompt:!1}:{status:"running",confidence:"low",reason:"default",hasActivePrompt:!1}}}};var t=require("../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),i=t.X(0,[8948,5972,3853,4893,7425,7566,7536],()=>r(46769));module.exports=i})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":1,"files":["../../../../../../data/cm.db","../../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../../node_modules/better-sqlite3/package.json","../../../../../../node_modules/bindings/bindings.js","../../../../../../node_modules/bindings/package.json","../../../../../../node_modules/file-uri-to-path/index.js","../../../../../../node_modules/file-uri-to-path/package.json","../../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../node_modules/next/package.json","../../../../../../package.json","../../../../../package.json","../../../../chunks/3853.js","../../../../chunks/4893.js","../../../../chunks/5972.js","../../../../chunks/7425.js","../../../../chunks/7536.js","../../../../chunks/
|
|
1
|
+
{"version":1,"files":["../../../../../../data/cm.db","../../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../../node_modules/better-sqlite3/package.json","../../../../../../node_modules/bindings/bindings.js","../../../../../../node_modules/bindings/package.json","../../../../../../node_modules/file-uri-to-path/index.js","../../../../../../node_modules/file-uri-to-path/package.json","../../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../node_modules/next/package.json","../../../../../../package.json","../../../../../package.json","../../../../chunks/3853.js","../../../../chunks/4893.js","../../../../chunks/5972.js","../../../../chunks/7425.js","../../../../chunks/7536.js","../../../../chunks/7566.js","../../../../chunks/8948.js","../../../../webpack-runtime.js"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var e={};e.id=2702,e.ids=[2702],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},98216:e=>{e.exports=require("net")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},82452:e=>{e.exports=require("tls")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},41306:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>A,patchFetch:()=>b,requestAsyncStorage:()=>y,routeModule:()=>q,serverHooks:()=>k,staticGenerationAsyncStorage:()=>R});var s={};r.r(s),r.d(s,{POST:()=>$});var n=r(49303),o=r(88716),i=r(60670),a=r(87070),l=r(97425),u=r(75748),c=r(43839),d=r(59991),p=r(89194),m=r(
|
|
1
|
+
"use strict";(()=>{var e={};e.id=2702,e.ids=[2702],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},98216:e=>{e.exports=require("net")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},82452:e=>{e.exports=require("tls")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},41306:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>A,patchFetch:()=>b,requestAsyncStorage:()=>y,routeModule:()=>q,serverHooks:()=>k,staticGenerationAsyncStorage:()=>R});var s={};r.r(s),r.d(s,{POST:()=>$});var n=r(49303),o=r(88716),i=r(60670),a=r(87070),l=r(97425),u=r(75748),c=r(43839),d=r(59991),p=r(89194),m=r(68507),g=r(19377);let f=[/^[╭╮╰╯│─\s]+$/,/Claude Code v[\d.]+/,/^─{10,}$/,/^❯\s*$/,/^\s*$/,/CLAUDE_HOOKS_/,/\/bin\/claude/,/@.*\s+%/,/localhost/,/:3000/,/curl.*POST/,/export\s+/,/Tips for getting started/,/Welcome back/,/\?\s*for shortcuts/];async function h(e,t,r,s){try{let n;let o=(0,u.zl)(e,t,r),i=o?.lastCapturedLine||0;try{n=await (0,p.NA)(t,r,1e4)}catch{return console.log(`[savePendingAssistantResponse] Failed to capture session output for ${t}`),null}if(!n)return null;let a=n.split("\n"),l=a.length;for(;l>0&&""===a[l-1].trim();)l--;let c=l,{bufferReset:h,reason:x}=c>0&&i>25&&c+25<i?{bufferReset:!0,reason:"shrink"}:c>0&&i>50&&c<50?{bufferReset:!0,reason:"restart"}:{bufferReset:!1,reason:null};if(h&&console.log(`[savePendingAssistantResponse] Buffer reset detected (${x}): current=${c}, last=${i}`),!h&&c<=i)return c<i&&((0,u.IH)(e,t,r,c),console.log(`[savePendingAssistantResponse] Corrected stale position (${i} → ${c})`)),null;let v=a.slice(h?0:i).join("\n"),w="claude"===r?function(e,t){if(!e||""===e.trim())return"";if("claude"!==t)return e.trim();let r=(0,g.vp)(e).split("\n"),s=r.length;for(let e=r.length-1;e>=0;e--)if(/^❯\s+\S/.test(r[e])){s=e;break}return r.slice(0,s).filter(e=>{let t=e.trim();return!!t&&!f.some(e=>e.test(t))}).join("\n").trim()}(v,r):function(e,t){switch(t){case"claude":return(0,d.ci)(e);case"gemini":return(0,d.RJ)(e);default:return e.trim()}}(v,r);if(!w||""===w.trim())return(0,u.IH)(e,t,r,c),console.log(`[savePendingAssistantResponse] Cleaned response is empty, updating position to ${c}`),null;let $=new Date(s.getTime()-1),q=(0,u.tn)(e,{worktreeId:t,role:"assistant",content:w,messageType:"normal",timestamp:$,cliToolId:r});return(0,u.IH)(e,t,r,c),(0,m.ps)("message",{worktreeId:t,message:q}),console.log(`[savePendingAssistantResponse] Saved assistant response (lines ${i}-${c})`),q}catch(e){return console.error("[savePendingAssistantResponse] Error:",e),null}}var x=r(3979);let v=["claude","codex","gemini"];function w(e){return e instanceof Error?e.message:"Unknown error"}async function $(e,{params:t}){try{let r=(0,l.n)(),s=(0,u.gU)(r,t.id);if(!s)return a.NextResponse.json({error:`Worktree '${t.id}' not found`},{status:404});let n=await e.json();if(!n.content||"string"!=typeof n.content||""===n.content.trim())return a.NextResponse.json({error:"Message content is required and must be a non-empty string"},{status:400});let o=n.cliToolId||s.cliToolId||"claude";if(!v.includes(o))return a.NextResponse.json({error:`Invalid CLI tool ID: ${o}. Must be one of: ${v.join(", ")}`},{status:400});let i=c.g.getInstance().getTool(o);if(!await i.isInstalled())return a.NextResponse.json({error:`${i.name} is not installed. Please install it first.`},{status:503});if(!await i.isRunning(t.id))try{await i.startSession(t.id,s.path);let e=(0,u.Q7)(r,t.id);if(null===e)try{let e=await (0,x.v)(s.path,null);"(unknown)"!==e.currentBranch&&"(detached HEAD)"!==e.currentBranch&&((0,u.Ek)(r,t.id,e.currentBranch),console.log(`[send] Saved initial branch for ${t.id}: ${e.currentBranch}`))}catch(e){console.error("[send] Failed to get/save initial branch:",e)}}catch(e){return console.error(`Failed to start ${i.name} session:`,e),a.NextResponse.json({error:`Failed to start ${i.name} session: ${w(e)}`},{status:500})}let p=new Date;try{await h(r,t.id,o,p)}catch(e){console.error("[send] Failed to save pending assistant response:",e)}try{await i.sendMessage(t.id,n.content)}catch(e){return console.error(`Failed to send message to ${i.name}:`,e),a.NextResponse.json({error:`Failed to send message to ${i.name}: ${w(e)}`},{status:500})}let m=(0,u.tn)(r,{worktreeId:t.id,role:"user",content:n.content,messageType:"normal",timestamp:p,cliToolId:o});return(0,u.OK)(r,t.id,n.content,p),(0,u.Mf)(r,t.id,o),console.log(`✓ Cleared in-progress message for ${t.id} (${o})`),(0,d.cn)(t.id,o),a.NextResponse.json(m,{status:201})}catch(e){return console.error("Error sending message:",e),a.NextResponse.json({error:"Failed to send message"},{status:500})}}let q=new n.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/worktrees/[id]/send/route",pathname:"/api/worktrees/[id]/send",filename:"route",bundlePath:"app/api/worktrees/[id]/send/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/send/route.ts",nextConfigOutput:"",userland:s}),{requestAsyncStorage:y,staticGenerationAsyncStorage:R,serverHooks:k}=q,A="/api/worktrees/[id]/send/route";function b(){return(0,i.patchFetch)({serverHooks:k,staticGenerationAsyncStorage:R})}},3979:(e,t,r)=>{r.d(t,{v:()=>i});var s=r(61282);let n=(0,r(21764).promisify)(s.execFile);async function o(e,t){try{let{stdout:r}=await n("git",e,{cwd:t,timeout:1e3});return r.trim()}catch(t){return console.error("[git-utils] Git command failed:",{args:e,error:t instanceof Error?t.message:"Unknown error"}),null}}async function i(e,t){let r;let s=await o(["rev-parse","--abbrev-ref","HEAD"],e);r=null===s?"(unknown)":"HEAD"===s?"(detached HEAD)":s;let n=await o(["rev-parse","--short","HEAD"],e),i=await o(["status","--porcelain"],e);return{currentBranch:r,initialBranch:t,isBranchMismatch:null!==t&&"(unknown)"!==r&&"(detached HEAD)"!==r&&r!==t,commitHash:n??"(unknown)",isDirty:null!==i&&i.length>0}}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[8948,5972,3853,4893,7425,7566,7536],()=>r(41306));module.exports=s})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":1,"files":["../../../../../../../data/cm.db","../../../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../../../node_modules/better-sqlite3/package.json","../../../../../../../node_modules/bindings/bindings.js","../../../../../../../node_modules/bindings/package.json","../../../../../../../node_modules/file-uri-to-path/index.js","../../../../../../../node_modules/file-uri-to-path/package.json","../../../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../../node_modules/next/package.json","../../../../../../../package.json","../../../../../../package.json","../../../../../chunks/3853.js","../../../../../chunks/4893.js","../../../../../chunks/5972.js","../../../../../chunks/7425.js","../../../../../chunks/7536.js","../../../../../chunks/
|
|
1
|
+
{"version":1,"files":["../../../../../../../data/cm.db","../../../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../../../node_modules/better-sqlite3/package.json","../../../../../../../node_modules/bindings/bindings.js","../../../../../../../node_modules/bindings/package.json","../../../../../../../node_modules/file-uri-to-path/index.js","../../../../../../../node_modules/file-uri-to-path/package.json","../../../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../../node_modules/next/package.json","../../../../../../../package.json","../../../../../../package.json","../../../../../chunks/3853.js","../../../../../chunks/4893.js","../../../../../chunks/5972.js","../../../../../chunks/7425.js","../../../../../chunks/7536.js","../../../../../chunks/7566.js","../../../../../chunks/8948.js","../../../../../webpack-runtime.js"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var e={};e.id=7479,e.ids=[7479],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},84770:e=>{e.exports=require("crypto")},92048:e=>{e.exports=require("fs")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},88424:(e,t
|
|
1
|
+
"use strict";(()=>{var e={};e.id=7479,e.ids=[7479],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},84770:e=>{e.exports=require("crypto")},92048:e=>{e.exports=require("fs")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},88424:(e,a,t)=>{t.r(a),t.d(a,{originalPathname:()=>S,patchFetch:()=>y,requestAsyncStorage:()=>g,routeModule:()=>f,serverHooks:()=>P,staticGenerationAsyncStorage:()=>x});var r={};t.r(r),t.d(r,{GET:()=>h});var s=t(49303),o=t(88716),n=t(60670),d=t(87070),i=t(97425),c=t(75748),l=t(53013),u=t(38056);let m=[{name:"clear",description:"Clear conversation history",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"compact",description:"Compact context to reduce token usage",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"resume",description:"Resume previous conversation",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"rewind",description:"Rewind to previous conversation state",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"config",description:"Open configuration settings",category:"standard-config",isStandard:!0,source:"standard",filePath:""},{name:"model",description:"Switch AI model",category:"standard-config",isStandard:!0,source:"standard",filePath:""},{name:"permissions",description:"View or update tool permissions",category:"standard-config",isStandard:!0,source:"standard",filePath:""},{name:"status",description:"Check session status",category:"standard-monitor",isStandard:!0,source:"standard",filePath:""},{name:"context",description:"Show context window usage",category:"standard-monitor",isStandard:!0,source:"standard",filePath:""},{name:"cost",description:"Display token and cost usage",category:"standard-monitor",isStandard:!0,source:"standard",filePath:""},{name:"review",description:"Review code changes",category:"standard-git",isStandard:!0,source:"standard",filePath:""},{name:"pr-comments",description:"Show PR comments",category:"standard-git",isStandard:!0,source:"standard",filePath:""},{name:"help",description:"Show all available commands",category:"standard-util",isStandard:!0,source:"standard",filePath:""},{name:"doctor",description:"Check installation health",category:"standard-util",isStandard:!0,source:"standard",filePath:""},{name:"export",description:"Export conversation history",category:"standard-util",isStandard:!0,source:"standard",filePath:""},{name:"todos",description:"Show TODO list",category:"standard-util",isStandard:!0,source:"standard",filePath:""},{name:"new",description:"Start a new conversation in same session",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"undo",description:"Undo the last Codex action",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"logout",description:"Sign out from Codex",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"quit",description:"Exit Codex CLI",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"approvals",description:"Change auto-execution approval level",category:"standard-config",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"diff",description:"Show Git diff (including untracked files)",category:"standard-git",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"mention",description:"Attach file/folder for next interaction",category:"standard-util",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"mcp",description:"List available MCP tools",category:"standard-util",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"init",description:"Generate AGENTS.md template in current directory",category:"standard-util",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"feedback",description:"Send feedback to Codex team",category:"standard-util",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]}];var p=t(83513);async function h(e,{params:a}){try{var t,r;let{id:s}=await a,o=(0,i.n)(),n=(0,c.gU)(o,s);if(!n)return d.NextResponse.json({error:"Worktree not found"},{status:404});if(!(!(!(t=n.path)||""===t.trim()||t.includes(".."))&&t.startsWith("/")&&(function(){let e=process.env.ALLOWED_WORKTREE_PATHS;return e?e.split(",").map(e=>e.trim()).filter(e=>e.length>0):["/Users","/home","/var","/tmp","/opt"]})().some(e=>t.startsWith(e))))return console.error(`[slash-commands API] Invalid worktree path detected: ${s}`),d.NextResponse.json({error:"Invalid worktree configuration"},{status:400});let h=(r=e.nextUrl.searchParams.get("cliTool"))&&p.t.includes(r)?r:"claude",f=(0,u.Xr)(m),g=[];try{g=await (0,l.HL)(n.path)}catch(e){console.warn(`[slash-commands API] Could not load worktree commands: ${e}`),g=[]}let x=(0,u.Nw)(f,g),P=(0,u.M6)(x,h),S=P.flatMap(e=>e.commands),y=S.filter(e=>"standard"===e.source).length,w=S.filter(e=>"worktree"===e.source).length,v=S.filter(e=>"skill"===e.source).length;return d.NextResponse.json({groups:P,sources:{standard:y,worktree:w,mcbd:0,skill:v},cliTool:h})}catch(e){return console.error("[slash-commands API] Error:",e),d.NextResponse.json({error:"Failed to load slash commands"},{status:500})}}let f=new s.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/worktrees/[id]/slash-commands/route",pathname:"/api/worktrees/[id]/slash-commands",filename:"route",bundlePath:"app/api/worktrees/[id]/slash-commands/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/slash-commands/route.ts",nextConfigOutput:"",userland:r}),{requestAsyncStorage:g,staticGenerationAsyncStorage:x,serverHooks:P}=f,S="/api/worktrees/[id]/slash-commands/route";function y(){return(0,n.patchFetch)({serverHooks:P,staticGenerationAsyncStorage:x})}},83513:(e,a,t)=>{t.d(a,{t:()=>r});let r=["claude","codex","gemini"]}};var a=require("../../../../../webpack-runtime.js");a.C(e);var t=e=>a(a.s=e),r=a.X(0,[8948,5972,3673,7425,3013],()=>t(88424));module.exports=r})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":1,"files":["../../../../../../../data/cm.db","../../../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../../../node_modules/better-sqlite3/package.json","../../../../../../../node_modules/bindings/bindings.js","../../../../../../../node_modules/bindings/package.json","../../../../../../../node_modules/file-uri-to-path/index.js","../../../../../../../node_modules/file-uri-to-path/package.json","../../../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../../node_modules/next/package.json","../../../../../../../package.json","../../../../../../package.json","../../../../../chunks/3673.js","../../../../../chunks/5972.js","../../../../../chunks/7425.js","../../../../../chunks/8948.js","../../../../../webpack-runtime.js"]}
|
|
1
|
+
{"version":1,"files":["../../../../../../../data/cm.db","../../../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../../../node_modules/better-sqlite3/package.json","../../../../../../../node_modules/bindings/bindings.js","../../../../../../../node_modules/bindings/package.json","../../../../../../../node_modules/file-uri-to-path/index.js","../../../../../../../node_modules/file-uri-to-path/package.json","../../../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../../node_modules/next/package.json","../../../../../../../package.json","../../../../../../package.json","../../../../../chunks/3013.js","../../../../../chunks/3673.js","../../../../../chunks/5972.js","../../../../../chunks/7425.js","../../../../../chunks/8948.js","../../../../../webpack-runtime.js"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var e={};e.id=9086,e.ids=[9086],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},98216:e=>{e.exports=require("net")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},82452:e=>{e.exports=require("tls")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},51057:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>m,patchFetch:()=>f,requestAsyncStorage:()=>x,routeModule:()=>c,serverHooks:()=>q,staticGenerationAsyncStorage:()=>g});var o={};t.r(o),t.d(o,{POST:()=>d});var s=t(49303),i=t(88716),n=t(60670),p=t(87070),u=t(97425),a=t(75748),l=t(59991);async function d(e,{params:r}){try{let t=(0,u.n)();if(!(0,a.gU)(t,r.id))return p.NextResponse.json({error:`Worktree '${r.id}' not found`},{status:404});let o=await e.json(),s=["claude","codex","gemini"];if(!o.cliToolId||!s.includes(o.cliToolId))return p.NextResponse.json({error:`Invalid CLI tool ID. Must be one of: ${s.join(", ")}`},{status:400});return console.log(`[API] Manually starting polling for ${r.id} (${o.cliToolId})`),(0,l.cn)(r.id,o.cliToolId),p.NextResponse.json({success:!0,message:`Started polling for ${o.cliToolId} session`})}catch(e){return console.error("Error starting polling:",e),p.NextResponse.json({error:"Failed to start polling"},{status:500})}}let c=new s.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/[id]/start-polling/route",pathname:"/api/worktrees/[id]/start-polling",filename:"route",bundlePath:"app/api/worktrees/[id]/start-polling/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/start-polling/route.ts",nextConfigOutput:"",userland:o}),{requestAsyncStorage:x,staticGenerationAsyncStorage:g,serverHooks:q}=c,m="/api/worktrees/[id]/start-polling/route";function f(){return(0,n.patchFetch)({serverHooks:q,staticGenerationAsyncStorage:g})}}};var r=require("../../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),o=r.X(0,[8948,5972,3853,4893,7425,
|
|
1
|
+
"use strict";(()=>{var e={};e.id=9086,e.ids=[9086],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},98216:e=>{e.exports=require("net")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},82452:e=>{e.exports=require("tls")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},51057:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>m,patchFetch:()=>f,requestAsyncStorage:()=>x,routeModule:()=>c,serverHooks:()=>q,staticGenerationAsyncStorage:()=>g});var o={};t.r(o),t.d(o,{POST:()=>d});var s=t(49303),i=t(88716),n=t(60670),p=t(87070),u=t(97425),a=t(75748),l=t(59991);async function d(e,{params:r}){try{let t=(0,u.n)();if(!(0,a.gU)(t,r.id))return p.NextResponse.json({error:`Worktree '${r.id}' not found`},{status:404});let o=await e.json(),s=["claude","codex","gemini"];if(!o.cliToolId||!s.includes(o.cliToolId))return p.NextResponse.json({error:`Invalid CLI tool ID. Must be one of: ${s.join(", ")}`},{status:400});return console.log(`[API] Manually starting polling for ${r.id} (${o.cliToolId})`),(0,l.cn)(r.id,o.cliToolId),p.NextResponse.json({success:!0,message:`Started polling for ${o.cliToolId} session`})}catch(e){return console.error("Error starting polling:",e),p.NextResponse.json({error:"Failed to start polling"},{status:500})}}let c=new s.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/[id]/start-polling/route",pathname:"/api/worktrees/[id]/start-polling",filename:"route",bundlePath:"app/api/worktrees/[id]/start-polling/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/start-polling/route.ts",nextConfigOutput:"",userland:o}),{requestAsyncStorage:x,staticGenerationAsyncStorage:g,serverHooks:q}=c,m="/api/worktrees/[id]/start-polling/route";function f(){return(0,n.patchFetch)({serverHooks:q,staticGenerationAsyncStorage:g})}}};var r=require("../../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),o=r.X(0,[8948,5972,3853,4893,7425,7566,7536],()=>t(51057));module.exports=o})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":1,"files":["../../../../../../../data/cm.db","../../../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../../../node_modules/better-sqlite3/package.json","../../../../../../../node_modules/bindings/bindings.js","../../../../../../../node_modules/bindings/package.json","../../../../../../../node_modules/file-uri-to-path/index.js","../../../../../../../node_modules/file-uri-to-path/package.json","../../../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../../node_modules/next/package.json","../../../../../../../package.json","../../../../../../package.json","../../../../../chunks/3853.js","../../../../../chunks/4893.js","../../../../../chunks/5972.js","../../../../../chunks/7425.js","../../../../../chunks/7536.js","../../../../../chunks/
|
|
1
|
+
{"version":1,"files":["../../../../../../../data/cm.db","../../../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../../../node_modules/better-sqlite3/package.json","../../../../../../../node_modules/bindings/bindings.js","../../../../../../../node_modules/bindings/package.json","../../../../../../../node_modules/file-uri-to-path/index.js","../../../../../../../node_modules/file-uri-to-path/package.json","../../../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../../node_modules/next/package.json","../../../../../../../package.json","../../../../../../package.json","../../../../../chunks/3853.js","../../../../../chunks/4893.js","../../../../../chunks/5972.js","../../../../../chunks/7425.js","../../../../../chunks/7536.js","../../../../../chunks/7566.js","../../../../../chunks/8948.js","../../../../../webpack-runtime.js"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var e={};e.id=3058,e.ids=[3058],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},98216:e=>{e.exports=require("net")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},82452:e=>{e.exports=require("tls")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},17679:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>v,patchFetch:()=>w,requestAsyncStorage:()=>x,routeModule:()=>g,serverHooks:()=>q,staticGenerationAsyncStorage:()=>f});var s={};t.r(s),t.d(s,{GET:()=>h,dynamic:()=>m});var o=t(49303),i=t(88716),n=t(60670),a=t(87070),p=t(97425),u=t(75748),c=t(43839),d=t(89194),l=t(13561);let m="force-dynamic";async function h(e){try{let r=(0,p.n)(),t=e.nextUrl?.searchParams,s=t?.get("repository"),o=(0,u.Xv)(r,s||void 0),i=c.g.getInstance(),n=["claude","codex","gemini"],m=await Promise.all(o.map(async e=>{let t={},s=!1,o=!1,a=!1;for(let p of n){let n=i.getTool(p),c=await n.isRunning(e.id),m=!1,h=!1;if(c)try{let t=await (0,d.NA)(e.id,p,100),s=(0,l._)(t,p);m="waiting"===s.status,h="running"===s.status,!s.hasActivePrompt&&(0,u._U)(r,e.id,void 0,10,p).some(e=>"prompt"===e.messageType&&e.promptData?.status!=="answered")&&(0,u.GP)(r,e.id,p)}catch{h=!0}t[p]={isRunning:c,isWaitingForResponse:m,isProcessing:h},c&&(s=!0),m&&(o=!0),h&&(a=!0)}return{...e,isSessionRunning:s,isWaitingForResponse:o,isProcessing:a,sessionStatusByCli:t}})),h=(0,u.ER)(r);return a.NextResponse.json({worktrees:m,repositories:h},{status:200})}catch(e){return console.error("Error fetching worktrees:",e),a.NextResponse.json({error:"Failed to fetch worktrees"},{status:500})}}let g=new o.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/route",pathname:"/api/worktrees",filename:"route",bundlePath:"app/api/worktrees/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/route.ts",nextConfigOutput:"",userland:s}),{requestAsyncStorage:x,staticGenerationAsyncStorage:f,serverHooks:q}=g,v="/api/worktrees/route";function w(){return(0,n.patchFetch)({serverHooks:q,staticGenerationAsyncStorage:f})}},13561:(e,r,t)=>{t.d(r,{_:()=>i});var s=t(19377),o=t(63661);function i(e,r,t){let i=(0,s.vp)(e),n=i.split("\n"),a=n.length-1;for(;a>=0&&""===n[a].trim();)a--;let p=n.slice(0,a+1),u=p.slice(-15).join("\n"),c=p.slice(-5).join("\n"),d=(0,s.Sg)(r);if((0,o.F)(i,d).isPrompt)return{status:"waiting",confidence:"high",reason:"prompt_detected",hasActivePrompt:!0};if((0,s.Wg)(r,c))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1};let{promptPattern:l}=(0,s.bs)(r);return l.test(u)?{status:"ready",confidence:"high",reason:"input_prompt",hasActivePrompt:!1}:t&&Date.now()-t.getTime()>5e3?{status:"ready",confidence:"low",reason:"no_recent_output",hasActivePrompt:!1}:{status:"running",confidence:"low",reason:"default",hasActivePrompt:!1}}}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[8948,5972,3853,4893,7425,
|
|
1
|
+
"use strict";(()=>{var e={};e.id=3058,e.ids=[3058],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},98216:e=>{e.exports=require("net")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},82452:e=>{e.exports=require("tls")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},17679:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>v,patchFetch:()=>w,requestAsyncStorage:()=>x,routeModule:()=>g,serverHooks:()=>q,staticGenerationAsyncStorage:()=>f});var s={};t.r(s),t.d(s,{GET:()=>h,dynamic:()=>m});var o=t(49303),i=t(88716),n=t(60670),a=t(87070),p=t(97425),u=t(75748),c=t(43839),d=t(89194),l=t(13561);let m="force-dynamic";async function h(e){try{let r=(0,p.n)(),t=e.nextUrl?.searchParams,s=t?.get("repository"),o=(0,u.Xv)(r,s||void 0),i=c.g.getInstance(),n=["claude","codex","gemini"],m=await Promise.all(o.map(async e=>{let t={},s=!1,o=!1,a=!1;for(let p of n){let n=i.getTool(p),c=await n.isRunning(e.id),m=!1,h=!1;if(c)try{let t=await (0,d.NA)(e.id,p,100),s=(0,l._)(t,p);m="waiting"===s.status,h="running"===s.status,!s.hasActivePrompt&&(0,u._U)(r,e.id,void 0,10,p).some(e=>"prompt"===e.messageType&&e.promptData?.status!=="answered")&&(0,u.GP)(r,e.id,p)}catch{h=!0}t[p]={isRunning:c,isWaitingForResponse:m,isProcessing:h},c&&(s=!0),m&&(o=!0),h&&(a=!0)}return{...e,isSessionRunning:s,isWaitingForResponse:o,isProcessing:a,sessionStatusByCli:t}})),h=(0,u.ER)(r);return a.NextResponse.json({worktrees:m,repositories:h},{status:200})}catch(e){return console.error("Error fetching worktrees:",e),a.NextResponse.json({error:"Failed to fetch worktrees"},{status:500})}}let g=new o.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/route",pathname:"/api/worktrees",filename:"route",bundlePath:"app/api/worktrees/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/route.ts",nextConfigOutput:"",userland:s}),{requestAsyncStorage:x,staticGenerationAsyncStorage:f,serverHooks:q}=g,v="/api/worktrees/route";function w(){return(0,n.patchFetch)({serverHooks:q,staticGenerationAsyncStorage:f})}},13561:(e,r,t)=>{t.d(r,{_:()=>i});var s=t(19377),o=t(63661);function i(e,r,t){let i=(0,s.vp)(e),n=i.split("\n"),a=n.length-1;for(;a>=0&&""===n[a].trim();)a--;let p=n.slice(0,a+1),u=p.slice(-15).join("\n"),c=p.slice(-5).join("\n"),d=(0,s.Sg)(r);if((0,o.F)(i,d).isPrompt)return{status:"waiting",confidence:"high",reason:"prompt_detected",hasActivePrompt:!0};if((0,s.Wg)(r,c))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1};let{promptPattern:l}=(0,s.bs)(r);return l.test(u)?{status:"ready",confidence:"high",reason:"input_prompt",hasActivePrompt:!1}:t&&Date.now()-t.getTime()>5e3?{status:"ready",confidence:"low",reason:"no_recent_output",hasActivePrompt:!1}:{status:"running",confidence:"low",reason:"default",hasActivePrompt:!1}}}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[8948,5972,3853,4893,7425,7566,7536],()=>t(17679));module.exports=s})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":1,"files":["../../../../../data/cm.db","../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../node_modules/better-sqlite3/package.json","../../../../../node_modules/bindings/bindings.js","../../../../../node_modules/bindings/package.json","../../../../../node_modules/file-uri-to-path/index.js","../../../../../node_modules/file-uri-to-path/package.json","../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../node_modules/next/package.json","../../../../../package.json","../../../../package.json","../../../chunks/3853.js","../../../chunks/4893.js","../../../chunks/5972.js","../../../chunks/7425.js","../../../chunks/7536.js","../../../chunks/
|
|
1
|
+
{"version":1,"files":["../../../../../data/cm.db","../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../node_modules/better-sqlite3/package.json","../../../../../node_modules/bindings/bindings.js","../../../../../node_modules/bindings/package.json","../../../../../node_modules/file-uri-to-path/index.js","../../../../../node_modules/file-uri-to-path/package.json","../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../node_modules/next/package.json","../../../../../package.json","../../../../package.json","../../../chunks/3853.js","../../../chunks/4893.js","../../../chunks/5972.js","../../../chunks/7425.js","../../../chunks/7536.js","../../../chunks/7566.js","../../../chunks/8948.js","../../../webpack-runtime.js"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var e={};e.id=2626,e.ids=[2626],e.modules={72934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},55315:e=>{"use strict";e.exports=require("path")},17360:e=>{"use strict";e.exports=require("url")},66023:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalError:()=>s.a,__next_app__:()=>m,originalPathname:()=>c,pages:()=>u,routeModule:()=>p,tree:()=>d}),r(80974),r(25086),r(35866);var a=r(23191),n=r(88716),o=r(37922),s=r.n(o),i=r(95231),l={};for(let e in i)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>i[e]);r.d(t,l);let d=["",{children:["login",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(r.bind(r,80974)),"/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx"]}]},{metadata:{icon:[async e=>(await Promise.resolve().then(r.bind(r,71150))).default(e)],apple:[async e=>(await Promise.resolve().then(r.bind(r,63601))).default(e)],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(r.bind(r,25086)),"/home/runner/work/CommandMate/CommandMate/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(r.t.bind(r,35866,23)),"next/dist/client/components/not-found-error"],metadata:{icon:[async e=>(await Promise.resolve().then(r.bind(r,71150))).default(e)],apple:[async e=>(await Promise.resolve().then(r.bind(r,63601))).default(e)],openGraph:[],twitter:[],manifest:void 0}}],u=["/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx"],c="/login/page",m={require:r,loadChunk:()=>Promise.resolve()},p=new a.AppPageRouteModule({definition:{kind:n.x.APP_PAGE,page:"/login/page",pathname:"/login",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},72089:(e,t,r)=>{Promise.resolve().then(r.bind(r,24146))},24146:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});var a=r(10326),n=r(17577),o=r(6162),s=r(94001);function i(){let e=(0,o.T)("auth"),t=(0,s.m)(),[r,i]=(0,n.useState)(""),[l,d]=(0,n.useState)(null),[u,c]=(0,n.useState)(!1),[m,p]=(0,n.useState)(null);async function g(t){t.preventDefault(),d(null),c(!0);try{let t=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:r})});if(t.ok){window.location.href="/";return}if(429===t.status){let r=t.headers.get("Retry-After"),a=r?parseInt(r,10):900;p(a),d(e("error.lockedOut"));return}if(401===t.status){d(e("error.invalidToken"));return}d(e("error.unknownError"))}catch{d(e("error.unknownError"))}finally{c(!1)}}return t?a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100 dark:bg-gray-900",children:(0,a.jsxs)("div",{className:"bg-white dark:bg-gray-800 p-8 rounded-lg shadow-md w-full max-w-md",children:[a.jsx("h1",{className:"text-2xl font-bold mb-6 text-center text-gray-900 dark:text-white",children:e("login.title")}),(0,a.jsxs)("form",{onSubmit:g,className:"space-y-4",children:[(0,a.jsxs)("div",{children:[a.jsx("label",{htmlFor:"token",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:e("login.tokenLabel")}),a.jsx("input",{id:"token",type:"password",value:r,onChange:e=>i(e.target.value),placeholder:e("login.tokenPlaceholder"),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white",autoFocus:!0,autoComplete:"off",disabled:null!==m&&m>0})]}),l&&(0,a.jsxs)("div",{className:"text-red-600 dark:text-red-400 text-sm",children:[l,null!==m&&m>0&&a.jsx("div",{className:"mt-1",children:e("error.retryAfter",{minutes:Math.ceil(m/60)})})]}),a.jsx("button",{type:"submit",disabled:u||!r||null!==m&&m>0,className:"w-full py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",children:u?"...":e("login.submitButton")})]})]})}):null}},80974:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});let a=(0,r(68570).createProxy)(String.raw`/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx#default`)},63601:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});var a=r(66621);let n=e=>[{type:"image/png",sizes:"180x180",url:(0,a.fillMetadataSegment)(".",e.params,"apple-icon.png")+"?31a89e65aa4ac65b"}]},71150:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});var a=r(66621);let n=e=>[{type:"image/png",sizes:"32x32",url:(0,a.fillMetadataSegment)(".",e.params,"icon.png")+"?32d9127ba30ee286"}]},6162:(e,t,r)=>{"use strict";r.d(t,{T:()=>o});var a=r(34643);function n(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let o=n(0,a.T_);n(0,a.Gb)}};var t=require("../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[8948,3294,6621,3860],()=>r(66023));module.exports=a})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":1,"files":["../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../node_modules/next/package.json","../../../../package.json","../../../package.json","../../chunks/2683.js","../../chunks/3074.js","../../chunks/3294.js","../../chunks/3348.js","../../chunks/369.js","../../chunks/3860.js","../../chunks/4559.js","../../chunks/5795.js","../../chunks/5823.js","../../chunks/5853.js","../../chunks/6621.js","../../chunks/6837.js","../../chunks/7266.js","../../chunks/8744.js","../../chunks/8948.js","../../chunks/9582.js","../../webpack-runtime.js","page_client-reference-manifest.js"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/login/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"80":{"*":{"id":"41868","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"79671","name":"*","chunks":[],"async":false}},"12846":{"*":{"id":"12994","name":"*","chunks":[],"async":false}},"18390":{"*":{"id":"74810","name":"*","chunks":[],"async":false}},"18828":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"38991":{"*":{"id":"24146","name":"*","chunks":[],"async":false}},"41845":{"*":{"id":"37398","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"66677":{"*":{"id":"42106","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx":{"id":38991,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","2626","static/chunks/app/login/page-2d42204ba87cd136.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","8091","static/chunks/8091-925542bdfc843dce.js","1931","static/chunks/app/page-238b5a70d8c101e9.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/page.tsx":{"id":50653,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":18390,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":41845,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/b9ea6a4fad17dc32.css"],"/home/runner/work/CommandMate/CommandMate/src/app/page":[],"/home/runner/work/CommandMate/CommandMate/src/app/login/page":[]}}
|
package/.next/server/app/page.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{var e={};e.id=1931,e.ids=[1931],e.modules={72934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},55315:e=>{"use strict";e.exports=require("path")},17360:e=>{"use strict";e.exports=require("url")},37906:(e,t,s)=>{"use strict";s.r(t),s.d(t,{GlobalError:()=>n.a,__next_app__:()=>m,originalPathname:()=>x,pages:()=>c,routeModule:()=>p,tree:()=>d}),s(35480),s(25086),s(35866);var a=s(23191),r=s(88716),l=s(37922),n=s.n(l),i=s(95231),o={};for(let e in i)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(o[e]=()=>i[e]);s.d(t,o);let d=["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(s.bind(s,35480)),"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx"],metadata:{icon:[async e=>(await Promise.resolve().then(s.bind(s,71150))).default(e)],apple:[async e=>(await Promise.resolve().then(s.bind(s,63601))).default(e)],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(s.bind(s,25086)),"/home/runner/work/CommandMate/CommandMate/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(s.t.bind(s,35866,23)),"next/dist/client/components/not-found-error"],metadata:{icon:[async e=>(await Promise.resolve().then(s.bind(s,71150))).default(e)],apple:[async e=>(await Promise.resolve().then(s.bind(s,63601))).default(e)],openGraph:[],twitter:[],manifest:void 0}}],c=["/home/runner/work/CommandMate/CommandMate/src/app/page.tsx"],x="/page",m={require:s,loadChunk:()=>Promise.resolve()},p=new a.AppPageRouteModule({definition:{kind:r.x.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},11518:(e,t,s)=>{Promise.resolve().then(s.bind(s,42106))},35047:(e,t,s)=>{"use strict";var a=s(77389);s.o(a,"useParams")&&s.d(t,{useParams:function(){return a.useParams}}),s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}})},42106:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>C});var a=s(10326),r=s(17577),l=s(2583),n=s(90434),i=s(77758),o=s(6162),d=s(34643),c=s(352),x=s(41593),m=s(73002);function p({worktree:e,onSessionKilled:t,onStatusChanged:s}){let{id:l,name:p,description:u,updatedAt:h,isSessionRunning:g,isWaitingForResponse:y,favorite:b,status:j,link:f}=e,[v,N]=(0,r.useState)(!1),[w,k]=(0,r.useState)(b||!1),[C,S]=(0,r.useState)(!1),[P,z]=(0,r.useState)(j||null),[A,$]=(0,r.useState)(!1),T=(0,o.T)(),L=(0,d.bU)(),R=(0,x.G)(L),D=h?(0,c.Q)(new Date(h),{addSuffix:!0,locale:R}):null,M="main"===p||"master"===p,E=async e=>{if(e.preventDefault(),e.stopPropagation(),confirm(T("worktree.session.confirmKill",{name:p})))try{N(!0),await m.Iv.killSession(l),t&&t()}catch(t){let e=(0,m.zG)(t);alert(`${T("worktree.session.failedToKill")}: ${e}`)}finally{N(!1)}},I=async e=>{e.preventDefault(),e.stopPropagation();try{S(!0);let e=!w;await m.Iv.toggleFavorite(l,e),k(e)}catch(t){let e=(0,m.zG)(t);alert(`${T("worktree.errors.failedToUpdateFavorite")}: ${e}`)}finally{S(!1)}},_=async(e,t)=>{t.preventDefault(),t.stopPropagation();try{$(!0),await m.Iv.updateStatus(l,e),z(e),s&&s()}catch(t){let e=(0,m.zG)(t);alert(`${T("worktree.errors.failedToUpdateStatus")}: ${e}`)}finally{$(!1)}};return a.jsx(n.default,{href:`/worktrees/${l}`,className:"block",children:(0,a.jsxs)(i.Zb,{hover:!0,padding:"lg",className:"h-full",children:[a.jsx(i.Ol,{children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)(i.ll,{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("button",{onClick:I,disabled:C,className:"flex-shrink-0 transition-colors hover:scale-110",title:w?T("common.favorites.remove"):T("common.favorites.add"),children:a.jsx("svg",{className:`w-5 h-5 ${w?"fill-yellow-400 text-yellow-400":"fill-none text-gray-400"}`,stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})})}),a.jsx("span",{className:"truncate",children:p}),M&&a.jsx(i.Ct,{variant:"info",children:"Main"}),g&&y&&a.jsx(i.Ct,{variant:"warning",dot:!0,children:T("worktree.status.waitingForResponse")}),g&&!y&&a.jsx(i.Ct,{variant:"success",dot:!0,children:T("worktree.status.responseCompleted")})]}),g&&a.jsx(i.zx,{variant:"danger",size:"sm",onClick:E,disabled:v,className:"flex-shrink-0",children:v?T("common.ending"):T("common.end")})]})}),a.jsx(i.aY,{children:(0,a.jsxs)("div",{className:"space-y-3",children:[u&&(0,a.jsxs)("div",{children:[a.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Description"}),a.jsx("p",{className:"text-sm text-gray-700 line-clamp-2 whitespace-pre-wrap",children:u})]}),f&&(0,a.jsxs)("div",{children:[a.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Link"}),(0,a.jsxs)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),f&&window.open(f,"_blank","noopener,noreferrer")},className:"flex items-center gap-1 text-sm text-blue-600 hover:text-blue-800 hover:underline transition-colors",title:"Open link in new tab",children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),a.jsx("span",{className:"truncate",children:f})]})]}),(0,a.jsxs)("div",{children:[a.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Status"}),(0,a.jsxs)("div",{className:"flex gap-1 flex-wrap",children:[a.jsx("button",{onClick:e=>_(null,e),disabled:A,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${null===P?"bg-gray-100 text-gray-700 border-gray-400":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50"}`,children:"Not set"}),a.jsx("button",{onClick:e=>_("todo",e),disabled:A,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${"todo"===P?"bg-gray-100 text-gray-700 border-gray-400":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50"}`,children:"ToDo"}),a.jsx("button",{onClick:e=>_("doing",e),disabled:A,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${"doing"===P?"bg-blue-100 text-blue-700 border-blue-400":"bg-white text-gray-600 border-gray-200 hover:bg-blue-50"}`,children:"Doing"}),a.jsx("button",{onClick:e=>_("done",e),disabled:A,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${"done"===P?"bg-green-100 text-green-700 border-green-400":"bg-white text-gray-600 border-gray-200 hover:bg-green-50"}`,children:"Done"})]})]}),D&&(0,a.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[a.jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,a.jsxs)("span",{children:["Updated ",D]})]})]})})]})})}function u({initialWorktrees:e=[]}){let[t,s]=(0,r.useState)(e),[l,n]=(0,r.useState)([]),[o,d]=(0,r.useState)(!e.length),[c,x]=(0,r.useState)(null),[u,h]=(0,r.useState)(""),[g,y]=(0,r.useState)("updated"),[b,j]=(0,r.useState)("desc"),[f,v]=(0,r.useState)(null),[N,w]=(0,r.useState)(null),[k,C]=(0,r.useState)(null),[S,P]=(0,r.useState)([]),[z,A]=(0,r.useState)(!1),[$,T]=(0,r.useState)(null),L=(0,r.useCallback)(async()=>{try{let e=await m.J1.getExcluded();e.success&&P(e.repositories)}catch{}},[]),R=(0,r.useCallback)(async(e=!1)=>{try{e||d(!0),x(null);let t=await m.Iv.getAll();s(t.worktrees),n(t.repositories)}catch(e){x((0,m.zG)(e))}finally{e||d(!1)}},[]),D=e=>!!(e&&"session_status_changed"===e.type),{status:M}=function(e={}){let{worktreeIds:t=[],onMessage:s,onStatusChange:a,autoReconnect:l=!0,reconnectDelay:n=3e3}=e,[i,o]=(0,r.useState)("disconnected"),d=(0,r.useRef)(null),c=(0,r.useRef)(),x=(0,r.useRef)(new Set),m=(0,r.useCallback)(e=>{o(e),a?.(e)},[a]),p=(0,r.useCallback)(()=>{if(d.current?.readyState===WebSocket.OPEN)return;m("connecting");let e="https:"===window.location.protocol?"wss:":"ws:",t=new WebSocket(`${e}//${window.location.host}`);t.onopen=()=>{m("connected"),x.current.forEach(e=>{t.send(JSON.stringify({type:"subscribe",worktreeId:e}))})},t.onmessage=e=>{try{let t=JSON.parse(e.data);s?.(t)}catch(e){console.error("Failed to parse WebSocket message:",e)}},t.onerror=()=>{m("error")},t.onclose=()=>{m("disconnected"),d.current=null,l&&(c.current=setTimeout(()=>{p()},n))},d.current=t},[m,s,l,n]),u=(0,r.useCallback)(()=>{c.current&&clearTimeout(c.current),d.current&&(d.current.close(1e3,"Client disconnect"),d.current=null),m("disconnected")},[m]);return{status:i,subscribe:(0,r.useCallback)(e=>{d.current?.readyState===WebSocket.OPEN&&(d.current.send(JSON.stringify({type:"subscribe",worktreeId:e})),x.current.add(e))},[]),unsubscribe:(0,r.useCallback)(e=>{d.current?.readyState===WebSocket.OPEN&&(d.current.send(JSON.stringify({type:"unsubscribe",worktreeId:e})),x.current.delete(e))},[]),sendMessage:(0,r.useCallback)(e=>{d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify(e))},[]),connect:p,disconnect:u}}({onMessage:(0,r.useCallback)(e=>{if(D(e.data)){let t=e.data;s(e=>e.map(e=>e.id===t.worktreeId?{...e,isSessionRunning:t.isRunning}:e))}"broadcast"===e.type&&R(!0)},[R])}),E=(0,r.useMemo)(()=>{let e=[...t];if(f&&(e=e.filter(e=>e.repositoryPath===f)),null!==N&&(e="unset"===N?e.filter(e=>!e.status):e.filter(e=>e.status===N)),u){let t=u.toLowerCase();e=e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)||e.repositoryName.toLowerCase().includes(t)||e.lastMessageSummary?.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t))}return e.sort((e,t)=>{let s=0;switch(g){case"name":s=e.name.localeCompare(t.name);break;case"updated":s=(e.updatedAt?new Date(e.updatedAt).getTime():0)-(t.updatedAt?new Date(t.updatedAt).getTime():0);break;case"favorite":s=(e.favorite?1:0)-(t.favorite?1:0)}return"asc"===b?s:-s}),e},[t,f,N,u,g,b]),I=(0,r.useMemo)(()=>{let e=new Map;for(let t of E){let s=t.repositoryPath||"unknown";e.has(s)||e.set(s,[]),e.get(s).push(t)}return e},[E]),_=e=>{g===e?j(e=>"asc"===e?"desc":"asc"):(y(e),j("asc"))},O=async e=>{T(e);try{let t=await m.J1.restore(e);t.warning&&x(t.warning),await R(),await L()}catch(e){x((0,m.zG)(e))}finally{T(null)}},F=async(e,t)=>{let s=l.find(t=>t.path===e)?.worktreeCount||0;if("delete"===prompt(`Delete repository "${t}"?
|
|
1
|
+
(()=>{var e={};e.id=1931,e.ids=[1931],e.modules={72934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},55315:e=>{"use strict";e.exports=require("path")},17360:e=>{"use strict";e.exports=require("url")},37906:(e,t,s)=>{"use strict";s.r(t),s.d(t,{GlobalError:()=>n.a,__next_app__:()=>m,originalPathname:()=>x,pages:()=>c,routeModule:()=>p,tree:()=>d}),s(35480),s(25086),s(35866);var a=s(23191),r=s(88716),l=s(37922),n=s.n(l),i=s(95231),o={};for(let e in i)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(o[e]=()=>i[e]);s.d(t,o);let d=["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(s.bind(s,35480)),"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx"],metadata:{icon:[async e=>(await Promise.resolve().then(s.bind(s,71150))).default(e)],apple:[async e=>(await Promise.resolve().then(s.bind(s,63601))).default(e)],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(s.bind(s,25086)),"/home/runner/work/CommandMate/CommandMate/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(s.t.bind(s,35866,23)),"next/dist/client/components/not-found-error"],metadata:{icon:[async e=>(await Promise.resolve().then(s.bind(s,71150))).default(e)],apple:[async e=>(await Promise.resolve().then(s.bind(s,63601))).default(e)],openGraph:[],twitter:[],manifest:void 0}}],c=["/home/runner/work/CommandMate/CommandMate/src/app/page.tsx"],x="/page",m={require:s,loadChunk:()=>Promise.resolve()},p=new a.AppPageRouteModule({definition:{kind:r.x.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},11518:(e,t,s)=>{Promise.resolve().then(s.bind(s,42106))},35047:(e,t,s)=>{"use strict";var a=s(77389);s.o(a,"useParams")&&s.d(t,{useParams:function(){return a.useParams}}),s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}})},42106:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>C});var a=s(10326),r=s(17577),l=s(79906),n=s(90434),i=s(77758),o=s(6162),d=s(34643),c=s(352),x=s(41593),m=s(73002);function p({worktree:e,onSessionKilled:t,onStatusChanged:s}){let{id:l,name:p,description:u,updatedAt:h,isSessionRunning:g,isWaitingForResponse:y,favorite:b,status:j,link:f}=e,[v,N]=(0,r.useState)(!1),[w,k]=(0,r.useState)(b||!1),[C,S]=(0,r.useState)(!1),[P,z]=(0,r.useState)(j||null),[A,$]=(0,r.useState)(!1),T=(0,o.T)(),L=(0,d.bU)(),R=(0,x.G)(L),D=h?(0,c.Q)(new Date(h),{addSuffix:!0,locale:R}):null,M="main"===p||"master"===p,E=async e=>{if(e.preventDefault(),e.stopPropagation(),confirm(T("worktree.session.confirmKill",{name:p})))try{N(!0),await m.Iv.killSession(l),t&&t()}catch(t){let e=(0,m.zG)(t);alert(`${T("worktree.session.failedToKill")}: ${e}`)}finally{N(!1)}},I=async e=>{e.preventDefault(),e.stopPropagation();try{S(!0);let e=!w;await m.Iv.toggleFavorite(l,e),k(e)}catch(t){let e=(0,m.zG)(t);alert(`${T("worktree.errors.failedToUpdateFavorite")}: ${e}`)}finally{S(!1)}},_=async(e,t)=>{t.preventDefault(),t.stopPropagation();try{$(!0),await m.Iv.updateStatus(l,e),z(e),s&&s()}catch(t){let e=(0,m.zG)(t);alert(`${T("worktree.errors.failedToUpdateStatus")}: ${e}`)}finally{$(!1)}};return a.jsx(n.default,{href:`/worktrees/${l}`,className:"block",children:(0,a.jsxs)(i.Zb,{hover:!0,padding:"lg",className:"h-full",children:[a.jsx(i.Ol,{children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)(i.ll,{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("button",{onClick:I,disabled:C,className:"flex-shrink-0 transition-colors hover:scale-110",title:w?T("common.favorites.remove"):T("common.favorites.add"),children:a.jsx("svg",{className:`w-5 h-5 ${w?"fill-yellow-400 text-yellow-400":"fill-none text-gray-400"}`,stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})})}),a.jsx("span",{className:"truncate",children:p}),M&&a.jsx(i.Ct,{variant:"info",children:"Main"}),g&&y&&a.jsx(i.Ct,{variant:"warning",dot:!0,children:T("worktree.status.waitingForResponse")}),g&&!y&&a.jsx(i.Ct,{variant:"success",dot:!0,children:T("worktree.status.responseCompleted")})]}),g&&a.jsx(i.zx,{variant:"danger",size:"sm",onClick:E,disabled:v,className:"flex-shrink-0",children:v?T("common.ending"):T("common.end")})]})}),a.jsx(i.aY,{children:(0,a.jsxs)("div",{className:"space-y-3",children:[u&&(0,a.jsxs)("div",{children:[a.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Description"}),a.jsx("p",{className:"text-sm text-gray-700 line-clamp-2 whitespace-pre-wrap",children:u})]}),f&&(0,a.jsxs)("div",{children:[a.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Link"}),(0,a.jsxs)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),f&&window.open(f,"_blank","noopener,noreferrer")},className:"flex items-center gap-1 text-sm text-blue-600 hover:text-blue-800 hover:underline transition-colors",title:"Open link in new tab",children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),a.jsx("span",{className:"truncate",children:f})]})]}),(0,a.jsxs)("div",{children:[a.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Status"}),(0,a.jsxs)("div",{className:"flex gap-1 flex-wrap",children:[a.jsx("button",{onClick:e=>_(null,e),disabled:A,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${null===P?"bg-gray-100 text-gray-700 border-gray-400":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50"}`,children:"Not set"}),a.jsx("button",{onClick:e=>_("todo",e),disabled:A,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${"todo"===P?"bg-gray-100 text-gray-700 border-gray-400":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50"}`,children:"ToDo"}),a.jsx("button",{onClick:e=>_("doing",e),disabled:A,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${"doing"===P?"bg-blue-100 text-blue-700 border-blue-400":"bg-white text-gray-600 border-gray-200 hover:bg-blue-50"}`,children:"Doing"}),a.jsx("button",{onClick:e=>_("done",e),disabled:A,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${"done"===P?"bg-green-100 text-green-700 border-green-400":"bg-white text-gray-600 border-gray-200 hover:bg-green-50"}`,children:"Done"})]})]}),D&&(0,a.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[a.jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,a.jsxs)("span",{children:["Updated ",D]})]})]})})]})})}function u({initialWorktrees:e=[]}){let[t,s]=(0,r.useState)(e),[l,n]=(0,r.useState)([]),[o,d]=(0,r.useState)(!e.length),[c,x]=(0,r.useState)(null),[u,h]=(0,r.useState)(""),[g,y]=(0,r.useState)("updated"),[b,j]=(0,r.useState)("desc"),[f,v]=(0,r.useState)(null),[N,w]=(0,r.useState)(null),[k,C]=(0,r.useState)(null),[S,P]=(0,r.useState)([]),[z,A]=(0,r.useState)(!1),[$,T]=(0,r.useState)(null),L=(0,r.useCallback)(async()=>{try{let e=await m.J1.getExcluded();e.success&&P(e.repositories)}catch{}},[]),R=(0,r.useCallback)(async(e=!1)=>{try{e||d(!0),x(null);let t=await m.Iv.getAll();s(t.worktrees),n(t.repositories)}catch(e){x((0,m.zG)(e))}finally{e||d(!1)}},[]),D=e=>!!(e&&"session_status_changed"===e.type),{status:M}=function(e={}){let{worktreeIds:t=[],onMessage:s,onStatusChange:a,autoReconnect:l=!0,reconnectDelay:n=3e3}=e,[i,o]=(0,r.useState)("disconnected"),d=(0,r.useRef)(null),c=(0,r.useRef)(),x=(0,r.useRef)(new Set),m=(0,r.useCallback)(e=>{o(e),a?.(e)},[a]),p=(0,r.useCallback)(()=>{if(d.current?.readyState===WebSocket.OPEN)return;m("connecting");let e="https:"===window.location.protocol?"wss:":"ws:",t=new WebSocket(`${e}//${window.location.host}`);t.onopen=()=>{m("connected"),x.current.forEach(e=>{t.send(JSON.stringify({type:"subscribe",worktreeId:e}))})},t.onmessage=e=>{try{let t=JSON.parse(e.data);s?.(t)}catch(e){console.error("Failed to parse WebSocket message:",e)}},t.onerror=()=>{m("error")},t.onclose=()=>{m("disconnected"),d.current=null,l&&(c.current=setTimeout(()=>{p()},n))},d.current=t},[m,s,l,n]),u=(0,r.useCallback)(()=>{c.current&&clearTimeout(c.current),d.current&&(d.current.close(1e3,"Client disconnect"),d.current=null),m("disconnected")},[m]);return{status:i,subscribe:(0,r.useCallback)(e=>{d.current?.readyState===WebSocket.OPEN&&(d.current.send(JSON.stringify({type:"subscribe",worktreeId:e})),x.current.add(e))},[]),unsubscribe:(0,r.useCallback)(e=>{d.current?.readyState===WebSocket.OPEN&&(d.current.send(JSON.stringify({type:"unsubscribe",worktreeId:e})),x.current.delete(e))},[]),sendMessage:(0,r.useCallback)(e=>{d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify(e))},[]),connect:p,disconnect:u}}({onMessage:(0,r.useCallback)(e=>{if(D(e.data)){let t=e.data;s(e=>e.map(e=>e.id===t.worktreeId?{...e,isSessionRunning:t.isRunning}:e))}"broadcast"===e.type&&R(!0)},[R])}),E=(0,r.useMemo)(()=>{let e=[...t];if(f&&(e=e.filter(e=>e.repositoryPath===f)),null!==N&&(e="unset"===N?e.filter(e=>!e.status):e.filter(e=>e.status===N)),u){let t=u.toLowerCase();e=e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)||e.repositoryName.toLowerCase().includes(t)||e.lastMessageSummary?.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t))}return e.sort((e,t)=>{let s=0;switch(g){case"name":s=e.name.localeCompare(t.name);break;case"updated":s=(e.updatedAt?new Date(e.updatedAt).getTime():0)-(t.updatedAt?new Date(t.updatedAt).getTime():0);break;case"favorite":s=(e.favorite?1:0)-(t.favorite?1:0)}return"asc"===b?s:-s}),e},[t,f,N,u,g,b]),I=(0,r.useMemo)(()=>{let e=new Map;for(let t of E){let s=t.repositoryPath||"unknown";e.has(s)||e.set(s,[]),e.get(s).push(t)}return e},[E]),_=e=>{g===e?j(e=>"asc"===e?"desc":"asc"):(y(e),j("asc"))},O=async e=>{T(e);try{let t=await m.J1.restore(e);t.warning&&x(t.warning),await R(),await L()}catch(e){x((0,m.zG)(e))}finally{T(null)}},F=async(e,t)=>{let s=l.find(t=>t.path===e)?.worktreeCount||0;if("delete"===prompt(`Delete repository "${t}"?
|
|
2
2
|
|
|
3
3
|
This will delete:
|
|
4
4
|
- ${s} worktree(s)
|
|
@@ -11,4 +11,4 @@ This repository will be added to the exclusion list.
|
|
|
11
11
|
It will NOT be re-registered when you run "Sync All".
|
|
12
12
|
You can restore it from the excluded repositories list.
|
|
13
13
|
|
|
14
|
-
Type "delete" to confirm:`)){C(e);try{await m.J1.delete(e),f===e&&v(null),await R(),await L()}catch(e){x((0,m.zG)(e))}finally{C(null)}}};return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsxs)(i.Ct,{variant:"gray",children:[t.length," branches"]}),l.length>0&&(0,a.jsxs)(i.Ct,{variant:"info",children:[l.length," ",1===l.length?"repository":"repositories"]}),"connected"===M&&a.jsx(i.Ct,{variant:"success",dot:!0,children:"Live"})]}),a.jsx("div",{className:"flex gap-2 w-full sm:w-auto",children:a.jsx(i.zx,{variant:"secondary",size:"sm",onClick:()=>R(),disabled:o,children:o?"Loading...":"Refresh"})})]}),a.jsx("div",{className:"flex flex-col sm:flex-row gap-3",children:a.jsx("input",{type:"text",placeholder:"Search worktrees...",value:u,onChange:e=>h(e.target.value),className:"input flex-1"})}),l.length>0&&(0,a.jsxs)("div",{className:"flex gap-2 flex-wrap items-center",children:[(0,a.jsxs)(i.zx,{variant:null===f?"primary":"ghost",size:"sm",onClick:()=>v(null),children:["All (",t.length,")"]}),l.map(e=>(0,a.jsxs)("div",{className:"relative group inline-flex items-center",children:[(0,a.jsxs)(i.zx,{variant:f===e.path?"primary":"ghost",size:"sm",onClick:()=>v(e.path),className:"pr-6",children:[e.name," (",e.worktreeCount,")"]}),a.jsx("button",{className:"absolute right-1 opacity-0 group-hover:opacity-100 text-gray-400 hover:text-red-500 transition-opacity px-1",onClick:t=>{t.stopPropagation(),F(e.path,e.name)},disabled:k===e.path,title:"Delete repository",children:k===e.path?"...":"x"})]},e.path))]}),(0,a.jsxs)("div",{className:"flex gap-2 flex-wrap items-center",children:[a.jsx(i.zx,{variant:null===N?"primary":"ghost",size:"sm",onClick:()=>w(null),children:"All"}),a.jsx(i.zx,{variant:"todo"===N?"primary":"ghost",size:"sm",onClick:()=>w("todo"),children:"\uD83D\uDCDD ToDo"}),a.jsx(i.zx,{variant:"doing"===N?"primary":"ghost",size:"sm",onClick:()=>w("doing"),children:"\uD83D\uDEA7 Doing"}),a.jsx(i.zx,{variant:"done"===N?"primary":"ghost",size:"sm",onClick:()=>w("done"),children:"✅ Done"}),a.jsx(i.zx,{variant:"unset"===N?"primary":"ghost",size:"sm",onClick:()=>w("unset"),children:"Not set"})]}),(0,a.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[a.jsx("span",{className:"text-sm text-gray-600 self-center",children:"Sort by:"}),(0,a.jsxs)(i.zx,{variant:"favorite"===g?"primary":"ghost",size:"sm",onClick:()=>_("favorite"),children:["⭐ Favorite ","favorite"===g&&("asc"===b?"↑":"↓")]}),(0,a.jsxs)(i.zx,{variant:"name"===g?"primary":"ghost",size:"sm",onClick:()=>_("name"),children:["Name ","name"===g&&("asc"===b?"↑":"↓")]}),(0,a.jsxs)(i.zx,{variant:"updated"===g?"primary":"ghost",size:"sm",onClick:()=>_("updated"),children:["Updated ","updated"===g&&("asc"===b?"↑":"↓")]})]}),c&&a.jsx("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:a.jsx("p",{className:"text-sm text-red-800",children:c})}),o&&!t.length&&(0,a.jsxs)("div",{className:"text-center py-12",children:[a.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"}),a.jsx("p",{className:"mt-4 text-gray-600",children:"Loading worktrees..."})]}),!o&&!c&&0===E.length&&(0,a.jsxs)("div",{className:"text-center py-12",children:[a.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),a.jsx("p",{className:"mt-4 text-gray-600",children:u?"No worktrees found matching your search":"No worktrees found"})]}),!o&&E.length>0&&a.jsx("div",{className:"space-y-8",children:Array.from(I.entries()).map(([e,t])=>{let s=l.find(t=>t.path===e),r=s?.name||"Unknown Repository";return(0,a.jsxs)("div",{className:"space-y-4",children:[(l.length>1||!f)&&(0,a.jsxs)("div",{className:"flex items-center gap-3 pb-2 border-b border-gray-200",children:[a.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:r}),a.jsx(i.Ct,{variant:"gray",children:t.length})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:t.map(e=>a.jsx(p,{worktree:e,onSessionKilled:R,onStatusChanged:R},e.id))})]},e)})}),S.length>0&&(0,a.jsxs)("div",{className:"border border-gray-200 rounded-lg",children:[(0,a.jsxs)("button",{className:"w-full flex items-center justify-between p-4 text-left hover:bg-gray-50 transition-colors",onClick:()=>A(!z),children:[(0,a.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Excluded Repositories (",S.length,")"]}),a.jsx("span",{className:"text-gray-400 text-sm",children:z?"Hide":"Show"})]}),z&&a.jsx("div",{className:"border-t border-gray-200 divide-y divide-gray-100",children:S.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,a.jsxs)("div",{children:[a.jsx("span",{className:"text-sm font-medium text-gray-700",children:e.name}),a.jsx("span",{className:"text-xs text-gray-500 ml-2",children:e.path})]}),a.jsx(i.zx,{variant:"secondary",size:"sm",onClick:()=>O(e.path),disabled:$===e.path,children:$===e.path?"Restoring...":"Restore"})]},e.id))})]})]})}s(35047),s(43053),s(15470),s(11867);class h{constructor(){}static getInstance(){return h.instance||(h.instance=new h),h.instance}normalize(e){let t=e.match(/^ssh:\/\/git@([^:\/]+)(:\d+)?\/(.+?)(\.git)?$/);if(t)return`https://${t[1]}/${t[3]}`.toLowerCase().replace(/\/$/,"");let s=e.match(/^git@([^:]+):(.+?)(\.git)?$/);return s?`https://${s[1]}/${s[2]}`.toLowerCase().replace(/\/$/,""):e.replace(/\.git\/?$/,"").replace(/\/$/,"").toLowerCase()}isSameRepository(e,t){return this.normalize(e)===this.normalize(t)}extractRepoName(e){let t=e.match(/^ssh:\/\/git@[^\/]+\/(.+?)(\.git)?$/);if(t){let e=t[1].split("/");return e[e.length-1]}let s=e.match(/:(.+?)(\.git)?$/);if(s&&e.startsWith("git@")){let e=s[1].split("/");return e[e.length-1]}let a=e.match(/\/([^\/]+?)(\.git)?$/);return a?a[1]:""}getUrlType(e){return e.startsWith("https://")?"https":e.startsWith("git@")||e.startsWith("ssh://")?"ssh":null}validate(e){if(!e||"string"!=typeof e||""===e.trim())return{valid:!1,error:"EMPTY_URL"};let t=e.trim();return t.startsWith("https://")?/^https:\/\/[^\/]+\/[^\/]+\/[^\/]+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}:t.startsWith("git@")?/^git@[^:]+:.+\/.+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}:t.startsWith("ssh://")&&/^ssh:\/\/git@[^\/]+(:\d+)?\/[^\/]+\/.+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}}}function g({onRepositoryAdded:e}){let[t,s]=(0,r.useState)(!1),[l,n]=(0,r.useState)("local"),[o,d]=(0,r.useState)(""),[c,x]=(0,r.useState)(""),[p,u]=(0,r.useState)(!1),[g,y]=(0,r.useState)(!1),[b,j]=(0,r.useState)(!1),[f,v]=(0,r.useState)(null),[N,w]=(0,r.useState)(null),[k,C]=(0,r.useState)(null),S=h.getInstance(),P=(0,r.useCallback)(async t=>{try{let a=await m.J1.getCloneStatus(t);"completed"===a.status?(C("Repository cloned successfully"),j(!1),v(null),x(""),s(!1),e&&e()):"failed"===a.status?(w(a.error?.message||"Clone failed"),j(!1),v(null)):("running"===a.status||"pending"===a.status)&&setTimeout(()=>P(t),2e3)}catch(e){w((0,m.zG)(e)),j(!1),v(null)}},[e]),z=async t=>{if(t.preventDefault(),!o.trim()){w("Repository path is required");return}w(null),C(null),u(!0);try{let t=await m.J1.scan(o);C(t.message),d(""),s(!1),e&&e()}catch(e){w((0,m.zG)(e))}finally{u(!1)}},A=async e=>{if(e.preventDefault(),!c.trim()){w("Clone URL is required");return}let t=S.validate(c.trim());if(!t.valid){"EMPTY_URL"===t.error?w("Clone URL is required"):w("Invalid URL format");return}w(null),C(null),j(!0);try{let e=await m.J1.clone(c.trim());v(e.jobId)}catch(e){w((0,m.zG)(e)),j(!1)}},$=async()=>{w(null),C(null),y(!0);try{let t=await m.J1.sync();C(t.message),e&&e()}catch(e){w((0,m.zG)(e))}finally{y(!1)}},T=()=>{s(!1),d(""),x(""),w(null),n("local")};return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[!t&&a.jsx(i.zx,{variant:"primary",size:"sm",onClick:()=>s(!0),children:"+ Add Repository"}),a.jsx(i.zx,{variant:"secondary",size:"sm",onClick:$,disabled:g,children:g?"Syncing...":"Sync All"})]}),t&&a.jsx(i.Zb,{padding:"lg",children:(0,a.jsxs)("div",{className:"space-y-4",children:[a.jsx("div",{children:a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Add New Repository"})}),(0,a.jsxs)("div",{className:"flex border-b border-gray-200",role:"tablist",children:[a.jsx("button",{role:"tab","aria-selected":"local"===l,onClick:()=>n("local"),className:`px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors ${"local"===l?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:"Local Path"}),a.jsx("button",{role:"tab","aria-selected":"url"===l,onClick:()=>n("url"),className:`px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors ${"url"===l?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:"Clone URL"})]}),"local"===l&&(0,a.jsxs)("form",{onSubmit:z,className:"space-y-4",children:[(0,a.jsxs)("div",{children:[a.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Enter the absolute path to a git repository containing worktrees."}),a.jsx("label",{htmlFor:"repositoryPath",className:"block text-sm font-medium text-gray-700 mb-2",children:"Repository Path"}),a.jsx("input",{id:"repositoryPath",type:"text",value:o,onChange:e=>d(e.target.value),placeholder:"/absolute/path/to/repository",className:"input w-full font-mono text-sm",disabled:p}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Example: /Users/username/projects/my-repo"})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[a.jsx(i.zx,{type:"submit",variant:"primary",disabled:p||!o.trim(),children:p?"Scanning...":"Scan & Add"}),a.jsx(i.zx,{type:"button",variant:"ghost",onClick:T,disabled:p,children:"Cancel"})]})]}),"url"===l&&(0,a.jsxs)("form",{onSubmit:A,className:"space-y-4",children:[(0,a.jsxs)("div",{children:[a.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Enter a git clone URL to clone a remote repository."}),a.jsx("label",{htmlFor:"cloneUrl",className:"block text-sm font-medium text-gray-700 mb-2",children:"Clone URL"}),a.jsx("input",{id:"cloneUrl",type:"text",value:c,onChange:e=>x(e.target.value),placeholder:"https://github.com/user/repo.git",className:"input w-full font-mono text-sm",disabled:b}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Supports HTTPS and SSH URLs"})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[a.jsx(i.zx,{type:"submit",variant:"primary",disabled:b||!c.trim(),children:b?"Cloning...":"Clone"}),a.jsx(i.zx,{type:"button",variant:"ghost",onClick:T,disabled:b,children:"Cancel"})]})]})]})}),k&&a.jsx("div",{className:"p-4 bg-green-50 border border-green-200 rounded-lg",children:a.jsx("p",{className:"text-sm text-green-800",children:k})}),N&&a.jsx("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:a.jsx("p",{className:"text-sm text-red-800",children:N})})]})}function y({appId:e,pollInterval:t=3e4,showResponseTime:s=!1,compact:l=!1}){let[n,i]=(0,r.useState)(null),[o,d]=(0,r.useState)(!0);if((0,r.useCallback)(async()=>{try{let t=await fetch(`/api/external-apps/${e}/health`);if(t.ok){let e=await t.json();i(e)}else i({id:e,healthy:!1,lastChecked:Date.now(),error:"Failed to check health"})}catch{i({id:e,healthy:!1,lastChecked:Date.now(),error:"Network error"})}finally{d(!1)}},[e]),o)return(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-gray-300 animate-pulse"}),!l&&a.jsx("span",{className:"text-xs text-gray-400",children:"Checking..."})]});let c=n?.healthy??!1,x=c?"bg-green-500":"bg-gray-400",m=c?"Running":"Stopped";return l?a.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full ${x}`,title:m}):(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full ${x}`}),a.jsx("span",{className:`text-xs ${c?"text-green-600":"text-gray-500"}`,children:m}),s&&n?.responseTime!==void 0&&(0,a.jsxs)("span",{className:"text-xs text-gray-400",children:["(",n.responseTime,"ms)"]})]})}function b({app:e,onEdit:t,onDelete:s}){var l;let[n,o]=(0,r.useState)(!1),[d,c]=(0,r.useState)(!1),x=async()=>{c(!0);try{await s(e.id)}finally{c(!1),o(!1)}},m=`/proxy/${e.pathPrefix}/`;return(0,a.jsxs)(i.Zb,{padding:"md",className:"relative",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[a.jsx("h4",{className:"text-base font-semibold text-gray-900 truncate",children:e.displayName}),a.jsx("p",{className:"text-xs text-gray-500 mt-0.5 font-mono truncate",children:e.name})]}),a.jsx(i.Ct,{variant:{sveltekit:"warning",streamlit:"error",nextjs:"info",other:"gray"}[e.appType]||"gray",children:{sveltekit:"SvelteKit",streamlit:"Streamlit",nextjs:"Next.js",other:"Other"}[l=e.appType]||l})]}),(0,a.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"Status"}),a.jsx(y,{appId:e.id,pollInterval:3e4})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"Port"}),(0,a.jsxs)("span",{className:"text-sm font-mono text-gray-900",children:[":",e.targetPort]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"Path"}),(0,a.jsxs)("span",{className:"text-sm font-mono text-gray-900 truncate max-w-[150px]",children:["/proxy/",e.pathPrefix,"/"]})]}),e.websocketEnabled&&(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"WebSocket"}),a.jsx(i.Ct,{variant:"info",children:"Enabled"})]}),!e.enabled&&a.jsx("div",{className:"mt-2 py-1 px-2 bg-yellow-50 border border-yellow-200 rounded text-xs text-yellow-700",children:"This app is disabled"})]}),n?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("p",{className:"text-sm text-gray-600",children:['Delete "',e.displayName,'"?']}),(0,a.jsxs)("div",{className:"flex gap-2",children:[a.jsx(i.zx,{variant:"danger",size:"sm",onClick:x,disabled:d,loading:d,children:"Delete"}),a.jsx(i.zx,{variant:"ghost",size:"sm",onClick:()=>o(!1),disabled:d,children:"Cancel"})]})]}):(0,a.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[a.jsx(i.zx,{variant:"primary",size:"sm",onClick:()=>window.open(m,"_blank"),disabled:!e.enabled,children:"Open"}),a.jsx(i.zx,{variant:"secondary",size:"sm",onClick:()=>t(e),children:"Settings"}),a.jsx(i.zx,{variant:"ghost",size:"sm",onClick:()=>o(!0),className:"text-red-600 hover:bg-red-50",children:"Delete"})]})]})}let j={MIN:1024,MAX:65535},f=/^[a-zA-Z0-9-]+$/,v={sveltekit:"SvelteKit",streamlit:"Streamlit",nextjs:"Next.js",other:"Other"},N=["sveltekit","streamlit","nextjs","other"].map(e=>({value:e,label:v[e]}));function w({isOpen:e,onClose:t,editApp:s,onSave:l}){let n=!!s,[o,d]=(0,r.useState)(""),[c,x]=(0,r.useState)(""),[m,p]=(0,r.useState)(""),[u,h]=(0,r.useState)(""),[g,y]=(0,r.useState)(""),[b,v]=(0,r.useState)(!1),[w,k]=(0,r.useState)(""),[C,S]=(0,r.useState)(!0),[P,z]=(0,r.useState)({}),[A,$]=(0,r.useState)(!1),[T,L]=(0,r.useState)(null),R=async e=>{e.preventDefault(),L(null);let a=function(e,t){var s;let a={};return e.displayName?.trim()||(a.displayName="Display name is required"),t||(e.name?.trim()?f.test(e.name)||(a.name="Only alphanumeric characters and hyphens are allowed"):a.name="Identifier name is required",e.pathPrefix?.trim()?f.test(e.pathPrefix)||(a.pathPrefix="Only alphanumeric characters and hyphens are allowed"):a.pathPrefix="Path prefix is required"),e.targetPort?"number"!=typeof e.targetPort||Number.isInteger(s=e.targetPort)&&s>=j.MIN&&s<=j.MAX||(a.targetPort=`Port must be between ${j.MIN} and ${j.MAX}`):a.targetPort="Port number is required",t||e.appType||(a.appType="App type is required"),a}({displayName:o,name:c,pathPrefix:m,targetPort:u,appType:g},n);if(Object.keys(a).length>0){z(a);return}z({}),$(!0);try{if(n&&s){let e=await fetch(`/api/external-apps/${s.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({displayName:o,description:w||void 0,targetPort:u||void 0,websocketEnabled:b,enabled:C})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to update app")}}else{let e=await fetch("/api/external-apps",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({displayName:o,name:c,pathPrefix:m,targetPort:u,appType:g,websocketEnabled:b,description:w||void 0})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to create app")}}l(),t()}catch(e){L(e instanceof Error?e.message:"An error occurred")}finally{$(!1)}};return a.jsx(i.u_,{isOpen:e,onClose:t,title:n?"Edit External App":"Add External App",size:"md",children:(0,a.jsxs)("form",{onSubmit:R,className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"displayName",className:"block text-sm font-medium text-gray-700 mb-1",children:["Display Name ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{id:"displayName",type:"text",value:o,onChange:e=>d(e.target.value),className:`input w-full ${P.displayName?"border-red-500":""}`,placeholder:"My App",disabled:A}),P.displayName&&a.jsx("p",{className:"mt-1 text-xs text-red-500",children:P.displayName})]}),!n&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-1",children:["Identifier Name ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{id:"name",type:"text",value:c,onChange:e=>x(e.target.value),className:`input w-full font-mono ${P.name?"border-red-500":""}`,placeholder:"my-app",disabled:A}),a.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Alphanumeric and hyphens only. Cannot be changed later."}),P.name&&a.jsx("p",{className:"mt-1 text-xs text-red-500",children:P.name})]}),!n&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"pathPrefix",className:"block text-sm font-medium text-gray-700 mb-1",children:["Path Prefix ",a.jsx("span",{className:"text-red-500",children:"*"})]}),(0,a.jsxs)("div",{className:"flex items-center",children:[a.jsx("span",{className:"text-sm text-gray-500 mr-1",children:"/proxy/"}),a.jsx("input",{id:"pathPrefix",type:"text",value:m,onChange:e=>p(e.target.value),className:`input flex-1 font-mono ${P.pathPrefix?"border-red-500":""}`,placeholder:"app-name",disabled:A}),a.jsx("span",{className:"text-sm text-gray-500 ml-1",children:"/"})]}),a.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"URL path for accessing this app. Cannot be changed later."}),P.pathPrefix&&a.jsx("p",{className:"mt-1 text-xs text-red-500",children:P.pathPrefix})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"targetPort",className:"block text-sm font-medium text-gray-700 mb-1",children:["Port Number ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{id:"targetPort",type:"number",value:u,onChange:e=>h(e.target.value?parseInt(e.target.value,10):""),className:`input w-full font-mono ${P.targetPort?"border-red-500":""}`,placeholder:"5173",min:j.MIN,max:j.MAX,disabled:A}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-gray-500",children:["Target port (",j.MIN,"-",j.MAX,")"]}),P.targetPort&&a.jsx("p",{className:"mt-1 text-xs text-red-500",children:P.targetPort})]}),!n&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"appType",className:"block text-sm font-medium text-gray-700 mb-1",children:["App Type ",a.jsx("span",{className:"text-red-500",children:"*"})]}),(0,a.jsxs)("select",{id:"appType",value:g,onChange:e=>y(e.target.value),className:`input w-full ${P.appType?"border-red-500":""}`,disabled:A,children:[a.jsx("option",{value:"",children:"Select app type..."}),N.map(e=>a.jsx("option",{value:e.value,children:e.label},e.value))]}),P.appType&&a.jsx("p",{className:"mt-1 text-xs text-red-500",children:P.appType})]}),(0,a.jsxs)("div",{children:[a.jsx("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700 mb-1",children:"Description"}),a.jsx("textarea",{id:"description",value:w,onChange:e=>k(e.target.value),className:"input w-full",placeholder:"Optional description...",rows:2,disabled:A})]}),(0,a.jsxs)("div",{className:"flex items-center",children:[a.jsx("input",{id:"websocketEnabled",type:"checkbox",checked:b,onChange:e=>v(e.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",disabled:A}),a.jsx("label",{htmlFor:"websocketEnabled",className:"ml-2 text-sm text-gray-700",children:"Enable WebSocket support"})]}),n&&(0,a.jsxs)("div",{className:"flex items-center",children:[a.jsx("input",{id:"enabled",type:"checkbox",checked:C,onChange:e=>S(e.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",disabled:A}),a.jsx("label",{htmlFor:"enabled",className:"ml-2 text-sm text-gray-700",children:"App is enabled"})]}),T&&a.jsx("div",{className:"p-3 bg-red-50 border border-red-200 rounded text-sm text-red-700",children:T}),(0,a.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-200",children:[a.jsx(i.zx,{type:"button",variant:"ghost",onClick:t,disabled:A,children:"Cancel"}),a.jsx(i.zx,{type:"submit",variant:"primary",loading:A,children:n?"Save Changes":"Add App"})]})]})})}function k(){let[e,t]=(0,r.useState)([]),[s,l]=(0,r.useState)(!0),[n,o]=(0,r.useState)(null),[d,c]=(0,r.useState)(!1),[x,m]=(0,r.useState)(null),p=(0,r.useCallback)(async()=>{try{o(null);let e=await fetch("/api/external-apps");if(!e.ok)throw Error("Failed to fetch external apps");let s=await e.json();t(s.apps||[])}catch(e){o(e instanceof Error?e.message:"An error occurred")}finally{l(!1)}},[]),u=(0,r.useCallback)(e=>{m(e),c(!0)},[]),h=(0,r.useCallback)(()=>{m(null),c(!0)},[]),g=(0,r.useCallback)(async e=>{try{let t=await fetch(`/api/external-apps/${e}`,{method:"DELETE"});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to delete app")}p()}catch(e){console.error("Failed to delete app:",e)}},[p]),y=(0,r.useCallback)(()=>{p()},[p]),j=(0,r.useCallback)(()=>{c(!1),m(null)},[]);return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"External Apps"}),a.jsx(i.zx,{variant:"primary",size:"sm",onClick:h,children:"+ Add App"})]}),s?a.jsx(i.Zb,{padding:"lg",children:(0,a.jsxs)("div",{className:"flex items-center justify-center py-8",children:[a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"}),a.jsx("span",{className:"ml-3 text-gray-600",children:"Loading apps..."})]})}):n?a.jsx(i.Zb,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-8",children:[a.jsx("p",{className:"text-red-600 mb-4",children:"Failed to load external apps"}),a.jsx(i.zx,{variant:"secondary",size:"sm",onClick:p,children:"Retry"})]})}):0===e.length?a.jsx(i.Zb,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-8",children:[a.jsx("p",{className:"text-gray-500 mb-4",children:"No external apps registered yet."}),a.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"Add an external app to proxy requests to other frontend applications."}),a.jsx(i.zx,{variant:"primary",size:"sm",onClick:h,children:"Add Your First App"})]})}):a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(e=>a.jsx(b,{app:e,onEdit:u,onDelete:g},e.id))}),a.jsx(w,{isOpen:d,onClose:j,editApp:x,onSave:y})]})}function C(){let[e,t]=(0,r.useState)(0),s=(0,r.useCallback)(()=>{t(e=>e+1)},[]);return a.jsx(l.Vw,{children:(0,a.jsxs)("div",{className:"container-custom py-8 overflow-auto h-full",children:[(0,a.jsxs)("div",{className:"mb-8",children:[a.jsx("h1",{className:"mb-2",children:"CommandMate"}),a.jsx("p",{className:"text-lg text-gray-600",children:"Git worktree management with Claude CLI and tmux sessions"})]}),a.jsx("div",{className:"mb-8",children:a.jsx(g,{onRepositoryAdded:s})}),a.jsx(u,{},e),a.jsx("div",{className:"mt-8",children:a.jsx(k,{})})]})})}},35480:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>a});let a=(0,s(68570).createProxy)(String.raw`/home/runner/work/CommandMate/CommandMate/src/app/page.tsx#default`)},6162:(e,t,s)=>{"use strict";s.d(t,{T:()=>l});var a=s(34643);function r(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let l=r(0,a.T_);r(0,a.Gb)}};var t=require("../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),a=t.X(0,[8948,1287,6621,8705,7808,3860,9238],()=>s(37906));module.exports=a})();
|
|
14
|
+
Type "delete" to confirm:`)){C(e);try{await m.J1.delete(e),f===e&&v(null),await R(),await L()}catch(e){x((0,m.zG)(e))}finally{C(null)}}};return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsxs)(i.Ct,{variant:"gray",children:[t.length," branches"]}),l.length>0&&(0,a.jsxs)(i.Ct,{variant:"info",children:[l.length," ",1===l.length?"repository":"repositories"]}),"connected"===M&&a.jsx(i.Ct,{variant:"success",dot:!0,children:"Live"})]}),a.jsx("div",{className:"flex gap-2 w-full sm:w-auto",children:a.jsx(i.zx,{variant:"secondary",size:"sm",onClick:()=>R(),disabled:o,children:o?"Loading...":"Refresh"})})]}),a.jsx("div",{className:"flex flex-col sm:flex-row gap-3",children:a.jsx("input",{type:"text",placeholder:"Search worktrees...",value:u,onChange:e=>h(e.target.value),className:"input flex-1"})}),l.length>0&&(0,a.jsxs)("div",{className:"flex gap-2 flex-wrap items-center",children:[(0,a.jsxs)(i.zx,{variant:null===f?"primary":"ghost",size:"sm",onClick:()=>v(null),children:["All (",t.length,")"]}),l.map(e=>(0,a.jsxs)("div",{className:"relative group inline-flex items-center",children:[(0,a.jsxs)(i.zx,{variant:f===e.path?"primary":"ghost",size:"sm",onClick:()=>v(e.path),className:"pr-6",children:[e.name," (",e.worktreeCount,")"]}),a.jsx("button",{className:"absolute right-1 opacity-0 group-hover:opacity-100 text-gray-400 hover:text-red-500 transition-opacity px-1",onClick:t=>{t.stopPropagation(),F(e.path,e.name)},disabled:k===e.path,title:"Delete repository",children:k===e.path?"...":"x"})]},e.path))]}),(0,a.jsxs)("div",{className:"flex gap-2 flex-wrap items-center",children:[a.jsx(i.zx,{variant:null===N?"primary":"ghost",size:"sm",onClick:()=>w(null),children:"All"}),a.jsx(i.zx,{variant:"todo"===N?"primary":"ghost",size:"sm",onClick:()=>w("todo"),children:"\uD83D\uDCDD ToDo"}),a.jsx(i.zx,{variant:"doing"===N?"primary":"ghost",size:"sm",onClick:()=>w("doing"),children:"\uD83D\uDEA7 Doing"}),a.jsx(i.zx,{variant:"done"===N?"primary":"ghost",size:"sm",onClick:()=>w("done"),children:"✅ Done"}),a.jsx(i.zx,{variant:"unset"===N?"primary":"ghost",size:"sm",onClick:()=>w("unset"),children:"Not set"})]}),(0,a.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[a.jsx("span",{className:"text-sm text-gray-600 self-center",children:"Sort by:"}),(0,a.jsxs)(i.zx,{variant:"favorite"===g?"primary":"ghost",size:"sm",onClick:()=>_("favorite"),children:["⭐ Favorite ","favorite"===g&&("asc"===b?"↑":"↓")]}),(0,a.jsxs)(i.zx,{variant:"name"===g?"primary":"ghost",size:"sm",onClick:()=>_("name"),children:["Name ","name"===g&&("asc"===b?"↑":"↓")]}),(0,a.jsxs)(i.zx,{variant:"updated"===g?"primary":"ghost",size:"sm",onClick:()=>_("updated"),children:["Updated ","updated"===g&&("asc"===b?"↑":"↓")]})]}),c&&a.jsx("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:a.jsx("p",{className:"text-sm text-red-800",children:c})}),o&&!t.length&&(0,a.jsxs)("div",{className:"text-center py-12",children:[a.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"}),a.jsx("p",{className:"mt-4 text-gray-600",children:"Loading worktrees..."})]}),!o&&!c&&0===E.length&&(0,a.jsxs)("div",{className:"text-center py-12",children:[a.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),a.jsx("p",{className:"mt-4 text-gray-600",children:u?"No worktrees found matching your search":"No worktrees found"})]}),!o&&E.length>0&&a.jsx("div",{className:"space-y-8",children:Array.from(I.entries()).map(([e,t])=>{let s=l.find(t=>t.path===e),r=s?.name||"Unknown Repository";return(0,a.jsxs)("div",{className:"space-y-4",children:[(l.length>1||!f)&&(0,a.jsxs)("div",{className:"flex items-center gap-3 pb-2 border-b border-gray-200",children:[a.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:r}),a.jsx(i.Ct,{variant:"gray",children:t.length})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:t.map(e=>a.jsx(p,{worktree:e,onSessionKilled:R,onStatusChanged:R},e.id))})]},e)})}),S.length>0&&(0,a.jsxs)("div",{className:"border border-gray-200 rounded-lg",children:[(0,a.jsxs)("button",{className:"w-full flex items-center justify-between p-4 text-left hover:bg-gray-50 transition-colors",onClick:()=>A(!z),children:[(0,a.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Excluded Repositories (",S.length,")"]}),a.jsx("span",{className:"text-gray-400 text-sm",children:z?"Hide":"Show"})]}),z&&a.jsx("div",{className:"border-t border-gray-200 divide-y divide-gray-100",children:S.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,a.jsxs)("div",{children:[a.jsx("span",{className:"text-sm font-medium text-gray-700",children:e.name}),a.jsx("span",{className:"text-xs text-gray-500 ml-2",children:e.path})]}),a.jsx(i.zx,{variant:"secondary",size:"sm",onClick:()=>O(e.path),disabled:$===e.path,children:$===e.path?"Restoring...":"Restore"})]},e.id))})]})]})}s(35047),s(43053),s(15470),s(11867);class h{constructor(){}static getInstance(){return h.instance||(h.instance=new h),h.instance}normalize(e){let t=e.match(/^ssh:\/\/git@([^:\/]+)(:\d+)?\/(.+?)(\.git)?$/);if(t)return`https://${t[1]}/${t[3]}`.toLowerCase().replace(/\/$/,"");let s=e.match(/^git@([^:]+):(.+?)(\.git)?$/);return s?`https://${s[1]}/${s[2]}`.toLowerCase().replace(/\/$/,""):e.replace(/\.git\/?$/,"").replace(/\/$/,"").toLowerCase()}isSameRepository(e,t){return this.normalize(e)===this.normalize(t)}extractRepoName(e){let t=e.match(/^ssh:\/\/git@[^\/]+\/(.+?)(\.git)?$/);if(t){let e=t[1].split("/");return e[e.length-1]}let s=e.match(/:(.+?)(\.git)?$/);if(s&&e.startsWith("git@")){let e=s[1].split("/");return e[e.length-1]}let a=e.match(/\/([^\/]+?)(\.git)?$/);return a?a[1]:""}getUrlType(e){return e.startsWith("https://")?"https":e.startsWith("git@")||e.startsWith("ssh://")?"ssh":null}validate(e){if(!e||"string"!=typeof e||""===e.trim())return{valid:!1,error:"EMPTY_URL"};let t=e.trim();return t.startsWith("https://")?/^https:\/\/[^\/]+\/[^\/]+\/[^\/]+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}:t.startsWith("git@")?/^git@[^:]+:.+\/.+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}:t.startsWith("ssh://")&&/^ssh:\/\/git@[^\/]+(:\d+)?\/[^\/]+\/.+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}}}function g({onRepositoryAdded:e}){let[t,s]=(0,r.useState)(!1),[l,n]=(0,r.useState)("local"),[o,d]=(0,r.useState)(""),[c,x]=(0,r.useState)(""),[p,u]=(0,r.useState)(!1),[g,y]=(0,r.useState)(!1),[b,j]=(0,r.useState)(!1),[f,v]=(0,r.useState)(null),[N,w]=(0,r.useState)(null),[k,C]=(0,r.useState)(null),S=h.getInstance(),P=(0,r.useCallback)(async t=>{try{let a=await m.J1.getCloneStatus(t);"completed"===a.status?(C("Repository cloned successfully"),j(!1),v(null),x(""),s(!1),e&&e()):"failed"===a.status?(w(a.error?.message||"Clone failed"),j(!1),v(null)):("running"===a.status||"pending"===a.status)&&setTimeout(()=>P(t),2e3)}catch(e){w((0,m.zG)(e)),j(!1),v(null)}},[e]),z=async t=>{if(t.preventDefault(),!o.trim()){w("Repository path is required");return}w(null),C(null),u(!0);try{let t=await m.J1.scan(o);C(t.message),d(""),s(!1),e&&e()}catch(e){w((0,m.zG)(e))}finally{u(!1)}},A=async e=>{if(e.preventDefault(),!c.trim()){w("Clone URL is required");return}let t=S.validate(c.trim());if(!t.valid){"EMPTY_URL"===t.error?w("Clone URL is required"):w("Invalid URL format");return}w(null),C(null),j(!0);try{let e=await m.J1.clone(c.trim());v(e.jobId)}catch(e){w((0,m.zG)(e)),j(!1)}},$=async()=>{w(null),C(null),y(!0);try{let t=await m.J1.sync();C(t.message),e&&e()}catch(e){w((0,m.zG)(e))}finally{y(!1)}},T=()=>{s(!1),d(""),x(""),w(null),n("local")};return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[!t&&a.jsx(i.zx,{variant:"primary",size:"sm",onClick:()=>s(!0),children:"+ Add Repository"}),a.jsx(i.zx,{variant:"secondary",size:"sm",onClick:$,disabled:g,children:g?"Syncing...":"Sync All"})]}),t&&a.jsx(i.Zb,{padding:"lg",children:(0,a.jsxs)("div",{className:"space-y-4",children:[a.jsx("div",{children:a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Add New Repository"})}),(0,a.jsxs)("div",{className:"flex border-b border-gray-200",role:"tablist",children:[a.jsx("button",{role:"tab","aria-selected":"local"===l,onClick:()=>n("local"),className:`px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors ${"local"===l?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:"Local Path"}),a.jsx("button",{role:"tab","aria-selected":"url"===l,onClick:()=>n("url"),className:`px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors ${"url"===l?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:"Clone URL"})]}),"local"===l&&(0,a.jsxs)("form",{onSubmit:z,className:"space-y-4",children:[(0,a.jsxs)("div",{children:[a.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Enter the absolute path to a git repository containing worktrees."}),a.jsx("label",{htmlFor:"repositoryPath",className:"block text-sm font-medium text-gray-700 mb-2",children:"Repository Path"}),a.jsx("input",{id:"repositoryPath",type:"text",value:o,onChange:e=>d(e.target.value),placeholder:"/absolute/path/to/repository",className:"input w-full font-mono text-sm",disabled:p}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Example: /Users/username/projects/my-repo"})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[a.jsx(i.zx,{type:"submit",variant:"primary",disabled:p||!o.trim(),children:p?"Scanning...":"Scan & Add"}),a.jsx(i.zx,{type:"button",variant:"ghost",onClick:T,disabled:p,children:"Cancel"})]})]}),"url"===l&&(0,a.jsxs)("form",{onSubmit:A,className:"space-y-4",children:[(0,a.jsxs)("div",{children:[a.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Enter a git clone URL to clone a remote repository."}),a.jsx("label",{htmlFor:"cloneUrl",className:"block text-sm font-medium text-gray-700 mb-2",children:"Clone URL"}),a.jsx("input",{id:"cloneUrl",type:"text",value:c,onChange:e=>x(e.target.value),placeholder:"https://github.com/user/repo.git",className:"input w-full font-mono text-sm",disabled:b}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Supports HTTPS and SSH URLs"})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[a.jsx(i.zx,{type:"submit",variant:"primary",disabled:b||!c.trim(),children:b?"Cloning...":"Clone"}),a.jsx(i.zx,{type:"button",variant:"ghost",onClick:T,disabled:b,children:"Cancel"})]})]})]})}),k&&a.jsx("div",{className:"p-4 bg-green-50 border border-green-200 rounded-lg",children:a.jsx("p",{className:"text-sm text-green-800",children:k})}),N&&a.jsx("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:a.jsx("p",{className:"text-sm text-red-800",children:N})})]})}function y({appId:e,pollInterval:t=3e4,showResponseTime:s=!1,compact:l=!1}){let[n,i]=(0,r.useState)(null),[o,d]=(0,r.useState)(!0);if((0,r.useCallback)(async()=>{try{let t=await fetch(`/api/external-apps/${e}/health`);if(t.ok){let e=await t.json();i(e)}else i({id:e,healthy:!1,lastChecked:Date.now(),error:"Failed to check health"})}catch{i({id:e,healthy:!1,lastChecked:Date.now(),error:"Network error"})}finally{d(!1)}},[e]),o)return(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-gray-300 animate-pulse"}),!l&&a.jsx("span",{className:"text-xs text-gray-400",children:"Checking..."})]});let c=n?.healthy??!1,x=c?"bg-green-500":"bg-gray-400",m=c?"Running":"Stopped";return l?a.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full ${x}`,title:m}):(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full ${x}`}),a.jsx("span",{className:`text-xs ${c?"text-green-600":"text-gray-500"}`,children:m}),s&&n?.responseTime!==void 0&&(0,a.jsxs)("span",{className:"text-xs text-gray-400",children:["(",n.responseTime,"ms)"]})]})}function b({app:e,onEdit:t,onDelete:s}){var l;let[n,o]=(0,r.useState)(!1),[d,c]=(0,r.useState)(!1),x=async()=>{c(!0);try{await s(e.id)}finally{c(!1),o(!1)}},m=`/proxy/${e.pathPrefix}/`;return(0,a.jsxs)(i.Zb,{padding:"md",className:"relative",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[a.jsx("h4",{className:"text-base font-semibold text-gray-900 truncate",children:e.displayName}),a.jsx("p",{className:"text-xs text-gray-500 mt-0.5 font-mono truncate",children:e.name})]}),a.jsx(i.Ct,{variant:{sveltekit:"warning",streamlit:"error",nextjs:"info",other:"gray"}[e.appType]||"gray",children:{sveltekit:"SvelteKit",streamlit:"Streamlit",nextjs:"Next.js",other:"Other"}[l=e.appType]||l})]}),(0,a.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"Status"}),a.jsx(y,{appId:e.id,pollInterval:3e4})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"Port"}),(0,a.jsxs)("span",{className:"text-sm font-mono text-gray-900",children:[":",e.targetPort]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"Path"}),(0,a.jsxs)("span",{className:"text-sm font-mono text-gray-900 truncate max-w-[150px]",children:["/proxy/",e.pathPrefix,"/"]})]}),e.websocketEnabled&&(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"WebSocket"}),a.jsx(i.Ct,{variant:"info",children:"Enabled"})]}),!e.enabled&&a.jsx("div",{className:"mt-2 py-1 px-2 bg-yellow-50 border border-yellow-200 rounded text-xs text-yellow-700",children:"This app is disabled"})]}),n?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("p",{className:"text-sm text-gray-600",children:['Delete "',e.displayName,'"?']}),(0,a.jsxs)("div",{className:"flex gap-2",children:[a.jsx(i.zx,{variant:"danger",size:"sm",onClick:x,disabled:d,loading:d,children:"Delete"}),a.jsx(i.zx,{variant:"ghost",size:"sm",onClick:()=>o(!1),disabled:d,children:"Cancel"})]})]}):(0,a.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[a.jsx(i.zx,{variant:"primary",size:"sm",onClick:()=>window.open(m,"_blank"),disabled:!e.enabled,children:"Open"}),a.jsx(i.zx,{variant:"secondary",size:"sm",onClick:()=>t(e),children:"Settings"}),a.jsx(i.zx,{variant:"ghost",size:"sm",onClick:()=>o(!0),className:"text-red-600 hover:bg-red-50",children:"Delete"})]})]})}let j={MIN:1024,MAX:65535},f=/^[a-zA-Z0-9-]+$/,v={sveltekit:"SvelteKit",streamlit:"Streamlit",nextjs:"Next.js",other:"Other"},N=["sveltekit","streamlit","nextjs","other"].map(e=>({value:e,label:v[e]}));function w({isOpen:e,onClose:t,editApp:s,onSave:l}){let n=!!s,[o,d]=(0,r.useState)(""),[c,x]=(0,r.useState)(""),[m,p]=(0,r.useState)(""),[u,h]=(0,r.useState)(""),[g,y]=(0,r.useState)(""),[b,v]=(0,r.useState)(!1),[w,k]=(0,r.useState)(""),[C,S]=(0,r.useState)(!0),[P,z]=(0,r.useState)({}),[A,$]=(0,r.useState)(!1),[T,L]=(0,r.useState)(null),R=async e=>{e.preventDefault(),L(null);let a=function(e,t){var s;let a={};return e.displayName?.trim()||(a.displayName="Display name is required"),t||(e.name?.trim()?f.test(e.name)||(a.name="Only alphanumeric characters and hyphens are allowed"):a.name="Identifier name is required",e.pathPrefix?.trim()?f.test(e.pathPrefix)||(a.pathPrefix="Only alphanumeric characters and hyphens are allowed"):a.pathPrefix="Path prefix is required"),e.targetPort?"number"!=typeof e.targetPort||Number.isInteger(s=e.targetPort)&&s>=j.MIN&&s<=j.MAX||(a.targetPort=`Port must be between ${j.MIN} and ${j.MAX}`):a.targetPort="Port number is required",t||e.appType||(a.appType="App type is required"),a}({displayName:o,name:c,pathPrefix:m,targetPort:u,appType:g},n);if(Object.keys(a).length>0){z(a);return}z({}),$(!0);try{if(n&&s){let e=await fetch(`/api/external-apps/${s.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({displayName:o,description:w||void 0,targetPort:u||void 0,websocketEnabled:b,enabled:C})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to update app")}}else{let e=await fetch("/api/external-apps",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({displayName:o,name:c,pathPrefix:m,targetPort:u,appType:g,websocketEnabled:b,description:w||void 0})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to create app")}}l(),t()}catch(e){L(e instanceof Error?e.message:"An error occurred")}finally{$(!1)}};return a.jsx(i.u_,{isOpen:e,onClose:t,title:n?"Edit External App":"Add External App",size:"md",children:(0,a.jsxs)("form",{onSubmit:R,className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"displayName",className:"block text-sm font-medium text-gray-700 mb-1",children:["Display Name ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{id:"displayName",type:"text",value:o,onChange:e=>d(e.target.value),className:`input w-full ${P.displayName?"border-red-500":""}`,placeholder:"My App",disabled:A}),P.displayName&&a.jsx("p",{className:"mt-1 text-xs text-red-500",children:P.displayName})]}),!n&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-1",children:["Identifier Name ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{id:"name",type:"text",value:c,onChange:e=>x(e.target.value),className:`input w-full font-mono ${P.name?"border-red-500":""}`,placeholder:"my-app",disabled:A}),a.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Alphanumeric and hyphens only. Cannot be changed later."}),P.name&&a.jsx("p",{className:"mt-1 text-xs text-red-500",children:P.name})]}),!n&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"pathPrefix",className:"block text-sm font-medium text-gray-700 mb-1",children:["Path Prefix ",a.jsx("span",{className:"text-red-500",children:"*"})]}),(0,a.jsxs)("div",{className:"flex items-center",children:[a.jsx("span",{className:"text-sm text-gray-500 mr-1",children:"/proxy/"}),a.jsx("input",{id:"pathPrefix",type:"text",value:m,onChange:e=>p(e.target.value),className:`input flex-1 font-mono ${P.pathPrefix?"border-red-500":""}`,placeholder:"app-name",disabled:A}),a.jsx("span",{className:"text-sm text-gray-500 ml-1",children:"/"})]}),a.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"URL path for accessing this app. Cannot be changed later."}),P.pathPrefix&&a.jsx("p",{className:"mt-1 text-xs text-red-500",children:P.pathPrefix})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"targetPort",className:"block text-sm font-medium text-gray-700 mb-1",children:["Port Number ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{id:"targetPort",type:"number",value:u,onChange:e=>h(e.target.value?parseInt(e.target.value,10):""),className:`input w-full font-mono ${P.targetPort?"border-red-500":""}`,placeholder:"5173",min:j.MIN,max:j.MAX,disabled:A}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-gray-500",children:["Target port (",j.MIN,"-",j.MAX,")"]}),P.targetPort&&a.jsx("p",{className:"mt-1 text-xs text-red-500",children:P.targetPort})]}),!n&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"appType",className:"block text-sm font-medium text-gray-700 mb-1",children:["App Type ",a.jsx("span",{className:"text-red-500",children:"*"})]}),(0,a.jsxs)("select",{id:"appType",value:g,onChange:e=>y(e.target.value),className:`input w-full ${P.appType?"border-red-500":""}`,disabled:A,children:[a.jsx("option",{value:"",children:"Select app type..."}),N.map(e=>a.jsx("option",{value:e.value,children:e.label},e.value))]}),P.appType&&a.jsx("p",{className:"mt-1 text-xs text-red-500",children:P.appType})]}),(0,a.jsxs)("div",{children:[a.jsx("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700 mb-1",children:"Description"}),a.jsx("textarea",{id:"description",value:w,onChange:e=>k(e.target.value),className:"input w-full",placeholder:"Optional description...",rows:2,disabled:A})]}),(0,a.jsxs)("div",{className:"flex items-center",children:[a.jsx("input",{id:"websocketEnabled",type:"checkbox",checked:b,onChange:e=>v(e.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",disabled:A}),a.jsx("label",{htmlFor:"websocketEnabled",className:"ml-2 text-sm text-gray-700",children:"Enable WebSocket support"})]}),n&&(0,a.jsxs)("div",{className:"flex items-center",children:[a.jsx("input",{id:"enabled",type:"checkbox",checked:C,onChange:e=>S(e.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",disabled:A}),a.jsx("label",{htmlFor:"enabled",className:"ml-2 text-sm text-gray-700",children:"App is enabled"})]}),T&&a.jsx("div",{className:"p-3 bg-red-50 border border-red-200 rounded text-sm text-red-700",children:T}),(0,a.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-200",children:[a.jsx(i.zx,{type:"button",variant:"ghost",onClick:t,disabled:A,children:"Cancel"}),a.jsx(i.zx,{type:"submit",variant:"primary",loading:A,children:n?"Save Changes":"Add App"})]})]})})}function k(){let[e,t]=(0,r.useState)([]),[s,l]=(0,r.useState)(!0),[n,o]=(0,r.useState)(null),[d,c]=(0,r.useState)(!1),[x,m]=(0,r.useState)(null),p=(0,r.useCallback)(async()=>{try{o(null);let e=await fetch("/api/external-apps");if(!e.ok)throw Error("Failed to fetch external apps");let s=await e.json();t(s.apps||[])}catch(e){o(e instanceof Error?e.message:"An error occurred")}finally{l(!1)}},[]),u=(0,r.useCallback)(e=>{m(e),c(!0)},[]),h=(0,r.useCallback)(()=>{m(null),c(!0)},[]),g=(0,r.useCallback)(async e=>{try{let t=await fetch(`/api/external-apps/${e}`,{method:"DELETE"});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to delete app")}p()}catch(e){console.error("Failed to delete app:",e)}},[p]),y=(0,r.useCallback)(()=>{p()},[p]),j=(0,r.useCallback)(()=>{c(!1),m(null)},[]);return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"External Apps"}),a.jsx(i.zx,{variant:"primary",size:"sm",onClick:h,children:"+ Add App"})]}),s?a.jsx(i.Zb,{padding:"lg",children:(0,a.jsxs)("div",{className:"flex items-center justify-center py-8",children:[a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"}),a.jsx("span",{className:"ml-3 text-gray-600",children:"Loading apps..."})]})}):n?a.jsx(i.Zb,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-8",children:[a.jsx("p",{className:"text-red-600 mb-4",children:"Failed to load external apps"}),a.jsx(i.zx,{variant:"secondary",size:"sm",onClick:p,children:"Retry"})]})}):0===e.length?a.jsx(i.Zb,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-8",children:[a.jsx("p",{className:"text-gray-500 mb-4",children:"No external apps registered yet."}),a.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"Add an external app to proxy requests to other frontend applications."}),a.jsx(i.zx,{variant:"primary",size:"sm",onClick:h,children:"Add Your First App"})]})}):a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(e=>a.jsx(b,{app:e,onEdit:u,onDelete:g},e.id))}),a.jsx(w,{isOpen:d,onClose:j,editApp:x,onSave:y})]})}function C(){let[e,t]=(0,r.useState)(0),s=(0,r.useCallback)(()=>{t(e=>e+1)},[]);return a.jsx(l.Vw,{children:(0,a.jsxs)("div",{className:"container-custom py-8 overflow-auto h-full",children:[(0,a.jsxs)("div",{className:"mb-8",children:[a.jsx("h1",{className:"mb-2",children:"CommandMate"}),a.jsx("p",{className:"text-lg text-gray-600",children:"Git worktree management with Claude CLI and tmux sessions"})]}),a.jsx("div",{className:"mb-8",children:a.jsx(g,{onRepositoryAdded:s})}),a.jsx(u,{},e),a.jsx("div",{className:"mt-8",children:a.jsx(k,{})})]})})}},35480:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>a});let a=(0,s(68570).createProxy)(String.raw`/home/runner/work/CommandMate/CommandMate/src/app/page.tsx#default`)},6162:(e,t,s)=>{"use strict";s.d(t,{T:()=>l});var a=s(34643);function r(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let l=r(0,a.T_);r(0,a.Gb)}};var t=require("../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),a=t.X(0,[8948,3294,6621,8705,7808,3860,539],()=>s(37906));module.exports=a})();
|