commandmate 0.3.3 → 0.3.5

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 (103) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +13 -13
  3. package/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/cache/config.json +3 -3
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/1.pack +0 -0
  9. package/.next/cache/webpack/client-production/2.pack +0 -0
  10. package/.next/cache/webpack/client-production/index.pack +0 -0
  11. package/.next/cache/webpack/client-production/index.pack.old +0 -0
  12. package/.next/cache/webpack/edge-server-production/0.pack +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/react-loadable-manifest.json +13 -7
  19. package/.next/required-server-files.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/route.js +2 -2
  23. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  24. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  25. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  26. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  27. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  28. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
  29. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js.nft.json +1 -1
  30. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +1 -1
  31. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js.nft.json +1 -1
  32. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  33. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  34. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  35. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  36. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  37. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  38. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  39. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  40. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  41. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  42. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +1 -1
  43. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js.nft.json +1 -1
  44. package/.next/server/app/api/worktrees/[id]/schedules/route.js +1 -1
  45. package/.next/server/app/api/worktrees/[id]/schedules/route.js.nft.json +1 -1
  46. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  47. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  48. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
  49. package/.next/server/app/api/worktrees/[id]/start-polling/route.js +1 -1
  50. package/.next/server/app/api/worktrees/[id]/start-polling/route.js.nft.json +1 -1
  51. package/.next/server/app/api/worktrees/route.js +1 -1
  52. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  53. package/.next/server/app/login/page.js +1 -1
  54. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  55. package/.next/server/app/page_client-reference-manifest.js +1 -1
  56. package/.next/server/app/proxy/[...path]/route.js +1 -1
  57. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  58. package/.next/server/app/worktrees/[id]/page.js +4 -4
  59. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  60. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  61. package/.next/server/app-paths-manifest.json +4 -4
  62. package/.next/server/chunks/2314.js +1 -1
  63. package/.next/server/chunks/3074.js +1 -1
  64. package/.next/server/chunks/4952.js +1 -0
  65. package/.next/server/chunks/539.js +3 -3
  66. package/.next/server/chunks/5795.js +1 -1
  67. package/.next/server/chunks/6228.js +1 -1
  68. package/.next/server/chunks/7425.js +52 -43
  69. package/.next/server/chunks/7566.js +1 -1
  70. package/.next/server/chunks/8693.js +1 -1
  71. package/.next/server/middleware-build-manifest.js +1 -1
  72. package/.next/server/middleware-manifest.json +5 -5
  73. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  74. package/.next/server/pages/500.html +1 -1
  75. package/.next/server/server-reference-manifest.json +1 -1
  76. package/.next/static/chunks/{4327.740cc7fe2d0b5049.js → 4327.157a4c226d919531.js} +14 -14
  77. package/.next/static/chunks/5970.0df906ad5a9c9147.js +1 -0
  78. package/.next/static/chunks/{8091-274bc0716106e7fc.js → 8091-d65d2ab6daed23c6.js} +1 -1
  79. package/.next/static/chunks/app/login/page-010f02fd4b0dbc48.js +1 -0
  80. package/.next/static/chunks/app/worktrees/[id]/page-8fb4dc30b58a5681.js +1 -0
  81. package/.next/static/chunks/webpack-81c97591dd5567ac.js +1 -0
  82. package/.next/static/css/45b3a41370668314.css +3 -0
  83. package/.next/trace +5 -5
  84. package/dist/server/src/lib/claude-executor.js +14 -3
  85. package/dist/server/src/lib/cli-patterns.js +99 -20
  86. package/dist/server/src/lib/cli-tools/manager.js +5 -3
  87. package/dist/server/src/lib/cli-tools/opencode-config.js +236 -0
  88. package/dist/server/src/lib/cli-tools/opencode.js +188 -0
  89. package/dist/server/src/lib/cli-tools/types.js +47 -6
  90. package/dist/server/src/lib/cli-tools/vibe-local.js +12 -3
  91. package/dist/server/src/lib/db-migrations.js +17 -1
  92. package/dist/server/src/lib/db.js +39 -2
  93. package/dist/server/src/lib/prompt-detector.js +23 -4
  94. package/dist/server/src/lib/response-poller.js +392 -28
  95. package/package.json +5 -4
  96. package/.next/server/chunks/9446.js +0 -1
  97. package/.next/static/chunks/app/login/page-2d42204ba87cd136.js +0 -1
  98. package/.next/static/chunks/app/worktrees/[id]/page-78580947c201d698.js +0 -1
  99. package/.next/static/chunks/webpack-3c0ee3ce5b546818.js +0 -1
  100. package/.next/static/css/e85de230ef5ddc40.css +0 -3
  101. /package/.next/static/chunks/app/{page-060057e02b841125.js → page-9e523a8f415bc707.js} +0 -0
  102. /package/.next/static/{O7EDFfAYQNe_HRbORxQAC → p3hosTZoJ22r35fWwUoLr}/_buildManifest.js +0 -0
  103. /package/.next/static/{O7EDFfAYQNe_HRbORxQAC → p3hosTZoJ22r35fWwUoLr}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";(()=>{var e={};e.id=2702,e.ids=[2702],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},98216:e=>{e.exports=require("net")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},82452:e=>{e.exports=require("tls")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},41306:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>A,patchFetch:()=>j,requestAsyncStorage:()=>R,routeModule:()=>y,serverHooks:()=>b,staticGenerationAsyncStorage:()=>k});var s={};r.r(s),r.d(s,{POST:()=>q});var n=r(49303),o=r(88716),i=r(60670),a=r(87070),l=r(97425),u=r(75748),c=r(23816),d=r(83513),p=r(59991),m=r(89194),g=r(68507),f=r(19377);let h=[/^[╭╮╰╯│─\s]+$/,/Claude Code v[\d.]+/,/^─{10,}$/,/^❯\s*$/,/^\s*$/,/CLAUDE_HOOKS_/,/\/bin\/claude/,/@.*\s+%/,/localhost/,/:3000/,/curl.*POST/,/export\s+/,/Tips for getting started/,/Welcome back/,/\?\s*for shortcuts/];async function x(e,t,r,s){try{let n;let o=(0,u.zl)(e,t,r),i=o?.lastCapturedLine||0;try{n=await (0,m.NA)(t,r,1e4)}catch{return console.log(`[savePendingAssistantResponse] Failed to capture session output for ${t}`),null}if(!n)return null;let a=n.split("\n"),l=a.length;for(;l>0&&""===a[l-1].trim();)l--;let c=l,{bufferReset:d,reason:x}=c>0&&i>25&&c+25<i?{bufferReset:!0,reason:"shrink"}:c>0&&i>50&&c<50?{bufferReset:!0,reason:"restart"}:{bufferReset:!1,reason:null};if(d&&console.log(`[savePendingAssistantResponse] Buffer reset detected (${x}): current=${c}, last=${i}`),!d&&c<=i)return c<i&&((0,u.IH)(e,t,r,c),console.log(`[savePendingAssistantResponse] Corrected stale position (${i} → ${c})`)),null;let v=a.slice(d?0:i).join("\n"),w="claude"===r?function(e,t){if(!e||""===e.trim())return"";if("claude"!==t)return e.trim();let r=(0,f.vp)(e).split("\n"),s=r.length;for(let e=r.length-1;e>=0;e--)if(/^❯\s+\S/.test(r[e])){s=e;break}return r.slice(0,s).filter(e=>{let t=e.trim();return!!t&&!h.some(e=>e.test(t))}).join("\n").trim()}(v,r):function(e,t){switch(t){case"claude":return(0,p.ci)(e);case"gemini":return(0,p.RJ)(e);default:return e.trim()}}(v,r);if(!w||""===w.trim())return(0,u.IH)(e,t,r,c),console.log(`[savePendingAssistantResponse] Cleaned response is empty, updating position to ${c}`),null;let $=new Date(s.getTime()-1),q=(0,u.tn)(e,{worktreeId:t,role:"assistant",content:w,messageType:"normal",timestamp:$,cliToolId:r});return(0,u.IH)(e,t,r,c),(0,g.ps)("message",{worktreeId:t,message:q}),console.log(`[savePendingAssistantResponse] Saved assistant response (lines ${i}-${c})`),q}catch(e){return console.error("[savePendingAssistantResponse] Error:",e),null}}var v=r(3979);let w=d.tK;function $(e){return e instanceof Error?e.message:"Unknown error"}async function q(e,{params:t}){try{let r=(0,l.getDbInstance)(),s=(0,u.gU)(r,t.id);if(!s)return a.NextResponse.json({error:`Worktree '${t.id}' not found`},{status:404});let n=await e.json();if(!n.content||"string"!=typeof n.content||""===n.content.trim())return a.NextResponse.json({error:"Message content is required and must be a non-empty string"},{status:400});let o=n.cliToolId||s.cliToolId||"claude";if(!w.includes(o))return a.NextResponse.json({error:`Invalid CLI tool ID: ${o}. Must be one of: ${w.join(", ")}`},{status:400});let i=c.g.getInstance().getTool(o);if(!await i.isInstalled())return a.NextResponse.json({error:`${i.name} is not installed. Please install it first.`},{status:503});if(!await i.isRunning(t.id))try{await i.startSession(t.id,s.path);let e=(0,u.Q7)(r,t.id);if(null===e)try{let e=await (0,v.v)(s.path,null);"(unknown)"!==e.currentBranch&&"(detached HEAD)"!==e.currentBranch&&((0,u.Ek)(r,t.id,e.currentBranch),console.log(`[send] Saved initial branch for ${t.id}: ${e.currentBranch}`))}catch(e){console.error("[send] Failed to get/save initial branch:",e)}}catch(e){return console.error(`Failed to start ${i.name} session:`,e),a.NextResponse.json({error:`Failed to start ${i.name} session: ${$(e)}`},{status:500})}let d=new Date;try{await x(r,t.id,o,d)}catch(e){console.error("[send] Failed to save pending assistant response:",e)}try{await i.sendMessage(t.id,n.content)}catch(e){return console.error(`Failed to send message to ${i.name}:`,e),a.NextResponse.json({error:`Failed to send message to ${i.name}: ${$(e)}`},{status:500})}let m=(0,u.tn)(r,{worktreeId:t.id,role:"user",content:n.content,messageType:"normal",timestamp:d,cliToolId:o});return(0,u.OK)(r,t.id,n.content,d),(0,u.Mf)(r,t.id,o),console.log(`✓ Cleared in-progress message for ${t.id} (${o})`),(0,p.cn)(t.id,o),a.NextResponse.json(m,{status:201})}catch(e){return console.error("Error sending message:",e),a.NextResponse.json({error:"Failed to send message"},{status:500})}}let y=new n.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/worktrees/[id]/send/route",pathname:"/api/worktrees/[id]/send",filename:"route",bundlePath:"app/api/worktrees/[id]/send/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/send/route.ts",nextConfigOutput:"",userland:s}),{requestAsyncStorage:R,staticGenerationAsyncStorage:k,serverHooks:b}=y,A="/api/worktrees/[id]/send/route";function j(){return(0,i.patchFetch)({serverHooks:b,staticGenerationAsyncStorage:k})}},3979:(e,t,r)=>{r.d(t,{v:()=>i});var s=r(61282);let n=(0,r(21764).promisify)(s.execFile);async function o(e,t){try{let{stdout:r}=await n("git",e,{cwd:t,timeout:1e3});return r.trim()}catch(t){return console.error("[git-utils] Git command failed:",{args:e,error:t instanceof Error?t.message:"Unknown error"}),null}}async function i(e,t){let r;let s=await o(["rev-parse","--abbrev-ref","HEAD"],e);r=null===s?"(unknown)":"HEAD"===s?"(detached HEAD)":s;let n=await o(["rev-parse","--short","HEAD"],e),i=await o(["status","--porcelain"],e);return{currentBranch:r,initialBranch:t,isBranchMismatch:null!==t&&"(unknown)"!==r&&"(detached HEAD)"!==r&&r!==t,commitHash:n??"(unknown)",isDirty:null!==i&&i.length>0}}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[8948,5972,3853,4893,7425,7566,9446],()=>r(41306));module.exports=s})();
