commandmate 0.2.10 → 0.2.11

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 (62) hide show
  1. package/.env.example +2 -1
  2. package/.next/BUILD_ID +1 -1
  3. package/.next/app-build-manifest.json +12 -12
  4. package/.next/app-path-routes-manifest.json +1 -1
  5. package/.next/build-manifest.json +2 -2
  6. package/.next/cache/.tsbuildinfo +1 -1
  7. package/.next/cache/config.json +3 -3
  8. package/.next/cache/webpack/client-production/0.pack +0 -0
  9. package/.next/cache/webpack/client-production/1.pack +0 -0
  10. package/.next/cache/webpack/client-production/2.pack +0 -0
  11. package/.next/cache/webpack/client-production/index.pack +0 -0
  12. package/.next/cache/webpack/client-production/index.pack.old +0 -0
  13. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  14. package/.next/cache/webpack/server-production/0.pack +0 -0
  15. package/.next/cache/webpack/server-production/index.pack +0 -0
  16. package/.next/next-server.js.nft.json +1 -1
  17. package/.next/prerender-manifest.json +1 -1
  18. package/.next/required-server-files.json +1 -1
  19. package/.next/routes-manifest.json +1 -1
  20. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/app/update-check/route.js +1 -1
  22. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  23. package/.next/server/app/api/repositories/clone/route.js +1 -1
  24. package/.next/server/app/api/repositories/route.js +2 -2
  25. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  26. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  27. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  28. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  29. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  30. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js +1 -1
  31. package/.next/server/app/api/worktrees/[id]/search/route.js +1 -1
  32. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js +1 -1
  33. package/.next/server/app/page_client-reference-manifest.js +1 -1
  34. package/.next/server/app/worktrees/[id]/files/[...path]/page.js +1 -1
  35. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  36. package/.next/server/app/worktrees/[id]/page.js +3 -3
  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/5488.js +4 -4
  41. package/.next/server/chunks/8693.js +1 -0
  42. package/.next/server/chunks/9238.js +14 -14
  43. package/.next/server/chunks/9367.js +2 -2
  44. package/.next/server/functions-config-manifest.json +1 -1
  45. package/.next/server/pages/500.html +1 -1
  46. package/.next/server/server-reference-manifest.json +1 -1
  47. package/.next/static/chunks/5970-2e18108d0cabd8af.js +1 -0
  48. package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-4a3c0861367e0391.js +1 -0
  49. package/.next/static/chunks/app/worktrees/[id]/page-dc0dde49ed95076f.js +1 -0
  50. package/.next/static/css/7c6675f6f65b4990.css +3 -0
  51. package/.next/trace +5 -5
  52. package/dist/server/src/lib/auto-yes-manager.js +114 -25
  53. package/dist/server/src/lib/claude-session.js +60 -21
  54. package/dist/server/src/lib/prompt-key.js +30 -0
  55. package/package.json +12 -1
  56. package/.next/server/chunks/667.js +0 -1
  57. package/.next/static/chunks/5970-dc8fb1c8c0217636.js +0 -1
  58. package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-ce9ac3658f2b7d91.js +0 -1
  59. package/.next/static/chunks/app/worktrees/[id]/page-1b8e4c49fbaf3f99.js +0 -1
  60. package/.next/static/css/a69d9c70fce558b4.css +0 -3
  61. /package/.next/static/{NGcx1ej6oVBba0MO0bwCg → ZTtC8-q8xrYUSilnXmMHl}/_buildManifest.js +0 -0
  62. /package/.next/static/{NGcx1ej6oVBba0MO0bwCg → ZTtC8-q8xrYUSilnXmMHl}/_ssgManifest.js +0 -0
