commandmate 0.2.8 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +8 -9
  3. package/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/cache/config.json +3 -3
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/1.pack +0 -0
  9. package/.next/cache/webpack/client-production/2.pack +0 -0
  10. package/.next/cache/webpack/client-production/index.pack +0 -0
  11. package/.next/cache/webpack/client-production/index.pack.old +0 -0
  12. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  13. package/.next/cache/webpack/server-production/0.pack +0 -0
  14. package/.next/cache/webpack/server-production/index.pack +0 -0
  15. package/.next/next-server.js.nft.json +1 -1
  16. package/.next/prerender-manifest.json +1 -1
  17. package/.next/required-server-files.json +1 -1
  18. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/app/update-check/route.js +1 -1
  20. package/.next/server/app/api/repositories/route.js +10 -10
  21. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  22. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  23. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  24. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  25. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  26. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js +1 -1
  27. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  28. package/.next/server/app/api/worktrees/[id]/search/route.js +1 -1
  29. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js +1 -1
  30. package/.next/server/app/api/worktrees/[id]/tree/route.js +1 -1
  31. package/.next/server/app/page.js +3 -3
  32. package/.next/server/app/page.js.nft.json +1 -1
  33. package/.next/server/app/page_client-reference-manifest.js +1 -1
  34. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  35. package/.next/server/app/worktrees/[id]/page.js +3 -3
  36. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  37. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  38. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  39. package/.next/server/app-paths-manifest.json +7 -7
  40. package/.next/server/chunks/2683.js +1 -1
  41. package/.next/server/chunks/5823.js +1 -1
  42. package/.next/server/chunks/667.js +1 -0
  43. package/.next/server/chunks/6837.js +1 -1
  44. package/.next/server/chunks/7266.js +1 -1
  45. package/.next/server/chunks/7536.js +1 -1
  46. package/.next/server/chunks/7808.js +1 -0
  47. package/.next/server/chunks/8585.js +1 -1
  48. package/.next/server/chunks/9238.js +35 -0
  49. package/.next/server/functions-config-manifest.json +1 -1
  50. package/.next/server/pages/500.html +1 -1
  51. package/.next/server/server-reference-manifest.json +1 -1
  52. package/.next/static/chunks/2335-98a211e00b94c7ac.js +1 -0
  53. package/.next/static/chunks/{4733-50bdfc169adb4881.js → 5970-dc8fb1c8c0217636.js} +1 -1
  54. package/.next/static/chunks/{6140-389f1951062dcf4f.js → 8864-2f60eadc8404fdd0.js} +1 -1
  55. package/.next/static/chunks/app/page-a6593b9640df66a6.js +1 -0
  56. package/.next/static/chunks/app/worktrees/[id]/page-1b8e4c49fbaf3f99.js +1 -0
  57. package/.next/static/css/{6a92c8ad3c94d15a.css → a69d9c70fce558b4.css} +1 -1
  58. package/.next/trace +5 -5
  59. package/README.md +234 -47
  60. package/dist/server/src/lib/auto-yes-manager.js +10 -59
  61. package/dist/server/src/lib/prompt-answer-sender.js +89 -0
  62. package/dist/server/src/lib/prompt-detector.js +9 -0
  63. package/package.json +1 -1
  64. package/.next/server/chunks/4704.js +0 -35
  65. package/.next/server/chunks/5781.js +0 -1
  66. package/.next/static/chunks/2330-0299b9879f4977d2.js +0 -1
  67. package/.next/static/chunks/8216-00e20326f32abd12.js +0 -1
  68. package/.next/static/chunks/app/page-43b5de1a0a788b1f.js +0 -1
  69. package/.next/static/chunks/app/worktrees/[id]/page-a836cda4ee0339c5.js +0 -1
  70. /package/.next/static/{yrO0L8bN6ioX1pKYKzlmV → NGcx1ej6oVBba0MO0bwCg}/_buildManifest.js +0 -0
  71. /package/.next/static/{yrO0L8bN6ioX1pKYKzlmV → NGcx1ej6oVBba0MO0bwCg}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";(()=>{var e={};e.id=1991,e.ids=[1991],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")},26683:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>q,patchFetch:()=>P,requestAsyncStorage:()=>v,routeModule:()=>w,serverHooks:()=>A,staticGenerationAsyncStorage:()=>b});var n={};r.r(n),r.d(n,{GET:()=>x});var o=r(49303),i=r(88716),s=r(60670),u=r(87070),a=r(97425),l=r(75748),p=r(63661),c=r(43839),d=r(89194),f=r(19377),m=r(13561),g=r(60667);let h=["claude","codex","gemini"];async function x(e,{params:t}){try{let r=(0,a.n)(),n=(0,l.gU)(r,t.id);if(!n)return u.NextResponse.json({error:`Worktree '${t.id}' not found`},{status:404});let o=new URL(e.url).searchParams.get("cliTool"),i=o&&h.includes(o)?o:n.cliToolId||"claude",s=c.g.getInstance().getTool(i);if(!await s.isRunning(t.id))return u.NextResponse.json({isRunning:!1,content:"",lineCount:0,cliToolId:i},{status:200});let x=(0,l.zl)(r,t.id,i),w=x?.lastCapturedLine||0,v=await (0,d.NA)(t.id,i,1e4),b=v.split("\n"),A=b.length,q=b.slice(Math.max(0,w)).join("\n"),P=(0,f.vp)(v),_=(0,m._)(v,i),k="running"===_.status&&"thinking_indicator"===_.reason,T={isPrompt:!1,cleanContent:P};if(!k){let e=(0,f.Sg)(i);T=(0,p.F)(P,e)}let S=_.hasActivePrompt,y=b.slice(-100).join("\n"),D=(0,g.bq)(t.id),I=(0,g.gf)(t.id);return u.NextResponse.json({isRunning:!0,cliToolId:i,content:q,fullOutput:v,realtimeSnippet:y,lineCount:A,lastCapturedLine:w,isComplete:S,isGenerating:k,thinking:k,thinkingMessage:k?"Claude is thinking...":null,isPromptWaiting:S,promptData:S?T.promptData:null,autoYes:{enabled:D?.enabled??!1,expiresAt:D?.enabled?D.expiresAt:null},lastServerResponseTimestamp:I})}catch(e){return console.error("Error getting current output:",e),u.NextResponse.json({error:"Failed to get current output"},{status:500})}}let w=new o.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/[id]/current-output/route",pathname:"/api/worktrees/[id]/current-output",filename:"route",bundlePath:"app/api/worktrees/[id]/current-output/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/current-output/route.ts",nextConfigOutput:"",userland:n}),{requestAsyncStorage:v,staticGenerationAsyncStorage:b,serverHooks:A}=w,q="/api/worktrees/[id]/current-output/route";function P(){return(0,s.patchFetch)({serverHooks:A,staticGenerationAsyncStorage:b})}},87946:(e,t,r)=>{r.d(t,{Ad:()=>o,l1:()=>i});let n=[36e5,108e5,288e5],o=36e5;function i(e){return"number"==typeof e&&n.includes(e)}},60667:(e,t,r)=>{r.d(t,{bq:()=>m,gf:()=>h,m$:()=>d,bY:()=>g,w:()=>v,Qz:()=>b});var n=r(89194),o=r(63661),i=r(10927),s=r(43839),u=r(19377),a=r(87946);let l=/^[a-zA-Z0-9_-]+$/,p=globalThis.__autoYesStates??(globalThis.__autoYesStates=new Map),c=globalThis.__autoYesPollerStates??(globalThis.__autoYesPollerStates=new Map);function d(e){return!!e&&0!==e.length&&l.test(e)}function f(e){return Date.now()>e.expiresAt}function m(e){let t=p.get(e);if(!t)return null;if(f(t)){let r={...t,enabled:!1};return p.set(e,r),r}return t}function g(e,t,r){if(t){let t=Date.now(),n={enabled:!0,enabledAt:t,expiresAt:t+(r??a.Ad)};return p.set(e,n),n}{let t=p.get(e),r={enabled:!1,enabledAt:t?.enabledAt??0,expiresAt:t?.expiresAt??0};return p.set(e,r),r}}function h(e){let t=c.get(e);return t?.lastServerResponseTimestamp??null}async function x(e,t){if(!c.get(e))return;let r=m(e);if(!r?.enabled||f(r)){b(e);return}try{let r=await (0,n.NA)(e,t,5e3),a=(0,u.vp)(r),l=a.split("\n").slice(-50).join("\n");if((0,u.Wg)(t,l)){w(e,t);return}let p=(0,u.Sg)(t),d=(0,o.F)(a,p);if(!d.isPrompt||!d.promptData){w(e,t);return}let f=function(e){if("yes_no"===e.type)return"y";if("multiple_choice"===e.type){let t=e.options.find(e=>e.isDefault)??e.options[0];return!t||t.requiresTextInput?null:t.number.toString()}return null}(d.promptData);if(null===f){w(e,t);return}let m=s.g.getInstance().getTool(t).getSessionName(e);if("claude"===t&&d.promptData?.type==="multiple_choice"&&/^\d+$/.test(f)&&d.promptData?.type==="multiple_choice"){let e=parseInt(f,10),t=d.promptData.options,r=t.find(e=>e.isDefault),n=r?.number??1,o=e-n;if(t.some(e=>/^\[[ x]\] /.test(e.label))){let r=t.filter(e=>/^\[[ x]\] /.test(e.label)).length,n=[];if(o>0)for(let e=0;e<o;e++)n.push("Down");else if(o<0)for(let e=0;e<Math.abs(o);e++)n.push("Up");n.push("Space");let s=r-e+1;for(let e=0;e<s;e++)n.push("Down");n.push("Enter"),await (0,i.hL)(m,n)}else{let e=[];if(o>0)for(let t=0;t<o;t++)e.push("Down");else if(o<0)for(let t=0;t<Math.abs(o);t++)e.push("Up");e.push("Enter"),await (0,i.hL)(m,e)}}else await (0,i.Is)(m,f,!1),await new Promise(e=>setTimeout(e,100)),await (0,i.Is)(m,"",!0);(function(e,t){let r=c.get(e);r&&(r.lastServerResponseTimestamp=t)})(e,Date.now()),function(e){let t=c.get(e);t&&(t.consecutiveErrors=0,t.currentInterval=2e3)}(e),console.info(`[Auto-Yes Poller] Sent response for worktree: ${e}`)}catch(r){!function(e){let t=c.get(e);if(t){var r;t.consecutiveErrors++,t.currentInterval=(r=t.consecutiveErrors)<5?2e3:Math.min(2e3*Math.pow(2,r-5+1),6e4)}}(e);let t=r instanceof Error?r.message:"Unknown error";console.warn(`[Auto-Yes Poller] Error for worktree ${e}: ${t}`)}w(e,t)}function w(e,t){let r=c.get(e);r&&(r.timerId=setTimeout(()=>{x(e,t)},r.currentInterval))}function v(e,t){if(!d(e))return{started:!1,reason:"invalid worktree ID"};let r=m(e);if(!r?.enabled)return{started:!1,reason:"auto-yes not enabled"};let n=c.has(e);if(!n&&c.size>=50)return{started:!1,reason:"max concurrent pollers reached"};n&&b(e);let o={timerId:null,cliToolId:t,consecutiveErrors:0,currentInterval:2e3,lastServerResponseTimestamp:null};return c.set(e,o),o.timerId=setTimeout(()=>{x(e,t)},2e3),console.info(`[Auto-Yes Poller] Started for worktree: ${e}, cliTool: ${t}`),{started:!0}}function b(e){let t=c.get(e);t&&(t.timerId&&clearTimeout(t.timerId),c.delete(e),console.info(`[Auto-Yes Poller] Stopped for worktree: ${e}`))}},13561:(e,t,r)=>{r.d(t,{_:()=>i});var n=r(19377),o=r(63661);function i(e,t,r){let i=(0,n.vp)(e),s=i.split("\n"),u=s.length-1;for(;u>=0&&""===s[u].trim();)u--;let a=s.slice(0,u+1),l=a.slice(-15).join("\n"),p=a.slice(-5).join("\n"),c=(0,n.Sg)(t);if((0,o.F)(i,c).isPrompt)return{status:"waiting",confidence:"high",reason:"prompt_detected",hasActivePrompt:!0};if((0,n.Wg)(t,p))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1};let{promptPattern:d}=(0,n.bs)(t);return d.test(l)?{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),n=t.X(0,[8948,5972,3853,4893,7425,9367,7536],()=>r(26683));module.exports=n})();