1
+ "use strict";(()=>{var e={};e.id=2702,e.ids=[2702],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},98216:e=>{e.exports=require("net")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},82452:e=>{e.exports=require("tls")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},41306:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>A,patchFetch:()=>j,requestAsyncStorage:()=>R,routeModule:()=>q,serverHooks:()=>b,staticGenerationAsyncStorage:()=>k});var s={};r.r(s),r.d(s,{POST:()=>y});var n=r(49303),o=r(88716),i=r(60670),a=r(87070),l=r(97425),u=r(75748),c=r(55837),d=r(83513),p=r(59991),m=r(89194),g=r(68507),f=r(19377);let h=[/^[╭╮╰╯│─\s]+$/,/Claude Code v[\d.]+/,/^─{10,}$/,/^❯\s*$/,/^\s*$/,/CLAUDE_HOOKS_/,/\/bin\/claude/,/@.*\s+%/,/localhost/,/:3000/,/curl.*POST/,/export\s+/,/Tips for getting started/,/Welcome back/,/\?\s*for shortcuts/];async function x(e,t,r,s){try{let n;if("opencode"===r)return null;let o=(0,u.zl)(e,t,r),i=o?.lastCapturedLine||0;try{n=await (0,m.NA)(t,r,1e4)}catch{return console.log(`[savePendingAssistantResponse] Failed to capture session output for ${t}`),null}if(!n)return null;let a=n.split("\n"),l=a.length;for(;l>0&&""===a[l-1].trim();)l--;let c=l,{bufferReset:d,reason:x}=c>0&&i>25&&c+25<i?{bufferReset:!0,reason:"shrink"}:c>0&&i>50&&c<50?{bufferReset:!0,reason:"restart"}:{bufferReset:!1,reason:null};if(d&&console.log(`[savePendingAssistantResponse] Buffer reset detected (${x}): current=${c}, last=${i}`),!d&&c<=i)return c<i&&((0,u.IH)(e,t,r,c),console.log(`[savePendingAssistantResponse] Corrected stale position (${i} → ${c})`)),null;let v=a.slice(d?0:i).join("\n"),$="claude"===r?function(e,t){if(!e||""===e.trim())return"";if("claude"!==t)return e.trim();let r=(0,f.vp)(e).split("\n"),s=r.length;for(let e=r.length-1;e>=0;e--)if(/^❯\s+\S/.test(r[e])){s=e;break}return r.slice(0,s).filter(e=>{let t=e.trim();return!!t&&!h.some(e=>e.test(t))}).join("\n").trim()}(v,r):function(e,t){switch(t){case"claude":return(0,p.ci)(e);case"gemini":return(0,p.RJ)(e);case"opencode":return(0,p.Di)(e);default:return e.trim()}}(v,r);if(!$||""===$.trim())return(0,u.IH)(e,t,r,c),console.log(`[savePendingAssistantResponse] Cleaned response is empty, updating position to ${c}`),null;let w=new Date(s.getTime()-1),y=(0,u.tn)(e,{worktreeId:t,role:"assistant",content:$,messageType:"normal",timestamp:w,cliToolId:r});return(0,u.IH)(e,t,r,c),(0,g.ps)("message",{worktreeId:t,message:y}),console.log(`[savePendingAssistantResponse] Saved assistant response (lines ${i}-${c})`),y}catch(e){return console.error("[savePendingAssistantResponse] Error:",e),null}}var v=r(3979);let $=d.tK;function w(e){return e instanceof Error?e.message:"Unknown error"}async function y(e,{params:t}){try{let r=(0,l.getDbInstance)(),s=(0,u.gU)(r,t.id);if(!s)return a.NextResponse.json({error:`Worktree '${t.id}' not found`},{status:404});let n=await e.json(),o="string"==typeof n.content?n.content.trim():"";if(""===o)return a.NextResponse.json({error:"Message content is required and must be a non-empty string"},{status:400});let i=n.cliToolId||s.cliToolId||"claude";if(!$.includes(i))return a.NextResponse.json({error:`Invalid CLI tool ID: ${i}. Must be one of: ${$.join(", ")}`},{status:400});let d=c.g.getInstance().getTool(i);if(!await d.isInstalled())return a.NextResponse.json({error:`${d.name} is not installed. Please install it first.`},{status:503});if(!await d.isRunning(t.id))try{await d.startSession(t.id,s.path);let e=(0,u.Q7)(r,t.id);if(null===e)try{let e=await (0,v.v)(s.path,null);"(unknown)"!==e.currentBranch&&"(detached HEAD)"!==e.currentBranch&&((0,u.Ek)(r,t.id,e.currentBranch),console.log(`[send] Saved initial branch for ${t.id}: ${e.currentBranch}`))}catch(e){console.error("[send] Failed to get/save initial branch:",e)}}catch(e){return console.error(`Failed to start ${d.name} session:`,e),a.NextResponse.json({error:`Failed to start ${d.name} session: ${w(e)}`},{status:500})}let m=new Date;try{await x(r,t.id,i,m)}catch(e){console.error("[send] Failed to save pending assistant response:",e)}let g=null;try{let e=(0,u._U)(r,t.id,void 0,1,i);e.length>0&&"user"===e[0].role&&e[0].content===o&&(g=e[0].id)}catch(e){console.error("[send] Failed to detect orphaned messages:",e)}try{await d.sendMessage(t.id,n.content)}catch(e){return console.error(`Failed to send message to ${d.name}:`,e),a.NextResponse.json({error:`Failed to send message to ${d.name}: ${w(e)}`},{status:500})}let f=(0,u.tn)(r,{worktreeId:t.id,role:"user",content:n.content,messageType:"normal",timestamp:m,cliToolId:i});if(g)try{(0,u.ls)(r,g)&&console.log(`[send] Cleaned up orphaned user message ${g} for ${t.id} (${i})`)}catch(e){console.error(`[send] Failed to clean up orphaned message ${g}:`,e)}return(0,u.OK)(r,t.id,n.content,m),(0,u.Mf)(r,t.id,i),console.log(`✓ Cleared in-progress message for ${t.id} (${i})`),(0,p.cn)(t.id,i),a.NextResponse.json(f,{status:201})}catch(e){return console.error("Error sending message:",e),a.NextResponse.json({error:"Failed to send message"},{status:500})}}let q=new n.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/worktrees/[id]/send/route",pathname:"/api/worktrees/[id]/send",filename:"route",bundlePath:"app/api/worktrees/[id]/send/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/send/route.ts",nextConfigOutput:"",userland:s}),{requestAsyncStorage:R,staticGenerationAsyncStorage:k,serverHooks:b}=q,A="/api/worktrees/[id]/send/route";function j(){return(0,i.patchFetch)({serverHooks:b,staticGenerationAsyncStorage:k})}},3979:(e,t,r)=>{r.d(t,{v:()=>i});var s=r(61282);let n=(0,r(21764).promisify)(s.execFile);async function o(e,t){try{let{stdout:r}=await n("git",e,{cwd:t,timeout:1e3});return r.trim()}catch(t){return console.error("[git-utils] Git command failed:",{args:e,error:t instanceof Error?t.message:"Unknown error"}),null}}async function i(e,t){let r;let s=await o(["rev-parse","--abbrev-ref","HEAD"],e);r=null===s?"(unknown)":"HEAD"===s?"(detached HEAD)":s;let n=await o(["rev-parse","--short","HEAD"],e),i=await o(["status","--porcelain"],e);return{currentBranch:r,initialBranch:t,isBranchMismatch:null!==t&&"(unknown)"!==r&&"(detached HEAD)"!==r&&r!==t,commitHash:n??"(unknown)",isDirty:null!==i&&i.length>0}}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[8948,5972,3853,4893,7425,7566,4952],()=>r(41306));module.exports=s})();
@@ -1 +1 @@
1
- {"version":1,"files":["../../../../../../../data/cm.db","../../../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../../../node_modules/better-sqlite3/package.json","../../../../../../../node_modules/bindings/bindings.js","../../../../../../../node_modules/bindings/package.json","../../../../../../../node_modules/file-uri-to-path/index.js","../../../../../../../node_modules/file-uri-to-path/package.json","../../../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../../node_modules/next/package.json","../../../../../../../package.json","../../../../../../package.json","../../../../../chunks/3853.js","../../../../../chunks/4893.js","../../../../../chunks/5972.js","../../../../../chunks/7425.js","../../../../../chunks/7566.js","../../../../../chunks/8948.js","../../../../../chunks/9446.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/4952.js","../../../../../chunks/5972.js","../../../../../chunks/7425.js","../../../../../chunks/7566.js","../../../../../chunks/8948.js","../../../../../webpack-runtime.js"]}
@@ -1 +1 @@
1
- "use strict";(()=>{var e={};e.id=7479,e.ids=[7479],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},84770:e=>{e.exports=require("crypto")},92048:e=>{e.exports=require("fs")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},88424:(e,a,t)=>{t.r(a),t.d(a,{originalPathname:()=>S,patchFetch:()=>y,requestAsyncStorage:()=>g,routeModule:()=>f,serverHooks:()=>P,staticGenerationAsyncStorage:()=>x});var r={};t.r(r),t.d(r,{GET:()=>h});var s=t(49303),o=t(88716),n=t(60670),d=t(87070),i=t(97425),c=t(75748),l=t(53013),u=t(38056);let p=[{name:"clear",description:"Clear conversation history",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"compact",description:"Compact context to reduce token usage",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"resume",description:"Resume previous conversation",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"rewind",description:"Rewind to previous conversation state",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"config",description:"Open configuration settings",category:"standard-config",isStandard:!0,source:"standard",filePath:""},{name:"model",description:"Switch AI model",category:"standard-config",isStandard:!0,source:"standard",filePath:""},{name:"permissions",description:"View or update tool permissions",category:"standard-config",isStandard:!0,source:"standard",filePath:""},{name:"status",description:"Check session status",category:"standard-monitor",isStandard:!0,source:"standard",filePath:""},{name:"context",description:"Show context window usage",category:"standard-monitor",isStandard:!0,source:"standard",filePath:""},{name:"cost",description:"Display token and cost usage",category:"standard-monitor",isStandard:!0,source:"standard",filePath:""},{name:"review",description:"Review code changes",category:"standard-git",isStandard:!0,source:"standard",filePath:""},{name:"pr-comments",description:"Show PR comments",category:"standard-git",isStandard:!0,source:"standard",filePath:""},{name:"help",description:"Show all available commands",category:"standard-util",isStandard:!0,source:"standard",filePath:""},{name:"doctor",description:"Check installation health",category:"standard-util",isStandard:!0,source:"standard",filePath:""},{name:"export",description:"Export conversation history",category:"standard-util",isStandard:!0,source:"standard",filePath:""},{name:"todos",description:"Show TODO list",category:"standard-util",isStandard:!0,source:"standard",filePath:""},{name:"new",description:"Start a new conversation in same session",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"undo",description:"Undo the last Codex action",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"logout",description:"Sign out from Codex",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"quit",description:"Exit Codex CLI",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"approvals",description:"Change auto-execution approval level",category:"standard-config",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"diff",description:"Show Git diff (including untracked files)",category:"standard-git",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"mention",description:"Attach file/folder for next interaction",category:"standard-util",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"mcp",description:"List available MCP tools",category:"standard-util",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"init",description:"Generate AGENTS.md template in current directory",category:"standard-util",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"feedback",description:"Send feedback to Codex team",category:"standard-util",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]}];var m=t(83513);async function h(e,{params:a}){try{var t,r;let{id:s}=await a,o=(0,i.getDbInstance)(),n=(0,c.gU)(o,s);if(!n)return d.NextResponse.json({error:"Worktree not found"},{status:404});if(!(!(!(t=n.path)||""===t.trim()||t.includes(".."))&&t.startsWith("/")&&(function(){let e=process.env.ALLOWED_WORKTREE_PATHS;return e?e.split(",").map(e=>e.trim()).filter(e=>e.length>0):["/Users","/home","/var","/tmp","/opt"]})().some(e=>t.startsWith(e))))return console.error(`[slash-commands API] Invalid worktree path detected: ${s}`),d.NextResponse.json({error:"Invalid worktree configuration"},{status:400});let h=(r=e.nextUrl.searchParams.get("cliTool"))&&m.tK.includes(r)?r:"claude",f=(0,u.Xr)(p),g=[];try{g=await (0,l.HL)(n.path)}catch(e){console.warn(`[slash-commands API] Could not load worktree commands: ${e}`),g=[]}let x=(0,u.Nw)(f,g),P=(0,u.M6)(x,h),S=P.flatMap(e=>e.commands),y=S.filter(e=>"standard"===e.source).length,w=S.filter(e=>"worktree"===e.source).length,v=S.filter(e=>"skill"===e.source).length;return d.NextResponse.json({groups:P,sources:{standard:y,worktree:w,mcbd:0,skill:v},cliTool:h})}catch(e){return console.error("[slash-commands API] Error:",e),d.NextResponse.json({error:"Failed to load slash commands"},{status:500})}}let f=new s.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/worktrees/[id]/slash-commands/route",pathname:"/api/worktrees/[id]/slash-commands",filename:"route",bundlePath:"app/api/worktrees/[id]/slash-commands/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/slash-commands/route.ts",nextConfigOutput:"",userland:r}),{requestAsyncStorage:g,staticGenerationAsyncStorage:x,serverHooks:P}=f,S="/api/worktrees/[id]/slash-commands/route";function y(){return(0,n.patchFetch)({serverHooks:P,staticGenerationAsyncStorage:x})}}};var a=require("../../../../../webpack-runtime.js");a.C(e);var t=e=>a(a.s=e),r=a.X(0,[8948,5972,3673,7425,3013],()=>t(88424));module.exports=r})();
1
+ "use strict";(()=>{var e={};e.id=7479,e.ids=[7479],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},84770:e=>{e.exports=require("crypto")},92048:e=>{e.exports=require("fs")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},88424:(e,a,t)=>{t.r(a),t.d(a,{originalPathname:()=>x,patchFetch:()=>y,requestAsyncStorage:()=>f,routeModule:()=>g,serverHooks:()=>P,staticGenerationAsyncStorage:()=>S});var r={};t.r(r),t.d(r,{GET:()=>h});var s=t(49303),o=t(88716),n=t(60670),d=t(87070),i=t(97425),c=t(75748),l=t(53013),u=t(38056);let p=[{name:"clear",description:"Clear conversation history",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"compact",description:"Compact context to reduce token usage",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["claude","opencode"]},{name:"resume",description:"Resume previous conversation",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"rewind",description:"Rewind to previous conversation state",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"config",description:"Open configuration settings",category:"standard-config",isStandard:!0,source:"standard",filePath:""},{name:"model",description:"Switch AI model",category:"standard-config",isStandard:!0,source:"standard",filePath:""},{name:"permissions",description:"View or update tool permissions",category:"standard-config",isStandard:!0,source:"standard",filePath:""},{name:"status",description:"Check session status",category:"standard-monitor",isStandard:!0,source:"standard",filePath:""},{name:"context",description:"Show context window usage",category:"standard-monitor",isStandard:!0,source:"standard",filePath:""},{name:"cost",description:"Display token and cost usage",category:"standard-monitor",isStandard:!0,source:"standard",filePath:""},{name:"review",description:"Review code changes",category:"standard-git",isStandard:!0,source:"standard",filePath:""},{name:"pr-comments",description:"Show PR comments",category:"standard-git",isStandard:!0,source:"standard",filePath:""},{name:"help",description:"Show all available commands",category:"standard-util",isStandard:!0,source:"standard",filePath:"",cliTools:["claude","opencode"]},{name:"doctor",description:"Check installation health",category:"standard-util",isStandard:!0,source:"standard",filePath:""},{name:"export",description:"Export conversation history",category:"standard-util",isStandard:!0,source:"standard",filePath:""},{name:"todos",description:"Show TODO list",category:"standard-util",isStandard:!0,source:"standard",filePath:""},{name:"new",description:"Start a new conversation",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["codex","opencode"]},{name:"undo",description:"Undo the last Codex action",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"logout",description:"Sign out from Codex",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"quit",description:"Exit Codex CLI",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"approvals",description:"Change auto-execution approval level",category:"standard-config",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"diff",description:"Show Git diff (including untracked files)",category:"standard-git",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"mention",description:"Attach file/folder for next interaction",category:"standard-util",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"mcp",description:"List available MCP tools",category:"standard-util",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"init",description:"Generate AGENTS.md template in current directory",category:"standard-util",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"feedback",description:"Send feedback to Codex team",category:"standard-util",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"sessions",description:"Browse conversation history",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["opencode"]},{name:"connect",description:"Connect to language server",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["opencode"]},{name:"exit",description:"Exit OpenCode TUI",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["opencode"]},{name:"models",description:"Switch AI model",category:"standard-config",isStandard:!0,source:"standard",filePath:"",cliTools:["opencode"]},{name:"agents",description:"Switch agent",category:"standard-config",isStandard:!0,source:"standard",filePath:"",cliTools:["opencode"]},{name:"themes",description:"Change TUI theme",category:"standard-config",isStandard:!0,source:"standard",filePath:"",cliTools:["opencode"]},{name:"editor",description:"Open editor for long messages",category:"standard-util",isStandard:!0,source:"standard",filePath:"",cliTools:["opencode"]}];var m=t(83513);async function h(e,{params:a}){try{var t,r;let{id:s}=await a,o=(0,i.getDbInstance)(),n=(0,c.gU)(o,s);if(!n)return d.NextResponse.json({error:"Worktree not found"},{status:404});if(!(!(!(t=n.path)||""===t.trim()||t.includes(".."))&&t.startsWith("/")&&(function(){let e=process.env.ALLOWED_WORKTREE_PATHS;return e?e.split(",").map(e=>e.trim()).filter(e=>e.length>0):["/Users","/home","/var","/tmp","/opt"]})().some(e=>t.startsWith(e))))return console.error(`[slash-commands API] Invalid worktree path detected: ${s}`),d.NextResponse.json({error:"Invalid worktree configuration"},{status:400});let h=(r=e.nextUrl.searchParams.get("cliTool"))&&m.tK.includes(r)?r:"claude",g=(0,u.Xr)(p),f=[];try{f=await (0,l.HL)(n.path)}catch(e){console.warn(`[slash-commands API] Could not load worktree commands: ${e}`),f=[]}let S=(0,u.Nw)(g,f),P=(0,u.M6)(S,h),x=P.flatMap(e=>e.commands),y=x.filter(e=>"standard"===e.source).length,w=x.filter(e=>"worktree"===e.source).length,v=x.filter(e=>"skill"===e.source).length;return d.NextResponse.json({groups:P,sources:{standard:y,worktree:w,mcbd:0,skill:v},cliTool:h})}catch(e){return console.error("[slash-commands API] Error:",e),d.NextResponse.json({error:"Failed to load slash commands"},{status:500})}}let g=new s.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/worktrees/[id]/slash-commands/route",pathname:"/api/worktrees/[id]/slash-commands",filename:"route",bundlePath:"app/api/worktrees/[id]/slash-commands/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/slash-commands/route.ts",nextConfigOutput:"",userland:r}),{requestAsyncStorage:f,staticGenerationAsyncStorage:S,serverHooks:P}=g,x="/api/worktrees/[id]/slash-commands/route";function y(){return(0,n.patchFetch)({serverHooks:P,staticGenerationAsyncStorage:S})}}};var a=require("../../../../../webpack-runtime.js");a.C(e);var t=e=>a(a.s=e),r=a.X(0,[8948,5972,3673,7425,3013],()=>t(88424));module.exports=r})();
@@ -1 +1 @@
1
- "use strict";(()=>{var e={};e.id=9086,e.ids=[9086],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},98216:e=>{e.exports=require("net")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},82452:e=>{e.exports=require("tls")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},51057:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>f,patchFetch:()=>h,requestAsyncStorage:()=>g,routeModule:()=>x,serverHooks:()=>m,staticGenerationAsyncStorage:()=>q});var o={};t.r(o),t.d(o,{POST:()=>c});var s=t(49303),i=t(88716),n=t(60670),p=t(87070),a=t(97425),u=t(75748),l=t(59991),d=t(83513);async function c(e,{params:r}){try{let t=(0,a.getDbInstance)();if(!(0,u.gU)(t,r.id))return p.NextResponse.json({error:`Worktree '${r.id}' not found`},{status:404});let o=await e.json();if(!o.cliToolId||!d.tK.includes(o.cliToolId))return p.NextResponse.json({error:`Invalid CLI tool ID. Must be one of: ${d.tK.join(", ")}`},{status:400});return console.log(`[API] Manually starting polling for ${r.id} (${o.cliToolId})`),(0,l.cn)(r.id,o.cliToolId),p.NextResponse.json({success:!0,message:`Started polling for ${o.cliToolId} session`})}catch(e){return console.error("Error starting polling:",e),p.NextResponse.json({error:"Failed to start polling"},{status:500})}}let x=new s.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/[id]/start-polling/route",pathname:"/api/worktrees/[id]/start-polling",filename:"route",bundlePath:"app/api/worktrees/[id]/start-polling/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/start-polling/route.ts",nextConfigOutput:"",userland:o}),{requestAsyncStorage:g,staticGenerationAsyncStorage:q,serverHooks:m}=x,f="/api/worktrees/[id]/start-polling/route";function h(){return(0,n.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:q})}}};var r=require("../../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),o=r.X(0,[8948,5972,3853,4893,7425,7566,9446],()=>t(51057));module.exports=o})();
1
+ "use strict";(()=>{var e={};e.id=9086,e.ids=[9086],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},98216:e=>{e.exports=require("net")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},82452:e=>{e.exports=require("tls")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},51057:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>f,patchFetch:()=>h,requestAsyncStorage:()=>g,routeModule:()=>x,serverHooks:()=>m,staticGenerationAsyncStorage:()=>q});var o={};t.r(o),t.d(o,{POST:()=>c});var s=t(49303),i=t(88716),n=t(60670),p=t(87070),a=t(97425),u=t(75748),l=t(59991),d=t(83513);async function c(e,{params:r}){try{let t=(0,a.getDbInstance)();if(!(0,u.gU)(t,r.id))return p.NextResponse.json({error:`Worktree '${r.id}' not found`},{status:404});let o=await e.json();if(!o.cliToolId||!d.tK.includes(o.cliToolId))return p.NextResponse.json({error:`Invalid CLI tool ID. Must be one of: ${d.tK.join(", ")}`},{status:400});return console.log(`[API] Manually starting polling for ${r.id} (${o.cliToolId})`),(0,l.cn)(r.id,o.cliToolId),p.NextResponse.json({success:!0,message:`Started polling for ${o.cliToolId} session`})}catch(e){return console.error("Error starting polling:",e),p.NextResponse.json({error:"Failed to start polling"},{status:500})}}let x=new s.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/[id]/start-polling/route",pathname:"/api/worktrees/[id]/start-polling",filename:"route",bundlePath:"app/api/worktrees/[id]/start-polling/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/start-polling/route.ts",nextConfigOutput:"",userland:o}),{requestAsyncStorage:g,staticGenerationAsyncStorage:q,serverHooks:m}=x,f="/api/worktrees/[id]/start-polling/route";function h(){return(0,n.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:q})}}};var r=require("../../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),o=r.X(0,[8948,5972,3853,4893,7425,7566,4952],()=>t(51057));module.exports=o})();
@@ -1 +1 @@
1
- {"version":1,"files":["../../../../../../../data/cm.db","../../../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../../../node_modules/better-sqlite3/package.json","../../../../../../../node_modules/bindings/bindings.js","../../../../../../../node_modules/bindings/package.json","../../../../../../../node_modules/file-uri-to-path/index.js","../../../../../../../node_modules/file-uri-to-path/package.json","../../../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../../node_modules/next/package.json","../../../../../../../package.json","../../../../../../package.json","../../../../../chunks/3853.js","../../../../../chunks/4893.js","../../../../../chunks/5972.js","../../../../../chunks/7425.js","../../../../../chunks/7566.js","../../../../../chunks/8948.js","../../../../../chunks/9446.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/4952.js","../../../../../chunks/5972.js","../../../../../chunks/7425.js","../../../../../chunks/7566.js","../../../../../chunks/8948.js","../../../../../webpack-runtime.js"]}
@@ -1 +1 @@
1
- "use strict";(()=>{var e={};e.id=3058,e.ids=[3058],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},98216:e=>{e.exports=require("net")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},82452:e=>{e.exports=require("tls")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},17679:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>w,patchFetch:()=>P,requestAsyncStorage:()=>f,routeModule:()=>x,serverHooks:()=>v,staticGenerationAsyncStorage:()=>q});var s={};t.r(s),t.d(s,{GET:()=>g,dynamic:()=>h});var o=t(49303),i=t(88716),n=t(60670),a=t(87070),p=t(97425),u=t(75748),c=t(23816),d=t(83513),l=t(89194),m=t(13561);let h="force-dynamic";async function g(e){try{let r=(0,p.getDbInstance)(),t=e.nextUrl?.searchParams,s=t?.get("repository"),o=(0,u.Xv)(r,s||void 0),i=c.g.getInstance(),n=d.tK,h=await Promise.all(o.map(async e=>{let t={},s=!1,o=!1,a=!1;for(let p of n){let n=i.getTool(p),c=await n.isRunning(e.id),d=!1,h=!1;if(c)try{let t=await (0,l.NA)(e.id,p,100),s=(0,m._)(t,p);d="waiting"===s.status,h="running"===s.status,!s.hasActivePrompt&&(0,u._U)(r,e.id,void 0,10,p).some(e=>"prompt"===e.messageType&&e.promptData?.status!=="answered")&&(0,u.GP)(r,e.id,p)}catch{h=!0}t[p]={isRunning:c,isWaitingForResponse:d,isProcessing:h},c&&(s=!0),d&&(o=!0),h&&(a=!0)}return{...e,isSessionRunning:s,isWaitingForResponse:o,isProcessing:a,sessionStatusByCli:t}})),g=(0,u.ER)(r);return a.NextResponse.json({worktrees:h,repositories:g},{status:200})}catch(e){return console.error("Error fetching worktrees:",e),a.NextResponse.json({error:"Failed to fetch worktrees"},{status:500})}}let x=new o.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/route",pathname:"/api/worktrees",filename:"route",bundlePath:"app/api/worktrees/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/route.ts",nextConfigOutput:"",userland:s}),{requestAsyncStorage:f,staticGenerationAsyncStorage:q,serverHooks:v}=x,w="/api/worktrees/route";function P(){return(0,n.patchFetch)({serverHooks:v,staticGenerationAsyncStorage:q})}},13561:(e,r,t)=>{t.d(r,{_:()=>i});var s=t(19377),o=t(63661);function i(e,r,t){let i=(0,s.vp)(e),n=i.split("\n"),a=n.length-1;for(;a>=0&&""===n[a].trim();)a--;let p=n.slice(0,a+1),u=p.slice(-15).join("\n"),c=p.slice(-5).join("\n"),d=(0,s.Sg)(r);if((0,o.F)((0,s.BN)(i),d).isPrompt)return{status:"waiting",confidence:"high",reason:"prompt_detected",hasActivePrompt:!0};if((0,s.Wg)(r,c))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1};let{promptPattern:l}=(0,s.bs)(r);return l.test(u)?{status:"ready",confidence:"high",reason:"input_prompt",hasActivePrompt:!1}:t&&Date.now()-t.getTime()>5e3?{status:"ready",confidence:"low",reason:"no_recent_output",hasActivePrompt:!1}:{status:"running",confidence:"low",reason:"default",hasActivePrompt:!1}}}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[8948,5972,3853,4893,7425,7566,9446],()=>t(17679));module.exports=s})();
1
+ "use strict";(()=>{var e={};e.id=3058,e.ids=[3058],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},98216:e=>{e.exports=require("net")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},82452:e=>{e.exports=require("tls")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},17679:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>P,patchFetch:()=>k,requestAsyncStorage:()=>v,routeModule:()=>x,serverHooks:()=>w,staticGenerationAsyncStorage:()=>q});var s={};r.r(s),r.d(s,{GET:()=>f,dynamic:()=>g});var o=r(49303),i=r(88716),n=r(60670),a=r(87070),p=r(97425),u=r(75748),c=r(55837),l=r(83513),d=r(89194),h=r(13561),m=r(2693);let g="force-dynamic";async function f(e){try{let t=(0,p.getDbInstance)(),r=e.nextUrl?.searchParams,s=r?.get("repository"),o=(0,u.Xv)(t,s||void 0),i=c.g.getInstance(),n=l.tK,g=await Promise.all(o.map(async e=>{let r={},s=!1,o=!1,a=!1;for(let p of n){let n=i.getTool(p),c=await n.isRunning(e.id),l=!1,g=!1;if(c)try{let r="opencode"===p?m.uC:100,s=await (0,d.NA)(e.id,p,r),o=(0,h._)(s,p);l="waiting"===o.status,g="running"===o.status,!o.hasActivePrompt&&(0,u._U)(t,e.id,void 0,10,p).some(e=>"prompt"===e.messageType&&e.promptData?.status!=="answered")&&(0,u.GP)(t,e.id,p)}catch{g=!0}r[p]={isRunning:c,isWaitingForResponse:l,isProcessing:g},c&&(s=!0),l&&(o=!0),g&&(a=!0)}return{...e,isSessionRunning:s,isWaitingForResponse:o,isProcessing:a,sessionStatusByCli:r}})),f=(0,u.ER)(t);return a.NextResponse.json({worktrees:g,repositories:f},{status:200})}catch(e){return console.error("Error fetching worktrees:",e),a.NextResponse.json({error:"Failed to fetch worktrees"},{status:500})}}let x=new o.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/route",pathname:"/api/worktrees",filename:"route",bundlePath:"app/api/worktrees/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/route.ts",nextConfigOutput:"",userland:s}),{requestAsyncStorage:v,staticGenerationAsyncStorage:q,serverHooks:w}=x,P="/api/worktrees/route";function k(){return(0,n.patchFetch)({serverHooks:w,staticGenerationAsyncStorage:q})}},13561:(e,t,r)=>{r.d(t,{_:()=>i});var s=r(19377),o=r(63661);function i(e,t,r){let i=(0,s.vp)(e),n=i.split("\n"),a=n.length-1;for(;a>=0&&""===n[a].trim();)a--;let p=n.slice(0,a+1),u=p.slice(-15).join("\n"),c=p.slice(-5).join("\n"),l=(0,s.Sg)(t);if((0,o.F)((0,s.BN)(i),l).isPrompt)return{status:"waiting",confidence:"high",reason:"prompt_detected",hasActivePrompt:!0};if((0,s.Wg)(t,c))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1};if("opencode"===t){if(s.nT.test(u))return{status:"running",confidence:"high",reason:"opencode_processing_indicator",hasActivePrompt:!1};let e=(0,s.BN)(i).split("\n"),t=Math.max(0,e.length-7);for(let r=e.length-1;r>=Math.max(0,e.length-10);r--)if(/ctrl\+[tp]/.test(e[r])){t=Math.max(0,r-2);break}let r=e.slice(0,t),o=r.length-1;for(;o>=0&&""===r[o].trim();)o--;if(o>=0){let e=r.slice(Math.max(0,o-5+1),o+1).join("\n");if((0,s.Wg)("opencode",e))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1};let t=r.slice(Math.max(0,o-15+1),o+1).join("\n");if(s.n9.test(t))return{status:"ready",confidence:"high",reason:"opencode_response_complete",hasActivePrompt:!1}}}let{promptPattern:d}=(0,s.bs)(t);return d.test(u)?{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),s=t.X(0,[8948,5972,3853,4893,7425,7566,4952],()=>r(17679));module.exports=s})();
@@ -1 +1 @@
1
- {"version":1,"files":["../../../../../data/cm.db","../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../node_modules/better-sqlite3/package.json","../../../../../node_modules/bindings/bindings.js","../../../../../node_modules/bindings/package.json","../../../../../node_modules/file-uri-to-path/index.js","../../../../../node_modules/file-uri-to-path/package.json","../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../node_modules/next/package.json","../../../../../package.json","../../../../package.json","../../../chunks/3853.js","../../../chunks/4893.js","../../../chunks/5972.js","../../../chunks/7425.js","../../../chunks/7566.js","../../../chunks/8948.js","../../../chunks/9446.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/4952.js","../../../chunks/5972.js","../../../chunks/7425.js","../../../chunks/7566.js","../../../chunks/8948.js","../../../webpack-runtime.js"]}
@@ -1 +1 @@
1
- (()=>{var e={};e.id=2626,e.ids=[2626],e.modules={72934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},55315:e=>{"use strict";e.exports=require("path")},17360:e=>{"use strict";e.exports=require("url")},66023:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalError:()=>s.a,__next_app__:()=>m,originalPathname:()=>c,pages:()=>u,routeModule:()=>p,tree:()=>d}),r(80974),r(25086),r(35866);var a=r(23191),n=r(88716),o=r(37922),s=r.n(o),i=r(95231),l={};for(let e in i)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>i[e]);r.d(t,l);let d=["",{children:["login",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(r.bind(r,80974)),"/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx"]}]},{metadata:{icon:[async e=>(await Promise.resolve().then(r.bind(r,71150))).default(e)],apple:[async e=>(await Promise.resolve().then(r.bind(r,63601))).default(e)],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(r.bind(r,25086)),"/home/runner/work/CommandMate/CommandMate/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(r.t.bind(r,35866,23)),"next/dist/client/components/not-found-error"],metadata:{icon:[async e=>(await Promise.resolve().then(r.bind(r,71150))).default(e)],apple:[async e=>(await Promise.resolve().then(r.bind(r,63601))).default(e)],openGraph:[],twitter:[],manifest:void 0}}],u=["/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx"],c="/login/page",m={require:r,loadChunk:()=>Promise.resolve()},p=new a.AppPageRouteModule({definition:{kind:n.x.APP_PAGE,page:"/login/page",pathname:"/login",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},72089:(e,t,r)=>{Promise.resolve().then(r.bind(r,24146))},24146:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});var a=r(10326),n=r(17577),o=r(6162),s=r(94001);function i(){let e=(0,o.T)("auth"),t=(0,s.m)(),[r,i]=(0,n.useState)(""),[l,d]=(0,n.useState)(null),[u,c]=(0,n.useState)(!1),[m,p]=(0,n.useState)(null);async function g(t){t.preventDefault(),d(null),c(!0);try{let t=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:r})});if(t.ok){window.location.href="/";return}if(429===t.status){let r=t.headers.get("Retry-After"),a=r?parseInt(r,10):900;p(a),d(e("error.lockedOut"));return}if(401===t.status){d(e("error.invalidToken"));return}d(e("error.unknownError"))}catch{d(e("error.unknownError"))}finally{c(!1)}}return t?a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100 dark:bg-gray-900",children:(0,a.jsxs)("div",{className:"bg-white dark:bg-gray-800 p-8 rounded-lg shadow-md w-full max-w-md",children:[a.jsx("h1",{className:"text-2xl font-bold mb-6 text-center text-gray-900 dark:text-white",children:e("login.title")}),(0,a.jsxs)("form",{onSubmit:g,className:"space-y-4",children:[(0,a.jsxs)("div",{children:[a.jsx("label",{htmlFor:"token",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:e("login.tokenLabel")}),a.jsx("input",{id:"token",type:"password",value:r,onChange:e=>i(e.target.value),placeholder:e("login.tokenPlaceholder"),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white",autoFocus:!0,autoComplete:"off",disabled:null!==m&&m>0})]}),l&&(0,a.jsxs)("div",{className:"text-red-600 dark:text-red-400 text-sm",children:[l,null!==m&&m>0&&a.jsx("div",{className:"mt-1",children:e("error.retryAfter",{minutes:Math.ceil(m/60)})})]}),a.jsx("button",{type:"submit",disabled:u||!r||null!==m&&m>0,className:"w-full py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",children:u?"...":e("login.submitButton")})]})]})}):null}},80974:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});let a=(0,r(68570).createProxy)(String.raw`/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx#default`)},63601:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});var a=r(66621);let n=e=>[{type:"image/png",sizes:"180x180",url:(0,a.fillMetadataSegment)(".",e.params,"apple-icon.png")+"?31a89e65aa4ac65b"}]},71150:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});var a=r(66621);let n=e=>[{type:"image/png",sizes:"32x32",url:(0,a.fillMetadataSegment)(".",e.params,"icon.png")+"?32d9127ba30ee286"}]},6162:(e,t,r)=>{"use strict";r.d(t,{T:()=>o});var a=r(34643);function n(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let o=n(0,a.T_);n(0,a.Gb)}};var t=require("../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[8948,3294,6621,3860],()=>r(66023));module.exports=a})();
1
+ (()=>{var e={};e.id=2626,e.ids=[2626],e.modules={72934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},55315:e=>{"use strict";e.exports=require("path")},17360:e=>{"use strict";e.exports=require("url")},66023:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalError:()=>o.a,__next_app__:()=>m,originalPathname:()=>c,pages:()=>d,routeModule:()=>f,tree:()=>u}),r(80974),r(25086),r(35866);var n=r(23191),a=r(88716),l=r(37922),o=r.n(l),s=r(95231),i={};for(let e in s)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(i[e]=()=>s[e]);r.d(t,i);let u=["",{children:["login",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(r.bind(r,80974)),"/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx"]}]},{metadata:{icon:[async e=>(await Promise.resolve().then(r.bind(r,71150))).default(e)],apple:[async e=>(await Promise.resolve().then(r.bind(r,63601))).default(e)],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(r.bind(r,25086)),"/home/runner/work/CommandMate/CommandMate/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(r.t.bind(r,35866,23)),"next/dist/client/components/not-found-error"],metadata:{icon:[async e=>(await Promise.resolve().then(r.bind(r,71150))).default(e)],apple:[async e=>(await Promise.resolve().then(r.bind(r,63601))).default(e)],openGraph:[],twitter:[],manifest:void 0}}],d=["/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx"],c="/login/page",m={require:r,loadChunk:()=>Promise.resolve()},f=new n.AppPageRouteModule({definition:{kind:a.x.APP_PAGE,page:"/login/page",pathname:"/login",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:u}})},72089:(e,t,r)=>{Promise.resolve().then(r.bind(r,25546))},33265:(e,t,r)=>{"use strict";r.d(t,{default:()=>a.a});var n=r(43353),a=r.n(n)},43353:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return l}});let n=r(91174);r(10326),r(17577);let a=n._(r(77028));function l(e,t){var r;let n={loading:e=>{let{error:t,isLoading:r,pastDelay:n}=e;return null}};"function"==typeof e&&(n.loader=e);let l={...n,...t};return(0,a.default)({...l,modules:null==(r=l.loadableGenerated)?void 0:r.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},933:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return a}});let n=r(94129);function a(e){let{reason:t,children:r}=e;throw new n.BailoutToCSRError(t)}},77028:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return u}});let n=r(10326),a=r(17577),l=r(933),o=r(46618);function s(e){return{default:e&&"default"in e?e.default:e}}let i={loader:()=>Promise.resolve(s(()=>null)),loading:null,ssr:!0},u=function(e){let t={...i,...e},r=(0,a.lazy)(()=>t.loader().then(s)),u=t.loading;function d(e){let s=u?(0,n.jsx)(u,{isLoading:!0,pastDelay:!0,error:null}):null,i=t.ssr?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.PreloadCss,{moduleIds:t.modules}),(0,n.jsx)(r,{...e})]}):(0,n.jsx)(l.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(a.Suspense,{fallback:s,children:i})}return d.displayName="LoadableComponent",d}},46618:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return l}});let n=r(10326),a=r(54580);function l(e){let{moduleIds:t}=e,r=(0,a.getExpectedRequestStore)("next/dynamic css"),l=[];if(r.reactLoadableManifest&&t){let e=r.reactLoadableManifest;for(let r of t){if(!e[r])continue;let t=e[r].files.filter(e=>e.endsWith(".css"));l.push(...t)}}return 0===l.length?null:(0,n.jsx)(n.Fragment,{children:l.map(e=>(0,n.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:r.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},25546:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var n=r(10326),a=r(17577),l=r(33265),o=r(6162),s=r(94001);let i=(0,l.default)(async()=>{},{loadableGenerated:{modules:["app/login/page.tsx -> @/components/auth/QrCodeGenerator"]},ssr:!1});function u(){let e=(0,o.T)("auth"),t=(0,s.m)(),[r,l]=(0,a.useState)(""),[u,d]=(0,a.useState)(null),[c,m]=(0,a.useState)(!1),[f,p]=(0,a.useState)(null),{autoLoginErrorKey:g,retryAfterSeconds:x,clearError:h}=function(e){let[t,r]=(0,a.useState)(null),[n,l]=(0,a.useState)(null);return(0,a.useRef)(!1),{autoLoginErrorKey:t,retryAfterSeconds:n,clearError:()=>{r(null),l(null)}}}(0),b={token_invalid:e("login.qr.tokenExpiredOrInvalid"),rate_limited:e("login.qr.rateLimited"),auto_login_failed:e("login.qr.autoLoginError")},y=g?b[g]??null:null;async function v(t){t.preventDefault(),d(null),h(),m(!0);try{let t=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:r})});if(t.ok){window.location.href="/";return}if(429===t.status){let r=t.headers.get("Retry-After"),n=r?parseInt(r,10):900;p(n),d(e("error.lockedOut"));return}if(401===t.status){d(e("error.invalidToken"));return}d(e("error.unknownError"))}catch{d(e("error.unknownError"))}finally{m(!1)}}if(!t)return null;let j=y||u;return n.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100 dark:bg-gray-900",children:(0,n.jsxs)("div",{className:"bg-white dark:bg-gray-800 p-8 rounded-lg shadow-md w-full max-w-md",children:[n.jsx("h1",{className:"text-2xl font-bold mb-6 text-center text-gray-900 dark:text-white",children:e("login.title")}),(0,n.jsxs)("form",{onSubmit:v,className:"space-y-4",children:[(0,n.jsxs)("div",{children:[n.jsx("label",{htmlFor:"token",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:e("login.tokenLabel")}),n.jsx("input",{id:"token",type:"password",value:r,onChange:e=>l(e.target.value),placeholder:e("login.tokenPlaceholder"),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white",autoFocus:!0,autoComplete:"off",disabled:null!==f&&f>0})]}),j&&(0,n.jsxs)("div",{className:"text-red-600 dark:text-red-400 text-sm",children:[j,null!==f&&f>0&&n.jsx("div",{className:"mt-1",children:e("error.retryAfter",{minutes:Math.ceil(f/60)})})]}),n.jsx("button",{type:"submit",disabled:c||!r||null!==f&&f>0,className:"w-full py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",children:c?"...":e("login.submitButton")})]}),n.jsx("div",{className:"hidden md:block",children:n.jsx(i,{})})]})})}},80974:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});let n=(0,r(68570).createProxy)(String.raw`/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx#default`)},63601:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var n=r(66621);let a=e=>[{type:"image/png",sizes:"180x180",url:(0,n.fillMetadataSegment)(".",e.params,"apple-icon.png")+"?31a89e65aa4ac65b"}]},71150:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var n=r(66621);let a=e=>[{type:"image/png",sizes:"32x32",url:(0,n.fillMetadataSegment)(".",e.params,"icon.png")+"?32d9127ba30ee286"}]},6162:(e,t,r)=>{"use strict";r.d(t,{T:()=>l});var n=r(34643);function a(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let l=a(0,n.T_);a(0,n.Gb)}};var t=require("../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),n=t.X(0,[8948,3294,6621,3860],()=>r(66023));module.exports=n})();
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/login/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"80":{"*":{"id":"41868","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"79671","name":"*","chunks":[],"async":false}},"12846":{"*":{"id":"12994","name":"*","chunks":[],"async":false}},"18828":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"38991":{"*":{"id":"24146","name":"*","chunks":[],"async":false}},"40991":{"*":{"id":"27247","name":"*","chunks":[],"async":false}},"41845":{"*":{"id":"37398","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"66677":{"*":{"id":"42106","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx":{"id":38991,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","2626","static/chunks/app/login/page-2d42204ba87cd136.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","8091","static/chunks/8091-274bc0716106e7fc.js","1931","static/chunks/app/page-060057e02b841125.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":40991,"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/e85de230ef5ddc40.css"],"/home/runner/work/CommandMate/CommandMate/src/app/page":[],"/home/runner/work/CommandMate/CommandMate/src/app/login/page":[]}}
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/login/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"80":{"*":{"id":"41868","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"79671","name":"*","chunks":[],"async":false}},"12846":{"*":{"id":"12994","name":"*","chunks":[],"async":false}},"18828":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"40991":{"*":{"id":"72964","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}},"88880":{"*":{"id":"25546","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx":{"id":88880,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","2626","static/chunks/app/login/page-010f02fd4b0dbc48.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","8091","static/chunks/8091-d65d2ab6daed23c6.js","1931","static/chunks/app/page-9e523a8f415bc707.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":40991,"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/45b3a41370668314.css"],"/home/runner/work/CommandMate/CommandMate/src/app/page":[],"/home/runner/work/CommandMate/CommandMate/src/app/login/page":[]}}
@@ -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}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"38991":{"*":{"id":"24146","name":"*","chunks":[],"async":false}},"40991":{"*":{"id":"27247","name":"*","chunks":[],"async":false}},"41845":{"*":{"id":"37398","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"66677":{"*":{"id":"42106","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx":{"id":38991,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","8091","static/chunks/8091-274bc0716106e7fc.js","1931","static/chunks/app/page-060057e02b841125.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":40991,"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/e85de230ef5ddc40.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}},"18828":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"40991":{"*":{"id":"72964","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}},"88880":{"*":{"id":"25546","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx":{"id":88880,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","8091","static/chunks/8091-d65d2ab6daed23c6.js","1931","static/chunks/app/page-9e523a8f415bc707.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":40991,"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/45b3a41370668314.css"],"/home/runner/work/CommandMate/CommandMate/src/app/page":[]}}
@@ -1,4 +1,4 @@
1
- "use strict";(()=>{var e={};e.id=4650,e.ids=[4650],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")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},6490:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>U,patchFetch:()=>v,requestAsyncStorage:()=>k,routeModule:()=>D,serverHooks:()=>$,staticGenerationAsyncStorage:()=>P});var a={};r.r(a),r.d(a,{DELETE:()=>A,GET:()=>g,PATCH:()=>T,POST:()=>b,PUT:()=>R,dynamic:()=>m});var n=r(49303),o=r(88716),s=r(60670),i=r(87070),p=r(97425),l=r(73068);let c={DEFAULT_MS:3e4},d=["host","connection","keep-alive","transfer-encoding","te","trailer","upgrade"],u=["transfer-encoding","connection","keep-alive"],h={BAD_GATEWAY:502,GATEWAY_TIMEOUT:504,UPGRADE_REQUIRED:426},f={GATEWAY_TIMEOUT:"The upstream server did not respond in time",BAD_GATEWAY:"Unable to connect to upstream server",UPGRADE_REQUIRED:"WebSocket connections are not supported through the proxy Route Handler"};async function _(e,t,r){let a=`http://${t.targetHost}:${t.targetPort}${r}`,n=new Headers;e.headers.forEach((e,t)=>{let r=t.toLowerCase();d.includes(r)||n.set(t,e)});try{let t=new AbortController,r=setTimeout(()=>t.abort(),c.DEFAULT_MS),o=await fetch(a,{method:e.method,headers:n,body:"GET"!==e.method&&"HEAD"!==e.method?e.body:void 0,signal:t.signal,duplex:"half"});clearTimeout(r);let s=new Headers;return o.headers.forEach((e,t)=>{let r=t.toLowerCase();u.includes(r)||s.set(t,e)}),new Response(o.body,{status:o.status,statusText:o.statusText,headers:s})}catch(e){if(e instanceof Error&&("AbortError"===e.name||"TimeoutError"===e.name))return new Response(JSON.stringify({error:"Gateway Timeout",message:f.GATEWAY_TIMEOUT}),{status:h.GATEWAY_TIMEOUT,headers:{"Content-Type":"application/json"}});return new Response(JSON.stringify({error:"Bad Gateway",message:f.BAD_GATEWAY}),{status:h.BAD_GATEWAY,headers:{"Content-Type":"application/json"}})}}async function E(e,t,r){let a=`ws://${t.targetHost}:${t.targetPort}${r}`;return new Response(JSON.stringify({error:"Upgrade Required",message:`${f.UPGRADE_REQUIRED}. Configure your WebSocket client to connect directly to ${a}`,directUrl:a}),{status:h.UPGRADE_REQUIRED,headers:{"Content-Type":"application/json",Upgrade:"websocket"}})}let w=(0,r(43895).h)("proxy");function x(e){let t=`[Proxy] ${e.method} /proxy/${e.pathPrefix}${e.path} -> ${e.statusCode} (${e.responseTime}ms)`;e.error?w.warn(t,{...e}):w.info(t,{...e})}let m="force-dynamic";async function y(e,t){let r=Date.now(),a=e.method,[n,...o]=t,s="/"+o.join("/");if(!n)return i.NextResponse.json({error:"Path prefix is required"},{status:400});try{let t=(0,p.getDbInstance)(),o=(0,l.V_)(t),c=await o.getByPathPrefix(n);if(!c)return i.NextResponse.json({error:`No external app found for path prefix: ${n}`},{status:404});if(!c.enabled)return i.NextResponse.json({error:`External app "${c.displayName}" is currently disabled`},{status:503});if(function(e){let t=e.headers.get("upgrade");return t?.toLowerCase()==="websocket"}(e)){let t=await E(e,c,s),o={timestamp:Date.now(),pathPrefix:n,method:a,path:s,statusCode:t.status,responseTime:Date.now()-r,isWebSocket:!0};return x(o),t}let d=await _(e,c,s),u={timestamp:Date.now(),pathPrefix:n,method:a,path:s,statusCode:d.status,responseTime:Date.now()-r,isWebSocket:!1};return d.status>=400&&(u.error=`HTTP ${d.status}`),x(u),d}catch(e){return w.error(`[Proxy] ${a} /proxy/${n}${s} failed: ${e.message}`,{pathPrefix:n,method:a,path:s,error:e.message,stack:e.stack}),i.NextResponse.json({error:"Proxy error",message:e.message},{status:502})}}async function g(e,{params:t}){let{path:r}=await t;return y(e,r)}async function b(e,{params:t}){let{path:r}=await t;return y(e,r)}async function R(e,{params:t}){let{path:r}=await t;return y(e,r)}async function T(e,{params:t}){let{path:r}=await t;return y(e,r)}async function A(e,{params:t}){let{path:r}=await t;return y(e,r)}let D=new n.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/proxy/[...path]/route",pathname:"/proxy/[...path]",filename:"route",bundlePath:"app/proxy/[...path]/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/proxy/[...path]/route.ts",nextConfigOutput:"",userland:a}),{requestAsyncStorage:k,staticGenerationAsyncStorage:P,serverHooks:$}=D,U="/proxy/[...path]/route";function v(){return(0,s.patchFetch)({serverHooks:$,staticGenerationAsyncStorage:P})}},73068:(e,t,r)=>{r.d(t,{V_:()=>s});var a=r(51172);class n{constructor(e,t=3e4){this.cache=new Map,this.allAppsCache=null,this.lastRefresh=0,this.db=e,this.ttl=t}getTTL(){return this.ttl}isStale(){return Date.now()-this.lastRefresh>this.ttl}async refresh(){let e=(0,a.J6)(this.db);for(let t of(this.cache.clear(),e))this.cache.set(t.pathPrefix,t);this.allAppsCache=e,this.lastRefresh=Date.now()}async getByPathPrefix(e){return this.isStale()&&await this.refresh(),this.cache.get(e)??null}async getAll(){return this.isStale()&&await this.refresh(),this.allAppsCache??[]}invalidate(){this.cache.clear(),this.allAppsCache=null,this.lastRefresh=0}invalidateByIssueNo(e){this.invalidate()}}let o=null;function s(e){if(!o){if(!e)throw Error("Database instance required to initialize cache");o=new n(e)}return o}},51172:(e,t,r)=>{r.d(t,{F1:()=>p,J6:()=>u,JF:()=>i,j6:()=>s,ke:()=>l,uz:()=>c,vV:()=>d});var a=r(84770);class n extends Error{constructor(e,t,r){super(e),this.code=t,this.cause=r,this.name="ExternalAppDbError"}}function o(e){return{id:e.id,name:e.name,displayName:e.display_name,description:e.description??void 0,pathPrefix:e.path_prefix,targetPort:e.target_port,targetHost:e.target_host,appType:e.app_type,websocketEnabled:1===e.websocket_enabled,websocketPathPattern:e.websocket_path_pattern??void 0,enabled:1===e.enabled,createdAt:e.created_at,updatedAt:e.updated_at}}function s(e,t){let r=(0,a.randomUUID)(),o=Date.now(),s={name:t.name,display_name:t.displayName,description:t.description??null,path_prefix:t.pathPrefix,target_port:t.targetPort,target_host:t.targetHost??"localhost",app_type:t.appType,websocket_enabled:t.websocketEnabled?1:0,websocket_path_pattern:t.websocketPathPattern??null};try{return e.prepare(`
1
+ "use strict";(()=>{var e={};e.id=4650,e.ids=[4650],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")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},6490:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>$,patchFetch:()=>v,requestAsyncStorage:()=>k,routeModule:()=>D,serverHooks:()=>U,staticGenerationAsyncStorage:()=>P});var a={};r.r(a),r.d(a,{DELETE:()=>A,GET:()=>y,PATCH:()=>T,POST:()=>b,PUT:()=>R,dynamic:()=>m});var n=r(49303),o=r(88716),s=r(60670),i=r(87070),p=r(97425),l=r(73068);let c={DEFAULT_MS:3e4},d=["host","connection","keep-alive","transfer-encoding","te","trailer","upgrade"],u=["transfer-encoding","connection","keep-alive"],h={BAD_GATEWAY:502,GATEWAY_TIMEOUT:504,UPGRADE_REQUIRED:426},f={GATEWAY_TIMEOUT:"The upstream server did not respond in time",BAD_GATEWAY:"Unable to connect to upstream server",UPGRADE_REQUIRED:"WebSocket connections are not supported through the proxy Route Handler"};async function _(e,t,r){let a=`http://${t.targetHost}:${t.targetPort}${r}`,n=new Headers;e.headers.forEach((e,t)=>{let r=t.toLowerCase();d.includes(r)||n.set(t,e)});try{let t=new AbortController,r=setTimeout(()=>t.abort(),c.DEFAULT_MS),o=await fetch(a,{method:e.method,headers:n,body:"GET"!==e.method&&"HEAD"!==e.method?e.body:void 0,signal:t.signal,duplex:"half"});clearTimeout(r);let s=new Headers;return o.headers.forEach((e,t)=>{let r=t.toLowerCase();u.includes(r)||s.set(t,e)}),new Response(o.body,{status:o.status,statusText:o.statusText,headers:s})}catch(e){if(e instanceof Error&&("AbortError"===e.name||"TimeoutError"===e.name))return new Response(JSON.stringify({error:"Gateway Timeout",message:f.GATEWAY_TIMEOUT}),{status:h.GATEWAY_TIMEOUT,headers:{"Content-Type":"application/json"}});return new Response(JSON.stringify({error:"Bad Gateway",message:f.BAD_GATEWAY}),{status:h.BAD_GATEWAY,headers:{"Content-Type":"application/json"}})}}async function E(e,t,r){let a=`ws://${t.targetHost}:${t.targetPort}${r}`;return new Response(JSON.stringify({error:"Upgrade Required",message:`${f.UPGRADE_REQUIRED}. Configure your WebSocket client to connect directly to ${a}`,directUrl:a}),{status:h.UPGRADE_REQUIRED,headers:{"Content-Type":"application/json",Upgrade:"websocket"}})}let w=(0,r(43895).h)("proxy");function x(e){let t=`[Proxy] ${e.method} ${e.path} -> ${e.statusCode} (${e.responseTime}ms)`;e.error?w.warn(t,{...e}):w.info(t,{...e})}let m="force-dynamic";async function g(e,t){let r=Date.now(),a=e.method,[n]=t,o="/proxy/"+t.join("/");if(!n)return i.NextResponse.json({error:"Path prefix is required"},{status:400});try{let t=(0,p.getDbInstance)(),s=(0,l.V_)(t),c=await s.getByPathPrefix(n);if(!c)return i.NextResponse.json({error:`No external app found for path prefix: ${n}`},{status:404});if(!c.enabled)return i.NextResponse.json({error:`External app "${c.displayName}" is currently disabled`},{status:503});if(function(e){let t=e.headers.get("upgrade");return t?.toLowerCase()==="websocket"}(e)){let t=await E(e,c,o),s={timestamp:Date.now(),pathPrefix:n,method:a,path:o,statusCode:t.status,responseTime:Date.now()-r,isWebSocket:!0};return x(s),t}let d=await _(e,c,o),u={timestamp:Date.now(),pathPrefix:n,method:a,path:o,statusCode:d.status,responseTime:Date.now()-r,isWebSocket:!1};return d.status>=400&&(u.error=`HTTP ${d.status}`),x(u),d}catch(e){return w.error(`[Proxy] ${a} ${o} failed: ${e.message}`,{pathPrefix:n,method:a,path:o,error:e.message,stack:e.stack}),i.NextResponse.json({error:"Proxy error",message:e.message},{status:502})}}async function y(e,{params:t}){let{path:r}=await t;return g(e,r)}async function b(e,{params:t}){let{path:r}=await t;return g(e,r)}async function R(e,{params:t}){let{path:r}=await t;return g(e,r)}async function T(e,{params:t}){let{path:r}=await t;return g(e,r)}async function A(e,{params:t}){let{path:r}=await t;return g(e,r)}let D=new n.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/proxy/[...path]/route",pathname:"/proxy/[...path]",filename:"route",bundlePath:"app/proxy/[...path]/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/proxy/[...path]/route.ts",nextConfigOutput:"",userland:a}),{requestAsyncStorage:k,staticGenerationAsyncStorage:P,serverHooks:U}=D,$="/proxy/[...path]/route";function v(){return(0,s.patchFetch)({serverHooks:U,staticGenerationAsyncStorage:P})}},73068:(e,t,r)=>{r.d(t,{V_:()=>s});var a=r(51172);class n{constructor(e,t=3e4){this.cache=new Map,this.allAppsCache=null,this.lastRefresh=0,this.db=e,this.ttl=t}getTTL(){return this.ttl}isStale(){return Date.now()-this.lastRefresh>this.ttl}async refresh(){let e=(0,a.J6)(this.db);for(let t of(this.cache.clear(),e))this.cache.set(t.pathPrefix,t);this.allAppsCache=e,this.lastRefresh=Date.now()}async getByPathPrefix(e){return this.isStale()&&await this.refresh(),this.cache.get(e)??null}async getAll(){return this.isStale()&&await this.refresh(),this.allAppsCache??[]}invalidate(){this.cache.clear(),this.allAppsCache=null,this.lastRefresh=0}invalidateByIssueNo(e){this.invalidate()}}let o=null;function s(e){if(!o){if(!e)throw Error("Database instance required to initialize cache");o=new n(e)}return o}},51172:(e,t,r)=>{r.d(t,{F1:()=>p,J6:()=>u,JF:()=>i,j6:()=>s,ke:()=>l,uz:()=>c,vV:()=>d});var a=r(84770);class n extends Error{constructor(e,t,r){super(e),this.code=t,this.cause=r,this.name="ExternalAppDbError"}}function o(e){return{id:e.id,name:e.name,displayName:e.display_name,description:e.description??void 0,pathPrefix:e.path_prefix,targetPort:e.target_port,targetHost:e.target_host,appType:e.app_type,websocketEnabled:1===e.websocket_enabled,websocketPathPattern:e.websocket_path_pattern??void 0,enabled:1===e.enabled,createdAt:e.created_at,updatedAt:e.updated_at}}function s(e,t){let r=(0,a.randomUUID)(),o=Date.now(),s={name:t.name,display_name:t.displayName,description:t.description??null,path_prefix:t.pathPrefix,target_port:t.targetPort,target_host:t.targetHost??"localhost",app_type:t.appType,websocket_enabled:t.websocketEnabled?1:0,websocket_path_pattern:t.websocketPathPattern??null};try{return e.prepare(`
2
2
  INSERT INTO external_apps (
3
3
  id, name, display_name, description, path_prefix,
4
4
  target_port, target_host, app_type,
@@ -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}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"38991":{"*":{"id":"24146","name":"*","chunks":[],"async":false}},"40991":{"*":{"id":"27247","name":"*","chunks":[],"async":false}},"41845":{"*":{"id":"37398","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"66677":{"*":{"id":"42106","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx":{"id":38991,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","8091","static/chunks/8091-274bc0716106e7fc.js","1931","static/chunks/app/page-060057e02b841125.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]/page.tsx":{"id":40991,"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","9178","static/chunks/9178-88850a7c48deea07.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","8091","static/chunks/8091-274bc0716106e7fc.js","130","static/chunks/app/worktrees/%5Bid%5D/page-78580947c201d698.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/e85de230ef5ddc40.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}},"18828":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"40991":{"*":{"id":"72964","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}},"88880":{"*":{"id":"25546","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx":{"id":88880,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","8091","static/chunks/8091-d65d2ab6daed23c6.js","1931","static/chunks/app/page-9e523a8f415bc707.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]/page.tsx":{"id":40991,"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","9178","static/chunks/9178-88850a7c48deea07.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","8091","static/chunks/8091-d65d2ab6daed23c6.js","130","static/chunks/app/worktrees/%5Bid%5D/page-8fb4dc30b58a5681.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/45b3a41370668314.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":[]}}