@@ -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/667.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/7425.js","../../../../../chunks/7536.js","../../../../../chunks/8693.js","../../../../../chunks/8948.js","../../../../../chunks/9367.js","../../../../../webpack-runtime.js"]}
@@ -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:()=>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
+ "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(38693);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,8693],()=>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/667.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/7425.js","../../../../../chunks/7536.js","../../../../../chunks/8693.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:()=>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
+ "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")},25780:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>D,patchFetch:()=>F,requestAsyncStorage:()=>A,routeModule:()=>v,serverHooks:()=>w,staticGenerationAsyncStorage:()=>x});var i={};t.r(i),t.d(i,{DELETE:()=>L,GET:()=>_,PATCH:()=>O,POST:()=>y,PUT:()=>h});var n=t(49303),o=t(88716),s=t(60670),a=t(87070),c=t(97425),l=t(75748),u=t(55315),d=t(57440),p=t(68585),f=t(39365),E=t(81481);let m=[".mp4"],I=[{extension:".mp4",mimeType:"video/mp4",magicBytes:[102,116,121,112],magicBytesOffset:4}];var N=t(20629);let g={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=g[e]??t;return a.NextResponse.json({success:!1,error:{code:e,message:r}},{status:i})}async function T(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 _(e,{params:r}){try{let e=await T(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,E.Db)(o)){let e=(0,u.join)(t.path,i);try{let r=await (0,N.readFile)(e),s=(0,E.gp)(o,r);if(!s.valid){if(s.error?.includes("5MB"))return R("FILE_TOO_LARGE",s.error);if(s.error?.includes("magic bytes"))return R("INVALID_MAGIC_BYTES",s.error);return R("INVALID_FILE_CONTENT",s.error||"Invalid image content")}let c=(0,E.Kc)(o),l=r.toString("base64"),u=`data:${c};base64,${l}`;return a.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}}if(function(e){if(!e)return!1;let r=(0,E.Ab)(e);return m.includes(r)}(o)){let e=(0,u.join)(t.path,i);try{if((await (0,N.stat)(e)).size>15728640)return R("FILE_TOO_LARGE","File size exceeds 15MB limit");let r=await (0,N.readFile)(e),s=r.length>15728640?{valid:!1,error:"File size exceeds 15MB limit"}:!function(e,r){let t=(0,E.Ab)(e),i=I.find(e=>e.extension===t);if(!i?.magicBytes)return!1;let n=i.magicBytesOffset||0;return!(r.length<n+i.magicBytes.length)&&i.magicBytes.every((e,t)=>r[n+t]===e)}(o,r)?{valid:!1,error:"Invalid video magic bytes"}:{valid:!0};if(!s.valid){if(s.error?.includes("MB"))return R("FILE_TOO_LARGE",s.error);if(s.error?.includes("magic bytes"))return R("INVALID_MAGIC_BYTES",s.error);return R("INVALID_FILE_CONTENT",s.error||"Invalid video content")}let c=function(e){if(!e)return;let r=(0,E.Ab)(e),t=I.find(e=>e.extension===r);return t?.mimeType}(o)||"video/mp4",l=r.toString("base64"),u=`data:${c};base64,${l}`;return a.NextResponse.json({success:!0,path:i,content:u,extension:n,worktreePath:t.path,isVideo:!0,mimeType:c})}catch(e){if("ENOENT"===e.code)return R("FILE_NOT_FOUND","File not found");throw e}}let s=await (0,p.O2)(t.path,i);if(!s.success)return R(s.error?.code||"INTERNAL_ERROR",s.error?.message||"Failed to read file");return a.NextResponse.json({success:!0,path:i,content:s.content,extension:n,worktreePath:t.path})}catch(e){return console.error("Error reading file:",e),R("INTERNAL_ERROR","Failed to read file")}}async function h(e,{params:r}){try{let t=await T(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 s=(0,u.extname)(n).toLowerCase(),c=(0,f.ty)(s,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 a.NextResponse.json({success:!0,path:n})}catch(e){return console.error("Error updating file:",e),R("INTERNAL_ERROR","Failed to update file")}}async function y(e,{params:r}){try{let t=await T(r.id,r.path);if("error"in t)return t.error;let{worktree:i,relativePath:n}=t,{type:o,content:s}=await e.json();if(!o||!["file","directory"].includes(o))return R("INVALID_REQUEST",'Type must be "file" or "directory"');if("file"===o&&void 0!==s){let e=(0,u.extname)(n).toLowerCase();if((0,f.ZI)(e)){let r=(0,f.ty)(e,s);if(!r.valid)return R("INVALID_CONTENT",r.error||"Invalid content")}}let c=await (0,p.D5)(i.path,n,o,s);if(!c.success)return R(c.error?.code||"INTERNAL_ERROR",c.error?.message||"Failed to create file/directory");return a.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 L(e,{params:r}){try{let t=await T(r.id,r.path);if("error"in t)return t.error;let{worktree:i,relativePath:n}=t,{searchParams:o}=new URL(e.url),s="true"===o.get("recursive"),c=await (0,p.jN)(i.path,n,s);if(!c.success)return R(c.error?.code||"INTERNAL_ERROR",c.error?.message||"Failed to delete file/directory");return a.NextResponse.json({success:!0})}catch(e){return console.error("Error deleting file/directory:",e),R("INTERNAL_ERROR","Failed to delete file/directory")}}async function O(e,{params:r}){try{let t=await T(r.id,r.path);if("error"in t)return t.error;let{worktree:i,relativePath:n}=t,{action:o,newName:s,destination:c}=await e.json();switch(o){case"rename":{if(!s||"string"!=typeof s)return R("INVALID_REQUEST","newName is required");let e=await (0,p.nz)(i.path,n,s);if(!e.success)return R(e.error?.code||"INTERNAL_ERROR",e.error?.message||"Failed to rename file/directory");return a.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 a.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 v=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:A,staticGenerationAsyncStorage:x,serverHooks:w}=v,D="/api/worktrees/[id]/files/[...path]/route";function F(){return(0,s.patchFetch)({serverHooks:w,staticGenerationAsyncStorage:x})}},81481:(e,r,t)=>{t.d(r,{Ab:()=>o,Db:()=>a,Kc:()=>s,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 s(e){let r=o(e),t=n.find(e=>e.extension===r);return t?.mimeType||"application/octet-stream"}function a(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 s=i.magicBytesOffset||0;return!(r.length<s+i.magicBytes.length)&&i.magicBytes.every((e,t)=>r[s+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(25780));module.exports=i})();
@@ -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:()=>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
+ "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,{Ab:()=>i,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=1210,e.ids=[1210],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")},14276:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>w,patchFetch:()=>L,requestAsyncStorage:()=>g,routeModule:()=>N,serverHooks:()=>_,staticGenerationAsyncStorage:()=>T});var i={};r.r(i),r.d(i,{POST:()=>E});var a=r(49303),o=r(88716),n=r(60670),s=r(87070),l=r(97425),p=r(75748),u=r(55315),m=r(57440),d=r(68585);let c=[{extension:".png",maxFileSize:5242880,allowedMimeTypes:["image/png"],magicBytes:[{bytes:[137,80,78,71,13,10,26,10]}]},{extension:".jpg",maxFileSize:5242880,allowedMimeTypes:["image/jpeg"],magicBytes:[{bytes:[255,216,255]}]},{extension:".jpeg",maxFileSize:5242880,allowedMimeTypes:["image/jpeg"],magicBytes:[{bytes:[255,216,255]}]},{extension:".gif",maxFileSize:5242880,allowedMimeTypes:["image/gif"],magicBytes:[{bytes:[71,73,70,56,55,97]},{bytes:[71,73,70,56,57,97]}]},{extension:".webp",maxFileSize:5242880,allowedMimeTypes:["image/webp"],magicBytes:[{bytes:[82,73,70,70],offset:0}]},{extension:".txt",maxFileSize:5242880,allowedMimeTypes:["text/plain"]},{extension:".log",maxFileSize:5242880,allowedMimeTypes:["text/plain"]},{extension:".md",maxFileSize:5242880,allowedMimeTypes:["text/markdown","text/plain"]},{extension:".csv",maxFileSize:5242880,allowedMimeTypes:["text/csv"]},{extension:".json",maxFileSize:5242880,allowedMimeTypes:["application/json"]},{extension:".yaml",maxFileSize:5242880,allowedMimeTypes:["text/yaml","application/x-yaml"]},{extension:".yml",maxFileSize:5242880,allowedMimeTypes:["text/yaml","application/x-yaml"]}],I=c.map(e=>e.extension);function x(e){let t=e.toLowerCase();return c.find(e=>e.extension===t)}let y={FILE_NOT_FOUND:404,WORKTREE_NOT_FOUND:404,PERMISSION_DENIED:403,INVALID_PATH:400,INVALID_REQUEST: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 f(e,t,r=500){if("string"==typeof e){let i=y[e]??r;return s.NextResponse.json({success:!1,error:{code:e,message:t}},{status:i})}let i=e.error?.code??"INTERNAL_ERROR",a=e.error?.message??"Unknown error",o=y[i]??r;return s.NextResponse.json({success:!1,error:{code:i,message:a}},{status:o})}async function E(e,{params:t}){try{let i;let a=(0,l.n)(),o=(0,p.gU)(a,t.id);if(!o)return f("WORKTREE_NOT_FOUND","Worktree not found");let n=t.path.join("/"),c=(0,u.normalize)(n);if(!(0,m.j)(c,o.path))return f("INVALID_PATH","Invalid file path");try{i=await e.formData()}catch{return f("INVALID_REQUEST","Invalid form data",400)}let y=i.get("file");if(!y||!(y instanceof File))return f("INVALID_REQUEST","File is required",400);let E=y.name,N=y.type,g=y.size,T=(0,u.extname)(E).toLowerCase();if(!function(e){if(!e)return!1;let t=e.toLowerCase();return I.includes(t)}(T))return f((0,d.wZ)("INVALID_EXTENSION"));if(!function(e,t){let r=x(e);return r?.allowedMimeTypes.includes(t)??!1}(T,N))return f((0,d.wZ)("INVALID_MIME_TYPE"));let _=await y.arrayBuffer(),w=Buffer.from(_);if(!function(e,t){let r=x(e);return!r?.magicBytes||0===r.magicBytes.length||r.magicBytes.some(e=>{let r=e.offset??0;return!(t.length<r+e.bytes.length)&&e.bytes.every((e,i)=>t[r+i]===e)})}(T,w))return f((0,d.wZ)("INVALID_MAGIC_BYTES"));let L=function(e){let t=x(e);return t?.maxFileSize??5242880}(T);if(g>L)return f((0,d.wZ)("FILE_TOO_LARGE"));if(!(0,d.TG)(E,{forUpload:!0}).valid)return f((0,d.wZ)("INVALID_FILENAME"));if(".yaml"===T||".yml"===T){var r;if(r=w.toString("utf-8"),[/!ruby\/object/i,/!python\/object/i,/!!python/i,/!!ruby/i,/!<tag:yaml\.org,2002:python/i,/!<tag:yaml\.org,2002:ruby/i].some(e=>e.test(r)))return f((0,d.wZ)("INVALID_FILE_CONTENT"))}if(".json"===T){let e=w.toString("utf-8");if(!function(e){try{return JSON.parse(e),!0}catch{return!1}}(e))return f((0,d.wZ)("INVALID_FILE_CONTENT"))}let A=c?`${c}/${E}`:E,F=await (0,d.Kr)(o.path,A,w);if(!F.success)return f(F);return s.NextResponse.json({success:!0,path:F.path,filename:E,size:F.size},{status:201})}catch(e){return console.error("Error uploading file:",e),f("INTERNAL_ERROR","Failed to upload file")}}let N=new a.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/worktrees/[id]/upload/[...path]/route",pathname:"/api/worktrees/[id]/upload/[...path]",filename:"route",bundlePath:"app/api/worktrees/[id]/upload/[...path]/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/upload/[...path]/route.ts",nextConfigOutput:"",userland:i}),{requestAsyncStorage:g,staticGenerationAsyncStorage:T,serverHooks:_}=N,w="/api/worktrees/[id]/upload/[...path]/route";function L(){return(0,n.patchFetch)({serverHooks:_,staticGenerationAsyncStorage:T})}}};var t=require("../../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),i=t.X(0,[8948,5972,7425,8585],()=>r(14276));module.exports=i})();
1
+ "use strict";(()=>{var e={};e.id=1210,e.ids=[1210],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")},14276:(e,t,i)=>{i.r(t),i.d(t,{originalPathname:()=>w,patchFetch:()=>L,requestAsyncStorage:()=>g,routeModule:()=>N,serverHooks:()=>_,staticGenerationAsyncStorage:()=>T});var r={};i.r(r),i.d(r,{POST:()=>E});var a=i(49303),o=i(88716),n=i(60670),s=i(87070),l=i(97425),p=i(75748),u=i(55315),m=i(57440),d=i(68585);let c=[{extension:".png",maxFileSize:5242880,allowedMimeTypes:["image/png"],magicBytes:[{bytes:[137,80,78,71,13,10,26,10]}]},{extension:".jpg",maxFileSize:5242880,allowedMimeTypes:["image/jpeg"],magicBytes:[{bytes:[255,216,255]}]},{extension:".jpeg",maxFileSize:5242880,allowedMimeTypes:["image/jpeg"],magicBytes:[{bytes:[255,216,255]}]},{extension:".gif",maxFileSize:5242880,allowedMimeTypes:["image/gif"],magicBytes:[{bytes:[71,73,70,56,55,97]},{bytes:[71,73,70,56,57,97]}]},{extension:".webp",maxFileSize:5242880,allowedMimeTypes:["image/webp"],magicBytes:[{bytes:[82,73,70,70],offset:0}]},{extension:".mp4",maxFileSize:15728640,allowedMimeTypes:["video/mp4"],magicBytes:[{bytes:[102,116,121,112],offset:4}]},{extension:".txt",maxFileSize:5242880,allowedMimeTypes:["text/plain"]},{extension:".log",maxFileSize:5242880,allowedMimeTypes:["text/plain"]},{extension:".md",maxFileSize:5242880,allowedMimeTypes:["text/markdown","text/plain"]},{extension:".csv",maxFileSize:5242880,allowedMimeTypes:["text/csv"]},{extension:".json",maxFileSize:5242880,allowedMimeTypes:["application/json"]},{extension:".yaml",maxFileSize:5242880,allowedMimeTypes:["text/yaml","application/x-yaml"]},{extension:".yml",maxFileSize:5242880,allowedMimeTypes:["text/yaml","application/x-yaml"]}],y=c.map(e=>e.extension);function x(e){let t=e.toLowerCase();return c.find(e=>e.extension===t)}let I={FILE_NOT_FOUND:404,WORKTREE_NOT_FOUND:404,PERMISSION_DENIED:403,INVALID_PATH:400,INVALID_REQUEST: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 f(e,t,i=500){if("string"==typeof e){let r=I[e]??i;return s.NextResponse.json({success:!1,error:{code:e,message:t}},{status:r})}let r=e.error?.code??"INTERNAL_ERROR",a=e.error?.message??"Unknown error",o=I[r]??i;return s.NextResponse.json({success:!1,error:{code:r,message:a}},{status:o})}async function E(e,{params:t}){try{let r;let a=(0,l.n)(),o=(0,p.gU)(a,t.id);if(!o)return f("WORKTREE_NOT_FOUND","Worktree not found");let n=t.path.join("/"),c=(0,u.normalize)(n);if(!(0,m.j)(c,o.path))return f("INVALID_PATH","Invalid file path");try{r=await e.formData()}catch{return f("INVALID_REQUEST","Invalid form data",400)}let I=r.get("file");if(!I||!(I instanceof File))return f("INVALID_REQUEST","File is required",400);let E=I.name,N=I.type,g=I.size,T=(0,u.extname)(E).toLowerCase();if(!function(e){if(!e)return!1;let t=e.toLowerCase();return y.includes(t)}(T))return f((0,d.wZ)("INVALID_EXTENSION"));if(!function(e,t){let i=x(e);return i?.allowedMimeTypes.includes(t)??!1}(T,N))return f((0,d.wZ)("INVALID_MIME_TYPE"));let _=function(e){let t=x(e);return t?.maxFileSize??5242880}(T);if(g>_)return f((0,d.wZ)("FILE_TOO_LARGE"));let w=await I.arrayBuffer(),L=Buffer.from(w);if(!function(e,t){let i=x(e);return!i?.magicBytes||0===i.magicBytes.length||i.magicBytes.some(e=>{let i=e.offset??0;return!(t.length<i+e.bytes.length)&&e.bytes.every((e,r)=>t[i+r]===e)})}(T,L))return f((0,d.wZ)("INVALID_MAGIC_BYTES"));if(!(0,d.TG)(E,{forUpload:!0}).valid)return f((0,d.wZ)("INVALID_FILENAME"));if(".yaml"===T||".yml"===T){var i;if(i=L.toString("utf-8"),[/!ruby\/object/i,/!python\/object/i,/!!python/i,/!!ruby/i,/!<tag:yaml\.org,2002:python/i,/!<tag:yaml\.org,2002:ruby/i].some(e=>e.test(i)))return f((0,d.wZ)("INVALID_FILE_CONTENT"))}if(".json"===T){let e=L.toString("utf-8");if(!function(e){try{return JSON.parse(e),!0}catch{return!1}}(e))return f((0,d.wZ)("INVALID_FILE_CONTENT"))}let F=c?`${c}/${E}`:E,S=await (0,d.Kr)(o.path,F,L);if(!S.success)return f(S);return s.NextResponse.json({success:!0,path:S.path,filename:E,size:S.size},{status:201})}catch(e){return console.error("Error uploading file:",e),f("INTERNAL_ERROR","Failed to upload file")}}let N=new a.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/worktrees/[id]/upload/[...path]/route",pathname:"/api/worktrees/[id]/upload/[...path]",filename:"route",bundlePath:"app/api/worktrees/[id]/upload/[...path]/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/upload/[...path]/route.ts",nextConfigOutput:"",userland:r}),{requestAsyncStorage:g,staticGenerationAsyncStorage:T,serverHooks:_}=N,w="/api/worktrees/[id]/upload/[...path]/route";function L(){return(0,n.patchFetch)({serverHooks:_,staticGenerationAsyncStorage:T})}}};var t=require("../../../../../../webpack-runtime.js");t.C(e);var i=e=>t(t.s=e),r=t.X(0,[8948,5972,7425,8585],()=>i(14276));module.exports=r})();
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"80":{"*":{"id":"41868","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"79671","name":"*","chunks":[],"async":false}},"12846":{"*":{"id":"12994","name":"*","chunks":[],"async":false}},"18828":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36093":{"*":{"id":"56055","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"41845":{"*":{"id":"37398","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"66677":{"*":{"id":"42106","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","816","static/chunks/816-af44cb865b0c980e.js","3185","static/chunks/app/layout-07755491d5d57242.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","816","static/chunks/816-af44cb865b0c980e.js","3185","static/chunks/app/layout-07755491d5d57242.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","816","static/chunks/816-af44cb865b0c980e.js","5970","static/chunks/5970-dc8fb1c8c0217636.js","1931","static/chunks/app/page-a6593b9640df66a6.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/page.tsx":{"id":50653,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":36093,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":41845,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/a69d9c70fce558b4.css"],"/home/runner/work/CommandMate/CommandMate/src/app/page":[]}}
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"80":{"*":{"id":"41868","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"79671","name":"*","chunks":[],"async":false}},"12846":{"*":{"id":"12994","name":"*","chunks":[],"async":false}},"18390":{"*":{"id":"74810","name":"*","chunks":[],"async":false}},"18828":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"41845":{"*":{"id":"37398","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"66677":{"*":{"id":"42106","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","816","static/chunks/816-af44cb865b0c980e.js","3185","static/chunks/app/layout-07755491d5d57242.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","816","static/chunks/816-af44cb865b0c980e.js","3185","static/chunks/app/layout-07755491d5d57242.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","816","static/chunks/816-af44cb865b0c980e.js","5970","static/chunks/5970-2e18108d0cabd8af.js","1931","static/chunks/app/page-a6593b9640df66a6.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":18390,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/page.tsx":{"id":50653,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":41845,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/7c6675f6f65b4990.css"],"/home/runner/work/CommandMate/CommandMate/src/app/page":[]}}
@@ -1 +1 @@
1
- (()=>{var e={};e.id=5441,e.ids=[5441],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")},49411:e=>{"use strict";e.exports=require("node:path")},97742:e=>{"use strict";e.exports=require("node:process")},41041:e=>{"use strict";e.exports=require("node:url")},56378:(e,r,s)=>{"use strict";s.r(r),s.d(r,{GlobalError:()=>o.a,__next_app__:()=>x,originalPathname:()=>m,pages:()=>c,routeModule:()=>p,tree:()=>d}),s(50503),s(25086),s(35866);var a=s(23191),t=s(88716),n=s(37922),o=s.n(n),l=s(95231),i={};for(let e in l)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(i[e]=()=>l[e]);s.d(r,i);let d=["",{children:["worktrees",{children:["[id]",{children:["files",{children:["[...path]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(s.bind(s,50503)),"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/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/worktrees/[id]/files/[...path]/page.tsx"],m="/worktrees/[id]/files/[...path]/page",x={require:s,loadChunk:()=>Promise.resolve()},p=new a.AppPageRouteModule({definition:{kind:t.x.APP_PAGE,page:"/worktrees/[id]/files/[...path]/page",pathname:"/worktrees/[id]/files/[...path]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},47578:(e,r,s)=>{Promise.resolve().then(s.bind(s,84442))},84442:(e,r,s)=>{"use strict";s.r(r),s.d(r,{default:()=>m});var a=s(10326),t=s(17577),n=s(35047),o=s(6162),l=s(77758),i=s(83173),d=s(26394),c=s(42283);function m(){let e=(0,n.useRouter)(),r=(0,n.useParams)(),s=(0,o.T)("common");r.id;let m=r.path.join("/"),[x,p]=(0,t.useState)(null),[u,h]=(0,t.useState)(!0),[g,b]=(0,t.useState)(null),f=x?.extension==="md"||x?.extension==="markdown";return(0,a.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[a.jsx("div",{className:"sticky top-0 z-10 bg-white border-b border-gray-200 shadow-sm",children:(0,a.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-3 flex items-center gap-3",children:[(0,a.jsxs)("button",{onClick:()=>e.back(),className:"flex items-center gap-2 text-gray-600 hover:text-gray-900 transition-colors","aria-label":s("back"),children:[a.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),a.jsx("span",{className:"hidden sm:inline",children:s("back")})]}),a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:m})})]})}),(0,a.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-6",children:[u&&a.jsx(l.Zb,{padding:"lg",children:(0,a.jsxs)("div",{className:"flex items-center justify-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:"ml-3 text-gray-600",children:"Loading file..."})]})}),g&&a.jsx(l.Zb,{padding:"lg",children:a.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[a.jsx("svg",{className:"w-5 h-5 text-red-600 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),a.jsx("p",{className:"text-sm text-red-800",children:g})]})})}),x&&!u&&!g&&(0,a.jsxs)(l.Zb,{padding:"none",children:[a.jsx("div",{className:"bg-gray-100 px-4 py-3 border-b border-gray-200",children:(0,a.jsxs)("p",{className:"text-xs text-gray-600 font-mono break-all",children:[x.worktreePath,"/",x.path]})}),a.jsx("div",{className:"p-6 sm:p-8 bg-white",children:f?a.jsx("div",{className:"prose prose-slate max-w-none prose-headings:font-semibold prose-h1:text-3xl prose-h1:border-b prose-h1:pb-2 prose-h2:text-2xl prose-h2:border-b prose-h2:pb-2 prose-h3:text-xl prose-a:text-blue-600 prose-a:no-underline hover:prose-a:underline prose-pre:bg-gray-100 prose-pre:border prose-pre:border-gray-200 prose-code:text-sm prose-code:bg-gray-100 prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:before:content-none prose-code:after:content-none prose-img:rounded-lg prose-img:shadow-md",children:a.jsx(i.UG,{remarkPlugins:[d.Z],rehypePlugins:[c.Z],components:{code:({inline:e,className:r,children:s,...t})=>e?a.jsx("code",{className:"bg-gray-100 text-gray-800 px-1.5 py-0.5 rounded text-sm font-mono",...t,children:s}):a.jsx("code",{className:r,...t,children:s}),pre:({children:e})=>a.jsx("pre",{className:"bg-gray-50 border border-gray-200 rounded-md p-4 overflow-x-auto",children:e}),table:({children:e})=>a.jsx("div",{className:"overflow-x-auto",children:a.jsx("table",{className:"border-collapse border border-gray-300",children:e})}),th:({children:e})=>a.jsx("th",{className:"border border-gray-300 bg-gray-100 px-4 py-2 text-left font-semibold",children:e}),td:({children:e})=>a.jsx("td",{className:"border border-gray-300 px-4 py-2",children:e}),blockquote:({children:e})=>a.jsx("blockquote",{className:"border-l-4 border-gray-300 pl-4 italic text-gray-700",children:e})},children:x.content})}):a.jsx("pre",{className:"bg-gray-50 border border-gray-200 rounded-md p-4 overflow-x-auto text-sm",children:a.jsx("code",{className:`language-${x.extension}`,children:x.content})})})]})]})]})}},28676:(e,r,s)=>{"use strict";s.d(r,{u:()=>o});var a=s(10326),t=s(17577),n=s(60962);function o({isOpen:e,onClose:r,title:s,children:o,size:l="lg",showCloseButton:i=!0,disableClose:d=!1}){let c=(0,t.useRef)(null);return e?(0,n.createPortal)((0,a.jsxs)("div",{className:"fixed inset-0 z-[9999] overflow-y-auto",children:[a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:d?void 0:r}),a.jsx("div",{className:"relative flex min-h-full items-center justify-center p-2 sm:p-4",children:(0,a.jsxs)("div",{ref:c,className:`relative w-full ${{sm:"max-w-[calc(100vw-2rem)] sm:max-w-md",md:"max-w-[calc(100vw-2rem)] sm:max-w-2xl",lg:"max-w-[calc(100vw-2rem)] sm:max-w-4xl",xl:"max-w-[calc(100vw-2rem)] sm:max-w-6xl",full:"max-w-[calc(100vw-2rem)] sm:max-w-[95vw]"}[l]} max-h-[calc(100vh-1rem)] sm:max-h-[calc(100vh-2rem)] flex flex-col bg-white rounded-lg shadow-xl transform transition-all`,children:[(s||i)&&(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-gray-200 flex-shrink-0",children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold text-gray-900 truncate pr-2",children:s}),i&&a.jsx("button",{onClick:r,className:"text-gray-400 hover:text-gray-600 transition-colors flex-shrink-0",children:a.jsx("svg",{className:"w-5 h-5 sm:w-6 sm:h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),a.jsx("div",{className:"px-4 sm:px-6 py-3 sm:py-4 overflow-y-auto flex-1 min-h-0",children:o})]})})]}),document.body):null}},77758:(e,r,s)=>{"use strict";s.d(r,{Ct:()=>d,zx:()=>t,Zb:()=>n,aY:()=>i,Ol:()=>o,ll:()=>l,u_:()=>c.u});var a=s(10326);function t({variant:e="primary",size:r="md",fullWidth:s=!1,loading:t=!1,disabled:n,className:o="",children:l,...i}){let d=["btn",{primary:"btn-primary",secondary:"btn-secondary",danger:"btn-danger",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500"}[e],{sm:"btn-sm",md:"",lg:"btn-lg"}[r],s?"w-full":"",n||t?"opacity-50 cursor-not-allowed":"",o].filter(Boolean).join(" ");return(0,a.jsxs)("button",{className:d,disabled:n||t,...i,children:[t&&(0,a.jsxs)("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l]})}function n({hover:e=!1,padding:r="md",className:s="",children:t,...n}){let o=["card",e?"card-hover":"",{none:"",sm:"p-3",md:"p-4",lg:"p-6"}[r],s].filter(Boolean).join(" ");return a.jsx("div",{className:o,...n,children:t})}function o({className:e="",children:r,...s}){return a.jsx("div",{className:`mb-3 ${e}`,...s,children:r})}function l({className:e="",children:r,...s}){return a.jsx("h3",{className:`text-lg font-semibold text-gray-900 ${e}`,...s,children:r})}function i({className:e="",children:r,...s}){return a.jsx("div",{className:e,...s,children:r})}function d({variant:e="gray",dot:r=!1,className:s="",children:t,...n}){let o=["badge",{success:"badge-success",warning:"badge-warning",error:"badge-error",info:"badge-info",gray:"badge-gray"}[e],s].filter(Boolean).join(" ");return(0,a.jsxs)("span",{className:o,...n,children:[r&&a.jsx("span",{className:`mr-1.5 inline-block h-2 w-2 rounded-full ${{success:"bg-green-600",warning:"bg-yellow-600",error:"bg-red-600",info:"bg-blue-600",gray:"bg-gray-600"}[e]}`,"aria-hidden":"true"}),t]})}s(17577);var c=s(28676)},50503:(e,r,s)=>{"use strict";s.r(r),s.d(r,{default:()=>a});let a=(0,s(68570).createProxy)(String.raw`/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/page.tsx#default`)},63601:(e,r,s)=>{"use strict";s.r(r),s.d(r,{default:()=>t});var a=s(66621);let t=e=>[{type:"image/png",sizes:"180x180",url:(0,a.fillMetadataSegment)(".",e.params,"apple-icon.png")+"?31a89e65aa4ac65b"}]},71150:(e,r,s)=>{"use strict";s.r(r),s.d(r,{default:()=>t});var a=s(66621);let t=e=>[{type:"image/png",sizes:"32x32",url:(0,a.fillMetadataSegment)(".",e.params,"icon.png")+"?32d9127ba30ee286"}]}};var r=require("../../../../../webpack-runtime.js");r.C(e);var s=e=>r(r.s=e),a=r.X(0,[8948,1287,6621,7458,3860],()=>s(56378));module.exports=a})();
1
+ (()=>{var e={};e.id=5441,e.ids=[5441],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")},49411:e=>{"use strict";e.exports=require("node:path")},97742:e=>{"use strict";e.exports=require("node:process")},41041:e=>{"use strict";e.exports=require("node:url")},56378:(e,r,s)=>{"use strict";s.r(r),s.d(r,{GlobalError:()=>o.a,__next_app__:()=>x,originalPathname:()=>m,pages:()=>c,routeModule:()=>p,tree:()=>d}),s(50503),s(25086),s(35866);var t=s(23191),a=s(88716),n=s(37922),o=s.n(n),l=s(95231),i={};for(let e in l)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(i[e]=()=>l[e]);s.d(r,i);let d=["",{children:["worktrees",{children:["[id]",{children:["files",{children:["[...path]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(s.bind(s,50503)),"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/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/worktrees/[id]/files/[...path]/page.tsx"],m="/worktrees/[id]/files/[...path]/page",x={require:s,loadChunk:()=>Promise.resolve()},p=new t.AppPageRouteModule({definition:{kind:a.x.APP_PAGE,page:"/worktrees/[id]/files/[...path]/page",pathname:"/worktrees/[id]/files/[...path]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},47578:(e,r,s)=>{Promise.resolve().then(s.bind(s,84442))},84442:(e,r,s)=>{"use strict";s.r(r),s.d(r,{default:()=>p});var t=s(10326),a=s(17577),n=s(35047),o=s(6162),l=s(77758),i=s(83173),d=s(26394),c=s(42283),m=s(81194),x=s(89918);function p(){let e=(0,n.useRouter)(),r=(0,n.useParams)(),s=(0,o.T)("common");r.id;let p=r.path.join("/"),[u,h]=(0,a.useState)(null),[g,b]=(0,a.useState)(!0),[f,y]=(0,a.useState)(null),j=u?.extension==="md"||u?.extension==="markdown";return(0,t.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[t.jsx("div",{className:"sticky top-0 z-10 bg-white border-b border-gray-200 shadow-sm",children:(0,t.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-3 flex items-center gap-3",children:[(0,t.jsxs)("button",{onClick:()=>e.back(),className:"flex items-center gap-2 text-gray-600 hover:text-gray-900 transition-colors","aria-label":s("back"),children:[t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),t.jsx("span",{className:"hidden sm:inline",children:s("back")})]}),t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:p})})]})}),(0,t.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-6",children:[g&&t.jsx(l.Zb,{padding:"lg",children:(0,t.jsxs)("div",{className:"flex items-center justify-center py-12",children:[t.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"}),t.jsx("p",{className:"ml-3 text-gray-600",children:"Loading file..."})]})}),f&&t.jsx(l.Zb,{padding:"lg",children:t.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[t.jsx("svg",{className:"w-5 h-5 text-red-600 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),t.jsx("p",{className:"text-sm text-red-800",children:f})]})})}),u&&!g&&!f&&(0,t.jsxs)(l.Zb,{padding:"none",children:[t.jsx("div",{className:"bg-gray-100 px-4 py-3 border-b border-gray-200",children:(0,t.jsxs)("p",{className:"text-xs text-gray-600 font-mono break-all",children:[u.worktreePath,"/",u.path]})}),t.jsx("div",{className:"p-6 sm:p-8 bg-white",children:u.isVideo?t.jsx(x.R,{src:u.content,mimeType:u.mimeType}):u.isImage?t.jsx(m.O,{src:u.content,alt:u.path,mimeType:u.mimeType}):j?t.jsx("div",{className:"prose prose-slate max-w-none prose-headings:font-semibold prose-h1:text-3xl prose-h1:border-b prose-h1:pb-2 prose-h2:text-2xl prose-h2:border-b prose-h2:pb-2 prose-h3:text-xl prose-a:text-blue-600 prose-a:no-underline hover:prose-a:underline prose-pre:bg-gray-100 prose-pre:border prose-pre:border-gray-200 prose-code:text-sm prose-code:bg-gray-100 prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:before:content-none prose-code:after:content-none prose-img:rounded-lg prose-img:shadow-md",children:t.jsx(i.UG,{remarkPlugins:[d.Z],rehypePlugins:[c.Z],components:{code:({inline:e,className:r,children:s,...a})=>e?t.jsx("code",{className:"bg-gray-100 text-gray-800 px-1.5 py-0.5 rounded text-sm font-mono",...a,children:s}):t.jsx("code",{className:r,...a,children:s}),pre:({children:e})=>t.jsx("pre",{className:"bg-gray-50 border border-gray-200 rounded-md p-4 overflow-x-auto",children:e}),table:({children:e})=>t.jsx("div",{className:"overflow-x-auto",children:t.jsx("table",{className:"border-collapse border border-gray-300",children:e})}),th:({children:e})=>t.jsx("th",{className:"border border-gray-300 bg-gray-100 px-4 py-2 text-left font-semibold",children:e}),td:({children:e})=>t.jsx("td",{className:"border border-gray-300 px-4 py-2",children:e}),blockquote:({children:e})=>t.jsx("blockquote",{className:"border-l-4 border-gray-300 pl-4 italic text-gray-700",children:e})},children:u.content})}):t.jsx("pre",{className:"bg-gray-50 border border-gray-200 rounded-md p-4 overflow-x-auto text-sm",children:t.jsx("code",{className:`language-${u.extension}`,children:u.content})})})]})]})]})}},28676:(e,r,s)=>{"use strict";s.d(r,{u:()=>l});var t=s(10326),a=s(17577),n=s(60962),o=s(22202);function l({isOpen:e,onClose:r,title:s,children:l,size:i="lg",showCloseButton:d=!0,disableClose:c=!1}){let m=(0,a.useRef)(null);return e?(0,n.createPortal)((0,t.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:o.k.MODAL},children:[t.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:c?void 0:r}),t.jsx("div",{className:"relative flex min-h-full items-center justify-center p-2 sm:p-4",children:(0,t.jsxs)("div",{ref:m,className:`relative w-full ${{sm:"max-w-[calc(100vw-2rem)] sm:max-w-md",md:"max-w-[calc(100vw-2rem)] sm:max-w-2xl",lg:"max-w-[calc(100vw-2rem)] sm:max-w-4xl",xl:"max-w-[calc(100vw-2rem)] sm:max-w-6xl",full:"max-w-[calc(100vw-2rem)] sm:max-w-[95vw]"}[i]} max-h-[calc(100vh-1rem)] sm:max-h-[calc(100vh-2rem)] flex flex-col bg-white rounded-lg shadow-xl transform transition-all`,children:[(s||d)&&(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-gray-200 flex-shrink-0",children:[t.jsx("h3",{className:"text-base sm:text-lg font-semibold text-gray-900 truncate pr-2",children:s}),d&&t.jsx("button",{onClick:r,className:"text-gray-400 hover:text-gray-600 transition-colors flex-shrink-0",children:t.jsx("svg",{className:"w-5 h-5 sm:w-6 sm:h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),t.jsx("div",{className:"px-4 sm:px-6 py-3 sm:py-4 overflow-y-auto flex-1 min-h-0",children:l})]})})]}),document.body):null}},77758:(e,r,s)=>{"use strict";s.d(r,{Ct:()=>d,zx:()=>a,Zb:()=>n,aY:()=>i,Ol:()=>o,ll:()=>l,u_:()=>c.u});var t=s(10326);function a({variant:e="primary",size:r="md",fullWidth:s=!1,loading:a=!1,disabled:n,className:o="",children:l,...i}){let d=["btn",{primary:"btn-primary",secondary:"btn-secondary",danger:"btn-danger",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500"}[e],{sm:"btn-sm",md:"",lg:"btn-lg"}[r],s?"w-full":"",n||a?"opacity-50 cursor-not-allowed":"",o].filter(Boolean).join(" ");return(0,t.jsxs)("button",{className:d,disabled:n||a,...i,children:[a&&(0,t.jsxs)("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l]})}function n({hover:e=!1,padding:r="md",className:s="",children:a,...n}){let o=["card",e?"card-hover":"",{none:"",sm:"p-3",md:"p-4",lg:"p-6"}[r],s].filter(Boolean).join(" ");return t.jsx("div",{className:o,...n,children:a})}function o({className:e="",children:r,...s}){return t.jsx("div",{className:`mb-3 ${e}`,...s,children:r})}function l({className:e="",children:r,...s}){return t.jsx("h3",{className:`text-lg font-semibold text-gray-900 ${e}`,...s,children:r})}function i({className:e="",children:r,...s}){return t.jsx("div",{className:e,...s,children:r})}function d({variant:e="gray",dot:r=!1,className:s="",children:a,...n}){let o=["badge",{success:"badge-success",warning:"badge-warning",error:"badge-error",info:"badge-info",gray:"badge-gray"}[e],s].filter(Boolean).join(" ");return(0,t.jsxs)("span",{className:o,...n,children:[r&&t.jsx("span",{className:`mr-1.5 inline-block h-2 w-2 rounded-full ${{success:"bg-green-600",warning:"bg-yellow-600",error:"bg-red-600",info:"bg-blue-600",gray:"bg-gray-600"}[e]}`,"aria-hidden":"true"}),a]})}s(17577);var c=s(28676)},81194:(e,r,s)=>{"use strict";s.d(r,{O:()=>n});var t=s(10326),a=s(17577);function n({src:e,alt:r,onError:s}){let[n,o]=(0,a.useState)(!1);return n?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-gray-500",children:[t.jsx("svg",{className:"w-16 h-16 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),t.jsx("p",{className:"text-sm",children:"Failed to load image"}),t.jsx("p",{className:"text-xs text-gray-400 mt-1",children:r})]}):t.jsx("div",{className:"flex items-center justify-center p-4",children:t.jsx("img",{src:e,alt:r,onError:()=>{o(!0),s?.()},style:{maxWidth:"100%",maxHeight:"500px",objectFit:"contain"},className:"rounded-lg shadow-sm"})})}},89918:(e,r,s)=>{"use strict";s.d(r,{R:()=>n});var t=s(10326),a=s(17577);function n({src:e,onError:r}){let[s,n]=(0,a.useState)(!0),[o,l]=(0,a.useState)(!1);return o?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-gray-500",children:[t.jsx("svg",{className:"w-16 h-16 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})}),t.jsx("p",{className:"text-sm",children:"Failed to load video"})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center p-4",children:[s&&(0,t.jsxs)("div",{className:"flex items-center justify-center py-8",children:[t.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"}),t.jsx("p",{className:"ml-3 text-gray-600",children:"Loading video..."})]}),t.jsx("video",{controls:!0,src:e,onLoadedData:()=>{n(!1)},onError:()=>{n(!1),l(!0),r?.()},style:{maxWidth:"100%",maxHeight:"500px",display:s?"none":"block"},className:"rounded-lg shadow-sm",children:"Your browser does not support the video tag."})]})}},22202:(e,r,s)=>{"use strict";s.d(r,{k:()=>t});let t={DROPDOWN:10,SIDEBAR:30,MODAL:50,MAXIMIZED_EDITOR:55,TOAST:60,CONTEXT_MENU:70}},50503:(e,r,s)=>{"use strict";s.r(r),s.d(r,{default:()=>t});let t=(0,s(68570).createProxy)(String.raw`/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/page.tsx#default`)},63601:(e,r,s)=>{"use strict";s.r(r),s.d(r,{default:()=>a});var t=s(66621);let a=e=>[{type:"image/png",sizes:"180x180",url:(0,t.fillMetadataSegment)(".",e.params,"apple-icon.png")+"?31a89e65aa4ac65b"}]},71150:(e,r,s)=>{"use strict";s.r(r),s.d(r,{default:()=>a});var t=s(66621);let a=e=>[{type:"image/png",sizes:"32x32",url:(0,t.fillMetadataSegment)(".",e.params,"icon.png")+"?32d9127ba30ee286"}]}};var r=require("../../../../../webpack-runtime.js");r.C(e);var s=e=>r(r.s=e),t=r.X(0,[8948,1287,6621,7458,3860],()=>s(56378));module.exports=t})();
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/worktrees/[id]/files/[...path]/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"80":{"*":{"id":"41868","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"79671","name":"*","chunks":[],"async":false}},"12846":{"*":{"id":"12994","name":"*","chunks":[],"async":false}},"18828":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36093":{"*":{"id":"56055","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"41845":{"*":{"id":"37398","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"66677":{"*":{"id":"42106","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","816","static/chunks/816-af44cb865b0c980e.js","3185","static/chunks/app/layout-07755491d5d57242.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","816","static/chunks/816-af44cb865b0c980e.js","3185","static/chunks/app/layout-07755491d5d57242.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","816","static/chunks/816-af44cb865b0c980e.js","5970","static/chunks/5970-dc8fb1c8c0217636.js","1931","static/chunks/app/page-a6593b9640df66a6.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/page.tsx":{"id":50653,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","1038","static/chunks/1038-3509435b68c0967e.js","5441","static/chunks/app/worktrees/%5Bid%5D/files/%5B...path%5D/page-ce9ac3658f2b7d91.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":36093,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","1038","static/chunks/1038-3509435b68c0967e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","8864","static/chunks/8864-2f60eadc8404fdd0.js","816","static/chunks/816-af44cb865b0c980e.js","5970","static/chunks/5970-dc8fb1c8c0217636.js","130","static/chunks/app/worktrees/%5Bid%5D/page-1b8e4c49fbaf3f99.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":41845,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/a69d9c70fce558b4.css"],"/home/runner/work/CommandMate/CommandMate/src/app/page":[],"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page":["static/css/5eacd01f773eed7f.css"],"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/page":[]}}
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/worktrees/[id]/files/[...path]/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"80":{"*":{"id":"41868","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"79671","name":"*","chunks":[],"async":false}},"12846":{"*":{"id":"12994","name":"*","chunks":[],"async":false}},"18390":{"*":{"id":"74810","name":"*","chunks":[],"async":false}},"18828":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"41845":{"*":{"id":"37398","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"66677":{"*":{"id":"42106","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","816","static/chunks/816-af44cb865b0c980e.js","3185","static/chunks/app/layout-07755491d5d57242.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","816","static/chunks/816-af44cb865b0c980e.js","3185","static/chunks/app/layout-07755491d5d57242.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","816","static/chunks/816-af44cb865b0c980e.js","5970","static/chunks/5970-2e18108d0cabd8af.js","1931","static/chunks/app/page-a6593b9640df66a6.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":18390,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","1038","static/chunks/1038-3509435b68c0967e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","8864","static/chunks/8864-2f60eadc8404fdd0.js","816","static/chunks/816-af44cb865b0c980e.js","5970","static/chunks/5970-2e18108d0cabd8af.js","130","static/chunks/app/worktrees/%5Bid%5D/page-dc0dde49ed95076f.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/page.tsx":{"id":50653,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","1038","static/chunks/1038-3509435b68c0967e.js","5441","static/chunks/app/worktrees/%5Bid%5D/files/%5B...path%5D/page-4a3c0861367e0391.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":41845,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/7c6675f6f65b4990.css"],"/home/runner/work/CommandMate/CommandMate/src/app/page":[],"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page":["static/css/5eacd01f773eed7f.css"],"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/page":[]}}