1
+ "use strict";(()=>{var e={};e.id=1991,e.ids=[1991],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")},26683:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>k,patchFetch:()=>A,requestAsyncStorage:()=>v,routeModule:()=>q,serverHooks:()=>P,staticGenerationAsyncStorage:()=>w});var n={};r.r(n),r.d(n,{GET:()=>f});var i=r(49303),o=r(88716),s=r(60670),u=r(87070),a=r(97425),p=r(75748),l=r(63661),c=r(43839),d=r(89194),g=r(19377),m=r(13561),h=r(60667);let x=["claude","codex","gemini"];async function f(e,{params:t}){try{let r=(0,a.n)(),n=(0,p.gU)(r,t.id);if(!n)return u.NextResponse.json({error:`Worktree '${t.id}' not found`},{status:404});let i=new URL(e.url).searchParams.get("cliTool"),o=i&&x.includes(i)?i:n.cliToolId||"claude",s=c.g.getInstance().getTool(o);if(!await s.isRunning(t.id))return u.NextResponse.json({isRunning:!1,content:"",lineCount:0,cliToolId:o},{status:200});let f=(0,p.zl)(r,t.id,o),q=f?.lastCapturedLine||0,v=await (0,d.NA)(t.id,o,1e4),w=v.split("\n"),P=w.length,k=w.slice(Math.max(0,q)).join("\n"),A=(0,g.vp)(v),j=(0,m._)(v,o),R="running"===j.status&&"thinking_indicator"===j.reason,b={isPrompt:!1,cleanContent:A};if(!R){let e=(0,g.Sg)(o);b=(0,l.F)(A,e)}let C=j.hasActivePrompt,_=w.slice(-100).join("\n"),y=(0,h.bq)(t.id),M=(0,h.gf)(t.id);return u.NextResponse.json({isRunning:!0,cliToolId:o,content:k,fullOutput:v,realtimeSnippet:_,lineCount:P,lastCapturedLine:q,isComplete:C,isGenerating:R,thinking:R,thinkingMessage:R?"Claude is thinking...":null,isPromptWaiting:C,promptData:C?b.promptData:null,autoYes:{enabled:y?.enabled??!1,expiresAt:y?.enabled?y.expiresAt:null},lastServerResponseTimestamp:M})}catch(e){return console.error("Error getting current output:",e),u.NextResponse.json({error:"Failed to get current output"},{status:500})}}let q=new i.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/worktrees/[id]/current-output/route",pathname:"/api/worktrees/[id]/current-output",filename:"route",bundlePath:"app/api/worktrees/[id]/current-output/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/current-output/route.ts",nextConfigOutput:"",userland:n}),{requestAsyncStorage:v,staticGenerationAsyncStorage:w,serverHooks:P}=q,k="/api/worktrees/[id]/current-output/route";function A(){return(0,s.patchFetch)({serverHooks:P,staticGenerationAsyncStorage:w})}},13561:(e,t,r)=>{r.d(t,{_:()=>o});var n=r(19377),i=r(63661);function o(e,t,r){let o=(0,n.vp)(e),s=o.split("\n"),u=s.length-1;for(;u>=0&&""===s[u].trim();)u--;let a=s.slice(0,u+1),p=a.slice(-15).join("\n"),l=a.slice(-5).join("\n"),c=(0,n.Sg)(t);if((0,i.F)(o,c).isPrompt)return{status:"waiting",confidence:"high",reason:"prompt_detected",hasActivePrompt:!0};if((0,n.Wg)(t,l))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1};let{promptPattern:d}=(0,n.bs)(t);return d.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),n=t.X(0,[8948,5972,3853,4893,7425,9367,7536,667],()=>r(26683));module.exports=n})();
@@ -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/8948.js","../../../../../chunks/9367.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/3853.js","../../../../../chunks/4893.js","../../../../../chunks/5972.js","../../../../../chunks/667.js","../../../../../chunks/7425.js","../../../../../chunks/7536.js","../../../../../chunks/8948.js","../../../../../chunks/9367.js","../../../../../webpack-runtime.js"]}
@@ -1 +1 @@
1
- "use strict";(()=>{var e={};e.id=9325,e.ids=[9325],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")},84770:e=>{e.exports=require("crypto")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},37999:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>x,patchFetch:()=>w,requestAsyncStorage:()=>O,routeModule:()=>y,serverHooks:()=>v,staticGenerationAsyncStorage:()=>A});var i={};t.r(i),t.d(i,{DELETE:()=>h,GET:()=>g,PATCH:()=>L,POST:()=>_,PUT:()=>T});var n=t(49303),o=t(88716),a=t(60670),s=t(87070),c=t(97425),l=t(75748),u=t(55315),p=t(57440),d=t(68585),E=t(39365),f=t(81481),I=t(20629);let N={FILE_NOT_FOUND:404,WORKTREE_NOT_FOUND:404,PERMISSION_DENIED:403,NOT_EDITABLE:403,PROTECTED_DIRECTORY:403,INVALID_PATH:400,INVALID_REQUEST:400,INVALID_NAME:400,INVALID_CONTENT:400,DIRECTORY_NOT_EMPTY:400,DELETE_LIMIT_EXCEEDED:400,FILE_EXISTS:409,DISK_FULL:507,INTERNAL_ERROR:500,INVALID_EXTENSION:400,INVALID_MIME_TYPE:400,INVALID_MAGIC_BYTES:400,FILE_TOO_LARGE:413,INVALID_FILENAME:400,INVALID_FILE_CONTENT:400};function m(e,r,t=500){let i=N[e]??t;return s.NextResponse.json({success:!1,error:{code:e,message:r}},{status:i})}async function R(e,r){let t=(0,c.n)(),i=(0,l.gU)(t,e);if(!i)return{error:m("WORKTREE_NOT_FOUND","Worktree not found")};let n=r.join("/"),o=(0,u.normalize)(n);return(0,p.j)(o,i.path)?{worktree:i,relativePath:o}:{error:m("INVALID_PATH","Invalid file path")}}async function g(e,{params:r}){try{let e=await R(r.id,r.path);if("error"in e)return e.error;let{worktree:t,relativePath:i}=e,n=i.split(".").pop()||"",o=(0,u.extname)(i).toLowerCase();if((0,f.Db)(o)){let e=(0,u.join)(t.path,i);try{let r=await (0,I.readFile)(e),a=(0,f.gp)(o,r);if(!a.valid){if(a.error?.includes("5MB"))return m("FILE_TOO_LARGE",a.error);if(a.error?.includes("magic bytes"))return m("INVALID_MAGIC_BYTES",a.error);return m("INVALID_FILE_CONTENT",a.error||"Invalid image content")}let c=(0,f.Kc)(o),l=r.toString("base64"),u=`data:${c};base64,${l}`;return s.NextResponse.json({success:!0,path:i,content:u,extension:n,worktreePath:t.path,isImage:!0,mimeType:c})}catch(e){if("ENOENT"===e.code)return m("FILE_NOT_FOUND","File not found");throw e}}let a=await (0,d.O2)(t.path,i);if(!a.success)return m(a.error?.code||"INTERNAL_ERROR",a.error?.message||"Failed to read file");return s.NextResponse.json({success:!0,path:i,content:a.content,extension:n,worktreePath:t.path})}catch(e){return console.error("Error reading file:",e),m("INTERNAL_ERROR","Failed to read file")}}async function T(e,{params:r}){try{let t=await R(r.id,r.path);if("error"in t)return t.error;let{worktree:i,relativePath:n}=t;if(!(0,d.rN)(n))return m("NOT_EDITABLE","File type is not editable");let{content:o}=await e.json();if(void 0===o)return m("INVALID_REQUEST","Content is required");let a=(0,u.extname)(n).toLowerCase(),c=(0,E.ty)(a,o);if(!c.valid)return m("INVALID_CONTENT",c.error||"Invalid content");let l=await (0,d.xH)(i.path,n,o);if(!l.success)return m(l.error?.code||"INTERNAL_ERROR",l.error?.message||"Failed to update file");return s.NextResponse.json({success:!0,path:n})}catch(e){return console.error("Error updating file:",e),m("INTERNAL_ERROR","Failed to update file")}}async function _(e,{params:r}){try{let t=await R(r.id,r.path);if("error"in t)return t.error;let{worktree:i,relativePath:n}=t,{type:o,content:a}=await e.json();if(!o||!["file","directory"].includes(o))return m("INVALID_REQUEST",'Type must be "file" or "directory"');if("file"===o&&void 0!==a){let e=(0,u.extname)(n).toLowerCase();if((0,E.ZI)(e)){let r=(0,E.ty)(e,a);if(!r.valid)return m("INVALID_CONTENT",r.error||"Invalid content")}}let c=await (0,d.D5)(i.path,n,o,a);if(!c.success)return m(c.error?.code||"INTERNAL_ERROR",c.error?.message||"Failed to create file/directory");return s.NextResponse.json({success:!0,path:n},{status:201})}catch(e){return console.error("Error creating file/directory:",e),m("INTERNAL_ERROR","Failed to create file/directory")}}async function h(e,{params:r}){try{let t=await R(r.id,r.path);if("error"in t)return t.error;let{worktree:i,relativePath:n}=t,{searchParams:o}=new URL(e.url),a="true"===o.get("recursive"),c=await (0,d.jN)(i.path,n,a);if(!c.success)return m(c.error?.code||"INTERNAL_ERROR",c.error?.message||"Failed to delete file/directory");return s.NextResponse.json({success:!0})}catch(e){return console.error("Error deleting file/directory:",e),m("INTERNAL_ERROR","Failed to delete file/directory")}}async function L(e,{params:r}){try{let t=await R(r.id,r.path);if("error"in t)return t.error;let{worktree:i,relativePath:n}=t,{action:o,newName:a}=await e.json();if("rename"!==o)return m("INVALID_REQUEST",'Unknown action. Supported: "rename"');if(!a||"string"!=typeof a)return m("INVALID_REQUEST","newName is required");let c=await (0,d.nz)(i.path,n,a);if(!c.success)return m(c.error?.code||"INTERNAL_ERROR",c.error?.message||"Failed to rename file/directory");return s.NextResponse.json({success:!0,path:c.path})}catch(e){return console.error("Error renaming file/directory:",e),m("INTERNAL_ERROR","Failed to rename file/directory")}}let y=new n.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/worktrees/[id]/files/[...path]/route",pathname:"/api/worktrees/[id]/files/[...path]",filename:"route",bundlePath:"app/api/worktrees/[id]/files/[...path]/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/files/[...path]/route.ts",nextConfigOutput:"",userland:i}),{requestAsyncStorage:O,staticGenerationAsyncStorage:A,serverHooks:v}=y,x="/api/worktrees/[id]/files/[...path]/route";function w(){return(0,a.patchFetch)({serverHooks:v,staticGenerationAsyncStorage:A})}},81481:(e,r,t)=>{t.d(r,{Db:()=>s,Kc:()=>a,P7:()=>i,gp:()=>c});let i=[".png",".jpg",".jpeg",".gif",".webp",".svg"],n=[{extension:".png",mimeType:"image/png",magicBytes:[137,80,78,71]},{extension:".jpg",mimeType:"image/jpeg",magicBytes:[255,216,255]},{extension:".jpeg",mimeType:"image/jpeg",magicBytes:[255,216,255]},{extension:".gif",mimeType:"image/gif",magicBytes:[71,73,70,56]},{extension:".webp",mimeType:"image/webp",magicBytes:[82,73,70,70]},{extension:".svg",mimeType:"image/svg+xml"}];function o(e){return e?e.startsWith(".")?e.toLowerCase():"."+e.toLowerCase():""}function a(e){let r=o(e),t=n.find(e=>e.extension===r);return t?.mimeType||"application/octet-stream"}function s(e){if(!e)return!1;let r=o(e);return i.includes(r)}function c(e,r){if(r.length>5242880)return{valid:!1,error:"File size exceeds 5MB limit"};if(".svg"===o(e)){var t;return(t=r.toString("utf-8")).includes("<svg")||t.startsWith("<?xml")?/<script[\s>]/i.test(t)?{valid:!1,error:"SVG contains script tags"}:/\s+on\w+\s*=/i.test(t)?{valid:!1,error:"SVG contains event handler attributes"}:/(?:xlink:)?href\s*=\s*["']?\s*(?:javascript|data|vbscript):/i.test(t)?{valid:!1,error:"SVG contains dangerous URI scheme"}:/<foreignObject[\s>]/i.test(t)?{valid:!1,error:"SVG contains foreignObject element"}:{valid:!0}:{valid:!1,error:"Invalid SVG format"}}return!function(e,r){let t=o(e),i=n.find(e=>e.extension===t);if(!i?.magicBytes)return".svg"===t;let a=i.magicBytesOffset||0;return!(r.length<a+i.magicBytes.length)&&i.magicBytes.every((e,t)=>r[a+t]===e)}(e,r)?{valid:!1,error:"Invalid image magic bytes"}:{valid:!0}}}};var r=require("../../../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),i=r.X(0,[8948,5972,7425,8585],()=>t(37999));module.exports=i})();
1
+ "use strict";(()=>{var e={};e.id=9325,e.ids=[9325],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")},84770:e=>{e.exports=require("crypto")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},37999:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>w,patchFetch:()=>x,requestAsyncStorage:()=>O,routeModule:()=>y,serverHooks:()=>v,staticGenerationAsyncStorage:()=>A});var i={};t.r(i),t.d(i,{DELETE:()=>h,GET:()=>g,PATCH:()=>L,POST:()=>_,PUT:()=>T});var n=t(49303),o=t(88716),a=t(60670),s=t(87070),c=t(97425),l=t(75748),u=t(55315),d=t(57440),p=t(68585),E=t(39365),f=t(81481),N=t(20629);let I={FILE_NOT_FOUND:404,WORKTREE_NOT_FOUND:404,PERMISSION_DENIED:403,NOT_EDITABLE:403,PROTECTED_DIRECTORY:403,INVALID_PATH:400,INVALID_REQUEST:400,INVALID_NAME:400,INVALID_CONTENT:400,DIRECTORY_NOT_EMPTY:400,DELETE_LIMIT_EXCEEDED:400,FILE_EXISTS:409,DISK_FULL:507,INTERNAL_ERROR:500,INVALID_EXTENSION:400,INVALID_MIME_TYPE:400,INVALID_MAGIC_BYTES:400,FILE_TOO_LARGE:413,INVALID_FILENAME:400,INVALID_FILE_CONTENT:400,MOVE_SAME_PATH:400,MOVE_INTO_SELF:400};function R(e,r,t=500){let i=I[e]??t;return s.NextResponse.json({success:!1,error:{code:e,message:r}},{status:i})}async function m(e,r){let t=(0,c.n)(),i=(0,l.gU)(t,e);if(!i)return{error:R("WORKTREE_NOT_FOUND","Worktree not found")};let n=r.join("/"),o=(0,u.normalize)(n);return(0,d.j)(o,i.path)?{worktree:i,relativePath:o}:{error:R("INVALID_PATH","Invalid file path")}}async function g(e,{params:r}){try{let e=await m(r.id,r.path);if("error"in e)return e.error;let{worktree:t,relativePath:i}=e,n=i.split(".").pop()||"",o=(0,u.extname)(i).toLowerCase();if((0,f.Db)(o)){let e=(0,u.join)(t.path,i);try{let r=await (0,N.readFile)(e),a=(0,f.gp)(o,r);if(!a.valid){if(a.error?.includes("5MB"))return R("FILE_TOO_LARGE",a.error);if(a.error?.includes("magic bytes"))return R("INVALID_MAGIC_BYTES",a.error);return R("INVALID_FILE_CONTENT",a.error||"Invalid image content")}let c=(0,f.Kc)(o),l=r.toString("base64"),u=`data:${c};base64,${l}`;return s.NextResponse.json({success:!0,path:i,content:u,extension:n,worktreePath:t.path,isImage:!0,mimeType:c})}catch(e){if("ENOENT"===e.code)return R("FILE_NOT_FOUND","File not found");throw e}}let a=await (0,p.O2)(t.path,i);if(!a.success)return R(a.error?.code||"INTERNAL_ERROR",a.error?.message||"Failed to read file");return s.NextResponse.json({success:!0,path:i,content:a.content,extension:n,worktreePath:t.path})}catch(e){return console.error("Error reading file:",e),R("INTERNAL_ERROR","Failed to read file")}}async function T(e,{params:r}){try{let t=await m(r.id,r.path);if("error"in t)return t.error;let{worktree:i,relativePath:n}=t;if(!(0,p.rN)(n))return R("NOT_EDITABLE","File type is not editable");let{content:o}=await e.json();if(void 0===o)return R("INVALID_REQUEST","Content is required");let a=(0,u.extname)(n).toLowerCase(),c=(0,E.ty)(a,o);if(!c.valid)return R("INVALID_CONTENT",c.error||"Invalid content");let l=await (0,p.xH)(i.path,n,o);if(!l.success)return R(l.error?.code||"INTERNAL_ERROR",l.error?.message||"Failed to update file");return s.NextResponse.json({success:!0,path:n})}catch(e){return console.error("Error updating file:",e),R("INTERNAL_ERROR","Failed to update file")}}async function _(e,{params:r}){try{let t=await m(r.id,r.path);if("error"in t)return t.error;let{worktree:i,relativePath:n}=t,{type:o,content:a}=await e.json();if(!o||!["file","directory"].includes(o))return R("INVALID_REQUEST",'Type must be "file" or "directory"');if("file"===o&&void 0!==a){let e=(0,u.extname)(n).toLowerCase();if((0,E.ZI)(e)){let r=(0,E.ty)(e,a);if(!r.valid)return R("INVALID_CONTENT",r.error||"Invalid content")}}let c=await (0,p.D5)(i.path,n,o,a);if(!c.success)return R(c.error?.code||"INTERNAL_ERROR",c.error?.message||"Failed to create file/directory");return s.NextResponse.json({success:!0,path:n},{status:201})}catch(e){return console.error("Error creating file/directory:",e),R("INTERNAL_ERROR","Failed to create file/directory")}}async function h(e,{params:r}){try{let t=await m(r.id,r.path);if("error"in t)return t.error;let{worktree:i,relativePath:n}=t,{searchParams:o}=new URL(e.url),a="true"===o.get("recursive"),c=await (0,p.jN)(i.path,n,a);if(!c.success)return R(c.error?.code||"INTERNAL_ERROR",c.error?.message||"Failed to delete file/directory");return s.NextResponse.json({success:!0})}catch(e){return console.error("Error deleting file/directory:",e),R("INTERNAL_ERROR","Failed to delete file/directory")}}async function L(e,{params:r}){try{let t=await m(r.id,r.path);if("error"in t)return t.error;let{worktree:i,relativePath:n}=t,{action:o,newName:a,destination:c}=await e.json();switch(o){case"rename":{if(!a||"string"!=typeof a)return R("INVALID_REQUEST","newName is required");let e=await (0,p.nz)(i.path,n,a);if(!e.success)return R(e.error?.code||"INTERNAL_ERROR",e.error?.message||"Failed to rename file/directory");return s.NextResponse.json({success:!0,path:e.path})}case"move":{if(!c||"string"!=typeof c)return R("INVALID_REQUEST","destination is required and must be a string");let e=await (0,p.wB)(i.path,n,c);if(!e.success)return R(e.error?.code||"INTERNAL_ERROR",e.error?.message||"Failed to move file/directory");return s.NextResponse.json({success:!0,path:e.path})}default:return R("INVALID_REQUEST",'Unknown action. Supported: "rename", "move"')}}catch(e){return console.error("Error renaming file/directory:",e),R("INTERNAL_ERROR","Failed to rename file/directory")}}let y=new n.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/worktrees/[id]/files/[...path]/route",pathname:"/api/worktrees/[id]/files/[...path]",filename:"route",bundlePath:"app/api/worktrees/[id]/files/[...path]/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/files/[...path]/route.ts",nextConfigOutput:"",userland:i}),{requestAsyncStorage:O,staticGenerationAsyncStorage:A,serverHooks:v}=y,w="/api/worktrees/[id]/files/[...path]/route";function x(){return(0,a.patchFetch)({serverHooks:v,staticGenerationAsyncStorage:A})}},81481:(e,r,t)=>{t.d(r,{Db:()=>s,Kc:()=>a,P7:()=>i,gp:()=>c});let i=[".png",".jpg",".jpeg",".gif",".webp",".svg"],n=[{extension:".png",mimeType:"image/png",magicBytes:[137,80,78,71]},{extension:".jpg",mimeType:"image/jpeg",magicBytes:[255,216,255]},{extension:".jpeg",mimeType:"image/jpeg",magicBytes:[255,216,255]},{extension:".gif",mimeType:"image/gif",magicBytes:[71,73,70,56]},{extension:".webp",mimeType:"image/webp",magicBytes:[82,73,70,70]},{extension:".svg",mimeType:"image/svg+xml"}];function o(e){return e?e.startsWith(".")?e.toLowerCase():"."+e.toLowerCase():""}function a(e){let r=o(e),t=n.find(e=>e.extension===r);return t?.mimeType||"application/octet-stream"}function s(e){if(!e)return!1;let r=o(e);return i.includes(r)}function c(e,r){if(r.length>5242880)return{valid:!1,error:"File size exceeds 5MB limit"};if(".svg"===o(e)){var t;return(t=r.toString("utf-8")).includes("<svg")||t.startsWith("<?xml")?/<script[\s>]/i.test(t)?{valid:!1,error:"SVG contains script tags"}:/\s+on\w+\s*=/i.test(t)?{valid:!1,error:"SVG contains event handler attributes"}:/(?:xlink:)?href\s*=\s*["']?\s*(?:javascript|data|vbscript):/i.test(t)?{valid:!1,error:"SVG contains dangerous URI scheme"}:/<foreignObject[\s>]/i.test(t)?{valid:!1,error:"SVG contains foreignObject element"}:{valid:!0}:{valid:!1,error:"Invalid SVG format"}}return!function(e,r){let t=o(e),i=n.find(e=>e.extension===t);if(!i?.magicBytes)return".svg"===t;let a=i.magicBytesOffset||0;return!(r.length<a+i.magicBytes.length)&&i.magicBytes.every((e,t)=>r[a+t]===e)}(e,r)?{valid:!1,error:"Invalid image magic bytes"}:{valid:!0}}}};var r=require("../../../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),i=r.X(0,[8948,5972,7425,8585],()=>t(37999));module.exports=i})();
@@ -1 +1 @@
1
- "use strict";(()=>{var e={};e.id=6366,e.ids=[6366],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")},45762:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>v,patchFetch:()=>j,requestAsyncStorage:()=>w,routeModule:()=>f,serverHooks:()=>g,staticGenerationAsyncStorage:()=>q});var s={};t.r(s),t.d(s,{POST:()=>h});var o=t(49303),n=t(88716),i=t(60670),p=t(87070),a=t(97425),u=t(75748),l=t(10927),d=t(43839),c=t(89194),m=t(63661),x=t(19377);async function h(e,{params:r}){try{let{answer:t,cliTool:s}=await e.json();if(!t)return p.NextResponse.json({error:"answer is required"},{status:400});let o=(0,a.n)(),n=(0,u.gU)(o,r.id);if(!n)return p.NextResponse.json({error:`Worktree '${r.id}' not found`},{status:404});let i=s||n.cliToolId||"claude",h=d.g.getInstance().getTool(i);if(!await h.isRunning(r.id))return p.NextResponse.json({error:`${h.name} session is not running`},{status:400});let f=h.getSessionName(r.id),w=null;try{let e=await (0,c.NA)(r.id,i,5e3),s=(0,x.vp)(e),o=(0,x.Sg)(i);if(!(w=(0,m.F)(s,o)).isPrompt)return p.NextResponse.json({success:!1,reason:"prompt_no_longer_active",answer:t})}catch{console.warn("[prompt-response] Failed to verify prompt state, proceeding with send")}try{if("claude"===i&&w?.promptData?.type==="multiple_choice"&&/^\d+$/.test(t)&&w?.promptData?.type==="multiple_choice"){let e=parseInt(t,10),r=w.promptData.options,s=r.find(e=>e.isDefault),o=s?.number??1,n=e-o;if(r.some(e=>/^\[[ x]\] /.test(e.label))){let t=r.filter(e=>/^\[[ x]\] /.test(e.label)).length,s=[];if(n>0)for(let e=0;e<n;e++)s.push("Down");else if(n<0)for(let e=0;e<Math.abs(n);e++)s.push("Up");s.push("Space");let o=t-e+1;for(let e=0;e<o;e++)s.push("Down");s.push("Enter"),await (0,l.hL)(f,s)}else{let e=[];if(n>0)for(let r=0;r<n;r++)e.push("Down");else if(n<0)for(let r=0;r<Math.abs(n);r++)e.push("Up");e.push("Enter"),await (0,l.hL)(f,e)}}else await (0,l.Is)(f,t,!1),await new Promise(e=>setTimeout(e,100)),await (0,l.Is)(f,"",!0)}catch(r){let e=r instanceof Error?r.message:"Unknown error";return p.NextResponse.json({error:`Failed to send answer to tmux: ${e}`},{status:500})}return p.NextResponse.json({success:!0,answer:t})}catch(r){console.error("Failed to respond to prompt:",r);let e=r instanceof Error?r.message:"Internal server error";return p.NextResponse.json({error:e},{status:500})}}let f=new o.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/worktrees/[id]/prompt-response/route",pathname:"/api/worktrees/[id]/prompt-response",filename:"route",bundlePath:"app/api/worktrees/[id]/prompt-response/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/prompt-response/route.ts",nextConfigOutput:"",userland:s}),{requestAsyncStorage:w,staticGenerationAsyncStorage:q,serverHooks:g}=f,v="/api/worktrees/[id]/prompt-response/route";function j(){return(0,i.patchFetch)({serverHooks:g,staticGenerationAsyncStorage:q})}}};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,9367,7536],()=>t(45762));module.exports=s})();
1
+ "use strict";(()=>{var e={};e.id=6366,e.ids=[6366],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")},45762:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>v,patchFetch:()=>y,requestAsyncStorage:()=>w,routeModule:()=>h,serverHooks:()=>g,staticGenerationAsyncStorage:()=>q});var s={};t.r(s),t.d(s,{POST:()=>f});var o=t(49303),n=t(88716),i=t(60670),p=t(87070),a=t(97425),u=t(75748),l=t(43839),c=t(89194),d=t(63661),m=t(19377),x=t(49528);async function f(e,{params:r}){try{let{answer:t,cliTool:s,promptType:o,defaultOptionNumber:n}=await e.json();if(!t)return p.NextResponse.json({error:"answer is required"},{status:400});let i=(0,a.n)(),f=(0,u.gU)(i,r.id);if(!f)return p.NextResponse.json({error:`Worktree '${r.id}' not found`},{status:404});let h=s||f.cliToolId||"claude",w=l.g.getInstance().getTool(h);if(!await w.isRunning(r.id))return p.NextResponse.json({error:`${w.name} session is not running`},{status:400});let q=w.getSessionName(r.id),g=null;try{let e=await (0,c.NA)(r.id,h,5e3),s=(0,m.vp)(e),o=(0,m.Sg)(h);if(!(g=(0,d.F)(s,o)).isPrompt)return p.NextResponse.json({success:!1,reason:"prompt_no_longer_active",answer:t})}catch{console.warn("[prompt-response] Failed to verify prompt state, proceeding with send")}try{await (0,x.z)({sessionName:q,answer:t,cliToolId:h,promptData:g?.promptData,fallbackPromptType:o,fallbackDefaultOptionNumber:n})}catch(r){let e=r instanceof Error?r.message:"Unknown error";return p.NextResponse.json({error:`Failed to send answer to tmux: ${e}`},{status:500})}return p.NextResponse.json({success:!0,answer:t})}catch(r){console.error("Failed to respond to prompt:",r);let e=r instanceof Error?r.message:"Internal server error";return p.NextResponse.json({error:e},{status:500})}}let h=new o.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/worktrees/[id]/prompt-response/route",pathname:"/api/worktrees/[id]/prompt-response",filename:"route",bundlePath:"app/api/worktrees/[id]/prompt-response/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/prompt-response/route.ts",nextConfigOutput:"",userland:s}),{requestAsyncStorage:w,staticGenerationAsyncStorage:q,serverHooks:g}=h,v="/api/worktrees/[id]/prompt-response/route";function y(){return(0,i.patchFetch)({serverHooks:g,staticGenerationAsyncStorage:q})}},49528:(e,r,t)=>{t.d(r,{z:()=>i});var s=t(10927);let o=/^\[[ x]\] /;function n(e){if(0===e)return[];let r=e>0?"Down":"Up";return Array.from({length:Math.abs(e)},()=>r)}async function i(e){let{sessionName:r,answer:t,cliToolId:i,promptData:p,fallbackPromptType:a,fallbackDefaultOptionNumber:u}=e;if("claude"===i&&(p?.type==="multiple_choice"||"multiple_choice"===a)&&/^\d+$/.test(t)){let e;let i=parseInt(t,10),a=null;if(p?.type==="multiple_choice"){let r=(a=p.options).find(e=>e.isDefault);e=r?.number??1}else e=u??1;let l=i-e;if(null!==a&&a.some(e=>o.test(e.label))&&null!==a){let e=a.filter(e=>o.test(e.label)).length,t=[...n(l),"Space"];t.push(...n(e-i+1)),t.push("Enter"),await (0,s.hL)(r,t)}else{let e=[...n(l),"Enter"];await (0,s.hL)(r,e)}}else await (0,s.Is)(r,t,!1),await new Promise(e=>setTimeout(e,100)),await (0,s.Is)(r,"",!0)}}};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,9367,7536],()=>t(45762));module.exports=s})();
@@ -1 +1 @@
1
- "use strict";(()=>{var e={};e.id=7601,e.ids=[7601],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")},84770:e=>{e.exports=require("crypto")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},19496:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>R,patchFetch:()=>j,requestAsyncStorage:()=>T,routeModule:()=>S,serverHooks:()=>M,staticGenerationAsyncStorage:()=>A});var n={};r.r(n),r.d(n,{GET:()=>D});var o=r(49303),s=r(88716),i=r(60670),a=r(87070),c=r(97425),u=r(75748),l=r(20629),d=r(55315),f=r(57440),p=r(18163);let m=[...r(81481).P7,".exe",".dll",".so",".dylib",".bin",".zip",".tar",".gz",".tar.gz",".tgz",".rar",".7z",".bz2",".xz",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".woff",".woff2",".ttf",".otf",".eot",".mp3",".mp4",".avi",".mov",".mkv",".wav",".flac",".ogg",".sqlite",".db",".o",".obj",".a",".lib",".class",".jar",".war",".pyc",".pyo",".wasm"];function h(e){return!!e&&0!==e.trim().length&&!(e.length>1e3)}async function g(e,t,r){let{query:n,maxResults:o=100,maxFileSize:s=p.bB.MAX_FILE_SIZE_PREVIEW,maxDepth:i=p.bB.MAX_DEPTH}=t;if(!h(n))return{results:[],totalMatches:0,truncated:!1};let a={results:[],totalMatches:0,truncated:!1,startTime:Date.now()},c={basePath:e,lowerQuery:n.toLowerCase(),maxDepth:i,maxResults:o,maxFileSize:s,signal:r};return await x(e,0,c,a),{results:a.results,totalMatches:a.totalMatches,truncated:a.truncated}}async function x(e,t,r,n){let o;let{basePath:s,maxDepth:i,maxResults:a,signal:c}=r;if(c?.aborted)throw new DOMException("Search aborted","AbortError");if(!(t>i)){if(n.results.length>=a){n.truncated=!0;return}if((0,f.j)(e,s)){try{o=await (0,l.readdir)(e)}catch{return}for(let i of o){if(c?.aborted)throw new DOMException("Search aborted","AbortError");if(n.results.length>=a){n.truncated=!0;return}if((0,p.bS)(i))continue;let o=(0,d.join)(e,i);if((0,f.j)(o,s))try{let e=await (0,l.lstat)(o);if(e.isSymbolicLink())continue;e.isDirectory()?await x(o,t+1,r,n):e.isFile()&&await y(o,i,e.size,r,n)}catch{continue}}}}}async function y(e,t,r,n,o){let s,i;let{basePath:a,lowerQuery:c,maxFileSize:u}=n;if(!(r>u||function(e){if(!e)return!1;let t=e.startsWith(".")?e.toLowerCase():"."+e.toLowerCase();return m.includes(t)}((0,d.extname)(t)))){try{s=await (0,l.readFile)(e)}catch{return}if(!s.includes(0)){try{i=s.toString("utf-8")}catch{return}if(i.toLowerCase().includes(c)){let r=function(e,t){let r=e.split("\n"),n=t.toLowerCase(),o=[];for(let e=0;e<r.length;e++){let t=r[e];t.toLowerCase().includes(n)&&o.push({line:e+1,content:function(e,t=500){return e.length<=t?e:e.slice(0,t)+"..."}(t)})}return o}(i,c);if(r.length>0){let n=(0,d.relative)(a,e);o.results.push({filePath:n,fileName:(0,d.basename)(t),matches:r}),o.totalMatches+=r.length}}}}}class w extends Error{constructor(e="Search timed out"){super(e),this.name="SearchTimeoutError"}}async function v(e,t){let r=t.timeoutMs??5e3,n=new AbortController,o=setTimeout(()=>n.abort(),r),s=Date.now();try{let r=await g(e,t,n.signal),o=Date.now()-s;return{...r,executionTimeMs:o}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)throw new w(`Search timed out after ${r}ms`);throw e}finally{clearTimeout(o)}}var E=r(43895);let b=(0,E.h)("api-search");async function D(e,{params:t}){let r=Date.now(),n=(0,E.Y)(),o=t.id,s=b.withContext({worktreeId:o,requestId:n});try{let t=e.nextUrl.searchParams,r=t.get("q")||"",n=t.get("mode")||"content";if("content"!==n)return s.warn("search:invalid-mode",{mode:n}),a.NextResponse.json({success:!1,error:{code:"INVALID_MODE",message:"Only mode=content is supported for API search"}},{status:400});if(!h(r))return s.warn("search:invalid-query",{queryLength:r.length}),a.NextResponse.json({success:!1,error:{code:"INVALID_QUERY",message:"Query cannot be empty or exceed 1000 characters"}},{status:400});let i=(0,c.n)(),l=(0,u.gU)(i,o);if(!l){let e=(0,p.dq)(o);return s.warn("search:worktree-not-found"),a.NextResponse.json({success:!1,error:{code:"WORKTREE_NOT_FOUND",message:e.error}},{status:e.status})}let d=await v(l.path,{query:r,maxResults:100,timeoutMs:5e3});return s.info("search:complete",{queryHash:Buffer.from(r).toString("base64").slice(0,8),executionTimeMs:d.executionTimeMs,resultCount:d.results.length,totalMatches:d.totalMatches,truncated:d.truncated}),a.NextResponse.json({success:!0,results:d.results,totalMatches:d.totalMatches,truncated:d.truncated,executionTimeMs:d.executionTimeMs})}catch(t){if(t instanceof w){let e=Date.now()-r;return s.warn("search:timeout",{executionTimeMs:e}),a.NextResponse.json({success:!1,error:{code:"SEARCH_TIMEOUT",message:"Search timed out. Try a more specific query."}},{status:408})}let e=Date.now()-r;return s.error("search:error",{error:t instanceof Error?t.message:"Unknown error",executionTimeMs:e}),a.NextResponse.json({success:!1,error:{code:"INTERNAL_ERROR",message:"An error occurred while searching"}},{status:500})}}let S=new o.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/worktrees/[id]/search/route",pathname:"/api/worktrees/[id]/search",filename:"route",bundlePath:"app/api/worktrees/[id]/search/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/search/route.ts",nextConfigOutput:"",userland:n}),{requestAsyncStorage:T,staticGenerationAsyncStorage:A,serverHooks:M}=S,R="/api/worktrees/[id]/search/route";function j(){return(0,i.patchFetch)({serverHooks:M,staticGenerationAsyncStorage:A})}},81481:(e,t,r)=>{r.d(t,{Db:()=>a,Kc:()=>i,P7:()=>n,gp:()=>c});let n=[".png",".jpg",".jpeg",".gif",".webp",".svg"],o=[{extension:".png",mimeType:"image/png",magicBytes:[137,80,78,71]},{extension:".jpg",mimeType:"image/jpeg",magicBytes:[255,216,255]},{extension:".jpeg",mimeType:"image/jpeg",magicBytes:[255,216,255]},{extension:".gif",mimeType:"image/gif",magicBytes:[71,73,70,56]},{extension:".webp",mimeType:"image/webp",magicBytes:[82,73,70,70]},{extension:".svg",mimeType:"image/svg+xml"}];function s(e){return e?e.startsWith(".")?e.toLowerCase():"."+e.toLowerCase():""}function i(e){let t=s(e),r=o.find(e=>e.extension===t);return r?.mimeType||"application/octet-stream"}function a(e){if(!e)return!1;let t=s(e);return n.includes(t)}function c(e,t){if(t.length>5242880)return{valid:!1,error:"File size exceeds 5MB limit"};if(".svg"===s(e)){var r;return(r=t.toString("utf-8")).includes("<svg")||r.startsWith("<?xml")?/<script[\s>]/i.test(r)?{valid:!1,error:"SVG contains script tags"}:/\s+on\w+\s*=/i.test(r)?{valid:!1,error:"SVG contains event handler attributes"}:/(?:xlink:)?href\s*=\s*["']?\s*(?:javascript|data|vbscript):/i.test(r)?{valid:!1,error:"SVG contains dangerous URI scheme"}:/<foreignObject[\s>]/i.test(r)?{valid:!1,error:"SVG contains foreignObject element"}:{valid:!0}:{valid:!1,error:"Invalid SVG format"}}return!function(e,t){let r=s(e),n=o.find(e=>e.extension===r);if(!n?.magicBytes)return".svg"===r;let i=n.magicBytesOffset||0;return!(t.length<i+n.magicBytes.length)&&n.magicBytes.every((e,r)=>t[i+r]===e)}(e,t)?{valid:!1,error:"Invalid image magic bytes"}:{valid:!0}}},18163:(e,t,r)=>{r.d(t,{GT:()=>l,Lu:()=>u,W:()=>f,bB:()=>i,bS:()=>a,dq:()=>d});var n=r(20629),o=r(55315);let s=[".git",".env",".env.*","node_modules",".DS_Store","Thumbs.db","*.pem","*.key",".env.local",".env.development",".env.production",".env.test"],i={MAX_ITEMS_PER_DIR:500,MAX_DEPTH:10,MAX_FILE_SIZE_PREVIEW:1048576};function a(e){for(let t of s){if(t===e)return!0;if(t.startsWith("*.")){let r=t.slice(1);if(e.endsWith(r))return!0}if(t.endsWith(".*")){let r=t.slice(0,-2);if(e.startsWith(r+"."))return!0}}return!1}async function c(e){try{return(await (0,n.readdir)(e)).filter(e=>!a(e)).length}catch{return 0}}async function u(e,t=""){let r;let s=t?(0,o.join)(e,t):e;try{r=await (0,n.stat)(s)}catch{throw Error(`Directory not found: ${t||"(root)"}`)}if(!r.isDirectory())throw Error(`Path is not a directory: ${t}`);let u=await (0,n.readdir)(s),l=[];for(let e of u){if(a(e))continue;let t=(0,o.join)(s,e);try{let r=await (0,n.lstat)(t);if(r.isSymbolicLink())continue;if(r.isDirectory()){let r=await c(t);l.push({name:e,type:"directory",itemCount:r})}else if(r.isFile()){let t=(0,o.extname)(e),n={name:e,type:"file",size:r.size};t&&t.length>1&&(n.extension=t.slice(1)),l.push(n)}}catch{continue}if(l.length>=i.MAX_ITEMS_PER_DIR)break}let d=[...l].sort((e,t)=>e.type!==t.type?"directory"===e.type?-1:1:e.name.toLowerCase().localeCompare(t.name.toLowerCase())),f=null;if(t){let e=(0,o.dirname)(t);f="."===e?"":e}return{path:t,name:t?(0,o.basename)(t):"",items:d,parentPath:f}}function l(e){let t=e instanceof Error?e.message:"Unknown error";return t.includes("not found")?{error:"Directory not found",status:404}:t.includes("not a directory")?{error:"Path is not a directory",status:400}:{error:"Failed to read directory",status:500}}function d(e){return{error:`Worktree '${e}' not found`,status:404}}function f(e="Invalid path"){return{error:`Access denied: ${e}`,status:403}}},43895:(e,t,r)=>{r.d(t,{Y:()=>c,h:()=>u});var n=r(98838);let o=[{pattern:/Bearer\s+[A-Za-z0-9\-._~+/]+=*/gi,replacement:"Bearer [REDACTED]"},{pattern:/(password|passwd|pwd)[=:]\s*\S+/gi,replacement:"$1=[REDACTED]"},{pattern:/(token|secret|api_key|apikey|auth)[=:]\s*\S+/gi,replacement:"$1=[REDACTED]"},{pattern:/Authorization:\s*\S+/gi,replacement:"Authorization: [REDACTED]"},{pattern:/-----BEGIN\s+\w+\s+PRIVATE\s+KEY-----[\s\S]*?-----END\s+\w+\s+PRIVATE\s+KEY-----/g,replacement:"[SSH_KEY_REDACTED]"}],s=/password|secret|token|key|auth/i,i={debug:0,info:1,warn:2,error:3};function a(e,t,r,a,c){let u=(0,n.LI)().level;if(i[e]<i[u])return;let l=a?function e(t){if("string"==typeof t){let e=t;for(let{pattern:t,replacement:r}of o)e=e.replace(t,r);return e}if("object"==typeof t&&null!==t){if(Array.isArray(t))return t.map(e);let r={};for(let[n,o]of Object.entries(t))s.test(n)?r[n]="[REDACTED]":r[n]=e(o);return r}return t}(a):void 0,d=function(e){if("json"===(0,n.LI)().format)return JSON.stringify(e);let{timestamp:t,level:r,module:o,action:s,data:i,worktreeId:a,cliToolId:c,requestId:u}=e,l=[a,c].filter(Boolean),d=l.length>0?` [${l.join(":")}]`:"",f=u?` (${u.slice(0,8)})`:"",p=i?` ${JSON.stringify(i)}`:"";return`[${t}] [${r.toUpperCase()}] [${o}]${d}${f} ${s}${p}`}({level:e,module:t,action:r,timestamp:new Date().toISOString(),...c,...l&&{data:l}});switch(e){case"error":console.error(d);break;case"warn":console.warn(d);break;default:console.log(d)}}function c(){return"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function u(e){let t=r=>({debug:(t,n)=>a("debug",e,t,n,r),info:(t,n)=>a("info",e,t,n,r),warn:(t,n)=>a("warn",e,t,n,r),error:(t,n)=>a("error",e,t,n,r),withContext:e=>t({...r,...e})});return t()}},57440:(e,t,r)=>{r.d(t,{j:()=>s});var n=r(55315),o=r.n(n);function s(e,t){if(!e||""===e.trim()||e.includes("\0"))return!1;let r=e;try{r=decodeURIComponent(e)}catch{r=e}if(r.includes("\0"))return!1;let n=o().resolve(t),s=o().resolve(t,r),i=o().relative(n,s);return!(i.startsWith("..")||o().isAbsolute(i))}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),n=t.X(0,[8948,5972,7425],()=>r(19496));module.exports=n})();
1
+ "use strict";(()=>{var e={};e.id=7601,e.ids=[7601],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")},84770:e=>{e.exports=require("crypto")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},19496:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>R,patchFetch:()=>I,requestAsyncStorage:()=>T,routeModule:()=>S,serverHooks:()=>M,staticGenerationAsyncStorage:()=>A});var n={};r.r(n),r.d(n,{GET:()=>D});var o=r(49303),i=r(88716),s=r(60670),a=r(87070),c=r(97425),u=r(75748),l=r(20629),d=r(55315),f=r(57440),p=r(18163);let m=[...r(81481).P7,".exe",".dll",".so",".dylib",".bin",".zip",".tar",".gz",".tar.gz",".tgz",".rar",".7z",".bz2",".xz",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".woff",".woff2",".ttf",".otf",".eot",".mp3",".mp4",".avi",".mov",".mkv",".wav",".flac",".ogg",".sqlite",".db",".o",".obj",".a",".lib",".class",".jar",".war",".pyc",".pyo",".wasm"];function h(e){return!!e&&0!==e.trim().length&&!(e.length>1e3)}async function g(e,t,r){let{query:n,maxResults:o=100,maxFileSize:i=p.bB.MAX_FILE_SIZE_PREVIEW,maxDepth:s=p.bB.MAX_DEPTH}=t;if(!h(n))return{results:[],totalMatches:0,truncated:!1};let a={results:[],totalMatches:0,truncated:!1,startTime:Date.now()},c={basePath:e,lowerQuery:n.toLowerCase(),maxDepth:s,maxResults:o,maxFileSize:i,signal:r};return await x(e,0,c,a),{results:a.results,totalMatches:a.totalMatches,truncated:a.truncated}}async function x(e,t,r,n){let o;let{basePath:i,maxDepth:s,maxResults:a,signal:c}=r;if(c?.aborted)throw new DOMException("Search aborted","AbortError");if(!(t>s)){if(n.results.length>=a){n.truncated=!0;return}if((0,f.j)(e,i)){try{o=await (0,l.readdir)(e)}catch{return}for(let s of o){if(c?.aborted)throw new DOMException("Search aborted","AbortError");if(n.results.length>=a){n.truncated=!0;return}if((0,p.bS)(s))continue;let o=(0,d.join)(e,s);if((0,f.j)(o,i))try{let e=await (0,l.lstat)(o);if(e.isSymbolicLink())continue;e.isDirectory()?await x(o,t+1,r,n):e.isFile()&&await y(o,s,e.size,r,n)}catch{continue}}}}}async function y(e,t,r,n,o){let i,s;let{basePath:a,lowerQuery:c,maxFileSize:u}=n;if(!(r>u||function(e){if(!e)return!1;let t=e.startsWith(".")?e.toLowerCase():"."+e.toLowerCase();return m.includes(t)}((0,d.extname)(t)))){try{i=await (0,l.readFile)(e)}catch{return}if(!i.includes(0)){try{s=i.toString("utf-8")}catch{return}if(s.toLowerCase().includes(c)){let r=function(e,t){let r=e.split("\n"),n=t.toLowerCase(),o=[];for(let e=0;e<r.length;e++){let t=r[e];t.toLowerCase().includes(n)&&o.push({line:e+1,content:function(e,t=500){return e.length<=t?e:e.slice(0,t)+"..."}(t)})}return o}(s,c);if(r.length>0){let n=(0,d.relative)(a,e);o.results.push({filePath:n,fileName:(0,d.basename)(t),matches:r}),o.totalMatches+=r.length}}}}}class w extends Error{constructor(e="Search timed out"){super(e),this.name="SearchTimeoutError"}}async function v(e,t){let r=t.timeoutMs??5e3,n=new AbortController,o=setTimeout(()=>n.abort(),r),i=Date.now();try{let r=await g(e,t,n.signal),o=Date.now()-i;return{...r,executionTimeMs:o}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)throw new w(`Search timed out after ${r}ms`);throw e}finally{clearTimeout(o)}}var E=r(43895);let b=(0,E.h)("api-search");async function D(e,{params:t}){let r=Date.now(),n=(0,E.Y)(),o=t.id,i=b.withContext({worktreeId:o,requestId:n});try{let t=e.nextUrl.searchParams,r=t.get("q")||"",n=t.get("mode")||"content";if("content"!==n)return i.warn("search:invalid-mode",{mode:n}),a.NextResponse.json({success:!1,error:{code:"INVALID_MODE",message:"Only mode=content is supported for API search"}},{status:400});if(!h(r))return i.warn("search:invalid-query",{queryLength:r.length}),a.NextResponse.json({success:!1,error:{code:"INVALID_QUERY",message:"Query cannot be empty or exceed 1000 characters"}},{status:400});let s=(0,c.n)(),l=(0,u.gU)(s,o);if(!l){let e=(0,p.dq)(o);return i.warn("search:worktree-not-found"),a.NextResponse.json({success:!1,error:{code:"WORKTREE_NOT_FOUND",message:e.error}},{status:e.status})}let d=await v(l.path,{query:r,maxResults:100,timeoutMs:5e3});return i.info("search:complete",{queryHash:Buffer.from(r).toString("base64").slice(0,8),executionTimeMs:d.executionTimeMs,resultCount:d.results.length,totalMatches:d.totalMatches,truncated:d.truncated}),a.NextResponse.json({success:!0,results:d.results,totalMatches:d.totalMatches,truncated:d.truncated,executionTimeMs:d.executionTimeMs})}catch(t){if(t instanceof w){let e=Date.now()-r;return i.warn("search:timeout",{executionTimeMs:e}),a.NextResponse.json({success:!1,error:{code:"SEARCH_TIMEOUT",message:"Search timed out. Try a more specific query."}},{status:408})}let e=Date.now()-r;return i.error("search:error",{error:t instanceof Error?t.message:"Unknown error",executionTimeMs:e}),a.NextResponse.json({success:!1,error:{code:"INTERNAL_ERROR",message:"An error occurred while searching"}},{status:500})}}let S=new o.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/[id]/search/route",pathname:"/api/worktrees/[id]/search",filename:"route",bundlePath:"app/api/worktrees/[id]/search/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/search/route.ts",nextConfigOutput:"",userland:n}),{requestAsyncStorage:T,staticGenerationAsyncStorage:A,serverHooks:M}=S,R="/api/worktrees/[id]/search/route";function I(){return(0,s.patchFetch)({serverHooks:M,staticGenerationAsyncStorage:A})}},81481:(e,t,r)=>{r.d(t,{Db:()=>a,Kc:()=>s,P7:()=>n,gp:()=>c});let n=[".png",".jpg",".jpeg",".gif",".webp",".svg"],o=[{extension:".png",mimeType:"image/png",magicBytes:[137,80,78,71]},{extension:".jpg",mimeType:"image/jpeg",magicBytes:[255,216,255]},{extension:".jpeg",mimeType:"image/jpeg",magicBytes:[255,216,255]},{extension:".gif",mimeType:"image/gif",magicBytes:[71,73,70,56]},{extension:".webp",mimeType:"image/webp",magicBytes:[82,73,70,70]},{extension:".svg",mimeType:"image/svg+xml"}];function i(e){return e?e.startsWith(".")?e.toLowerCase():"."+e.toLowerCase():""}function s(e){let t=i(e),r=o.find(e=>e.extension===t);return r?.mimeType||"application/octet-stream"}function a(e){if(!e)return!1;let t=i(e);return n.includes(t)}function c(e,t){if(t.length>5242880)return{valid:!1,error:"File size exceeds 5MB limit"};if(".svg"===i(e)){var r;return(r=t.toString("utf-8")).includes("<svg")||r.startsWith("<?xml")?/<script[\s>]/i.test(r)?{valid:!1,error:"SVG contains script tags"}:/\s+on\w+\s*=/i.test(r)?{valid:!1,error:"SVG contains event handler attributes"}:/(?:xlink:)?href\s*=\s*["']?\s*(?:javascript|data|vbscript):/i.test(r)?{valid:!1,error:"SVG contains dangerous URI scheme"}:/<foreignObject[\s>]/i.test(r)?{valid:!1,error:"SVG contains foreignObject element"}:{valid:!0}:{valid:!1,error:"Invalid SVG format"}}return!function(e,t){let r=i(e),n=o.find(e=>e.extension===r);if(!n?.magicBytes)return".svg"===r;let s=n.magicBytesOffset||0;return!(t.length<s+n.magicBytes.length)&&n.magicBytes.every((e,r)=>t[s+r]===e)}(e,t)?{valid:!1,error:"Invalid image magic bytes"}:{valid:!0}}},18163:(e,t,r)=>{r.d(t,{GT:()=>l,Lu:()=>u,W:()=>f,bB:()=>s,bS:()=>a,dq:()=>d});var n=r(20629),o=r(55315);let i=[".git",".env",".env.*","node_modules",".DS_Store","Thumbs.db","*.pem","*.key",".env.local",".env.development",".env.production",".env.test"],s={MAX_ITEMS_PER_DIR:500,MAX_DEPTH:10,MAX_FILE_SIZE_PREVIEW:1048576};function a(e){for(let t of i){if(t===e)return!0;if(t.startsWith("*.")){let r=t.slice(1);if(e.endsWith(r))return!0}if(t.endsWith(".*")){let r=t.slice(0,-2);if(e.startsWith(r+"."))return!0}}return!1}async function c(e){try{return(await (0,n.readdir)(e)).filter(e=>!a(e)).length}catch{return 0}}async function u(e,t=""){let r;let i=t?(0,o.join)(e,t):e;try{r=await (0,n.stat)(i)}catch{throw Error(`Directory not found: ${t||"(root)"}`)}if(!r.isDirectory())throw Error(`Path is not a directory: ${t}`);let u=await (0,n.readdir)(i),l=[];for(let e of u){if(a(e))continue;let t=(0,o.join)(i,e);try{let r=await (0,n.lstat)(t);if(r.isSymbolicLink())continue;if(r.isDirectory()){let r=await c(t);l.push({name:e,type:"directory",itemCount:r})}else if(r.isFile()){let t=(0,o.extname)(e),n={name:e,type:"file",size:r.size,birthtime:r.birthtime.toISOString()};t&&t.length>1&&(n.extension=t.slice(1)),l.push(n)}}catch{continue}if(l.length>=s.MAX_ITEMS_PER_DIR)break}let d=[...l].sort((e,t)=>e.type!==t.type?"directory"===e.type?-1:1:e.name.toLowerCase().localeCompare(t.name.toLowerCase())),f=null;if(t){let e=(0,o.dirname)(t);f="."===e?"":e}return{path:t,name:t?(0,o.basename)(t):"",items:d,parentPath:f}}function l(e){let t=e instanceof Error?e.message:"Unknown error";return t.includes("not found")?{error:"Directory not found",status:404}:t.includes("not a directory")?{error:"Path is not a directory",status:400}:{error:"Failed to read directory",status:500}}function d(e){return{error:`Worktree '${e}' not found`,status:404}}function f(e="Invalid path"){return{error:`Access denied: ${e}`,status:403}}},43895:(e,t,r)=>{r.d(t,{Y:()=>c,h:()=>u});var n=r(98838);let o=[{pattern:/Bearer\s+[A-Za-z0-9\-._~+/]+=*/gi,replacement:"Bearer [REDACTED]"},{pattern:/(password|passwd|pwd)[=:]\s*\S+/gi,replacement:"$1=[REDACTED]"},{pattern:/(token|secret|api_key|apikey|auth)[=:]\s*\S+/gi,replacement:"$1=[REDACTED]"},{pattern:/Authorization:\s*\S+/gi,replacement:"Authorization: [REDACTED]"},{pattern:/-----BEGIN\s+\w+\s+PRIVATE\s+KEY-----[\s\S]*?-----END\s+\w+\s+PRIVATE\s+KEY-----/g,replacement:"[SSH_KEY_REDACTED]"}],i=/password|secret|token|key|auth/i,s={debug:0,info:1,warn:2,error:3};function a(e,t,r,a,c){let u=(0,n.LI)().level;if(s[e]<s[u])return;let l=a?function e(t){if("string"==typeof t){let e=t;for(let{pattern:t,replacement:r}of o)e=e.replace(t,r);return e}if("object"==typeof t&&null!==t){if(Array.isArray(t))return t.map(e);let r={};for(let[n,o]of Object.entries(t))i.test(n)?r[n]="[REDACTED]":r[n]=e(o);return r}return t}(a):void 0,d=function(e){if("json"===(0,n.LI)().format)return JSON.stringify(e);let{timestamp:t,level:r,module:o,action:i,data:s,worktreeId:a,cliToolId:c,requestId:u}=e,l=[a,c].filter(Boolean),d=l.length>0?` [${l.join(":")}]`:"",f=u?` (${u.slice(0,8)})`:"",p=s?` ${JSON.stringify(s)}`:"";return`[${t}] [${r.toUpperCase()}] [${o}]${d}${f} ${i}${p}`}({level:e,module:t,action:r,timestamp:new Date().toISOString(),...c,...l&&{data:l}});switch(e){case"error":console.error(d);break;case"warn":console.warn(d);break;default:console.log(d)}}function c(){return"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function u(e){let t=r=>({debug:(t,n)=>a("debug",e,t,n,r),info:(t,n)=>a("info",e,t,n,r),warn:(t,n)=>a("warn",e,t,n,r),error:(t,n)=>a("error",e,t,n,r),withContext:e=>t({...r,...e})});return t()}},57440:(e,t,r)=>{r.d(t,{j:()=>i});var n=r(55315),o=r.n(n);function i(e,t){if(!e||""===e.trim()||e.includes("\0"))return!1;let r=e;try{r=decodeURIComponent(e)}catch{r=e}if(r.includes("\0"))return!1;let n=o().resolve(t),i=o().resolve(t,r),s=o().relative(n,i);return!(s.startsWith("..")||o().isAbsolute(s))}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),n=t.X(0,[8948,5972,7425],()=>r(19496));module.exports=n})();
@@ -1 +1 @@
1
- "use strict";(()=>{var e={};e.id=8347,e.ids=[8347],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")},84770:e=>{e.exports=require("crypto")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},74097:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>v,patchFetch:()=>x,requestAsyncStorage:()=>f,routeModule:()=>h,serverHooks:()=>y,staticGenerationAsyncStorage:()=>m});var o={};r.r(o),r.d(o,{GET:()=>p});var n=r(49303),i=r(88716),s=r(60670),a=r(87070),u=r(97425),d=r(75748),c=r(18163),l=r(57440);async function p(e,{params:t}){try{let e=(0,u.n)(),r=(0,d.gU)(e,t.id);if(!r){let e=(0,c.dq)(t.id);return a.NextResponse.json({error:e.error},{status:e.status})}let o=t.path.join("/");if(t.path.some(e=>{let t=function(e){try{return decodeURIComponent(e)}catch{return e}}(e);return(0,c.bS)(t)})){let e=(0,c.W)("Path contains excluded pattern");return a.NextResponse.json({error:e.error},{status:e.status})}if(!(0,l.j)(o,r.path)){let e=(0,c.W)("Invalid path");return a.NextResponse.json({error:e.error},{status:e.status})}let n=await (0,c.Lu)(r.path,o);return a.NextResponse.json(n)}catch(t){console.error("Error reading directory:",t);let e=(0,c.GT)(t);return a.NextResponse.json({error:e.error},{status:e.status})}}let h=new n.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/[id]/tree/[...path]/route",pathname:"/api/worktrees/[id]/tree/[...path]",filename:"route",bundlePath:"app/api/worktrees/[id]/tree/[...path]/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/tree/[...path]/route.ts",nextConfigOutput:"",userland:o}),{requestAsyncStorage:f,staticGenerationAsyncStorage:m,serverHooks:y}=h,v="/api/worktrees/[id]/tree/[...path]/route";function x(){return(0,s.patchFetch)({serverHooks:y,staticGenerationAsyncStorage:m})}},18163:(e,t,r)=>{r.d(t,{GT:()=>c,Lu:()=>d,W:()=>p,bB:()=>s,bS:()=>a,dq:()=>l});var o=r(20629),n=r(55315);let i=[".git",".env",".env.*","node_modules",".DS_Store","Thumbs.db","*.pem","*.key",".env.local",".env.development",".env.production",".env.test"],s={MAX_ITEMS_PER_DIR:500,MAX_DEPTH:10,MAX_FILE_SIZE_PREVIEW:1048576};function a(e){for(let t of i){if(t===e)return!0;if(t.startsWith("*.")){let r=t.slice(1);if(e.endsWith(r))return!0}if(t.endsWith(".*")){let r=t.slice(0,-2);if(e.startsWith(r+"."))return!0}}return!1}async function u(e){try{return(await (0,o.readdir)(e)).filter(e=>!a(e)).length}catch{return 0}}async function d(e,t=""){let r;let i=t?(0,n.join)(e,t):e;try{r=await (0,o.stat)(i)}catch{throw Error(`Directory not found: ${t||"(root)"}`)}if(!r.isDirectory())throw Error(`Path is not a directory: ${t}`);let d=await (0,o.readdir)(i),c=[];for(let e of d){if(a(e))continue;let t=(0,n.join)(i,e);try{let r=await (0,o.lstat)(t);if(r.isSymbolicLink())continue;if(r.isDirectory()){let r=await u(t);c.push({name:e,type:"directory",itemCount:r})}else if(r.isFile()){let t=(0,n.extname)(e),o={name:e,type:"file",size:r.size};t&&t.length>1&&(o.extension=t.slice(1)),c.push(o)}}catch{continue}if(c.length>=s.MAX_ITEMS_PER_DIR)break}let l=[...c].sort((e,t)=>e.type!==t.type?"directory"===e.type?-1:1:e.name.toLowerCase().localeCompare(t.name.toLowerCase())),p=null;if(t){let e=(0,n.dirname)(t);p="."===e?"":e}return{path:t,name:t?(0,n.basename)(t):"",items:l,parentPath:p}}function c(e){let t=e instanceof Error?e.message:"Unknown error";return t.includes("not found")?{error:"Directory not found",status:404}:t.includes("not a directory")?{error:"Path is not a directory",status:400}:{error:"Failed to read directory",status:500}}function l(e){return{error:`Worktree '${e}' not found`,status:404}}function p(e="Invalid path"){return{error:`Access denied: ${e}`,status:403}}},57440:(e,t,r)=>{r.d(t,{j:()=>i});var o=r(55315),n=r.n(o);function i(e,t){if(!e||""===e.trim()||e.includes("\0"))return!1;let r=e;try{r=decodeURIComponent(e)}catch{r=e}if(r.includes("\0"))return!1;let o=n().resolve(t),i=n().resolve(t,r),s=n().relative(o,i);return!(s.startsWith("..")||n().isAbsolute(s))}}};var t=require("../../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),o=t.X(0,[8948,5972,7425],()=>r(74097));module.exports=o})();
1
+ "use strict";(()=>{var e={};e.id=8347,e.ids=[8347],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")},84770:e=>{e.exports=require("crypto")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},74097:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>v,patchFetch:()=>x,requestAsyncStorage:()=>f,routeModule:()=>h,serverHooks:()=>y,staticGenerationAsyncStorage:()=>m});var o={};r.r(o),r.d(o,{GET:()=>p});var n=r(49303),i=r(88716),s=r(60670),a=r(87070),u=r(97425),d=r(75748),c=r(18163),l=r(57440);async function p(e,{params:t}){try{let e=(0,u.n)(),r=(0,d.gU)(e,t.id);if(!r){let e=(0,c.dq)(t.id);return a.NextResponse.json({error:e.error},{status:e.status})}let o=t.path.join("/");if(t.path.some(e=>{let t=function(e){try{return decodeURIComponent(e)}catch{return e}}(e);return(0,c.bS)(t)})){let e=(0,c.W)("Path contains excluded pattern");return a.NextResponse.json({error:e.error},{status:e.status})}if(!(0,l.j)(o,r.path)){let e=(0,c.W)("Invalid path");return a.NextResponse.json({error:e.error},{status:e.status})}let n=await (0,c.Lu)(r.path,o);return a.NextResponse.json(n)}catch(t){console.error("Error reading directory:",t);let e=(0,c.GT)(t);return a.NextResponse.json({error:e.error},{status:e.status})}}let h=new n.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/[id]/tree/[...path]/route",pathname:"/api/worktrees/[id]/tree/[...path]",filename:"route",bundlePath:"app/api/worktrees/[id]/tree/[...path]/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/tree/[...path]/route.ts",nextConfigOutput:"",userland:o}),{requestAsyncStorage:f,staticGenerationAsyncStorage:m,serverHooks:y}=h,v="/api/worktrees/[id]/tree/[...path]/route";function x(){return(0,s.patchFetch)({serverHooks:y,staticGenerationAsyncStorage:m})}},18163:(e,t,r)=>{r.d(t,{GT:()=>c,Lu:()=>d,W:()=>p,bB:()=>s,bS:()=>a,dq:()=>l});var o=r(20629),n=r(55315);let i=[".git",".env",".env.*","node_modules",".DS_Store","Thumbs.db","*.pem","*.key",".env.local",".env.development",".env.production",".env.test"],s={MAX_ITEMS_PER_DIR:500,MAX_DEPTH:10,MAX_FILE_SIZE_PREVIEW:1048576};function a(e){for(let t of i){if(t===e)return!0;if(t.startsWith("*.")){let r=t.slice(1);if(e.endsWith(r))return!0}if(t.endsWith(".*")){let r=t.slice(0,-2);if(e.startsWith(r+"."))return!0}}return!1}async function u(e){try{return(await (0,o.readdir)(e)).filter(e=>!a(e)).length}catch{return 0}}async function d(e,t=""){let r;let i=t?(0,n.join)(e,t):e;try{r=await (0,o.stat)(i)}catch{throw Error(`Directory not found: ${t||"(root)"}`)}if(!r.isDirectory())throw Error(`Path is not a directory: ${t}`);let d=await (0,o.readdir)(i),c=[];for(let e of d){if(a(e))continue;let t=(0,n.join)(i,e);try{let r=await (0,o.lstat)(t);if(r.isSymbolicLink())continue;if(r.isDirectory()){let r=await u(t);c.push({name:e,type:"directory",itemCount:r})}else if(r.isFile()){let t=(0,n.extname)(e),o={name:e,type:"file",size:r.size,birthtime:r.birthtime.toISOString()};t&&t.length>1&&(o.extension=t.slice(1)),c.push(o)}}catch{continue}if(c.length>=s.MAX_ITEMS_PER_DIR)break}let l=[...c].sort((e,t)=>e.type!==t.type?"directory"===e.type?-1:1:e.name.toLowerCase().localeCompare(t.name.toLowerCase())),p=null;if(t){let e=(0,n.dirname)(t);p="."===e?"":e}return{path:t,name:t?(0,n.basename)(t):"",items:l,parentPath:p}}function c(e){let t=e instanceof Error?e.message:"Unknown error";return t.includes("not found")?{error:"Directory not found",status:404}:t.includes("not a directory")?{error:"Path is not a directory",status:400}:{error:"Failed to read directory",status:500}}function l(e){return{error:`Worktree '${e}' not found`,status:404}}function p(e="Invalid path"){return{error:`Access denied: ${e}`,status:403}}},57440:(e,t,r)=>{r.d(t,{j:()=>i});var o=r(55315),n=r.n(o);function i(e,t){if(!e||""===e.trim()||e.includes("\0"))return!1;let r=e;try{r=decodeURIComponent(e)}catch{r=e}if(r.includes("\0"))return!1;let o=n().resolve(t),i=n().resolve(t,r),s=n().relative(o,i);return!(s.startsWith("..")||n().isAbsolute(s))}}};var t=require("../../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),o=t.X(0,[8948,5972,7425],()=>r(74097));module.exports=o})();
@@ -1 +1 @@
1
- "use strict";(()=>{var e={};e.id=6392,e.ids=[6392],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")},84770:e=>{e.exports=require("crypto")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},36658:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>y,patchFetch:()=>x,requestAsyncStorage:()=>f,routeModule:()=>p,serverHooks:()=>m,staticGenerationAsyncStorage:()=>h});var o={};r.r(o),r.d(o,{GET:()=>l});var n=r(49303),i=r(88716),s=r(60670),a=r(87070),u=r(97425),d=r(75748),c=r(18163);async function l(e,{params:t}){try{let e=(0,u.n)(),r=(0,d.gU)(e,t.id);if(!r){let e=(0,c.dq)(t.id);return a.NextResponse.json({error:e.error},{status:e.status})}let o=await (0,c.Lu)(r.path);return a.NextResponse.json(o)}catch(t){console.error("Error reading directory:",t);let e=(0,c.GT)(t);return a.NextResponse.json({error:e.error},{status:e.status})}}let p=new n.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/[id]/tree/route",pathname:"/api/worktrees/[id]/tree",filename:"route",bundlePath:"app/api/worktrees/[id]/tree/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/tree/route.ts",nextConfigOutput:"",userland:o}),{requestAsyncStorage:f,staticGenerationAsyncStorage:h,serverHooks:m}=p,y="/api/worktrees/[id]/tree/route";function x(){return(0,s.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:h})}},18163:(e,t,r)=>{r.d(t,{GT:()=>c,Lu:()=>d,W:()=>p,bB:()=>s,bS:()=>a,dq:()=>l});var o=r(20629),n=r(55315);let i=[".git",".env",".env.*","node_modules",".DS_Store","Thumbs.db","*.pem","*.key",".env.local",".env.development",".env.production",".env.test"],s={MAX_ITEMS_PER_DIR:500,MAX_DEPTH:10,MAX_FILE_SIZE_PREVIEW:1048576};function a(e){for(let t of i){if(t===e)return!0;if(t.startsWith("*.")){let r=t.slice(1);if(e.endsWith(r))return!0}if(t.endsWith(".*")){let r=t.slice(0,-2);if(e.startsWith(r+"."))return!0}}return!1}async function u(e){try{return(await (0,o.readdir)(e)).filter(e=>!a(e)).length}catch{return 0}}async function d(e,t=""){let r;let i=t?(0,n.join)(e,t):e;try{r=await (0,o.stat)(i)}catch{throw Error(`Directory not found: ${t||"(root)"}`)}if(!r.isDirectory())throw Error(`Path is not a directory: ${t}`);let d=await (0,o.readdir)(i),c=[];for(let e of d){if(a(e))continue;let t=(0,n.join)(i,e);try{let r=await (0,o.lstat)(t);if(r.isSymbolicLink())continue;if(r.isDirectory()){let r=await u(t);c.push({name:e,type:"directory",itemCount:r})}else if(r.isFile()){let t=(0,n.extname)(e),o={name:e,type:"file",size:r.size};t&&t.length>1&&(o.extension=t.slice(1)),c.push(o)}}catch{continue}if(c.length>=s.MAX_ITEMS_PER_DIR)break}let l=[...c].sort((e,t)=>e.type!==t.type?"directory"===e.type?-1:1:e.name.toLowerCase().localeCompare(t.name.toLowerCase())),p=null;if(t){let e=(0,n.dirname)(t);p="."===e?"":e}return{path:t,name:t?(0,n.basename)(t):"",items:l,parentPath:p}}function c(e){let t=e instanceof Error?e.message:"Unknown error";return t.includes("not found")?{error:"Directory not found",status:404}:t.includes("not a directory")?{error:"Path is not a directory",status:400}:{error:"Failed to read directory",status:500}}function l(e){return{error:`Worktree '${e}' not found`,status:404}}function p(e="Invalid path"){return{error:`Access denied: ${e}`,status:403}}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),o=t.X(0,[8948,5972,7425],()=>r(36658));module.exports=o})();
1
+ "use strict";(()=>{var e={};e.id=6392,e.ids=[6392],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")},84770:e=>{e.exports=require("crypto")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},36658:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>y,patchFetch:()=>x,requestAsyncStorage:()=>f,routeModule:()=>p,serverHooks:()=>m,staticGenerationAsyncStorage:()=>h});var o={};r.r(o),r.d(o,{GET:()=>l});var i=r(49303),n=r(88716),s=r(60670),a=r(87070),u=r(97425),d=r(75748),c=r(18163);async function l(e,{params:t}){try{let e=(0,u.n)(),r=(0,d.gU)(e,t.id);if(!r){let e=(0,c.dq)(t.id);return a.NextResponse.json({error:e.error},{status:e.status})}let o=await (0,c.Lu)(r.path);return a.NextResponse.json(o)}catch(t){console.error("Error reading directory:",t);let e=(0,c.GT)(t);return a.NextResponse.json({error:e.error},{status:e.status})}}let p=new i.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/worktrees/[id]/tree/route",pathname:"/api/worktrees/[id]/tree",filename:"route",bundlePath:"app/api/worktrees/[id]/tree/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/tree/route.ts",nextConfigOutput:"",userland:o}),{requestAsyncStorage:f,staticGenerationAsyncStorage:h,serverHooks:m}=p,y="/api/worktrees/[id]/tree/route";function x(){return(0,s.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:h})}},18163:(e,t,r)=>{r.d(t,{GT:()=>c,Lu:()=>d,W:()=>p,bB:()=>s,bS:()=>a,dq:()=>l});var o=r(20629),i=r(55315);let n=[".git",".env",".env.*","node_modules",".DS_Store","Thumbs.db","*.pem","*.key",".env.local",".env.development",".env.production",".env.test"],s={MAX_ITEMS_PER_DIR:500,MAX_DEPTH:10,MAX_FILE_SIZE_PREVIEW:1048576};function a(e){for(let t of n){if(t===e)return!0;if(t.startsWith("*.")){let r=t.slice(1);if(e.endsWith(r))return!0}if(t.endsWith(".*")){let r=t.slice(0,-2);if(e.startsWith(r+"."))return!0}}return!1}async function u(e){try{return(await (0,o.readdir)(e)).filter(e=>!a(e)).length}catch{return 0}}async function d(e,t=""){let r;let n=t?(0,i.join)(e,t):e;try{r=await (0,o.stat)(n)}catch{throw Error(`Directory not found: ${t||"(root)"}`)}if(!r.isDirectory())throw Error(`Path is not a directory: ${t}`);let d=await (0,o.readdir)(n),c=[];for(let e of d){if(a(e))continue;let t=(0,i.join)(n,e);try{let r=await (0,o.lstat)(t);if(r.isSymbolicLink())continue;if(r.isDirectory()){let r=await u(t);c.push({name:e,type:"directory",itemCount:r})}else if(r.isFile()){let t=(0,i.extname)(e),o={name:e,type:"file",size:r.size,birthtime:r.birthtime.toISOString()};t&&t.length>1&&(o.extension=t.slice(1)),c.push(o)}}catch{continue}if(c.length>=s.MAX_ITEMS_PER_DIR)break}let l=[...c].sort((e,t)=>e.type!==t.type?"directory"===e.type?-1:1:e.name.toLowerCase().localeCompare(t.name.toLowerCase())),p=null;if(t){let e=(0,i.dirname)(t);p="."===e?"":e}return{path:t,name:t?(0,i.basename)(t):"",items:l,parentPath:p}}function c(e){let t=e instanceof Error?e.message:"Unknown error";return t.includes("not found")?{error:"Directory not found",status:404}:t.includes("not a directory")?{error:"Path is not a directory",status:400}:{error:"Failed to read directory",status:500}}function l(e){return{error:`Worktree '${e}' not found`,status:404}}function p(e="Invalid path"){return{error:`Access denied: ${e}`,status:403}}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),o=t.X(0,[8948,5972,7425],()=>r(36658));module.exports=o})();
@@ -1,7 +1,7 @@
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,a)=>{"use strict";a.r(t),a.d(t,{GlobalError:()=>i.a,__next_app__:()=>m,originalPathname:()=>u,pages:()=>c,routeModule:()=>h,tree:()=>d}),a(35480),a(25086),a(35866);var r=a(23191),n=a(88716),s=a(37922),i=a.n(s),l=a(95231),o={};for(let e in l)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(o[e]=()=>l[e]);a.d(t,o);let d=["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(a.bind(a,35480)),"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx"],metadata:{icon:[async e=>(await Promise.resolve().then(a.bind(a,71150))).default(e)],apple:[async e=>(await Promise.resolve().then(a.bind(a,63601))).default(e)],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(a.bind(a,25086)),"/home/runner/work/CommandMate/CommandMate/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(a.t.bind(a,35866,23)),"next/dist/client/components/not-found-error"],metadata:{icon:[async e=>(await Promise.resolve().then(a.bind(a,71150))).default(e)],apple:[async e=>(await Promise.resolve().then(a.bind(a,63601))).default(e)],openGraph:[],twitter:[],manifest:void 0}}],c=["/home/runner/work/CommandMate/CommandMate/src/app/page.tsx"],u="/page",m={require:a,loadChunk:()=>Promise.resolve()},h=new r.AppPageRouteModule({definition:{kind:n.x.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},11518:(e,t,a)=>{Promise.resolve().then(a.bind(a,84792))},35047:(e,t,a)=>{"use strict";var r=a(77389);a.o(r,"useParams")&&a.d(t,{useParams:function(){return r.useParams}}),a.o(r,"useRouter")&&a.d(t,{useRouter:function(){return r.useRouter}})},84792:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>q});var r=a(10326),n=a(17577),s=a(2583),i=a(90434),l=a(77758),o=a(6162),d=a(34643);let c=Symbol.for("constructDateFrom");function u(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&c in e?e[c](t):e instanceof Date?new e.constructor(t):new Date(t)}let m={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function h(e){return (t={})=>{let a=t.width?String(t.width):e.defaultWidth;return e.formats[a]||e.formats[e.defaultWidth]}}let p={date:h({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:h({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:h({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},x={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function g(e){return(t,a)=>{let r;if("formatting"===(a?.context?String(a.context):"standalone")&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,n=a?.width?String(a.width):t;r=e.formattingValues[n]||e.formattingValues[t]}else{let t=e.defaultWidth,n=a?.width?String(a.width):e.defaultWidth;r=e.values[n]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function f(e){return(t,a={})=>{let r;let n=a.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;let l=i[0],o=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(o)?function(e,t){for(let a=0;a<e.length;a++)if(t(e[a]))return a}(o,e=>e.test(l)):function(e,t){for(let a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t(e[a]))return a}(o,e=>e.test(l));return r=e.valueCallback?e.valueCallback(d):d,{value:r=a.valueCallback?a.valueCallback(r):r,rest:t.slice(l.length)}}}function y(e){return(t,a={})=>{let r=t.match(e.matchPattern);if(!r)return null;let n=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];return{value:i=a.valueCallback?a.valueCallback(i):i,rest:t.slice(n.length)}}}let b={code:"en-US",formatDistance:(e,t,a)=>{let r;let n=m[e];return(r="string"==typeof n?n:1===t?n.one:n.other.replace("{{count}}",t.toString()),a?.addSuffix)?a.comparison&&a.comparison>0?"in "+r:r+" ago":r},formatLong:p,formatRelative:(e,t,a,r)=>x[e],localize:{ordinalNumber:(e,t)=>{let a=Number(e),r=a%100;if(r>20||r<10)switch(r%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},era:g({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:g({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:g({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:g({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:g({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:y({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:f({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:f({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:f({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:f({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:f({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},v={};function j(e,t){return u(t||e,e)}function w(e){let t=j(e),a=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return a.setUTCFullYear(t.getFullYear()),+e-+a}function N(e,...t){let a=u.bind(null,e||t.find(e=>"object"==typeof e));return t.map(a)}function k(e,t){let a=+j(e)-+j(t);return a<0?-1:a>0?1:a}let C={lessThanXSeconds:{one:"1秒未満",other:"{{count}}秒未満",oneWithSuffix:"約1秒",otherWithSuffix:"約{{count}}秒"},xSeconds:{one:"1秒",other:"{{count}}秒"},halfAMinute:"30秒",lessThanXMinutes:{one:"1分未満",other:"{{count}}分未満",oneWithSuffix:"約1分",otherWithSuffix:"約{{count}}分"},xMinutes:{one:"1分",other:"{{count}}分"},aboutXHours:{one:"約1時間",other:"約{{count}}時間"},xHours:{one:"1時間",other:"{{count}}時間"},xDays:{one:"1日",other:"{{count}}日"},aboutXWeeks:{one:"約1週間",other:"約{{count}}週間"},xWeeks:{one:"1週間",other:"{{count}}週間"},aboutXMonths:{one:"約1か月",other:"約{{count}}か月"},xMonths:{one:"1か月",other:"{{count}}か月"},aboutXYears:{one:"約1年",other:"約{{count}}年"},xYears:{one:"1年",other:"{{count}}年"},overXYears:{one:"1年以上",other:"{{count}}年以上"},almostXYears:{one:"1年近く",other:"{{count}}年近く"}},S={date:h({formats:{full:"y年M月d日EEEE",long:"y年M月d日",medium:"y/MM/dd",short:"y/MM/dd"},defaultWidth:"full"}),time:h({formats:{full:"H時mm分ss秒 zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},defaultWidth:"full"}),dateTime:h({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},P={lastWeek:"先週のeeeeのp",yesterday:"昨日のp",today:"今日のp",tomorrow:"明日のp",nextWeek:"翌週のeeeeのp",other:"P"},M={en:b,ja:{code:"ja",formatDistance:(e,t,a)=>{let r;a=a||{};let n=C[e];return(r="string"==typeof n?n:1===t?a.addSuffix&&n.oneWithSuffix?n.oneWithSuffix:n.one:a.addSuffix&&n.otherWithSuffix?n.otherWithSuffix.replace("{{count}}",String(t)):n.other.replace("{{count}}",String(t)),a.addSuffix)?a.comparison&&a.comparison>0?r+"後":r+"前":r},formatLong:S,formatRelative:(e,t,a,r)=>P[e],localize:{ordinalNumber:(e,t)=>{let a=Number(e);switch(String(t?.unit)){case"year":return`${a}年`;case"quarter":return`第${a}四半期`;case"month":return`${a}月`;case"week":return`第${a}週`;case"date":return`${a}日`;case"hour":return`${a}時`;case"minute":return`${a}分`;case"second":return`${a}秒`;default:return`${a}`}},era:g({values:{narrow:["BC","AC"],abbreviated:["紀元前","西暦"],wide:["紀元前","西暦"]},defaultWidth:"wide"}),quarter:g({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["第1四半期","第2四半期","第3四半期","第4四半期"]},defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:g({values:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]},defaultWidth:"wide"}),day:g({values:{narrow:["日","月","火","水","木","金","土"],short:["日","月","火","水","木","金","土"],abbreviated:["日","月","火","水","木","金","土"],wide:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"]},defaultWidth:"wide"}),dayPeriod:g({values:{narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},defaultWidth:"wide",formattingValues:{narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:y({matchPattern:/^第?\d+(年|四半期|月|週|日|時|分|秒)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:f({matchPatterns:{narrow:/^(B\.?C\.?|A\.?D\.?)/i,abbreviated:/^(紀元[前後]|西暦)/i,wide:/^(紀元[前後]|西暦)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^B/i,/^A/i],any:[/^(紀元前)/i,/^(西暦|紀元後)/i]},defaultParseWidth:"any"}),quarter:f({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^Q[1234]/i,wide:/^第[1234一二三四1234]四半期/i},defaultMatchWidth:"wide",parsePatterns:{any:[/(1|一|1)/i,/(2|二|2)/i,/(3|三|3)/i,/(4|四|4)/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:f({matchPatterns:{narrow:/^([123456789]|1[012])/,abbreviated:/^([123456789]|1[012])月/i,wide:/^([123456789]|1[012])月/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^1\D/,/^2/,/^3/,/^4/,/^5/,/^6/,/^7/,/^8/,/^9/,/^10/,/^11/,/^12/]},defaultParseWidth:"any"}),day:f({matchPatterns:{narrow:/^[日月火水木金土]/,short:/^[日月火水木金土]/,abbreviated:/^[日月火水木金土]/,wide:/^[日月火水木金土]曜日/},defaultMatchWidth:"wide",parsePatterns:{any:[/^日/,/^月/,/^火/,/^水/,/^木/,/^金/,/^土/]},defaultParseWidth:"any"}),dayPeriod:f({matchPatterns:{any:/^(AM|PM|午前|午後|正午|深夜|真夜中|夜|朝)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^(A|午前)/i,pm:/^(P|午後)/i,midnight:/^深夜|真夜中/i,noon:/^正午/i,morning:/^朝/i,afternoon:/^午後/i,evening:/^夜/i,night:/^深夜/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}}};var W=a(73002);function z({worktree:e,onSessionKilled:t,onStatusChanged:a}){var s,c;let{id:m,name:h,description:p,updatedAt:x,isSessionRunning:g,isWaitingForResponse:f,favorite:y,status:C,link:S}=e,[P,z]=(0,n.useState)(!1),[D,A]=(0,n.useState)(y||!1),[T,$]=(0,n.useState)(!1),[L,E]=(0,n.useState)(C||null),[R,F]=(0,n.useState)(!1),O=(0,o.T)(),X=M[(0,d.bU)()]??b,I=x?(s=new Date(x),c={addSuffix:!0,locale:X},function(e,t,a){var r,n,s,i;let l;let o=a?.locale??v.locale??b,d=k(e,t);if(isNaN(d))throw RangeError("Invalid time value");let c=Object.assign({},a,{addSuffix:a?.addSuffix,comparison:d}),[u,m]=N(a?.in,...d>0?[t,e]:[e,t]),h=(r=m,n=u,(i=void 0,e=>{let t=(i?Math[i]:Math.trunc)(e);return 0===t?0:t})((+j(r)-+j(n))/1e3)),p=Math.round((h-(w(m)-w(u))/1e3)/60);if(p<2){if(a?.includeSeconds){if(h<5)return o.formatDistance("lessThanXSeconds",5,c);if(h<10)return o.formatDistance("lessThanXSeconds",10,c);if(h<20)return o.formatDistance("lessThanXSeconds",20,c);if(h<40)return o.formatDistance("halfAMinute",0,c);else if(h<60)return o.formatDistance("lessThanXMinutes",1,c);else return o.formatDistance("xMinutes",1,c)}return 0===p?o.formatDistance("lessThanXMinutes",1,c):o.formatDistance("xMinutes",p,c)}if(p<45)return o.formatDistance("xMinutes",p,c);if(p<90)return o.formatDistance("aboutXHours",1,c);if(p<1440)return o.formatDistance("aboutXHours",Math.round(p/60),c);if(p<2520)return o.formatDistance("xDays",1,c);if(p<43200)return o.formatDistance("xDays",Math.round(p/1440),c);if(p<86400)return l=Math.round(p/43200),o.formatDistance("aboutXMonths",l,c);if((l=function(e,t,a){let[r,n,s]=N(void 0,e,e,t),i=k(n,s),l=Math.abs(function(e,t,a){let[r,n]=N(void 0,e,t);return 12*(r.getFullYear()-n.getFullYear())+(r.getMonth()-n.getMonth())}(n,s));if(l<1)return 0;1===n.getMonth()&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*l);let o=k(n,s)===-i;(function(e,t){let a=j(e,void 0);return+function(e,t){let a=j(e,t?.in);return a.setHours(23,59,59,999),a}(a,void 0)==+function(e,t){let a=j(e,t?.in),r=a.getMonth();return a.setFullYear(a.getFullYear(),r+1,0),a.setHours(23,59,59,999),a}(a,void 0)})(r)&&1===l&&1===k(r,s)&&(o=!1);let d=i*(l-+o);return 0===d?0:d}(m,u))<12)return o.formatDistance("xMonths",Math.round(p/43200),c);{let e=l%12,t=Math.trunc(l/12);return e<3?o.formatDistance("aboutXYears",t,c):e<9?o.formatDistance("overXYears",t,c):o.formatDistance("almostXYears",t+1,c)}}(s,u(s,Date.now()),c)):null,q="main"===h||"master"===h,_=async e=>{if(e.preventDefault(),e.stopPropagation(),confirm(O("worktree.session.confirmKill",{name:h})))try{z(!0),await W.Iv.killSession(m),t&&t()}catch(t){let e=(0,W.zG)(t);alert(`${O("worktree.session.failedToKill")}: ${e}`)}finally{z(!1)}},U=async e=>{e.preventDefault(),e.stopPropagation();try{$(!0);let e=!D;await W.Iv.toggleFavorite(m,e),A(e)}catch(t){let e=(0,W.zG)(t);alert(`${O("worktree.errors.failedToUpdateFavorite")}: ${e}`)}finally{$(!1)}},J=async(e,t)=>{t.preventDefault(),t.stopPropagation();try{F(!0),await W.Iv.updateStatus(m,e),E(e),a&&a()}catch(t){let e=(0,W.zG)(t);alert(`${O("worktree.errors.failedToUpdateStatus")}: ${e}`)}finally{F(!1)}};return r.jsx(i.default,{href:`/worktrees/${m}`,className:"block",children:(0,r.jsxs)(l.Zb,{hover:!0,padding:"lg",className:"h-full",children:[r.jsx(l.Ol,{children:(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsxs)(l.ll,{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("button",{onClick:U,disabled:T,className:"flex-shrink-0 transition-colors hover:scale-110",title:D?O("common.favorites.remove"):O("common.favorites.add"),children:r.jsx("svg",{className:`w-5 h-5 ${D?"fill-yellow-400 text-yellow-400":"fill-none text-gray-400"}`,stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:r.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"})})}),r.jsx("span",{className:"truncate",children:h}),q&&r.jsx(l.Ct,{variant:"info",children:"Main"}),g&&f&&r.jsx(l.Ct,{variant:"warning",dot:!0,children:O("worktree.status.waitingForResponse")}),g&&!f&&r.jsx(l.Ct,{variant:"success",dot:!0,children:O("worktree.status.responseCompleted")})]}),g&&r.jsx(l.zx,{variant:"danger",size:"sm",onClick:_,disabled:P,className:"flex-shrink-0",children:P?O("common.ending"):O("common.end")})]})}),r.jsx(l.aY,{children:(0,r.jsxs)("div",{className:"space-y-3",children:[p&&(0,r.jsxs)("div",{children:[r.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Description"}),r.jsx("p",{className:"text-sm text-gray-700 line-clamp-2 whitespace-pre-wrap",children:p})]}),S&&(0,r.jsxs)("div",{children:[r.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Link"}),(0,r.jsxs)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),S&&window.open(S,"_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:[r.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.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"})}),r.jsx("span",{className:"truncate",children:S})]})]}),(0,r.jsxs)("div",{children:[r.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Status"}),(0,r.jsxs)("div",{className:"flex gap-1 flex-wrap",children:[r.jsx("button",{onClick:e=>J(null,e),disabled:R,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${null===L?"bg-gray-100 text-gray-700 border-gray-400":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50"}`,children:"Not set"}),r.jsx("button",{onClick:e=>J("todo",e),disabled:R,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${"todo"===L?"bg-gray-100 text-gray-700 border-gray-400":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50"}`,children:"ToDo"}),r.jsx("button",{onClick:e=>J("doing",e),disabled:R,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${"doing"===L?"bg-blue-100 text-blue-700 border-blue-400":"bg-white text-gray-600 border-gray-200 hover:bg-blue-50"}`,children:"Doing"}),r.jsx("button",{onClick:e=>J("done",e),disabled:R,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${"done"===L?"bg-green-100 text-green-700 border-green-400":"bg-white text-gray-600 border-gray-200 hover:bg-green-50"}`,children:"Done"})]})]}),I&&(0,r.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[r.jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,r.jsxs)("span",{children:["Updated ",I]})]})]})})]})})}function D({initialWorktrees:e=[]}){let[t,a]=(0,n.useState)(e),[s,i]=(0,n.useState)([]),[o,d]=(0,n.useState)(!e.length),[c,u]=(0,n.useState)(null),[m,h]=(0,n.useState)(""),[p,x]=(0,n.useState)("updated"),[g,f]=(0,n.useState)("desc"),[y,b]=(0,n.useState)(null),[v,j]=(0,n.useState)(null),[w,N]=(0,n.useState)(null),[k,C]=(0,n.useState)([]),[S,P]=(0,n.useState)(!1),[M,D]=(0,n.useState)(null),A=(0,n.useCallback)(async()=>{try{let e=await W.J1.getExcluded();e.success&&C(e.repositories)}catch{}},[]),T=(0,n.useCallback)(async(e=!1)=>{try{e||d(!0),u(null);let t=await W.Iv.getAll();a(t.worktrees),i(t.repositories)}catch(e){u((0,W.zG)(e))}finally{e||d(!1)}},[]),$=e=>!!(e&&"session_status_changed"===e.type),{status:L}=function(e={}){let{worktreeIds:t=[],onMessage:a,onStatusChange:r,autoReconnect:s=!0,reconnectDelay:i=3e3}=e,[l,o]=(0,n.useState)("disconnected"),d=(0,n.useRef)(null),c=(0,n.useRef)(),u=(0,n.useRef)(new Set),m=(0,n.useCallback)(e=>{o(e),r?.(e)},[r]),h=(0,n.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"),u.current.forEach(e=>{t.send(JSON.stringify({type:"subscribe",worktreeId:e}))})},t.onmessage=e=>{try{let t=JSON.parse(e.data);a?.(t)}catch(e){console.error("Failed to parse WebSocket message:",e)}},t.onerror=()=>{m("error")},t.onclose=()=>{m("disconnected"),d.current=null,s&&(c.current=setTimeout(()=>{h()},i))},d.current=t},[m,a,s,i]),p=(0,n.useCallback)(()=>{c.current&&clearTimeout(c.current),d.current&&(d.current.close(1e3,"Client disconnect"),d.current=null),m("disconnected")},[m]);return{status:l,subscribe:(0,n.useCallback)(e=>{d.current?.readyState===WebSocket.OPEN&&(d.current.send(JSON.stringify({type:"subscribe",worktreeId:e})),u.current.add(e))},[]),unsubscribe:(0,n.useCallback)(e=>{d.current?.readyState===WebSocket.OPEN&&(d.current.send(JSON.stringify({type:"unsubscribe",worktreeId:e})),u.current.delete(e))},[]),sendMessage:(0,n.useCallback)(e=>{d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify(e))},[]),connect:h,disconnect:p}}({onMessage:(0,n.useCallback)(e=>{if($(e.data)){let t=e.data;a(e=>e.map(e=>e.id===t.worktreeId?{...e,isSessionRunning:t.isRunning}:e))}"broadcast"===e.type&&T(!0)},[T])}),E=(0,n.useMemo)(()=>{let e=[...t];if(y&&(e=e.filter(e=>e.repositoryPath===y)),null!==v&&(e="unset"===v?e.filter(e=>!e.status):e.filter(e=>e.status===v)),m){let t=m.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 a=0;switch(p){case"name":a=e.name.localeCompare(t.name);break;case"updated":a=(e.updatedAt?new Date(e.updatedAt).getTime():0)-(t.updatedAt?new Date(t.updatedAt).getTime():0);break;case"favorite":a=(e.favorite?1:0)-(t.favorite?1:0)}return"asc"===g?a:-a}),e},[t,y,v,m,p,g]),R=(0,n.useMemo)(()=>{let e=new Map;for(let t of E){let a=t.repositoryPath||"unknown";e.has(a)||e.set(a,[]),e.get(a).push(t)}return e},[E]),F=e=>{p===e?f(e=>"asc"===e?"desc":"asc"):(x(e),f("asc"))},O=async e=>{D(e);try{let t=await W.J1.restore(e);t.warning&&u(t.warning),await T(),await A()}catch(e){u((0,W.zG)(e))}finally{D(null)}},X=async(e,t)=>{let a=s.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(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}"?
2
2
 
3
3
  This will delete:
4
- - ${a} worktree(s)
4
+ - ${s} worktree(s)
5
5
  - Related chat history
6
6
  - Related memos
7
7
 
@@ -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:`)){N(e);try{await W.J1.delete(e),y===e&&b(null),await T(),await A()}catch(e){u((0,W.zG)(e))}finally{N(null)}}};return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,r.jsxs)(l.Ct,{variant:"gray",children:[t.length," branches"]}),s.length>0&&(0,r.jsxs)(l.Ct,{variant:"info",children:[s.length," ",1===s.length?"repository":"repositories"]}),"connected"===L&&r.jsx(l.Ct,{variant:"success",dot:!0,children:"Live"})]}),r.jsx("div",{className:"flex gap-2 w-full sm:w-auto",children:r.jsx(l.zx,{variant:"secondary",size:"sm",onClick:()=>T(),disabled:o,children:o?"Loading...":"Refresh"})})]}),r.jsx("div",{className:"flex flex-col sm:flex-row gap-3",children:r.jsx("input",{type:"text",placeholder:"Search worktrees...",value:m,onChange:e=>h(e.target.value),className:"input flex-1"})}),s.length>0&&(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap items-center",children:[(0,r.jsxs)(l.zx,{variant:null===y?"primary":"ghost",size:"sm",onClick:()=>b(null),children:["All (",t.length,")"]}),s.map(e=>(0,r.jsxs)("div",{className:"relative group inline-flex items-center",children:[(0,r.jsxs)(l.zx,{variant:y===e.path?"primary":"ghost",size:"sm",onClick:()=>b(e.path),className:"pr-6",children:[e.name," (",e.worktreeCount,")"]}),r.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(),X(e.path,e.name)},disabled:w===e.path,title:"Delete repository",children:w===e.path?"...":"x"})]},e.path))]}),(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap items-center",children:[r.jsx(l.zx,{variant:null===v?"primary":"ghost",size:"sm",onClick:()=>j(null),children:"All"}),r.jsx(l.zx,{variant:"todo"===v?"primary":"ghost",size:"sm",onClick:()=>j("todo"),children:"\uD83D\uDCDD ToDo"}),r.jsx(l.zx,{variant:"doing"===v?"primary":"ghost",size:"sm",onClick:()=>j("doing"),children:"\uD83D\uDEA7 Doing"}),r.jsx(l.zx,{variant:"done"===v?"primary":"ghost",size:"sm",onClick:()=>j("done"),children:"✅ Done"}),r.jsx(l.zx,{variant:"unset"===v?"primary":"ghost",size:"sm",onClick:()=>j("unset"),children:"Not set"})]}),(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[r.jsx("span",{className:"text-sm text-gray-600 self-center",children:"Sort by:"}),(0,r.jsxs)(l.zx,{variant:"favorite"===p?"primary":"ghost",size:"sm",onClick:()=>F("favorite"),children:["⭐ Favorite ","favorite"===p&&("asc"===g?"↑":"↓")]}),(0,r.jsxs)(l.zx,{variant:"name"===p?"primary":"ghost",size:"sm",onClick:()=>F("name"),children:["Name ","name"===p&&("asc"===g?"↑":"↓")]}),(0,r.jsxs)(l.zx,{variant:"updated"===p?"primary":"ghost",size:"sm",onClick:()=>F("updated"),children:["Updated ","updated"===p&&("asc"===g?"↑":"↓")]})]}),c&&r.jsx("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:r.jsx("p",{className:"text-sm text-red-800",children:c})}),o&&!t.length&&(0,r.jsxs)("div",{className:"text-center py-12",children:[r.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"}),r.jsx("p",{className:"mt-4 text-gray-600",children:"Loading worktrees..."})]}),!o&&!c&&0===E.length&&(0,r.jsxs)("div",{className:"text-center py-12",children:[r.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.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"})}),r.jsx("p",{className:"mt-4 text-gray-600",children:m?"No worktrees found matching your search":"No worktrees found"})]}),!o&&E.length>0&&r.jsx("div",{className:"space-y-8",children:Array.from(R.entries()).map(([e,t])=>{let a=s.find(t=>t.path===e),n=a?.name||"Unknown Repository";return(0,r.jsxs)("div",{className:"space-y-4",children:[(s.length>1||!y)&&(0,r.jsxs)("div",{className:"flex items-center gap-3 pb-2 border-b border-gray-200",children:[r.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:n}),r.jsx(l.Ct,{variant:"gray",children:t.length})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:t.map(e=>r.jsx(z,{worktree:e,onSessionKilled:T,onStatusChanged:T},e.id))})]},e)})}),k.length>0&&(0,r.jsxs)("div",{className:"border border-gray-200 rounded-lg",children:[(0,r.jsxs)("button",{className:"w-full flex items-center justify-between p-4 text-left hover:bg-gray-50 transition-colors",onClick:()=>P(!S),children:[(0,r.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Excluded Repositories (",k.length,")"]}),r.jsx("span",{className:"text-gray-400 text-sm",children:S?"Hide":"Show"})]}),S&&r.jsx("div",{className:"border-t border-gray-200 divide-y divide-gray-100",children:k.map(e=>(0,r.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,r.jsxs)("div",{children:[r.jsx("span",{className:"text-sm font-medium text-gray-700",children:e.name}),r.jsx("span",{className:"text-xs text-gray-500 ml-2",children:e.path})]}),r.jsx(l.zx,{variant:"secondary",size:"sm",onClick:()=>O(e.path),disabled:M===e.path,children:M===e.path?"Restoring...":"Restore"})]},e.id))})]})]})}a(35047),a(43053),a(15470),a(11867);class A{constructor(){}static getInstance(){return A.instance||(A.instance=new A),A.instance}normalize(e){let t=e.match(/^ssh:\/\/git@([^:\/]+)(:\d+)?\/(.+?)(\.git)?$/);if(t)return`https://${t[1]}/${t[3]}`.toLowerCase().replace(/\/$/,"");let a=e.match(/^git@([^:]+):(.+?)(\.git)?$/);return a?`https://${a[1]}/${a[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 a=e.match(/:(.+?)(\.git)?$/);if(a&&e.startsWith("git@")){let e=a[1].split("/");return e[e.length-1]}let r=e.match(/\/([^\/]+?)(\.git)?$/);return r?r[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 T({onRepositoryAdded:e}){let[t,a]=(0,n.useState)(!1),[s,i]=(0,n.useState)("local"),[o,d]=(0,n.useState)(""),[c,u]=(0,n.useState)(""),[m,h]=(0,n.useState)(!1),[p,x]=(0,n.useState)(!1),[g,f]=(0,n.useState)(!1),[y,b]=(0,n.useState)(null),[v,j]=(0,n.useState)(null),[w,N]=(0,n.useState)(null),k=A.getInstance(),C=(0,n.useCallback)(async t=>{try{let r=await W.J1.getCloneStatus(t);"completed"===r.status?(N("Repository cloned successfully"),f(!1),b(null),u(""),a(!1),e&&e()):"failed"===r.status?(j(r.error?.message||"Clone failed"),f(!1),b(null)):("running"===r.status||"pending"===r.status)&&setTimeout(()=>C(t),2e3)}catch(e){j((0,W.zG)(e)),f(!1),b(null)}},[e]),S=async t=>{if(t.preventDefault(),!o.trim()){j("Repository path is required");return}j(null),N(null),h(!0);try{let t=await W.J1.scan(o);N(t.message),d(""),a(!1),e&&e()}catch(e){j((0,W.zG)(e))}finally{h(!1)}},P=async e=>{if(e.preventDefault(),!c.trim()){j("Clone URL is required");return}let t=k.validate(c.trim());if(!t.valid){"EMPTY_URL"===t.error?j("Clone URL is required"):j("Invalid URL format");return}j(null),N(null),f(!0);try{let e=await W.J1.clone(c.trim());b(e.jobId)}catch(e){j((0,W.zG)(e)),f(!1)}},M=async()=>{j(null),N(null),x(!0);try{let t=await W.J1.sync();N(t.message),e&&e()}catch(e){j((0,W.zG)(e))}finally{x(!1)}},z=()=>{a(!1),d(""),u(""),j(null),i("local")};return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[!t&&r.jsx(l.zx,{variant:"primary",size:"sm",onClick:()=>a(!0),children:"+ Add Repository"}),r.jsx(l.zx,{variant:"secondary",size:"sm",onClick:M,disabled:p,children:p?"Syncing...":"Sync All"})]}),t&&r.jsx(l.Zb,{padding:"lg",children:(0,r.jsxs)("div",{className:"space-y-4",children:[r.jsx("div",{children:r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Add New Repository"})}),(0,r.jsxs)("div",{className:"flex border-b border-gray-200",role:"tablist",children:[r.jsx("button",{role:"tab","aria-selected":"local"===s,onClick:()=>i("local"),className:`px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors ${"local"===s?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:"Local Path"}),r.jsx("button",{role:"tab","aria-selected":"url"===s,onClick:()=>i("url"),className:`px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors ${"url"===s?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:"Clone URL"})]}),"local"===s&&(0,r.jsxs)("form",{onSubmit:S,className:"space-y-4",children:[(0,r.jsxs)("div",{children:[r.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Enter the absolute path to a git repository containing worktrees."}),r.jsx("label",{htmlFor:"repositoryPath",className:"block text-sm font-medium text-gray-700 mb-2",children:"Repository Path"}),r.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:m}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Example: /Users/username/projects/my-repo"})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[r.jsx(l.zx,{type:"submit",variant:"primary",disabled:m||!o.trim(),children:m?"Scanning...":"Scan & Add"}),r.jsx(l.zx,{type:"button",variant:"ghost",onClick:z,disabled:m,children:"Cancel"})]})]}),"url"===s&&(0,r.jsxs)("form",{onSubmit:P,className:"space-y-4",children:[(0,r.jsxs)("div",{children:[r.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Enter a git clone URL to clone a remote repository."}),r.jsx("label",{htmlFor:"cloneUrl",className:"block text-sm font-medium text-gray-700 mb-2",children:"Clone URL"}),r.jsx("input",{id:"cloneUrl",type:"text",value:c,onChange:e=>u(e.target.value),placeholder:"https://github.com/user/repo.git",className:"input w-full font-mono text-sm",disabled:g}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Supports HTTPS and SSH URLs"})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[r.jsx(l.zx,{type:"submit",variant:"primary",disabled:g||!c.trim(),children:g?"Cloning...":"Clone"}),r.jsx(l.zx,{type:"button",variant:"ghost",onClick:z,disabled:g,children:"Cancel"})]})]})]})}),w&&r.jsx("div",{className:"p-4 bg-green-50 border border-green-200 rounded-lg",children:r.jsx("p",{className:"text-sm text-green-800",children:w})}),v&&r.jsx("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:r.jsx("p",{className:"text-sm text-red-800",children:v})})]})}function $({appId:e,pollInterval:t=3e4,showResponseTime:a=!1,compact:s=!1}){let[i,l]=(0,n.useState)(null),[o,d]=(0,n.useState)(!0);if((0,n.useCallback)(async()=>{try{let t=await fetch(`/api/external-apps/${e}/health`);if(t.ok){let e=await t.json();l(e)}else l({id:e,healthy:!1,lastChecked:Date.now(),error:"Failed to check health"})}catch{l({id:e,healthy:!1,lastChecked:Date.now(),error:"Network error"})}finally{d(!1)}},[e]),o)return(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-gray-300 animate-pulse"}),!s&&r.jsx("span",{className:"text-xs text-gray-400",children:"Checking..."})]});let c=i?.healthy??!1,u=c?"bg-green-500":"bg-gray-400",m=c?"Running":"Stopped";return s?r.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full ${u}`,title:m}):(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full ${u}`}),r.jsx("span",{className:`text-xs ${c?"text-green-600":"text-gray-500"}`,children:m}),a&&i?.responseTime!==void 0&&(0,r.jsxs)("span",{className:"text-xs text-gray-400",children:["(",i.responseTime,"ms)"]})]})}function L({app:e,onEdit:t,onDelete:a}){var s;let[i,o]=(0,n.useState)(!1),[d,c]=(0,n.useState)(!1),u=async()=>{c(!0);try{await a(e.id)}finally{c(!1),o(!1)}},m=`/proxy/${e.pathPrefix}/`;return(0,r.jsxs)(l.Zb,{padding:"md",className:"relative",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[r.jsx("h4",{className:"text-base font-semibold text-gray-900 truncate",children:e.displayName}),r.jsx("p",{className:"text-xs text-gray-500 mt-0.5 font-mono truncate",children:e.name})]}),r.jsx(l.Ct,{variant:{sveltekit:"warning",streamlit:"error",nextjs:"info",other:"gray"}[e.appType]||"gray",children:{sveltekit:"SvelteKit",streamlit:"Streamlit",nextjs:"Next.js",other:"Other"}[s=e.appType]||s})]}),(0,r.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-sm text-gray-600",children:"Status"}),r.jsx($,{appId:e.id,pollInterval:3e4})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-sm text-gray-600",children:"Port"}),(0,r.jsxs)("span",{className:"text-sm font-mono text-gray-900",children:[":",e.targetPort]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-sm text-gray-600",children:"Path"}),(0,r.jsxs)("span",{className:"text-sm font-mono text-gray-900 truncate max-w-[150px]",children:["/proxy/",e.pathPrefix,"/"]})]}),e.websocketEnabled&&(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-sm text-gray-600",children:"WebSocket"}),r.jsx(l.Ct,{variant:"info",children:"Enabled"})]}),!e.enabled&&r.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"})]}),i?(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("p",{className:"text-sm text-gray-600",children:['Delete "',e.displayName,'"?']}),(0,r.jsxs)("div",{className:"flex gap-2",children:[r.jsx(l.zx,{variant:"danger",size:"sm",onClick:u,disabled:d,loading:d,children:"Delete"}),r.jsx(l.zx,{variant:"ghost",size:"sm",onClick:()=>o(!1),disabled:d,children:"Cancel"})]})]}):(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[r.jsx(l.zx,{variant:"primary",size:"sm",onClick:()=>window.open(m,"_blank"),disabled:!e.enabled,children:"Open"}),r.jsx(l.zx,{variant:"secondary",size:"sm",onClick:()=>t(e),children:"Settings"}),r.jsx(l.zx,{variant:"ghost",size:"sm",onClick:()=>o(!0),className:"text-red-600 hover:bg-red-50",children:"Delete"})]})]})}let E={MIN:1024,MAX:65535},R=/^[a-zA-Z0-9-]+$/,F={sveltekit:"SvelteKit",streamlit:"Streamlit",nextjs:"Next.js",other:"Other"},O=["sveltekit","streamlit","nextjs","other"].map(e=>({value:e,label:F[e]}));function X({isOpen:e,onClose:t,editApp:a,onSave:s}){let i=!!a,[o,d]=(0,n.useState)(""),[c,u]=(0,n.useState)(""),[m,h]=(0,n.useState)(""),[p,x]=(0,n.useState)(""),[g,f]=(0,n.useState)(""),[y,b]=(0,n.useState)(!1),[v,j]=(0,n.useState)(""),[w,N]=(0,n.useState)(!0),[k,C]=(0,n.useState)({}),[S,P]=(0,n.useState)(!1),[M,W]=(0,n.useState)(null),z=async e=>{e.preventDefault(),W(null);let r=function(e,t){var a;let r={};return e.displayName?.trim()||(r.displayName="Display name is required"),t||(e.name?.trim()?R.test(e.name)||(r.name="Only alphanumeric characters and hyphens are allowed"):r.name="Identifier name is required",e.pathPrefix?.trim()?R.test(e.pathPrefix)||(r.pathPrefix="Only alphanumeric characters and hyphens are allowed"):r.pathPrefix="Path prefix is required"),e.targetPort?"number"!=typeof e.targetPort||Number.isInteger(a=e.targetPort)&&a>=E.MIN&&a<=E.MAX||(r.targetPort=`Port must be between ${E.MIN} and ${E.MAX}`):r.targetPort="Port number is required",t||e.appType||(r.appType="App type is required"),r}({displayName:o,name:c,pathPrefix:m,targetPort:p,appType:g},i);if(Object.keys(r).length>0){C(r);return}C({}),P(!0);try{if(i&&a){let e=await fetch(`/api/external-apps/${a.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({displayName:o,description:v||void 0,targetPort:p||void 0,websocketEnabled:y,enabled:w})});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:p,appType:g,websocketEnabled:y,description:v||void 0})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to create app")}}s(),t()}catch(e){W(e instanceof Error?e.message:"An error occurred")}finally{P(!1)}};return r.jsx(l.u_,{isOpen:e,onClose:t,title:i?"Edit External App":"Add External App",size:"md",children:(0,r.jsxs)("form",{onSubmit:z,className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"displayName",className:"block text-sm font-medium text-gray-700 mb-1",children:["Display Name ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsx("input",{id:"displayName",type:"text",value:o,onChange:e=>d(e.target.value),className:`input w-full ${k.displayName?"border-red-500":""}`,placeholder:"My App",disabled:S}),k.displayName&&r.jsx("p",{className:"mt-1 text-xs text-red-500",children:k.displayName})]}),!i&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-1",children:["Identifier Name ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsx("input",{id:"name",type:"text",value:c,onChange:e=>u(e.target.value),className:`input w-full font-mono ${k.name?"border-red-500":""}`,placeholder:"my-app",disabled:S}),r.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Alphanumeric and hyphens only. Cannot be changed later."}),k.name&&r.jsx("p",{className:"mt-1 text-xs text-red-500",children:k.name})]}),!i&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"pathPrefix",className:"block text-sm font-medium text-gray-700 mb-1",children:["Path Prefix ",r.jsx("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("div",{className:"flex items-center",children:[r.jsx("span",{className:"text-sm text-gray-500 mr-1",children:"/proxy/"}),r.jsx("input",{id:"pathPrefix",type:"text",value:m,onChange:e=>h(e.target.value),className:`input flex-1 font-mono ${k.pathPrefix?"border-red-500":""}`,placeholder:"app-name",disabled:S}),r.jsx("span",{className:"text-sm text-gray-500 ml-1",children:"/"})]}),r.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"URL path for accessing this app. Cannot be changed later."}),k.pathPrefix&&r.jsx("p",{className:"mt-1 text-xs text-red-500",children:k.pathPrefix})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"targetPort",className:"block text-sm font-medium text-gray-700 mb-1",children:["Port Number ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsx("input",{id:"targetPort",type:"number",value:p,onChange:e=>x(e.target.value?parseInt(e.target.value,10):""),className:`input w-full font-mono ${k.targetPort?"border-red-500":""}`,placeholder:"5173",min:E.MIN,max:E.MAX,disabled:S}),(0,r.jsxs)("p",{className:"mt-1 text-xs text-gray-500",children:["Target port (",E.MIN,"-",E.MAX,")"]}),k.targetPort&&r.jsx("p",{className:"mt-1 text-xs text-red-500",children:k.targetPort})]}),!i&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"appType",className:"block text-sm font-medium text-gray-700 mb-1",children:["App Type ",r.jsx("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("select",{id:"appType",value:g,onChange:e=>f(e.target.value),className:`input w-full ${k.appType?"border-red-500":""}`,disabled:S,children:[r.jsx("option",{value:"",children:"Select app type..."}),O.map(e=>r.jsx("option",{value:e.value,children:e.label},e.value))]}),k.appType&&r.jsx("p",{className:"mt-1 text-xs text-red-500",children:k.appType})]}),(0,r.jsxs)("div",{children:[r.jsx("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700 mb-1",children:"Description"}),r.jsx("textarea",{id:"description",value:v,onChange:e=>j(e.target.value),className:"input w-full",placeholder:"Optional description...",rows:2,disabled:S})]}),(0,r.jsxs)("div",{className:"flex items-center",children:[r.jsx("input",{id:"websocketEnabled",type:"checkbox",checked:y,onChange:e=>b(e.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",disabled:S}),r.jsx("label",{htmlFor:"websocketEnabled",className:"ml-2 text-sm text-gray-700",children:"Enable WebSocket support"})]}),i&&(0,r.jsxs)("div",{className:"flex items-center",children:[r.jsx("input",{id:"enabled",type:"checkbox",checked:w,onChange:e=>N(e.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",disabled:S}),r.jsx("label",{htmlFor:"enabled",className:"ml-2 text-sm text-gray-700",children:"App is enabled"})]}),M&&r.jsx("div",{className:"p-3 bg-red-50 border border-red-200 rounded text-sm text-red-700",children:M}),(0,r.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-200",children:[r.jsx(l.zx,{type:"button",variant:"ghost",onClick:t,disabled:S,children:"Cancel"}),r.jsx(l.zx,{type:"submit",variant:"primary",loading:S,children:i?"Save Changes":"Add App"})]})]})})}function I(){let[e,t]=(0,n.useState)([]),[a,s]=(0,n.useState)(!0),[i,o]=(0,n.useState)(null),[d,c]=(0,n.useState)(!1),[u,m]=(0,n.useState)(null),h=(0,n.useCallback)(async()=>{try{o(null);let e=await fetch("/api/external-apps");if(!e.ok)throw Error("Failed to fetch external apps");let a=await e.json();t(a.apps||[])}catch(e){o(e instanceof Error?e.message:"An error occurred")}finally{s(!1)}},[]),p=(0,n.useCallback)(e=>{m(e),c(!0)},[]),x=(0,n.useCallback)(()=>{m(null),c(!0)},[]),g=(0,n.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")}h()}catch(e){console.error("Failed to delete app:",e)}},[h]),f=(0,n.useCallback)(()=>{h()},[h]),y=(0,n.useCallback)(()=>{c(!1),m(null)},[]);return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"External Apps"}),r.jsx(l.zx,{variant:"primary",size:"sm",onClick:x,children:"+ Add App"})]}),a?r.jsx(l.Zb,{padding:"lg",children:(0,r.jsxs)("div",{className:"flex items-center justify-center py-8",children:[r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"}),r.jsx("span",{className:"ml-3 text-gray-600",children:"Loading apps..."})]})}):i?r.jsx(l.Zb,{padding:"lg",children:(0,r.jsxs)("div",{className:"text-center py-8",children:[r.jsx("p",{className:"text-red-600 mb-4",children:"Failed to load external apps"}),r.jsx(l.zx,{variant:"secondary",size:"sm",onClick:h,children:"Retry"})]})}):0===e.length?r.jsx(l.Zb,{padding:"lg",children:(0,r.jsxs)("div",{className:"text-center py-8",children:[r.jsx("p",{className:"text-gray-500 mb-4",children:"No external apps registered yet."}),r.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"Add an external app to proxy requests to other frontend applications."}),r.jsx(l.zx,{variant:"primary",size:"sm",onClick:x,children:"Add Your First App"})]})}):r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(e=>r.jsx(L,{app:e,onEdit:p,onDelete:g},e.id))}),r.jsx(X,{isOpen:d,onClose:y,editApp:u,onSave:f})]})}function q(){let[e,t]=(0,n.useState)(0),a=(0,n.useCallback)(()=>{t(e=>e+1)},[]);return r.jsx(s.Vw,{children:(0,r.jsxs)("div",{className:"container-custom py-8 overflow-auto h-full",children:[(0,r.jsxs)("div",{className:"mb-8",children:[r.jsx("h1",{className:"mb-2",children:"CommandMate"}),r.jsx("p",{className:"text-lg text-gray-600",children:"Git worktree management with Claude CLI and tmux sessions"})]}),r.jsx("div",{className:"mb-8",children:r.jsx(T,{onRepositoryAdded:a})}),r.jsx(D,{},e),r.jsx("div",{className:"mt-8",children:r.jsx(I,{})})]})})}},35480:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>r});let r=(0,a(68570).createProxy)(String.raw`/home/runner/work/CommandMate/CommandMate/src/app/page.tsx#default`)},6162:(e,t,a)=>{"use strict";a.d(t,{T:()=>s});var r=a(34643);function n(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let s=n(0,r.T_);n(0,r.Gb)}};var t=require("../webpack-runtime.js");t.C(e);var a=e=>t(t.s=e),r=t.X(0,[8948,1287,6621,8705,5781,3860,4704],()=>a(37906));module.exports=r})();
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})();
@@ -1 +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/1287.js","../chunks/2683.js","../chunks/3348.js","../chunks/369.js","../chunks/3860.js","../chunks/4559.js","../chunks/4704.js","../chunks/5781.js","../chunks/5823.js","../chunks/5853.js","../chunks/6621.js","../chunks/6837.js","../chunks/7266.js","../chunks/8705.js","../chunks/8744.js","../chunks/8948.js","../chunks/9582.js","../webpack-runtime.js","page_client-reference-manifest.js"]}
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/1287.js","../chunks/2683.js","../chunks/3348.js","../chunks/369.js","../chunks/3860.js","../chunks/4559.js","../chunks/5823.js","../chunks/5853.js","../chunks/6621.js","../chunks/6837.js","../chunks/7266.js","../chunks/7808.js","../chunks/8705.js","../chunks/8744.js","../chunks/8948.js","../chunks/9238.js","../chunks/9582.js","../webpack-runtime.js","page_client-reference-manifest.js"]}