commandmate 0.1.12 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/.env.example +4 -9
  2. package/.next/BUILD_ID +1 -1
  3. package/.next/app-build-manifest.json +24 -24
  4. package/.next/app-path-routes-manifest.json +1 -1
  5. package/.next/build-manifest.json +7 -7
  6. package/.next/cache/.tsbuildinfo +1 -1
  7. package/.next/cache/config.json +3 -3
  8. package/.next/cache/webpack/client-production/0.pack +0 -0
  9. package/.next/cache/webpack/client-production/1.pack +0 -0
  10. package/.next/cache/webpack/client-production/2.pack +0 -0
  11. package/.next/cache/webpack/client-production/index.pack +0 -0
  12. package/.next/cache/webpack/client-production/index.pack.old +0 -0
  13. package/.next/cache/webpack/edge-server-production/0.pack +0 -0
  14. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  15. package/.next/cache/webpack/server-production/0.pack +0 -0
  16. package/.next/cache/webpack/server-production/index.pack +0 -0
  17. package/.next/next-server.js.nft.json +1 -1
  18. package/.next/prerender-manifest.json +1 -1
  19. package/.next/react-loadable-manifest.json +7 -7
  20. package/.next/required-server-files.json +1 -1
  21. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  22. package/.next/server/app/_not-found.html +1 -1
  23. package/.next/server/app/_not-found.rsc +2 -2
  24. package/.next/server/app/api/hooks/claude-done/route.js +1 -19
  25. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  26. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  27. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  28. package/.next/server/app/api/repositories/clone/route.js +1 -1
  29. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  30. package/.next/server/app/api/repositories/excluded/route.js +36 -0
  31. package/.next/server/app/api/repositories/excluded/route.js.nft.json +1 -0
  32. package/.next/server/app/api/repositories/excluded.body +1 -0
  33. package/.next/server/app/api/repositories/excluded.meta +1 -0
  34. package/.next/server/app/api/repositories/restore/route.js +36 -0
  35. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -0
  36. package/.next/server/app/api/repositories/route.js +36 -1
  37. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  38. package/.next/server/app/api/repositories/scan/route.js +1 -1
  39. package/.next/server/app/api/repositories/sync/route.js +36 -1
  40. package/.next/server/app/api/slash-commands/route.js +1 -1
  41. package/.next/server/app/api/slash-commands.body +1 -1
  42. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  43. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  44. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  45. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  46. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  47. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  48. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  49. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  50. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js +1 -1
  51. package/.next/server/app/api/worktrees/[id]/logs/route.js +1 -1
  52. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  53. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  54. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  55. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  56. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  57. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  58. package/.next/server/app/api/worktrees/[id]/search/route.js +1 -1
  59. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  60. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  61. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
  62. package/.next/server/app/api/worktrees/[id]/start-polling/route.js +1 -1
  63. package/.next/server/app/api/worktrees/[id]/start-polling/route.js.nft.json +1 -1
  64. package/.next/server/app/api/worktrees/route.js +1 -1
  65. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  66. package/.next/server/app/index.html +2 -2
  67. package/.next/server/app/index.rsc +3 -3
  68. package/.next/server/app/page.js +7 -7
  69. package/.next/server/app/page.js.nft.json +1 -1
  70. package/.next/server/app/page_client-reference-manifest.js +1 -1
  71. package/.next/server/app/proxy/[...path]/route.js +2 -2
  72. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  73. package/.next/server/app/worktrees/[id]/page.js +4 -4
  74. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  75. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  76. package/.next/server/app/worktrees/[id]/simple-terminal/page_client-reference-manifest.js +1 -1
  77. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  78. package/.next/server/app-paths-manifest.json +10 -8
  79. package/.next/server/chunks/5488.js +36 -0
  80. package/.next/server/chunks/6550.js +1 -1
  81. package/.next/server/chunks/7425.js +53 -50
  82. package/.next/server/chunks/7536.js +1 -0
  83. package/.next/server/chunks/8174.js +23 -0
  84. package/.next/server/chunks/9367.js +19 -0
  85. package/.next/server/functions-config-manifest.json +1 -1
  86. package/.next/server/middleware-build-manifest.js +1 -1
  87. package/.next/server/middleware-manifest.json +2 -28
  88. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  89. package/.next/server/pages/404.html +1 -1
  90. package/.next/server/pages/500.html +1 -1
  91. package/.next/server/server-reference-manifest.json +1 -1
  92. package/.next/static/chunks/4327.740cc7fe2d0b5049.js +60 -0
  93. package/.next/static/chunks/4343-ebe884a2a80eb033.js +1 -0
  94. package/.next/static/chunks/6568-38a33aa67d82e12b.js +1 -0
  95. package/.next/static/chunks/816-c254f4e2406e696a.js +1 -0
  96. package/.next/static/chunks/app/layout-4804cfba519283cf.js +1 -0
  97. package/.next/static/chunks/app/page-3926224c4cdf315b.js +1 -0
  98. package/.next/static/chunks/app/worktrees/[id]/page-d64624eb67af57c0.js +1 -0
  99. package/.next/static/chunks/main-b6d727aa9248d4f2.js +1 -0
  100. package/.next/static/chunks/{webpack-3fc79fab9bb738d7.js → webpack-4f85dcef6279c6ee.js} +1 -1
  101. package/.next/static/css/28be35e4727ae7ef.css +3 -0
  102. package/.next/trace +5 -5
  103. package/.next/types/app/api/repositories/excluded/route.ts +343 -0
  104. package/.next/types/app/api/repositories/restore/route.ts +343 -0
  105. package/README.md +2 -2
  106. package/dist/cli/commands/init.d.ts.map +1 -1
  107. package/dist/cli/commands/init.js +2 -13
  108. package/dist/cli/commands/start.d.ts.map +1 -1
  109. package/dist/cli/commands/start.js +3 -7
  110. package/dist/cli/config/security-messages.d.ts +11 -0
  111. package/dist/cli/config/security-messages.d.ts.map +1 -0
  112. package/dist/cli/config/security-messages.js +29 -0
  113. package/dist/cli/types/index.d.ts +0 -1
  114. package/dist/cli/types/index.d.ts.map +1 -1
  115. package/dist/cli/utils/daemon.d.ts.map +1 -1
  116. package/dist/cli/utils/daemon.js +3 -7
  117. package/dist/cli/utils/env-setup.d.ts +0 -4
  118. package/dist/cli/utils/env-setup.d.ts.map +1 -1
  119. package/dist/cli/utils/env-setup.js +0 -14
  120. package/dist/cli/utils/security-logger.d.ts.map +1 -1
  121. package/dist/cli/utils/security-logger.js +1 -2
  122. package/dist/server/src/lib/auto-yes-manager.js +13 -5
  123. package/dist/server/src/lib/claude-poller.js +337 -0
  124. package/dist/server/src/lib/cli-patterns.js +9 -2
  125. package/dist/server/src/lib/cli-tools/base.js +7 -1
  126. package/dist/server/src/lib/cli-tools/codex.js +14 -2
  127. package/dist/server/src/lib/cli-tools/manager.js +27 -0
  128. package/dist/server/src/lib/cli-tools/types.js +7 -0
  129. package/dist/server/src/lib/cli-tools/validation.js +41 -0
  130. package/dist/server/src/lib/db.js +23 -0
  131. package/dist/server/src/lib/env.js +0 -17
  132. package/dist/server/src/lib/logger.js +0 -4
  133. package/dist/server/src/lib/prompt-detector.js +129 -31
  134. package/dist/server/src/lib/ws-server.js +12 -1
  135. package/dist/server/src/types/sidebar.js +16 -31
  136. package/dist/server/src/types/slash-commands.js +2 -0
  137. package/package.json +1 -1
  138. package/.next/server/chunks/1318.js +0 -29
  139. package/.next/server/chunks/2597.js +0 -1
  140. package/.next/server/chunks/2648.js +0 -1
  141. package/.next/server/chunks/9703.js +0 -31
  142. package/.next/server/chunks/9723.js +0 -19
  143. package/.next/server/edge-runtime-webpack.js +0 -2
  144. package/.next/server/edge-runtime-webpack.js.map +0 -1
  145. package/.next/server/src/middleware.js +0 -14
  146. package/.next/server/src/middleware.js.map +0 -1
  147. package/.next/static/chunks/2853-d11a80b03c9a1640.js +0 -1
  148. package/.next/static/chunks/4327.3b84aa049900fdeb.js +0 -60
  149. package/.next/static/chunks/816-7e340dad784be28c.js +0 -1
  150. package/.next/static/chunks/9365-733d8c05712d2888.js +0 -1
  151. package/.next/static/chunks/app/layout-37e55f11dcc8b1bf.js +0 -1
  152. package/.next/static/chunks/app/page-fe35d61f14b90a51.js +0 -1
  153. package/.next/static/chunks/app/worktrees/[id]/page-58fcf2e63c056743.js +0 -1
  154. package/.next/static/chunks/main-a960f4a5e1a2f598.js +0 -1
  155. package/.next/static/css/376b339640084689.css +0 -3
  156. /package/.next/static/{564GHwluX5xIv9qpqLJV2 → bdUePCj-b9Gv5okYGp49O}/_buildManifest.js +0 -0
  157. /package/.next/static/{564GHwluX5xIv9qpqLJV2 → bdUePCj-b9Gv5okYGp49O}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";(()=>{var e={};e.id=7479,e.ids=[7479],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},84770:e=>{e.exports=require("crypto")},92048:e=>{e.exports=require("fs")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},88424:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>v,patchFetch:()=>y,requestAsyncStorage:()=>h,routeModule:()=>f,serverHooks:()=>w,staticGenerationAsyncStorage:()=>g});var a={};r.r(a),r.d(a,{GET:()=>p});var n=r(49303),o=r(88716),s=r(60670),d=r(87070),i=r(97425),c=r(75748),l=r(53013),u=r(38056);let m=[{name:"clear",description:"Clear conversation history",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"compact",description:"Compact context to reduce token usage",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"resume",description:"Resume previous conversation",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"rewind",description:"Rewind to previous conversation state",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"config",description:"Open configuration settings",category:"standard-config",isStandard:!0,source:"standard",filePath:""},{name:"model",description:"Switch AI model",category:"standard-config",isStandard:!0,source:"standard",filePath:""},{name:"permissions",description:"View or update tool permissions",category:"standard-config",isStandard:!0,source:"standard",filePath:""},{name:"status",description:"Check session status",category:"standard-monitor",isStandard:!0,source:"standard",filePath:""},{name:"context",description:"Show context window usage",category:"standard-monitor",isStandard:!0,source:"standard",filePath:""},{name:"cost",description:"Display token and cost usage",category:"standard-monitor",isStandard:!0,source:"standard",filePath:""},{name:"review",description:"Review code changes",category:"standard-git",isStandard:!0,source:"standard",filePath:""},{name:"pr-comments",description:"Show PR comments",category:"standard-git",isStandard:!0,source:"standard",filePath:""},{name:"help",description:"Show all available commands",category:"standard-util",isStandard:!0,source:"standard",filePath:""},{name:"doctor",description:"Check installation health",category:"standard-util",isStandard:!0,source:"standard",filePath:""},{name:"export",description:"Export conversation history",category:"standard-util",isStandard:!0,source:"standard",filePath:""},{name:"todos",description:"Show TODO list",category:"standard-util",isStandard:!0,source:"standard",filePath:""}];async function p(e,{params:t}){try{var r;let{id:e}=await t,a=(0,i.n)(),n=(0,c.gU)(a,e);if(!n)return d.NextResponse.json({error:"Worktree not found"},{status:404});if(!(!(!(r=n.path)||""===r.trim()||r.includes(".."))&&r.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=>r.startsWith(e))))return console.error(`[slash-commands API] Invalid worktree path detected: ${e}`),d.NextResponse.json({error:"Invalid worktree configuration"},{status:400});let o=(0,u.Xr)(m),s=[];try{s=await (0,l.HL)(n.path)}catch(e){console.warn(`[slash-commands API] Could not load worktree commands: ${e}`),s=[]}let p=(0,u.Nw)(o,s),f=m.length,h=(0,u.SU)(s);return d.NextResponse.json({groups:p,sources:{standard:f,worktree:h,mcbd:0}})}catch(e){return console.error("[slash-commands API] Error:",e),d.NextResponse.json({error:"Failed to load slash commands"},{status:500})}}let f=new n.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:a}),{requestAsyncStorage:h,staticGenerationAsyncStorage:g,serverHooks:w}=f,v="/api/worktrees/[id]/slash-commands/route";function y(){return(0,s.patchFetch)({serverHooks:w,staticGenerationAsyncStorage:g})}},38056:(e,t,r)=>{r.d(t,{Nw:()=>s,SU:()=>d,Xr:()=>o});var a=r(35835);let n=["planning","development","review","documentation","workflow","standard-session","standard-config","standard-monitor","standard-git","standard-util"];function o(e){if(0===e.length)return[];let t=new Map;for(let r of e){let e=t.get(r.category)||[];e.push(r),t.set(r.category,e)}let r=[];for(let e of n){let n=t.get(e);n&&n.length>0&&r.push({category:e,label:a.H[e],commands:n})}for(let[e,o]of t)!n.includes(e)&&o.length>0&&r.push({category:e,label:a.H[e]||e,commands:o});return r}function s(e,t){let r=new Map;for(let t of e)for(let e of t.commands)r.set(e.name,{...e,source:e.source||"standard"});for(let e of t)for(let t of e.commands)r.set(t.name,{...t,source:t.source||"worktree"});return o(Array.from(r.values()))}function d(e){return e.reduce((e,t)=>e+t.commands.length,0)}},53013:(e,t,r)=>{r.d(t,{HL:()=>u});var a=r(92048),n=r(55315),o=r(3673),s=r.n(o),d=r(35835),i=r(38056);let c=null;async function l(e){let t=function(e){let t=e||process.cwd();return n.join(t,".claude","commands")}(e);if(!a.existsSync(t))return console.warn(`Commands directory not found: ${t}`),[];let r=a.readdirSync(t).filter(e=>e.endsWith(".md")),o=[];for(let e of r){let r=function(e){try{let t=a.readFileSync(e,"utf-8"),{data:r}=s()(t),o=n.basename(e,".md"),i=d.c[o]||"workflow";return{name:o,description:r.description||"",category:i,model:r.model,filePath:n.relative(process.cwd(),e)}}catch(t){return console.error(`Error parsing command file ${e}:`,t),null}}(n.join(t,e));r&&o.push(r)}return o.sort((e,t)=>e.name.localeCompare(t.name)),c=o,o}async function u(e){let t=e?await l(e):c||await l();return(0,i.Xr)(t)}},35835:(e,t,r)=>{r.d(t,{H:()=>a,c:()=>n});let a={planning:"Planning",development:"Development",review:"Review",documentation:"Documentation",workflow:"Workflow","standard-session":"Standard (Session)","standard-config":"Standard (Config)","standard-monitor":"Standard (Monitor)","standard-git":"Standard (Git)","standard-util":"Standard (Utility)"},n={"work-plan":"planning","issue-create":"planning","issue-split":"planning","design-policy":"planning","tdd-impl":"development","bug-fix":"development",refactoring:"development","architecture-review":"review","acceptance-test":"review","progress-report":"documentation","create-pr":"workflow","pm-auto-dev":"workflow"}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[8948,5972,3673,7425],()=>r(88424));module.exports=a})();
1
+ "use strict";(()=>{var e={};e.id=7479,e.ids=[7479],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},84770:e=>{e.exports=require("crypto")},92048:e=>{e.exports=require("fs")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},88424:(e,t,a)=>{a.r(t),a.d(t,{originalPathname:()=>S,patchFetch:()=>v,requestAsyncStorage:()=>g,routeModule:()=>h,serverHooks:()=>y,staticGenerationAsyncStorage:()=>w});var r={};a.r(r),a.d(r,{GET:()=>f});var o=a(49303),n=a(88716),s=a(60670),d=a(87070),i=a(97425),c=a(75748),l=a(53013),u=a(38056);let m=[{name:"clear",description:"Clear conversation history",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"compact",description:"Compact context to reduce token usage",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"resume",description:"Resume previous conversation",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"rewind",description:"Rewind to previous conversation state",category:"standard-session",isStandard:!0,source:"standard",filePath:""},{name:"config",description:"Open configuration settings",category:"standard-config",isStandard:!0,source:"standard",filePath:""},{name:"model",description:"Switch AI model",category:"standard-config",isStandard:!0,source:"standard",filePath:""},{name:"permissions",description:"View or update tool permissions",category:"standard-config",isStandard:!0,source:"standard",filePath:""},{name:"status",description:"Check session status",category:"standard-monitor",isStandard:!0,source:"standard",filePath:""},{name:"context",description:"Show context window usage",category:"standard-monitor",isStandard:!0,source:"standard",filePath:""},{name:"cost",description:"Display token and cost usage",category:"standard-monitor",isStandard:!0,source:"standard",filePath:""},{name:"review",description:"Review code changes",category:"standard-git",isStandard:!0,source:"standard",filePath:""},{name:"pr-comments",description:"Show PR comments",category:"standard-git",isStandard:!0,source:"standard",filePath:""},{name:"help",description:"Show all available commands",category:"standard-util",isStandard:!0,source:"standard",filePath:""},{name:"doctor",description:"Check installation health",category:"standard-util",isStandard:!0,source:"standard",filePath:""},{name:"export",description:"Export conversation history",category:"standard-util",isStandard:!0,source:"standard",filePath:""},{name:"todos",description:"Show TODO list",category:"standard-util",isStandard:!0,source:"standard",filePath:""},{name:"new",description:"Start a new conversation in same session",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"undo",description:"Undo the last Codex action",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"logout",description:"Sign out from Codex",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"quit",description:"Exit Codex CLI",category:"standard-session",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"approvals",description:"Change auto-execution approval level",category:"standard-config",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"diff",description:"Show Git diff (including untracked files)",category:"standard-git",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"mention",description:"Attach file/folder for next interaction",category:"standard-util",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"mcp",description:"List available MCP tools",category:"standard-util",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"init",description:"Generate AGENTS.md template in current directory",category:"standard-util",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]},{name:"feedback",description:"Send feedback to Codex team",category:"standard-util",isStandard:!0,source:"standard",filePath:"",cliTools:["codex"]}];var p=a(83513);async function f(e,{params:t}){try{var a,r;let{id:o}=await t,n=(0,i.n)(),s=(0,c.gU)(n,o);if(!s)return d.NextResponse.json({error:"Worktree not found"},{status:404});if(!(!(!(a=s.path)||""===a.trim()||a.includes(".."))&&a.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=>a.startsWith(e))))return console.error(`[slash-commands API] Invalid worktree path detected: ${o}`),d.NextResponse.json({error:"Invalid worktree configuration"},{status:400});let f=(r=e.nextUrl.searchParams.get("cliTool"))&&p.t.includes(r)?r:"claude",h=(0,u.Xr)(m),g=[];try{g=await (0,l.HL)(s.path)}catch(e){console.warn(`[slash-commands API] Could not load worktree commands: ${e}`),g=[]}let w=(0,u.Nw)(h,g),y=(0,u.M6)(w,f),S=y.flatMap(e=>e.commands).filter(e=>"standard"===e.source).length,v=y.flatMap(e=>e.commands).filter(e=>"worktree"===e.source).length;return d.NextResponse.json({groups:y,sources:{standard:S,worktree:v,mcbd:0},cliTool:f})}catch(e){return console.error("[slash-commands API] Error:",e),d.NextResponse.json({error:"Failed to load slash commands"},{status:500})}}let h=new o.AppRouteRouteModule({definition:{kind:n.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:w,serverHooks:y}=h,S="/api/worktrees/[id]/slash-commands/route";function v(){return(0,s.patchFetch)({serverHooks:y,staticGenerationAsyncStorage:w})}},83513:(e,t,a)=>{a.d(t,{t:()=>r});let r=["claude","codex","gemini"]},38056:(e,t,a)=>{a.d(t,{M6:()=>d,Nw:()=>s,Xr:()=>n});var r=a(35835);let o=["planning","development","review","documentation","workflow","standard-session","standard-config","standard-monitor","standard-git","standard-util"];function n(e){if(0===e.length)return[];let t=new Map;for(let a of e){let e=t.get(a.category)||[];e.push(a),t.set(a.category,e)}let a=[];for(let e of o){let o=t.get(e);o&&o.length>0&&a.push({category:e,label:r.H[e],commands:o})}for(let[e,n]of t)!o.includes(e)&&n.length>0&&a.push({category:e,label:r.H[e]||e,commands:n});return a}function s(e,t){let a=new Map;for(let t of e)for(let e of t.commands)a.set(e.name,{...e,source:e.source||"standard"});for(let e of t)for(let t of e.commands)a.set(t.name,{...t,source:t.source||"worktree"});return n(Array.from(a.values()))}function d(e,t){return e.map(e=>({...e,commands:e.commands.filter(e=>e.cliTools?e.cliTools.includes(t):"claude"===t)})).filter(e=>e.commands.length>0)}},53013:(e,t,a)=>{a.d(t,{HL:()=>u});var r=a(92048),o=a(55315),n=a(3673),s=a.n(n),d=a(35835),i=a(38056);let c=null;async function l(e){let t=function(e){let t=e||process.cwd();return o.join(t,".claude","commands")}(e);if(!r.existsSync(t))return console.warn(`Commands directory not found: ${t}`),[];let a=r.readdirSync(t).filter(e=>e.endsWith(".md")),n=[];for(let e of a){let a=function(e){try{let t=r.readFileSync(e,"utf-8"),{data:a}=s()(t),n=o.basename(e,".md"),i=d.c[n]||"workflow";return{name:n,description:a.description||"",category:i,model:a.model,filePath:o.relative(process.cwd(),e)}}catch(t){return console.error(`Error parsing command file ${e}:`,t),null}}(o.join(t,e));a&&n.push(a)}return n.sort((e,t)=>e.name.localeCompare(t.name)),c=n,n}async function u(e){let t=e?await l(e):c||await l();return(0,i.Xr)(t)}},35835:(e,t,a)=>{a.d(t,{H:()=>r,c:()=>o});let r={planning:"Planning",development:"Development",review:"Review",documentation:"Documentation",workflow:"Workflow","standard-session":"Standard (Session)","standard-config":"Standard (Config)","standard-monitor":"Standard (Monitor)","standard-git":"Standard (Git)","standard-util":"Standard (Utility)"},o={"work-plan":"planning","issue-create":"planning","issue-split":"planning","design-policy":"planning","tdd-impl":"development","bug-fix":"development",refactoring:"development","architecture-review":"review","acceptance-test":"review","progress-report":"documentation","create-pr":"workflow","pm-auto-dev":"workflow"}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var a=e=>t(t.s=e),r=t.X(0,[8948,5972,3673,7425],()=>a(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:()=>m,patchFetch:()=>f,requestAsyncStorage:()=>x,routeModule:()=>c,serverHooks:()=>q,staticGenerationAsyncStorage:()=>g});var o={};t.r(o),t.d(o,{POST:()=>d});var s=t(49303),i=t(88716),n=t(60670),p=t(87070),u=t(97425),a=t(75748),l=t(59991);async function d(e,{params:r}){try{let t=(0,u.n)();if(!(0,a.gU)(t,r.id))return p.NextResponse.json({error:`Worktree '${r.id}' not found`},{status:404});let o=await e.json(),s=["claude","codex","gemini"];if(!o.cliToolId||!s.includes(o.cliToolId))return p.NextResponse.json({error:`Invalid CLI tool ID. Must be one of: ${s.join(", ")}`},{status:400});return console.log(`[API] Manually starting polling for ${r.id} (${o.cliToolId})`),(0,l.cn)(r.id,o.cliToolId),p.NextResponse.json({success:!0,message:`Started polling for ${o.cliToolId} session`})}catch(e){return console.error("Error starting polling:",e),p.NextResponse.json({error:"Failed to start polling"},{status:500})}}let c=new s.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/[id]/start-polling/route",pathname:"/api/worktrees/[id]/start-polling",filename:"route",bundlePath:"app/api/worktrees/[id]/start-polling/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/start-polling/route.ts",nextConfigOutput:"",userland:o}),{requestAsyncStorage:x,staticGenerationAsyncStorage:g,serverHooks:q}=c,m="/api/worktrees/[id]/start-polling/route";function f(){return(0,n.patchFetch)({serverHooks:q,staticGenerationAsyncStorage:g})}}};var r=require("../../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),o=r.X(0,[8948,5972,3853,4893,7425,2648,2597,9723],()=>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:()=>m,patchFetch:()=>f,requestAsyncStorage:()=>x,routeModule:()=>c,serverHooks:()=>q,staticGenerationAsyncStorage:()=>g});var o={};t.r(o),t.d(o,{POST:()=>d});var s=t(49303),i=t(88716),n=t(60670),p=t(87070),u=t(97425),a=t(75748),l=t(59991);async function d(e,{params:r}){try{let t=(0,u.n)();if(!(0,a.gU)(t,r.id))return p.NextResponse.json({error:`Worktree '${r.id}' not found`},{status:404});let o=await e.json(),s=["claude","codex","gemini"];if(!o.cliToolId||!s.includes(o.cliToolId))return p.NextResponse.json({error:`Invalid CLI tool ID. Must be one of: ${s.join(", ")}`},{status:400});return console.log(`[API] Manually starting polling for ${r.id} (${o.cliToolId})`),(0,l.cn)(r.id,o.cliToolId),p.NextResponse.json({success:!0,message:`Started polling for ${o.cliToolId} session`})}catch(e){return console.error("Error starting polling:",e),p.NextResponse.json({error:"Failed to start polling"},{status:500})}}let c=new s.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/[id]/start-polling/route",pathname:"/api/worktrees/[id]/start-polling",filename:"route",bundlePath:"app/api/worktrees/[id]/start-polling/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/start-polling/route.ts",nextConfigOutput:"",userland:o}),{requestAsyncStorage:x,staticGenerationAsyncStorage:g,serverHooks:q}=c,m="/api/worktrees/[id]/start-polling/route";function f(){return(0,n.patchFetch)({serverHooks:q,staticGenerationAsyncStorage:g})}}};var r=require("../../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),o=r.X(0,[8948,5972,3853,4893,7425,9367,7536],()=>t(51057));module.exports=o})();
@@ -1 +1 @@
1
- {"version":1,"files":["../../../../../../../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/2597.js","../../../../../chunks/2648.js","../../../../../chunks/3853.js","../../../../../chunks/4893.js","../../../../../chunks/5972.js","../../../../../chunks/7425.js","../../../../../chunks/8948.js","../../../../../chunks/9723.js","../../../../../webpack-runtime.js"]}
1
+ {"version":1,"files":["../../../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../../../node_modules/better-sqlite3/package.json","../../../../../../../node_modules/bindings/bindings.js","../../../../../../../node_modules/bindings/package.json","../../../../../../../node_modules/file-uri-to-path/index.js","../../../../../../../node_modules/file-uri-to-path/package.json","../../../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../../node_modules/next/package.json","../../../../../../../package.json","../../../../../../package.json","../../../../../chunks/3853.js","../../../../../chunks/4893.js","../../../../../chunks/5972.js","../../../../../chunks/7425.js","../../../../../chunks/7536.js","../../../../../chunks/8948.js","../../../../../chunks/9367.js","../../../../../webpack-runtime.js"]}
@@ -1 +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")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},92048:e=>{e.exports=require("fs")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},21764:e=>{e.exports=require("util")},17679:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>k,patchFetch:()=>q,requestAsyncStorage:()=>w,routeModule:()=>h,serverHooks:()=>v,staticGenerationAsyncStorage:()=>f});var s={};t.r(s),t.d(s,{GET:()=>g,dynamic:()=>x});var o=t(49303),i=t(88716),a=t(60670),n=t(87070),p=t(97425),u=t(75748),c=t(97213),d=t(89194),l=t(19377),m=t(63661);let x="force-dynamic";async function g(e){try{let r=(0,p.n)(),t=e.nextUrl?.searchParams,s=t?.get("repository"),o=(0,u.Xv)(r,s||void 0),i=c.g.getInstance(),a=["claude","codex","gemini"],x=await Promise.all(o.map(async e=>{let t={},s=!1,o=!1,n=!1;for(let p of a){let a=i.getTool(p),c=await a.isRunning(e.id),x=!1,g=!1;if(c)try{let t=await (0,d.NA)(e.id,p,100),s=(0,l.vp)(t),o=(0,m.F)(s);if(o.isPrompt)x=!0;else{let e=s.split("\n").filter(e=>""!==e.trim()).slice(-15).join("\n");(0,l.Wg)(p,e)?g=!0:/^[>❯](\s*$|\s+\S)/m.test(e)||(g=!0)}!o.isPrompt&&(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{g=!0}t[p]={isRunning:c,isWaitingForResponse:x,isProcessing:g},c&&(s=!0),x&&(o=!0),g&&(n=!0)}return{...e,isSessionRunning:s,isWaitingForResponse:o,isProcessing:n,sessionStatusByCli:t}})),g=(0,u.ER)(r);return n.NextResponse.json({worktrees:x,repositories:g},{status:200})}catch(e){return console.error("Error fetching worktrees:",e),n.NextResponse.json({error:"Failed to fetch worktrees"},{status:500})}}let h=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:w,staticGenerationAsyncStorage:f,serverHooks:v}=h,k="/api/worktrees/route";function q(){return(0,a.patchFetch)({serverHooks:v,staticGenerationAsyncStorage:f})}}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[8948,5972,7425,2648,2597],()=>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,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>v,patchFetch:()=>w,requestAsyncStorage:()=>g,routeModule:()=>x,serverHooks:()=>q,staticGenerationAsyncStorage:()=>f});var s={};t.r(s),t.d(s,{GET:()=>h,dynamic:()=>m});var o=t(49303),i=t(88716),n=t(60670),a=t(87070),p=t(97425),u=t(75748),c=t(43839),d=t(89194),l=t(13561);let m="force-dynamic";async function h(e){try{let r=(0,p.n)(),t=e.nextUrl?.searchParams,s=t?.get("repository"),o=(0,u.Xv)(r,s||void 0),i=c.g.getInstance(),n=["claude","codex","gemini"],m=await Promise.all(o.map(async e=>{let t={},s=!1,o=!1,a=!1;for(let p of n){let n=i.getTool(p),c=await n.isRunning(e.id),m=!1,h=!1;if(c)try{let t=await (0,d.NA)(e.id,p,100),s=(0,l._)(t,p);m="waiting"===s.status,h="running"===s.status,!s.hasActivePrompt&&(0,u._U)(r,e.id,void 0,10,p).some(e=>"prompt"===e.messageType&&e.promptData?.status!=="answered")&&(0,u.GP)(r,e.id,p)}catch{h=!0}t[p]={isRunning:c,isWaitingForResponse:m,isProcessing:h},c&&(s=!0),m&&(o=!0),h&&(a=!0)}return{...e,isSessionRunning:s,isWaitingForResponse:o,isProcessing:a,sessionStatusByCli:t}})),h=(0,u.ER)(r);return a.NextResponse.json({worktrees:m,repositories:h},{status:200})}catch(e){return console.error("Error fetching worktrees:",e),a.NextResponse.json({error:"Failed to fetch worktrees"},{status:500})}}let 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:g,staticGenerationAsyncStorage:f,serverHooks:q}=x,v="/api/worktrees/route";function w(){return(0,n.patchFetch)({serverHooks:q,staticGenerationAsyncStorage:f})}},13561:(e,r,t)=>{t.d(r,{_:()=>i});var s=t(19377),o=t(63661);function i(e,r,t){let i=(0,s.vp)(e).split("\n").slice(-15).join("\n");if((0,o.F)(i).isPrompt)return{status:"waiting",confidence:"high",reason:"prompt_detected",hasActivePrompt:!0};if((0,s.Wg)(r,i))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1};let{promptPattern:n}=(0,s.bs)(r);return n.test(i)?{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,9367,7536],()=>t(17679));module.exports=s})();
@@ -1 +1 @@
1
- {"version":1,"files":["../../../../../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/2597.js","../../../chunks/2648.js","../../../chunks/5972.js","../../../chunks/7425.js","../../../chunks/8948.js","../../../webpack-runtime.js"]}
1
+ {"version":1,"files":["../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../node_modules/better-sqlite3/package.json","../../../../../node_modules/bindings/bindings.js","../../../../../node_modules/bindings/package.json","../../../../../node_modules/file-uri-to-path/index.js","../../../../../node_modules/file-uri-to-path/package.json","../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../node_modules/next/package.json","../../../../../package.json","../../../../package.json","../../../chunks/3853.js","../../../chunks/4893.js","../../../chunks/5972.js","../../../chunks/7425.js","../../../chunks/7536.js","../../../chunks/8948.js","../../../chunks/9367.js","../../../webpack-runtime.js"]}
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html><html lang="ja"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/376b339640084689.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-3fc79fab9bb738d7.js"/><script src="/_next/static/chunks/fd9d1056-bbe86e4ae099d5cd.js" async=""></script><script src="/_next/static/chunks/2117-d845c2cd62e344a6.js" async=""></script><script src="/_next/static/chunks/main-app-420d93e43682fee5.js" async=""></script><script src="/_next/static/chunks/7648-325564a6e12a3257.js" async=""></script><script src="/_next/static/chunks/9365-733d8c05712d2888.js" async=""></script><script src="/_next/static/chunks/6725-f7607851b7d57eb1.js" async=""></script><script src="/_next/static/chunks/816-7e340dad784be28c.js" async=""></script><script src="/_next/static/chunks/2853-d11a80b03c9a1640.js" async=""></script><script src="/_next/static/chunks/app/page-fe35d61f14b90a51.js" async=""></script><script src="/_next/static/chunks/app/layout-37e55f11dcc8b1bf.js" async=""></script><title>CommandMate</title><meta name="description" content="Git worktree management with Claude CLI and tmux sessions"/><link rel="icon" href="/icon.png?32d9127ba30ee286" type="image/png" sizes="32x32"/><link rel="apple-touch-icon" href="/apple-icon.png?31a89e65aa4ac65b" type="image/png" sizes="180x180"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="min-h-screen bg-gray-50"><div data-testid="app-shell" class="h-screen flex"><aside data-testid="sidebar-container" class="
1
+ <!DOCTYPE html><html lang="ja"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/28be35e4727ae7ef.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-4f85dcef6279c6ee.js"/><script src="/_next/static/chunks/fd9d1056-bbe86e4ae099d5cd.js" async=""></script><script src="/_next/static/chunks/2117-d845c2cd62e344a6.js" async=""></script><script src="/_next/static/chunks/main-app-420d93e43682fee5.js" async=""></script><script src="/_next/static/chunks/7648-325564a6e12a3257.js" async=""></script><script src="/_next/static/chunks/4343-ebe884a2a80eb033.js" async=""></script><script src="/_next/static/chunks/6725-f7607851b7d57eb1.js" async=""></script><script src="/_next/static/chunks/816-c254f4e2406e696a.js" async=""></script><script src="/_next/static/chunks/6568-38a33aa67d82e12b.js" async=""></script><script src="/_next/static/chunks/app/page-3926224c4cdf315b.js" async=""></script><script src="/_next/static/chunks/app/layout-4804cfba519283cf.js" async=""></script><title>CommandMate</title><meta name="description" content="Git worktree management with Claude CLI and tmux sessions"/><link rel="icon" href="/icon.png?32d9127ba30ee286" type="image/png" sizes="32x32"/><link rel="apple-touch-icon" href="/apple-icon.png?31a89e65aa4ac65b" type="image/png" sizes="180x180"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="min-h-screen bg-gray-50"><div data-testid="app-shell" class="h-screen flex"><aside data-testid="sidebar-container" class="
2
2
  fixed left-0 top-0 h-full w-72
3
3
  transform transition-transform duration-300 ease-out
4
4
  translate-x-0
@@ -6,4 +6,4 @@
6
6
  flex-1 min-w-0 h-full overflow-hidden
7
7
  transition-[padding] duration-300 ease-out
8
8
  md:pl-72
9
- " role="main"><div class="container-custom py-8 overflow-auto h-full"><div class="mb-8"><h1 class="mb-2">CommandMate</h1><p class="text-lg text-gray-600">Git worktree management with Claude CLI and tmux sessions</p></div><div class="mb-8"><div class="space-y-4"><div class="flex gap-2 flex-wrap"><button class="btn btn-primary btn-sm">+ Add Repository</button><button class="btn btn-secondary btn-sm">Sync All</button></div></div></div><div class="space-y-6"><div class="flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between"><div class="flex items-center gap-2 flex-wrap"><span class="badge badge-gray">0<!-- --> branches</span></div><div class="flex gap-2 w-full sm:w-auto"><button class="btn btn-secondary btn-sm opacity-50 cursor-not-allowed" disabled="">Loading...</button></div></div><div class="flex flex-col sm:flex-row gap-3"><input type="text" placeholder="Search worktrees..." class="input flex-1" value=""/></div><div class="flex gap-2 flex-wrap items-center"><button class="btn btn-primary btn-sm">All</button><button class="btn bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500 btn-sm">📝 ToDo</button><button class="btn bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500 btn-sm">🚧 Doing</button><button class="btn bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500 btn-sm">✅ Done</button><button class="btn bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500 btn-sm">Not set</button></div><div class="flex gap-2 flex-wrap"><span class="text-sm text-gray-600 self-center">Sort by:</span><button class="btn bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500 btn-sm">⭐ Favorite </button><button class="btn bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500 btn-sm">Name </button><button class="btn btn-primary btn-sm">Updated <!-- -->↓</button></div><div class="text-center py-12"><div class="inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"></div><p class="mt-4 text-gray-600">Loading worktrees...</p></div></div><div class="mt-8"><div class="space-y-4"><div class="flex items-center justify-between"><h2 class="text-xl font-semibold text-gray-900">External Apps</h2><button class="btn btn-primary btn-sm">+ Add App</button></div><div class="card p-6"><div class="flex items-center justify-center py-8"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"></div><span class="ml-3 text-gray-600">Loading apps...</span></div></div></div></div></div></main></div><script src="/_next/static/chunks/webpack-3fc79fab9bb738d7.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/376b339640084689.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[12846,[],\"\"]\n4:I[19107,[],\"ClientPageRoot\"]\n5:I[89707,[\"7648\",\"static/chunks/7648-325564a6e12a3257.js\",\"9365\",\"static/chunks/9365-733d8c05712d2888.js\",\"6725\",\"static/chunks/6725-f7607851b7d57eb1.js\",\"816\",\"static/chunks/816-7e340dad784be28c.js\",\"2853\",\"static/chunks/2853-d11a80b03c9a1640.js\",\"1931\",\"static/chunks/app/page-fe35d61f14b90a51.js\"],\"default\",1]\n6:I[91795,[\"816\",\"static/chunks/816-7e340dad784be28c.js\",\"3185\",\"static/chunks/app/layout-37e55f11dcc8b1bf.js\"],\"AppProviders\"]\n7:I[4707,[],\"\"]\n8:I[36423,[],\"\"]\na:I[61060,[],\"\"]\nb:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"564GHwluX5xIv9qpqLJV2\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"\"],\"initialTree\":[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[\"$\",\"$L4\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$5\"}],null],null],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/376b339640084689.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"ja\",\"children\":[\"$\",\"body\",null,{\"className\":\"min-h-screen bg-gray-50\",\"children\":[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L7\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L8\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$L9\"],\"globalErrorComponent\":\"$a\",\"missingSlots\":\"$Wb\"}]\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"CommandMate\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Git worktree management with Claude CLI and tmux sessions\"}],[\"$\",\"link\",\"4\",{\"rel\":\"icon\",\"href\":\"/icon.png?32d9127ba30ee286\",\"type\":\"image/png\",\"sizes\":\"32x32\"}],[\"$\",\"link\",\"5\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-icon.png?31a89e65aa4ac65b\",\"type\":\"image/png\",\"sizes\":\"180x180\"}]]\n3:null\n"])</script></body></html>
9
+ " role="main"><div class="container-custom py-8 overflow-auto h-full"><div class="mb-8"><h1 class="mb-2">CommandMate</h1><p class="text-lg text-gray-600">Git worktree management with Claude CLI and tmux sessions</p></div><div class="mb-8"><div class="space-y-4"><div class="flex gap-2 flex-wrap"><button class="btn btn-primary btn-sm">+ Add Repository</button><button class="btn btn-secondary btn-sm">Sync All</button></div></div></div><div class="space-y-6"><div class="flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between"><div class="flex items-center gap-2 flex-wrap"><span class="badge badge-gray">0<!-- --> branches</span></div><div class="flex gap-2 w-full sm:w-auto"><button class="btn btn-secondary btn-sm opacity-50 cursor-not-allowed" disabled="">Loading...</button></div></div><div class="flex flex-col sm:flex-row gap-3"><input type="text" placeholder="Search worktrees..." class="input flex-1" value=""/></div><div class="flex gap-2 flex-wrap items-center"><button class="btn btn-primary btn-sm">All</button><button class="btn bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500 btn-sm">📝 ToDo</button><button class="btn bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500 btn-sm">🚧 Doing</button><button class="btn bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500 btn-sm">✅ Done</button><button class="btn bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500 btn-sm">Not set</button></div><div class="flex gap-2 flex-wrap"><span class="text-sm text-gray-600 self-center">Sort by:</span><button class="btn bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500 btn-sm">⭐ Favorite </button><button class="btn bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500 btn-sm">Name </button><button class="btn btn-primary btn-sm">Updated <!-- -->↓</button></div><div class="text-center py-12"><div class="inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"></div><p class="mt-4 text-gray-600">Loading worktrees...</p></div></div><div class="mt-8"><div class="space-y-4"><div class="flex items-center justify-between"><h2 class="text-xl font-semibold text-gray-900">External Apps</h2><button class="btn btn-primary btn-sm">+ Add App</button></div><div class="card p-6"><div class="flex items-center justify-center py-8"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"></div><span class="ml-3 text-gray-600">Loading apps...</span></div></div></div></div></div></main></div><script src="/_next/static/chunks/webpack-4f85dcef6279c6ee.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/28be35e4727ae7ef.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[12846,[],\"\"]\n4:I[19107,[],\"ClientPageRoot\"]\n5:I[89707,[\"7648\",\"static/chunks/7648-325564a6e12a3257.js\",\"4343\",\"static/chunks/4343-ebe884a2a80eb033.js\",\"6725\",\"static/chunks/6725-f7607851b7d57eb1.js\",\"816\",\"static/chunks/816-c254f4e2406e696a.js\",\"6568\",\"static/chunks/6568-38a33aa67d82e12b.js\",\"1931\",\"static/chunks/app/page-3926224c4cdf315b.js\"],\"default\",1]\n6:I[91795,[\"816\",\"static/chunks/816-c254f4e2406e696a.js\",\"3185\",\"static/chunks/app/layout-4804cfba519283cf.js\"],\"AppProviders\"]\n7:I[4707,[],\"\"]\n8:I[36423,[],\"\"]\na:I[61060,[],\"\"]\nb:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"bdUePCj-b9Gv5okYGp49O\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"\"],\"initialTree\":[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[\"$\",\"$L4\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$5\"}],null],null],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/28be35e4727ae7ef.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"ja\",\"children\":[\"$\",\"body\",null,{\"className\":\"min-h-screen bg-gray-50\",\"children\":[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L7\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L8\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$L9\"],\"globalErrorComponent\":\"$a\",\"missingSlots\":\"$Wb\"}]\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"CommandMate\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Git worktree management with Claude CLI and tmux sessions\"}],[\"$\",\"link\",\"4\",{\"rel\":\"icon\",\"href\":\"/icon.png?32d9127ba30ee286\",\"type\":\"image/png\",\"sizes\":\"32x32\"}],[\"$\",\"link\",\"5\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-icon.png?31a89e65aa4ac65b\",\"type\":\"image/png\",\"sizes\":\"180x180\"}]]\n3:null\n"])</script></body></html>
@@ -1,8 +1,8 @@
1
1
  2:I[19107,[],"ClientPageRoot"]
2
- 3:I[89707,["7648","static/chunks/7648-325564a6e12a3257.js","9365","static/chunks/9365-733d8c05712d2888.js","6725","static/chunks/6725-f7607851b7d57eb1.js","816","static/chunks/816-7e340dad784be28c.js","2853","static/chunks/2853-d11a80b03c9a1640.js","1931","static/chunks/app/page-fe35d61f14b90a51.js"],"default",1]
3
- 4:I[91795,["816","static/chunks/816-7e340dad784be28c.js","3185","static/chunks/app/layout-37e55f11dcc8b1bf.js"],"AppProviders"]
2
+ 3:I[89707,["7648","static/chunks/7648-325564a6e12a3257.js","4343","static/chunks/4343-ebe884a2a80eb033.js","6725","static/chunks/6725-f7607851b7d57eb1.js","816","static/chunks/816-c254f4e2406e696a.js","6568","static/chunks/6568-38a33aa67d82e12b.js","1931","static/chunks/app/page-3926224c4cdf315b.js"],"default",1]
3
+ 4:I[91795,["816","static/chunks/816-c254f4e2406e696a.js","3185","static/chunks/app/layout-4804cfba519283cf.js"],"AppProviders"]
4
4
  5:I[4707,[],""]
5
5
  6:I[36423,[],""]
6
- 0:["564GHwluX5xIv9qpqLJV2",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/376b339640084689.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"ja","children":["$","body",null,{"className":"min-h-screen bg-gray-50","children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]]
6
+ 0:["bdUePCj-b9Gv5okYGp49O",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/28be35e4727ae7ef.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"ja","children":["$","body",null,{"className":"min-h-screen bg-gray-50","children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]]
7
7
  7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"CommandMate"}],["$","meta","3",{"name":"description","content":"Git worktree management with Claude CLI and tmux sessions"}],["$","link","4",{"rel":"icon","href":"/icon.png?32d9127ba30ee286","type":"image/png","sizes":"32x32"}],["$","link","5",{"rel":"apple-touch-icon","href":"/apple-icon.png?31a89e65aa4ac65b","type":"image/png","sizes":"180x180"}]]
8
8
  1:null
@@ -1,16 +1,16 @@
1
- (()=>{var e={};e.id=1931,e.ids=[1931],e.modules={72934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},55315:e=>{"use strict";e.exports=require("path")},17360:e=>{"use strict";e.exports=require("url")},37906:(e,t,a)=>{"use strict";a.r(t),a.d(t,{GlobalError:()=>i.a,__next_app__:()=>m,originalPathname:()=>u,pages:()=>c,routeModule:()=>h,tree:()=>d}),a(35480),a(25086),a(35866);var r=a(23191),n=a(88716),s=a(37922),i=a.n(s),l=a(95231),o={};for(let e in l)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(o[e]=()=>l[e]);a.d(t,o);let d=["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(a.bind(a,35480)),"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx"],metadata:{icon:[async e=>(await Promise.resolve().then(a.bind(a,71150))).default(e)],apple:[async e=>(await Promise.resolve().then(a.bind(a,63601))).default(e)],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(a.bind(a,25086)),"/home/runner/work/CommandMate/CommandMate/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(a.t.bind(a,35866,23)),"next/dist/client/components/not-found-error"],metadata:{icon:[async e=>(await Promise.resolve().then(a.bind(a,71150))).default(e)],apple:[async e=>(await Promise.resolve().then(a.bind(a,63601))).default(e)],openGraph:[],twitter:[],manifest:void 0}}],c=["/home/runner/work/CommandMate/CommandMate/src/app/page.tsx"],u="/page",m={require:a,loadChunk:()=>Promise.resolve()},h=new r.AppPageRouteModule({definition:{kind:n.x.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},11518:(e,t,a)=>{Promise.resolve().then(a.bind(a,54846))},35047:(e,t,a)=>{"use strict";var r=a(77389);a.o(r,"useParams")&&a.d(t,{useParams:function(){return r.useParams}}),a.o(r,"useRouter")&&a.d(t,{useRouter:function(){return r.useRouter}})},54846:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>X});var r=a(10326),n=a(17577),s=a(75433),i=a(90434),l=a(77758);let o=Symbol.for("constructDateFrom");function d(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&o in e?e[o](t):e instanceof Date?new e.constructor(t):new Date(t)}let c={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function u(e){return (t={})=>{let a=t.width?String(t.width):e.defaultWidth;return e.formats[a]||e.formats[e.defaultWidth]}}let m={date:u({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:u({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:u({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},h={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function p(e){return(t,a)=>{let r;if("formatting"===(a?.context?String(a.context):"standalone")&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,n=a?.width?String(a.width):t;r=e.formattingValues[n]||e.formattingValues[t]}else{let t=e.defaultWidth,n=a?.width?String(a.width):e.defaultWidth;r=e.values[n]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function x(e){return(t,a={})=>{let r;let n=a.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;let l=i[0],o=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(o)?function(e,t){for(let a=0;a<e.length;a++)if(t(e[a]))return a}(o,e=>e.test(l)):function(e,t){for(let a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t(e[a]))return a}(o,e=>e.test(l));return r=e.valueCallback?e.valueCallback(d):d,{value:r=a.valueCallback?a.valueCallback(r):r,rest:t.slice(l.length)}}}function g(e){return(t,a={})=>{let r=t.match(e.matchPattern);if(!r)return null;let n=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];return{value:i=a.valueCallback?a.valueCallback(i):i,rest:t.slice(n.length)}}}let f={code:"en-US",formatDistance:(e,t,a)=>{let r;let n=c[e];return(r="string"==typeof n?n:1===t?n.one:n.other.replace("{{count}}",t.toString()),a?.addSuffix)?a.comparison&&a.comparison>0?"in "+r:r+" ago":r},formatLong:m,formatRelative:(e,t,a,r)=>h[e],localize:{ordinalNumber:(e,t)=>{let a=Number(e),r=a%100;if(r>20||r<10)switch(r%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},era:p({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:p({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:p({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:p({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:p({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:g({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:x({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:x({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:x({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:x({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:x({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},y={};function b(e,t){return d(t||e,e)}function v(e){let t=b(e),a=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return a.setUTCFullYear(t.getFullYear()),+e-+a}function j(e,...t){let a=d.bind(null,e||t.find(e=>"object"==typeof e));return t.map(a)}function w(e,t){let a=+b(e)-+b(t);return a<0?-1:a>0?1:a}let N={lessThanXSeconds:{one:"1秒未満",other:"{{count}}秒未満",oneWithSuffix:"約1秒",otherWithSuffix:"約{{count}}秒"},xSeconds:{one:"1秒",other:"{{count}}秒"},halfAMinute:"30秒",lessThanXMinutes:{one:"1分未満",other:"{{count}}分未満",oneWithSuffix:"約1分",otherWithSuffix:"約{{count}}分"},xMinutes:{one:"1分",other:"{{count}}分"},aboutXHours:{one:"約1時間",other:"約{{count}}時間"},xHours:{one:"1時間",other:"{{count}}時間"},xDays:{one:"1日",other:"{{count}}日"},aboutXWeeks:{one:"約1週間",other:"約{{count}}週間"},xWeeks:{one:"1週間",other:"{{count}}週間"},aboutXMonths:{one:"約1か月",other:"約{{count}}か月"},xMonths:{one:"1か月",other:"{{count}}か月"},aboutXYears:{one:"約1年",other:"約{{count}}年"},xYears:{one:"1年",other:"{{count}}年"},overXYears:{one:"1年以上",other:"{{count}}年以上"},almostXYears:{one:"1年近く",other:"{{count}}年近く"}},k={date:u({formats:{full:"y年M月d日EEEE",long:"y年M月d日",medium:"y/MM/dd",short:"y/MM/dd"},defaultWidth:"full"}),time:u({formats:{full:"H時mm分ss秒 zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},defaultWidth:"full"}),dateTime:u({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},C={lastWeek:"先週のeeeeのp",yesterday:"昨日のp",today:"今日のp",tomorrow:"明日のp",nextWeek:"翌週のeeeeのp",other:"P"},S={code:"ja",formatDistance:(e,t,a)=>{let r;a=a||{};let n=N[e];return(r="string"==typeof n?n:1===t?a.addSuffix&&n.oneWithSuffix?n.oneWithSuffix:n.one:a.addSuffix&&n.otherWithSuffix?n.otherWithSuffix.replace("{{count}}",String(t)):n.other.replace("{{count}}",String(t)),a.addSuffix)?a.comparison&&a.comparison>0?r+"後":r+"前":r},formatLong:k,formatRelative:(e,t,a,r)=>C[e],localize:{ordinalNumber:(e,t)=>{let a=Number(e);switch(String(t?.unit)){case"year":return`${a}年`;case"quarter":return`第${a}四半期`;case"month":return`${a}月`;case"week":return`第${a}週`;case"date":return`${a}日`;case"hour":return`${a}時`;case"minute":return`${a}分`;case"second":return`${a}秒`;default:return`${a}`}},era:p({values:{narrow:["BC","AC"],abbreviated:["紀元前","西暦"],wide:["紀元前","西暦"]},defaultWidth:"wide"}),quarter:p({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["第1四半期","第2四半期","第3四半期","第4四半期"]},defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:p({values:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]},defaultWidth:"wide"}),day:p({values:{narrow:["日","月","火","水","木","金","土"],short:["日","月","火","水","木","金","土"],abbreviated:["日","月","火","水","木","金","土"],wide:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"]},defaultWidth:"wide"}),dayPeriod:p({values:{narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},defaultWidth:"wide",formattingValues:{narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:g({matchPattern:/^第?\d+(年|四半期|月|週|日|時|分|秒)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:x({matchPatterns:{narrow:/^(B\.?C\.?|A\.?D\.?)/i,abbreviated:/^(紀元[前後]|西暦)/i,wide:/^(紀元[前後]|西暦)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^B/i,/^A/i],any:[/^(紀元前)/i,/^(西暦|紀元後)/i]},defaultParseWidth:"any"}),quarter:x({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^Q[1234]/i,wide:/^第[1234一二三四1234]四半期/i},defaultMatchWidth:"wide",parsePatterns:{any:[/(1|一|1)/i,/(2|二|2)/i,/(3|三|3)/i,/(4|四|4)/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:x({matchPatterns:{narrow:/^([123456789]|1[012])/,abbreviated:/^([123456789]|1[012])月/i,wide:/^([123456789]|1[012])月/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^1\D/,/^2/,/^3/,/^4/,/^5/,/^6/,/^7/,/^8/,/^9/,/^10/,/^11/,/^12/]},defaultParseWidth:"any"}),day:x({matchPatterns:{narrow:/^[日月火水木金土]/,short:/^[日月火水木金土]/,abbreviated:/^[日月火水木金土]/,wide:/^[日月火水木金土]曜日/},defaultMatchWidth:"wide",parsePatterns:{any:[/^日/,/^月/,/^火/,/^水/,/^木/,/^金/,/^土/]},defaultParseWidth:"any"}),dayPeriod:x({matchPatterns:{any:/^(AM|PM|午前|午後|正午|深夜|真夜中|夜|朝)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^(A|午前)/i,pm:/^(P|午後)/i,midnight:/^深夜|真夜中/i,noon:/^正午/i,morning:/^朝/i,afternoon:/^午後/i,evening:/^夜/i,night:/^深夜/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};var P=a(73002);function M({worktree:e,onSessionKilled:t,onStatusChanged:a}){var s,o;let{id:c,name:u,description:m,lastMessagesByCli:h,updatedAt:p,isSessionRunning:x,isWaitingForResponse:g,favorite:N,status:k,link:C,sessionStatusByCli:M}=e,[W,D]=(0,n.useState)(!1),[z,A]=(0,n.useState)(N||!1),[T,$]=(0,n.useState)(!1),[R,E]=(0,n.useState)(k||null),[L,F]=(0,n.useState)(!1),O=p?(s=new Date(p),o={addSuffix:!0,locale:S},function(e,t,a){var r,n,s,i;let l;let o=a?.locale??y.locale??f,d=w(e,t);if(isNaN(d))throw RangeError("Invalid time value");let c=Object.assign({},a,{addSuffix:a?.addSuffix,comparison:d}),[u,m]=j(a?.in,...d>0?[t,e]:[e,t]),h=(r=m,n=u,(i=void 0,e=>{let t=(i?Math[i]:Math.trunc)(e);return 0===t?0:t})((+b(r)-+b(n))/1e3)),p=Math.round((h-(v(m)-v(u))/1e3)/60);if(p<2){if(a?.includeSeconds){if(h<5)return o.formatDistance("lessThanXSeconds",5,c);if(h<10)return o.formatDistance("lessThanXSeconds",10,c);if(h<20)return o.formatDistance("lessThanXSeconds",20,c);if(h<40)return o.formatDistance("halfAMinute",0,c);else if(h<60)return o.formatDistance("lessThanXMinutes",1,c);else return o.formatDistance("xMinutes",1,c)}return 0===p?o.formatDistance("lessThanXMinutes",1,c):o.formatDistance("xMinutes",p,c)}if(p<45)return o.formatDistance("xMinutes",p,c);if(p<90)return o.formatDistance("aboutXHours",1,c);if(p<1440)return o.formatDistance("aboutXHours",Math.round(p/60),c);if(p<2520)return o.formatDistance("xDays",1,c);if(p<43200)return o.formatDistance("xDays",Math.round(p/1440),c);if(p<86400)return l=Math.round(p/43200),o.formatDistance("aboutXMonths",l,c);if((l=function(e,t,a){let[r,n,s]=j(void 0,e,e,t),i=w(n,s),l=Math.abs(function(e,t,a){let[r,n]=j(void 0,e,t);return 12*(r.getFullYear()-n.getFullYear())+(r.getMonth()-n.getMonth())}(n,s));if(l<1)return 0;1===n.getMonth()&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*l);let o=w(n,s)===-i;(function(e,t){let a=b(e,void 0);return+function(e,t){let a=b(e,t?.in);return a.setHours(23,59,59,999),a}(a,void 0)==+function(e,t){let a=b(e,t?.in),r=a.getMonth();return a.setFullYear(a.getFullYear(),r+1,0),a.setHours(23,59,59,999),a}(a,void 0)})(r)&&1===l&&1===w(r,s)&&(o=!1);let d=i*(l-+o);return 0===d?0:d}(m,u))<12)return o.formatDistance("xMonths",Math.round(p/43200),c);{let e=l%12,t=Math.trunc(l/12);return e<3?o.formatDistance("aboutXYears",t,c):e<9?o.formatDistance("overXYears",t,c):o.formatDistance("almostXYears",t+1,c)}}(s,d(s,Date.now()),o)):null,I="main"===u||"master"===u,X=async e=>{if(e.preventDefault(),e.stopPropagation(),confirm(`「${u}」のセッションを終了しますか?
1
+ (()=>{var e={};e.id=1931,e.ids=[1931],e.modules={72934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},55315:e=>{"use strict";e.exports=require("path")},17360:e=>{"use strict";e.exports=require("url")},37906:(e,t,a)=>{"use strict";a.r(t),a.d(t,{GlobalError:()=>i.a,__next_app__:()=>m,originalPathname:()=>u,pages:()=>c,routeModule:()=>h,tree:()=>d}),a(35480),a(25086),a(35866);var r=a(23191),n=a(88716),s=a(37922),i=a.n(s),l=a(95231),o={};for(let e in l)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(o[e]=()=>l[e]);a.d(t,o);let d=["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(a.bind(a,35480)),"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx"],metadata:{icon:[async e=>(await Promise.resolve().then(a.bind(a,71150))).default(e)],apple:[async e=>(await Promise.resolve().then(a.bind(a,63601))).default(e)],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(a.bind(a,25086)),"/home/runner/work/CommandMate/CommandMate/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(a.t.bind(a,35866,23)),"next/dist/client/components/not-found-error"],metadata:{icon:[async e=>(await Promise.resolve().then(a.bind(a,71150))).default(e)],apple:[async e=>(await Promise.resolve().then(a.bind(a,63601))).default(e)],openGraph:[],twitter:[],manifest:void 0}}],c=["/home/runner/work/CommandMate/CommandMate/src/app/page.tsx"],u="/page",m={require:a,loadChunk:()=>Promise.resolve()},h=new r.AppPageRouteModule({definition:{kind:n.x.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},11518:(e,t,a)=>{Promise.resolve().then(a.bind(a,54846))},35047:(e,t,a)=>{"use strict";var r=a(77389);a.o(r,"useParams")&&a.d(t,{useParams:function(){return r.useParams}}),a.o(r,"useRouter")&&a.d(t,{useRouter:function(){return r.useRouter}})},54846:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>X});var r=a(10326),n=a(17577),s=a(75076),i=a(90434),l=a(77758);let o=Symbol.for("constructDateFrom");function d(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&o in e?e[o](t):e instanceof Date?new e.constructor(t):new Date(t)}let c={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function u(e){return (t={})=>{let a=t.width?String(t.width):e.defaultWidth;return e.formats[a]||e.formats[e.defaultWidth]}}let m={date:u({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:u({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:u({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},h={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function p(e){return(t,a)=>{let r;if("formatting"===(a?.context?String(a.context):"standalone")&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,n=a?.width?String(a.width):t;r=e.formattingValues[n]||e.formattingValues[t]}else{let t=e.defaultWidth,n=a?.width?String(a.width):e.defaultWidth;r=e.values[n]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function x(e){return(t,a={})=>{let r;let n=a.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;let l=i[0],o=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(o)?function(e,t){for(let a=0;a<e.length;a++)if(t(e[a]))return a}(o,e=>e.test(l)):function(e,t){for(let a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t(e[a]))return a}(o,e=>e.test(l));return r=e.valueCallback?e.valueCallback(d):d,{value:r=a.valueCallback?a.valueCallback(r):r,rest:t.slice(l.length)}}}function g(e){return(t,a={})=>{let r=t.match(e.matchPattern);if(!r)return null;let n=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];return{value:i=a.valueCallback?a.valueCallback(i):i,rest:t.slice(n.length)}}}let f={code:"en-US",formatDistance:(e,t,a)=>{let r;let n=c[e];return(r="string"==typeof n?n:1===t?n.one:n.other.replace("{{count}}",t.toString()),a?.addSuffix)?a.comparison&&a.comparison>0?"in "+r:r+" ago":r},formatLong:m,formatRelative:(e,t,a,r)=>h[e],localize:{ordinalNumber:(e,t)=>{let a=Number(e),r=a%100;if(r>20||r<10)switch(r%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},era:p({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:p({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:p({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:p({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:p({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:g({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:x({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:x({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:x({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:x({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:x({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},y={};function b(e,t){return d(t||e,e)}function v(e){let t=b(e),a=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return a.setUTCFullYear(t.getFullYear()),+e-+a}function j(e,...t){let a=d.bind(null,e||t.find(e=>"object"==typeof e));return t.map(a)}function w(e,t){let a=+b(e)-+b(t);return a<0?-1:a>0?1:a}let N={lessThanXSeconds:{one:"1秒未満",other:"{{count}}秒未満",oneWithSuffix:"約1秒",otherWithSuffix:"約{{count}}秒"},xSeconds:{one:"1秒",other:"{{count}}秒"},halfAMinute:"30秒",lessThanXMinutes:{one:"1分未満",other:"{{count}}分未満",oneWithSuffix:"約1分",otherWithSuffix:"約{{count}}分"},xMinutes:{one:"1分",other:"{{count}}分"},aboutXHours:{one:"約1時間",other:"約{{count}}時間"},xHours:{one:"1時間",other:"{{count}}時間"},xDays:{one:"1日",other:"{{count}}日"},aboutXWeeks:{one:"約1週間",other:"約{{count}}週間"},xWeeks:{one:"1週間",other:"{{count}}週間"},aboutXMonths:{one:"約1か月",other:"約{{count}}か月"},xMonths:{one:"1か月",other:"{{count}}か月"},aboutXYears:{one:"約1年",other:"約{{count}}年"},xYears:{one:"1年",other:"{{count}}年"},overXYears:{one:"1年以上",other:"{{count}}年以上"},almostXYears:{one:"1年近く",other:"{{count}}年近く"}},k={date:u({formats:{full:"y年M月d日EEEE",long:"y年M月d日",medium:"y/MM/dd",short:"y/MM/dd"},defaultWidth:"full"}),time:u({formats:{full:"H時mm分ss秒 zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},defaultWidth:"full"}),dateTime:u({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},C={lastWeek:"先週のeeeeのp",yesterday:"昨日のp",today:"今日のp",tomorrow:"明日のp",nextWeek:"翌週のeeeeのp",other:"P"},S={code:"ja",formatDistance:(e,t,a)=>{let r;a=a||{};let n=N[e];return(r="string"==typeof n?n:1===t?a.addSuffix&&n.oneWithSuffix?n.oneWithSuffix:n.one:a.addSuffix&&n.otherWithSuffix?n.otherWithSuffix.replace("{{count}}",String(t)):n.other.replace("{{count}}",String(t)),a.addSuffix)?a.comparison&&a.comparison>0?r+"後":r+"前":r},formatLong:k,formatRelative:(e,t,a,r)=>C[e],localize:{ordinalNumber:(e,t)=>{let a=Number(e);switch(String(t?.unit)){case"year":return`${a}年`;case"quarter":return`第${a}四半期`;case"month":return`${a}月`;case"week":return`第${a}週`;case"date":return`${a}日`;case"hour":return`${a}時`;case"minute":return`${a}分`;case"second":return`${a}秒`;default:return`${a}`}},era:p({values:{narrow:["BC","AC"],abbreviated:["紀元前","西暦"],wide:["紀元前","西暦"]},defaultWidth:"wide"}),quarter:p({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["第1四半期","第2四半期","第3四半期","第4四半期"]},defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:p({values:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]},defaultWidth:"wide"}),day:p({values:{narrow:["日","月","火","水","木","金","土"],short:["日","月","火","水","木","金","土"],abbreviated:["日","月","火","水","木","金","土"],wide:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"]},defaultWidth:"wide"}),dayPeriod:p({values:{narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},defaultWidth:"wide",formattingValues:{narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:g({matchPattern:/^第?\d+(年|四半期|月|週|日|時|分|秒)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:x({matchPatterns:{narrow:/^(B\.?C\.?|A\.?D\.?)/i,abbreviated:/^(紀元[前後]|西暦)/i,wide:/^(紀元[前後]|西暦)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^B/i,/^A/i],any:[/^(紀元前)/i,/^(西暦|紀元後)/i]},defaultParseWidth:"any"}),quarter:x({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^Q[1234]/i,wide:/^第[1234一二三四1234]四半期/i},defaultMatchWidth:"wide",parsePatterns:{any:[/(1|一|1)/i,/(2|二|2)/i,/(3|三|3)/i,/(4|四|4)/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:x({matchPatterns:{narrow:/^([123456789]|1[012])/,abbreviated:/^([123456789]|1[012])月/i,wide:/^([123456789]|1[012])月/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^1\D/,/^2/,/^3/,/^4/,/^5/,/^6/,/^7/,/^8/,/^9/,/^10/,/^11/,/^12/]},defaultParseWidth:"any"}),day:x({matchPatterns:{narrow:/^[日月火水木金土]/,short:/^[日月火水木金土]/,abbreviated:/^[日月火水木金土]/,wide:/^[日月火水木金土]曜日/},defaultMatchWidth:"wide",parsePatterns:{any:[/^日/,/^月/,/^火/,/^水/,/^木/,/^金/,/^土/]},defaultParseWidth:"any"}),dayPeriod:x({matchPatterns:{any:/^(AM|PM|午前|午後|正午|深夜|真夜中|夜|朝)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^(A|午前)/i,pm:/^(P|午後)/i,midnight:/^深夜|真夜中/i,noon:/^正午/i,morning:/^朝/i,afternoon:/^午後/i,evening:/^夜/i,night:/^深夜/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};var P=a(73002);function M({worktree:e,onSessionKilled:t,onStatusChanged:a}){var s,o;let{id:c,name:u,description:m,updatedAt:h,isSessionRunning:p,isWaitingForResponse:x,favorite:g,status:N,link:k}=e,[C,M]=(0,n.useState)(!1),[W,z]=(0,n.useState)(g||!1),[D,A]=(0,n.useState)(!1),[T,$]=(0,n.useState)(N||null),[L,E]=(0,n.useState)(!1),R=h?(s=new Date(h),o={addSuffix:!0,locale:S},function(e,t,a){var r,n,s,i;let l;let o=a?.locale??y.locale??f,d=w(e,t);if(isNaN(d))throw RangeError("Invalid time value");let c=Object.assign({},a,{addSuffix:a?.addSuffix,comparison:d}),[u,m]=j(a?.in,...d>0?[t,e]:[e,t]),h=(r=m,n=u,(i=void 0,e=>{let t=(i?Math[i]:Math.trunc)(e);return 0===t?0:t})((+b(r)-+b(n))/1e3)),p=Math.round((h-(v(m)-v(u))/1e3)/60);if(p<2){if(a?.includeSeconds){if(h<5)return o.formatDistance("lessThanXSeconds",5,c);if(h<10)return o.formatDistance("lessThanXSeconds",10,c);if(h<20)return o.formatDistance("lessThanXSeconds",20,c);if(h<40)return o.formatDistance("halfAMinute",0,c);else if(h<60)return o.formatDistance("lessThanXMinutes",1,c);else return o.formatDistance("xMinutes",1,c)}return 0===p?o.formatDistance("lessThanXMinutes",1,c):o.formatDistance("xMinutes",p,c)}if(p<45)return o.formatDistance("xMinutes",p,c);if(p<90)return o.formatDistance("aboutXHours",1,c);if(p<1440)return o.formatDistance("aboutXHours",Math.round(p/60),c);if(p<2520)return o.formatDistance("xDays",1,c);if(p<43200)return o.formatDistance("xDays",Math.round(p/1440),c);if(p<86400)return l=Math.round(p/43200),o.formatDistance("aboutXMonths",l,c);if((l=function(e,t,a){let[r,n,s]=j(void 0,e,e,t),i=w(n,s),l=Math.abs(function(e,t,a){let[r,n]=j(void 0,e,t);return 12*(r.getFullYear()-n.getFullYear())+(r.getMonth()-n.getMonth())}(n,s));if(l<1)return 0;1===n.getMonth()&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*l);let o=w(n,s)===-i;(function(e,t){let a=b(e,void 0);return+function(e,t){let a=b(e,t?.in);return a.setHours(23,59,59,999),a}(a,void 0)==+function(e,t){let a=b(e,t?.in),r=a.getMonth();return a.setFullYear(a.getFullYear(),r+1,0),a.setHours(23,59,59,999),a}(a,void 0)})(r)&&1===l&&1===w(r,s)&&(o=!1);let d=i*(l-+o);return 0===d?0:d}(m,u))<12)return o.formatDistance("xMonths",Math.round(p/43200),c);{let e=l%12,t=Math.trunc(l/12);return e<3?o.formatDistance("aboutXYears",t,c):e<9?o.formatDistance("overXYears",t,c):o.formatDistance("almostXYears",t+1,c)}}(s,d(s,Date.now()),o)):null,F="main"===u||"master"===u,O=async e=>{if(e.preventDefault(),e.stopPropagation(),confirm(`「${u}」のセッションを終了しますか?
2
2
 
3
- ※全てのメッセージ履歴が削除されます。ログファイルは保持されます。`))try{D(!0),await P.Iv.killSession(c),t&&t()}catch(t){let e=(0,P.zG)(t);alert(`セッションの終了に失敗しました: ${e}`)}finally{D(!1)}},_=async e=>{e.preventDefault(),e.stopPropagation();try{$(!0);let e=!z;await P.Iv.toggleFavorite(c,e),A(e)}catch(t){let e=(0,P.zG)(t);alert(`お気に入りの更新に失敗しました: ${e}`)}finally{$(!1)}},q=async(e,t)=>{t.preventDefault(),t.stopPropagation();try{F(!0),await P.Iv.updateStatus(c,e),E(e),a&&a()}catch(t){let e=(0,P.zG)(t);alert(`ステータスの更新に失敗しました: ${e}`)}finally{F(!1)}};return r.jsx(i.default,{href:`/worktrees/${c}`,className:"block",children:(0,r.jsxs)(l.Zb,{hover:!0,padding:"lg",className:"h-full",children:[r.jsx(l.Ol,{children:(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsxs)(l.ll,{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("button",{onClick:_,disabled:T,className:"flex-shrink-0 transition-colors hover:scale-110",title:z?"お気に入りを解除":"お気に入りに追加",children:r.jsx("svg",{className:`w-5 h-5 ${z?"fill-yellow-400 text-yellow-400":"fill-none text-gray-400"}`,stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})})}),r.jsx("span",{className:"truncate",children:u}),I&&r.jsx(l.Ct,{variant:"info",children:"Main"}),x&&g&&r.jsx(l.Ct,{variant:"warning",dot:!0,children:"レスポンス待ち"}),x&&!g&&r.jsx(l.Ct,{variant:"success",dot:!0,children:"レスポンス完了"})]}),x&&r.jsx(l.zx,{variant:"danger",size:"sm",onClick:X,disabled:W,className:"flex-shrink-0",children:W?"終了中...":"終了"})]})}),r.jsx(l.aY,{children:(0,r.jsxs)("div",{className:"space-y-3",children:[m&&(0,r.jsxs)("div",{children:[r.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Description"}),r.jsx("p",{className:"text-sm text-gray-700 line-clamp-2 whitespace-pre-wrap",children:m})]}),C&&(0,r.jsxs)("div",{children:[r.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Link"}),(0,r.jsxs)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),C&&window.open(C,"_blank","noopener,noreferrer")},className:"flex items-center gap-1 text-sm text-blue-600 hover:text-blue-800 hover:underline transition-colors",title:"Open link in new tab",children:[r.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),r.jsx("span",{className:"truncate",children:C})]})]}),(h||M)&&(0,r.jsxs)("div",{children:[r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"Last Messages & Status"}),r.jsx("div",{className:"space-y-1.5",children:(h?.claude||M?.claude)&&(0,r.jsxs)("div",{className:"flex items-start gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[r.jsx(l.Ct,{variant:"info",className:"text-xs",children:"Claude"}),M?.claude?.isRunning&&M?.claude?.isWaitingForResponse&&r.jsx(l.Ct,{variant:"warning",dot:!0,className:"text-xs",children:"待機中"}),M?.claude?.isRunning&&!M?.claude?.isWaitingForResponse&&r.jsx(l.Ct,{variant:"success",dot:!0,className:"text-xs",children:"完了"})]}),h?.claude&&r.jsx("p",{className:"text-sm text-gray-700 line-clamp-1 flex-1",children:h.claude})]})})]}),(0,r.jsxs)("div",{children:[r.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Status"}),(0,r.jsxs)("div",{className:"flex gap-1 flex-wrap",children:[r.jsx("button",{onClick:e=>q(null,e),disabled:L,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${null===R?"bg-gray-100 text-gray-700 border-gray-400":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50"}`,children:"Not set"}),r.jsx("button",{onClick:e=>q("todo",e),disabled:L,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${"todo"===R?"bg-gray-100 text-gray-700 border-gray-400":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50"}`,children:"ToDo"}),r.jsx("button",{onClick:e=>q("doing",e),disabled:L,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${"doing"===R?"bg-blue-100 text-blue-700 border-blue-400":"bg-white text-gray-600 border-gray-200 hover:bg-blue-50"}`,children:"Doing"}),r.jsx("button",{onClick:e=>q("done",e),disabled:L,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${"done"===R?"bg-green-100 text-green-700 border-green-400":"bg-white text-gray-600 border-gray-200 hover:bg-green-50"}`,children:"Done"})]})]}),O&&(0,r.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[r.jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,r.jsxs)("span",{children:["Updated ",O]})]})]})})]})})}function W(e){let t=process.env.NEXT_PUBLIC_WORKTREE_REPOS;return!!t&&t.split(",").map(e=>e.trim()).includes(e)}function D({initialWorktrees:e=[]}){let[t,a]=(0,n.useState)(e),[s,i]=(0,n.useState)([]),[o,d]=(0,n.useState)(!e.length),[c,u]=(0,n.useState)(null),[m,h]=(0,n.useState)(""),[p,x]=(0,n.useState)("updated"),[g,f]=(0,n.useState)("desc"),[y,b]=(0,n.useState)(null),[v,j]=(0,n.useState)(null),[w,N]=(0,n.useState)(null),k=(0,n.useCallback)(async(e=!1)=>{try{e||d(!0),u(null);let t=await P.Iv.getAll();a(t.worktrees),i(t.repositories)}catch(e){u((0,P.zG)(e))}finally{e||d(!1)}},[]),C=e=>!!(e&&"session_status_changed"===e.type),{status:S}=function(e={}){let{worktreeIds:t=[],onMessage:a,onStatusChange:r,autoReconnect:s=!0,reconnectDelay:i=3e3}=e,[l,o]=(0,n.useState)("disconnected"),d=(0,n.useRef)(null),c=(0,n.useRef)(),u=(0,n.useRef)(new Set),m=(0,n.useCallback)(e=>{o(e),r?.(e)},[r]),h=(0,n.useCallback)(()=>{if(d.current?.readyState===WebSocket.OPEN)return;m("connecting");let e="https:"===window.location.protocol?"wss:":"ws:",t=new WebSocket(`${e}//${window.location.host}`);t.onopen=()=>{m("connected"),u.current.forEach(e=>{t.send(JSON.stringify({type:"subscribe",worktreeId:e}))})},t.onmessage=e=>{try{let t=JSON.parse(e.data);a?.(t)}catch(e){console.error("Failed to parse WebSocket message:",e)}},t.onerror=()=>{m("error")},t.onclose=()=>{m("disconnected"),d.current=null,s&&(c.current=setTimeout(()=>{h()},i))},d.current=t},[m,a,s,i]),p=(0,n.useCallback)(()=>{c.current&&clearTimeout(c.current),d.current&&(d.current.close(1e3,"Client disconnect"),d.current=null),m("disconnected")},[m]);return{status:l,subscribe:(0,n.useCallback)(e=>{d.current?.readyState===WebSocket.OPEN&&(d.current.send(JSON.stringify({type:"subscribe",worktreeId:e})),u.current.add(e))},[]),unsubscribe:(0,n.useCallback)(e=>{d.current?.readyState===WebSocket.OPEN&&(d.current.send(JSON.stringify({type:"unsubscribe",worktreeId:e})),u.current.delete(e))},[]),sendMessage:(0,n.useCallback)(e=>{d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify(e))},[]),connect:h,disconnect:p}}({onMessage:(0,n.useCallback)(e=>{if(C(e.data)){let t=e.data;a(e=>e.map(e=>e.id===t.worktreeId?{...e,isSessionRunning:t.isRunning}:e))}"broadcast"===e.type&&k(!0)},[k])}),D=(0,n.useMemo)(()=>{let e=[...t];if(y&&(e=e.filter(e=>e.repositoryPath===y)),null!==v&&(e="unset"===v?e.filter(e=>!e.status):e.filter(e=>e.status===v)),m){let t=m.toLowerCase();e=e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)||e.repositoryName.toLowerCase().includes(t)||e.lastMessageSummary?.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t))}return e.sort((e,t)=>{let a=0;switch(p){case"name":a=e.name.localeCompare(t.name);break;case"updated":a=(e.updatedAt?new Date(e.updatedAt).getTime():0)-(t.updatedAt?new Date(t.updatedAt).getTime():0);break;case"favorite":a=(e.favorite?1:0)-(t.favorite?1:0)}return"asc"===g?a:-a}),e},[t,y,v,m,p,g]),z=(0,n.useMemo)(()=>{let e=new Map;for(let t of D){let a=t.repositoryPath||"unknown";e.has(a)||e.set(a,[]),e.get(a).push(t)}return e},[D]),A=e=>{p===e?f(e=>"asc"===e?"desc":"asc"):(x(e),f("asc"))},T=async(e,t)=>{let a=s.find(t=>t.path===e)?.worktreeCount||0,r=W(e),n=`Delete repository "${t}"?
3
+ ※全てのメッセージ履歴が削除されます。ログファイルは保持されます。`))try{M(!0),await P.Iv.killSession(c),t&&t()}catch(t){let e=(0,P.zG)(t);alert(`セッションの終了に失敗しました: ${e}`)}finally{M(!1)}},X=async e=>{e.preventDefault(),e.stopPropagation();try{A(!0);let e=!W;await P.Iv.toggleFavorite(c,e),z(e)}catch(t){let e=(0,P.zG)(t);alert(`お気に入りの更新に失敗しました: ${e}`)}finally{A(!1)}},I=async(e,t)=>{t.preventDefault(),t.stopPropagation();try{E(!0),await P.Iv.updateStatus(c,e),$(e),a&&a()}catch(t){let e=(0,P.zG)(t);alert(`ステータスの更新に失敗しました: ${e}`)}finally{E(!1)}};return r.jsx(i.default,{href:`/worktrees/${c}`,className:"block",children:(0,r.jsxs)(l.Zb,{hover:!0,padding:"lg",className:"h-full",children:[r.jsx(l.Ol,{children:(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsxs)(l.ll,{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("button",{onClick:X,disabled:D,className:"flex-shrink-0 transition-colors hover:scale-110",title:W?"お気に入りを解除":"お気に入りに追加",children:r.jsx("svg",{className:`w-5 h-5 ${W?"fill-yellow-400 text-yellow-400":"fill-none text-gray-400"}`,stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})})}),r.jsx("span",{className:"truncate",children:u}),F&&r.jsx(l.Ct,{variant:"info",children:"Main"}),p&&x&&r.jsx(l.Ct,{variant:"warning",dot:!0,children:"レスポンス待ち"}),p&&!x&&r.jsx(l.Ct,{variant:"success",dot:!0,children:"レスポンス完了"})]}),p&&r.jsx(l.zx,{variant:"danger",size:"sm",onClick:O,disabled:C,className:"flex-shrink-0",children:C?"終了中...":"終了"})]})}),r.jsx(l.aY,{children:(0,r.jsxs)("div",{className:"space-y-3",children:[m&&(0,r.jsxs)("div",{children:[r.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Description"}),r.jsx("p",{className:"text-sm text-gray-700 line-clamp-2 whitespace-pre-wrap",children:m})]}),k&&(0,r.jsxs)("div",{children:[r.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Link"}),(0,r.jsxs)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),k&&window.open(k,"_blank","noopener,noreferrer")},className:"flex items-center gap-1 text-sm text-blue-600 hover:text-blue-800 hover:underline transition-colors",title:"Open link in new tab",children:[r.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),r.jsx("span",{className:"truncate",children:k})]})]}),(0,r.jsxs)("div",{children:[r.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Status"}),(0,r.jsxs)("div",{className:"flex gap-1 flex-wrap",children:[r.jsx("button",{onClick:e=>I(null,e),disabled:L,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${null===T?"bg-gray-100 text-gray-700 border-gray-400":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50"}`,children:"Not set"}),r.jsx("button",{onClick:e=>I("todo",e),disabled:L,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${"todo"===T?"bg-gray-100 text-gray-700 border-gray-400":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50"}`,children:"ToDo"}),r.jsx("button",{onClick:e=>I("doing",e),disabled:L,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${"doing"===T?"bg-blue-100 text-blue-700 border-blue-400":"bg-white text-gray-600 border-gray-200 hover:bg-blue-50"}`,children:"Doing"}),r.jsx("button",{onClick:e=>I("done",e),disabled:L,className:`px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ${"done"===T?"bg-green-100 text-green-700 border-green-400":"bg-white text-gray-600 border-gray-200 hover:bg-green-50"}`,children:"Done"})]})]}),R&&(0,r.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[r.jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,r.jsxs)("span",{children:["Updated ",R]})]})]})})]})})}function W({initialWorktrees:e=[]}){let[t,a]=(0,n.useState)(e),[s,i]=(0,n.useState)([]),[o,d]=(0,n.useState)(!e.length),[c,u]=(0,n.useState)(null),[m,h]=(0,n.useState)(""),[p,x]=(0,n.useState)("updated"),[g,f]=(0,n.useState)("desc"),[y,b]=(0,n.useState)(null),[v,j]=(0,n.useState)(null),[w,N]=(0,n.useState)(null),[k,C]=(0,n.useState)([]),[S,W]=(0,n.useState)(!1),[z,D]=(0,n.useState)(null),A=(0,n.useCallback)(async()=>{try{let e=await P.J1.getExcluded();e.success&&C(e.repositories)}catch{}},[]),T=(0,n.useCallback)(async(e=!1)=>{try{e||d(!0),u(null);let t=await P.Iv.getAll();a(t.worktrees),i(t.repositories)}catch(e){u((0,P.zG)(e))}finally{e||d(!1)}},[]),$=e=>!!(e&&"session_status_changed"===e.type),{status:L}=function(e={}){let{worktreeIds:t=[],onMessage:a,onStatusChange:r,autoReconnect:s=!0,reconnectDelay:i=3e3}=e,[l,o]=(0,n.useState)("disconnected"),d=(0,n.useRef)(null),c=(0,n.useRef)(),u=(0,n.useRef)(new Set),m=(0,n.useCallback)(e=>{o(e),r?.(e)},[r]),h=(0,n.useCallback)(()=>{if(d.current?.readyState===WebSocket.OPEN)return;m("connecting");let e="https:"===window.location.protocol?"wss:":"ws:",t=new WebSocket(`${e}//${window.location.host}`);t.onopen=()=>{m("connected"),u.current.forEach(e=>{t.send(JSON.stringify({type:"subscribe",worktreeId:e}))})},t.onmessage=e=>{try{let t=JSON.parse(e.data);a?.(t)}catch(e){console.error("Failed to parse WebSocket message:",e)}},t.onerror=()=>{m("error")},t.onclose=()=>{m("disconnected"),d.current=null,s&&(c.current=setTimeout(()=>{h()},i))},d.current=t},[m,a,s,i]),p=(0,n.useCallback)(()=>{c.current&&clearTimeout(c.current),d.current&&(d.current.close(1e3,"Client disconnect"),d.current=null),m("disconnected")},[m]);return{status:l,subscribe:(0,n.useCallback)(e=>{d.current?.readyState===WebSocket.OPEN&&(d.current.send(JSON.stringify({type:"subscribe",worktreeId:e})),u.current.add(e))},[]),unsubscribe:(0,n.useCallback)(e=>{d.current?.readyState===WebSocket.OPEN&&(d.current.send(JSON.stringify({type:"unsubscribe",worktreeId:e})),u.current.delete(e))},[]),sendMessage:(0,n.useCallback)(e=>{d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify(e))},[]),connect:h,disconnect:p}}({onMessage:(0,n.useCallback)(e=>{if($(e.data)){let t=e.data;a(e=>e.map(e=>e.id===t.worktreeId?{...e,isSessionRunning:t.isRunning}:e))}"broadcast"===e.type&&T(!0)},[T])}),E=(0,n.useMemo)(()=>{let e=[...t];if(y&&(e=e.filter(e=>e.repositoryPath===y)),null!==v&&(e="unset"===v?e.filter(e=>!e.status):e.filter(e=>e.status===v)),m){let t=m.toLowerCase();e=e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)||e.repositoryName.toLowerCase().includes(t)||e.lastMessageSummary?.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t))}return e.sort((e,t)=>{let a=0;switch(p){case"name":a=e.name.localeCompare(t.name);break;case"updated":a=(e.updatedAt?new Date(e.updatedAt).getTime():0)-(t.updatedAt?new Date(t.updatedAt).getTime():0);break;case"favorite":a=(e.favorite?1:0)-(t.favorite?1:0)}return"asc"===g?a:-a}),e},[t,y,v,m,p,g]),R=(0,n.useMemo)(()=>{let e=new Map;for(let t of E){let a=t.repositoryPath||"unknown";e.has(a)||e.set(a,[]),e.get(a).push(t)}return e},[E]),F=e=>{p===e?f(e=>"asc"===e?"desc":"asc"):(x(e),f("asc"))},O=async e=>{D(e);try{let t=await P.J1.restore(e);t.warning&&u(t.warning),await T(),await A()}catch(e){u((0,P.zG)(e))}finally{D(null)}},X=async(e,t)=>{let a=s.find(t=>t.path===e)?.worktreeCount||0;if("delete"===prompt(`Delete repository "${t}"?
4
4
 
5
5
  This will delete:
6
6
  - ${a} worktree(s)
7
7
  - Related chat history
8
8
  - Related memos
9
9
 
10
- * Log files will be preserved`;if(r&&(n+=`
10
+ * Log files will be preserved
11
11
 
12
- WARNING: This repository is configured in environment variable (WORKTREE_REPOS).
13
- It will be re-registered when you run "Sync All".
14
- To permanently remove it, also update the environment variable.`),"delete"===prompt(n+=`
12
+ This repository will be added to the exclusion list.
13
+ It will NOT be re-registered when you run "Sync All".
14
+ You can restore it from the excluded repositories list.
15
15
 
16
- Type "delete" to confirm:`)){N(e);try{await P.J1.delete(e),y===e&&b(null),await k()}catch(e){u((0,P.zG)(e))}finally{N(null)}}};return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,r.jsxs)(l.Ct,{variant:"gray",children:[t.length," branches"]}),s.length>0&&(0,r.jsxs)(l.Ct,{variant:"info",children:[s.length," ",1===s.length?"repository":"repositories"]}),"connected"===S&&r.jsx(l.Ct,{variant:"success",dot:!0,children:"Live"})]}),r.jsx("div",{className:"flex gap-2 w-full sm:w-auto",children:r.jsx(l.zx,{variant:"secondary",size:"sm",onClick:()=>k(),disabled:o,children:o?"Loading...":"Refresh"})})]}),r.jsx("div",{className:"flex flex-col sm:flex-row gap-3",children:r.jsx("input",{type:"text",placeholder:"Search worktrees...",value:m,onChange:e=>h(e.target.value),className:"input flex-1"})}),s.length>0&&(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap items-center",children:[(0,r.jsxs)(l.zx,{variant:null===y?"primary":"ghost",size:"sm",onClick:()=>b(null),children:["All (",t.length,")"]}),s.map(e=>(0,r.jsxs)("div",{className:"relative group inline-flex items-center",children:[(0,r.jsxs)(l.zx,{variant:y===e.path?"primary":"ghost",size:"sm",onClick:()=>b(e.path),className:"pr-6",children:[e.name," (",e.worktreeCount,")",W(e.path)&&r.jsx("span",{title:"Configured in environment variable",className:"ml-1 text-amber-500",children:"!"})]}),r.jsx("button",{className:"absolute right-1 opacity-0 group-hover:opacity-100 text-gray-400 hover:text-red-500 transition-opacity px-1",onClick:t=>{t.stopPropagation(),T(e.path,e.name)},disabled:w===e.path,title:"Delete repository",children:w===e.path?"...":"x"})]},e.path))]}),(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap items-center",children:[r.jsx(l.zx,{variant:null===v?"primary":"ghost",size:"sm",onClick:()=>j(null),children:"All"}),r.jsx(l.zx,{variant:"todo"===v?"primary":"ghost",size:"sm",onClick:()=>j("todo"),children:"\uD83D\uDCDD ToDo"}),r.jsx(l.zx,{variant:"doing"===v?"primary":"ghost",size:"sm",onClick:()=>j("doing"),children:"\uD83D\uDEA7 Doing"}),r.jsx(l.zx,{variant:"done"===v?"primary":"ghost",size:"sm",onClick:()=>j("done"),children:"✅ Done"}),r.jsx(l.zx,{variant:"unset"===v?"primary":"ghost",size:"sm",onClick:()=>j("unset"),children:"Not set"})]}),(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[r.jsx("span",{className:"text-sm text-gray-600 self-center",children:"Sort by:"}),(0,r.jsxs)(l.zx,{variant:"favorite"===p?"primary":"ghost",size:"sm",onClick:()=>A("favorite"),children:["⭐ Favorite ","favorite"===p&&("asc"===g?"↑":"↓")]}),(0,r.jsxs)(l.zx,{variant:"name"===p?"primary":"ghost",size:"sm",onClick:()=>A("name"),children:["Name ","name"===p&&("asc"===g?"↑":"↓")]}),(0,r.jsxs)(l.zx,{variant:"updated"===p?"primary":"ghost",size:"sm",onClick:()=>A("updated"),children:["Updated ","updated"===p&&("asc"===g?"↑":"↓")]})]}),c&&r.jsx("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:r.jsx("p",{className:"text-sm text-red-800",children:c})}),o&&!t.length&&(0,r.jsxs)("div",{className:"text-center py-12",children:[r.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"}),r.jsx("p",{className:"mt-4 text-gray-600",children:"Loading worktrees..."})]}),!o&&!c&&0===D.length&&(0,r.jsxs)("div",{className:"text-center py-12",children:[r.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),r.jsx("p",{className:"mt-4 text-gray-600",children:m?"No worktrees found matching your search":"No worktrees found"})]}),!o&&D.length>0&&r.jsx("div",{className:"space-y-8",children:Array.from(z.entries()).map(([e,t])=>{let a=s.find(t=>t.path===e),n=a?.name||"Unknown Repository";return(0,r.jsxs)("div",{className:"space-y-4",children:[(s.length>1||!y)&&(0,r.jsxs)("div",{className:"flex items-center gap-3 pb-2 border-b border-gray-200",children:[r.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:n}),r.jsx(l.Ct,{variant:"gray",children:t.length})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:t.map(e=>r.jsx(M,{worktree:e,onSessionKilled:k,onStatusChanged:k},e.id))})]},e)})})]})}a(35047),a(43053),a(15470);class z{constructor(){}static getInstance(){return z.instance||(z.instance=new z),z.instance}normalize(e){let t=e.match(/^ssh:\/\/git@([^:\/]+)(:\d+)?\/(.+?)(\.git)?$/);if(t)return`https://${t[1]}/${t[3]}`.toLowerCase().replace(/\/$/,"");let a=e.match(/^git@([^:]+):(.+?)(\.git)?$/);return a?`https://${a[1]}/${a[2]}`.toLowerCase().replace(/\/$/,""):e.replace(/\.git\/?$/,"").replace(/\/$/,"").toLowerCase()}isSameRepository(e,t){return this.normalize(e)===this.normalize(t)}extractRepoName(e){let t=e.match(/^ssh:\/\/git@[^\/]+\/(.+?)(\.git)?$/);if(t){let e=t[1].split("/");return e[e.length-1]}let a=e.match(/:(.+?)(\.git)?$/);if(a&&e.startsWith("git@")){let e=a[1].split("/");return e[e.length-1]}let r=e.match(/\/([^\/]+?)(\.git)?$/);return r?r[1]:""}getUrlType(e){return e.startsWith("https://")?"https":e.startsWith("git@")||e.startsWith("ssh://")?"ssh":null}validate(e){if(!e||"string"!=typeof e||""===e.trim())return{valid:!1,error:"EMPTY_URL"};let t=e.trim();return t.startsWith("https://")?/^https:\/\/[^\/]+\/[^\/]+\/[^\/]+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}:t.startsWith("git@")?/^git@[^:]+:.+\/.+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}:t.startsWith("ssh://")&&/^ssh:\/\/git@[^\/]+(:\d+)?\/[^\/]+\/.+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}}}function A({onRepositoryAdded:e}){let[t,a]=(0,n.useState)(!1),[s,i]=(0,n.useState)("local"),[o,d]=(0,n.useState)(""),[c,u]=(0,n.useState)(""),[m,h]=(0,n.useState)(!1),[p,x]=(0,n.useState)(!1),[g,f]=(0,n.useState)(!1),[y,b]=(0,n.useState)(null),[v,j]=(0,n.useState)(null),[w,N]=(0,n.useState)(null),k=z.getInstance(),C=(0,n.useCallback)(async t=>{try{let r=await P.J1.getCloneStatus(t);"completed"===r.status?(N("Repository cloned successfully"),f(!1),b(null),u(""),a(!1),e&&e()):"failed"===r.status?(j(r.error?.message||"Clone failed"),f(!1),b(null)):("running"===r.status||"pending"===r.status)&&setTimeout(()=>C(t),2e3)}catch(e){j((0,P.zG)(e)),f(!1),b(null)}},[e]),S=async t=>{if(t.preventDefault(),!o.trim()){j("Repository path is required");return}j(null),N(null),h(!0);try{let t=await P.J1.scan(o);N(t.message),d(""),a(!1),e&&e()}catch(e){j((0,P.zG)(e))}finally{h(!1)}},M=async e=>{if(e.preventDefault(),!c.trim()){j("Clone URL is required");return}let t=k.validate(c.trim());if(!t.valid){"EMPTY_URL"===t.error?j("Clone URL is required"):j("Invalid URL format");return}j(null),N(null),f(!0);try{let e=await P.J1.clone(c.trim());b(e.jobId)}catch(e){j((0,P.zG)(e)),f(!1)}},W=async()=>{j(null),N(null),x(!0);try{let t=await P.J1.sync();N(t.message),e&&e()}catch(e){j((0,P.zG)(e))}finally{x(!1)}},D=()=>{a(!1),d(""),u(""),j(null),i("local")};return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[!t&&r.jsx(l.zx,{variant:"primary",size:"sm",onClick:()=>a(!0),children:"+ Add Repository"}),r.jsx(l.zx,{variant:"secondary",size:"sm",onClick:W,disabled:p,children:p?"Syncing...":"Sync All"})]}),t&&r.jsx(l.Zb,{padding:"lg",children:(0,r.jsxs)("div",{className:"space-y-4",children:[r.jsx("div",{children:r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Add New Repository"})}),(0,r.jsxs)("div",{className:"flex border-b border-gray-200",role:"tablist",children:[r.jsx("button",{role:"tab","aria-selected":"local"===s,onClick:()=>i("local"),className:`px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors ${"local"===s?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:"Local Path"}),r.jsx("button",{role:"tab","aria-selected":"url"===s,onClick:()=>i("url"),className:`px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors ${"url"===s?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:"Clone URL"})]}),"local"===s&&(0,r.jsxs)("form",{onSubmit:S,className:"space-y-4",children:[(0,r.jsxs)("div",{children:[r.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Enter the absolute path to a git repository containing worktrees."}),r.jsx("label",{htmlFor:"repositoryPath",className:"block text-sm font-medium text-gray-700 mb-2",children:"Repository Path"}),r.jsx("input",{id:"repositoryPath",type:"text",value:o,onChange:e=>d(e.target.value),placeholder:"/absolute/path/to/repository",className:"input w-full font-mono text-sm",disabled:m}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Example: /Users/username/projects/my-repo"})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[r.jsx(l.zx,{type:"submit",variant:"primary",disabled:m||!o.trim(),children:m?"Scanning...":"Scan & Add"}),r.jsx(l.zx,{type:"button",variant:"ghost",onClick:D,disabled:m,children:"Cancel"})]})]}),"url"===s&&(0,r.jsxs)("form",{onSubmit:M,className:"space-y-4",children:[(0,r.jsxs)("div",{children:[r.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Enter a git clone URL to clone a remote repository."}),r.jsx("label",{htmlFor:"cloneUrl",className:"block text-sm font-medium text-gray-700 mb-2",children:"Clone URL"}),r.jsx("input",{id:"cloneUrl",type:"text",value:c,onChange:e=>u(e.target.value),placeholder:"https://github.com/user/repo.git",className:"input w-full font-mono text-sm",disabled:g}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Supports HTTPS and SSH URLs"})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[r.jsx(l.zx,{type:"submit",variant:"primary",disabled:g||!c.trim(),children:g?"Cloning...":"Clone"}),r.jsx(l.zx,{type:"button",variant:"ghost",onClick:D,disabled:g,children:"Cancel"})]})]})]})}),w&&r.jsx("div",{className:"p-4 bg-green-50 border border-green-200 rounded-lg",children:r.jsx("p",{className:"text-sm text-green-800",children:w})}),v&&r.jsx("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:r.jsx("p",{className:"text-sm text-red-800",children:v})})]})}function T({appId:e,pollInterval:t=3e4,showResponseTime:a=!1,compact:s=!1}){let[i,l]=(0,n.useState)(null),[o,d]=(0,n.useState)(!0);if((0,n.useCallback)(async()=>{try{let t=await fetch(`/api/external-apps/${e}/health`);if(t.ok){let e=await t.json();l(e)}else l({id:e,healthy:!1,lastChecked:Date.now(),error:"Failed to check health"})}catch{l({id:e,healthy:!1,lastChecked:Date.now(),error:"Network error"})}finally{d(!1)}},[e]),o)return(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-gray-300 animate-pulse"}),!s&&r.jsx("span",{className:"text-xs text-gray-400",children:"Checking..."})]});let c=i?.healthy??!1,u=c?"bg-green-500":"bg-gray-400",m=c?"Running":"Stopped";return s?r.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full ${u}`,title:m}):(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full ${u}`}),r.jsx("span",{className:`text-xs ${c?"text-green-600":"text-gray-500"}`,children:m}),a&&i?.responseTime!==void 0&&(0,r.jsxs)("span",{className:"text-xs text-gray-400",children:["(",i.responseTime,"ms)"]})]})}function $({app:e,onEdit:t,onDelete:a}){var s;let[i,o]=(0,n.useState)(!1),[d,c]=(0,n.useState)(!1),u=async()=>{c(!0);try{await a(e.id)}finally{c(!1),o(!1)}},m=`/proxy/${e.pathPrefix}/`;return(0,r.jsxs)(l.Zb,{padding:"md",className:"relative",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[r.jsx("h4",{className:"text-base font-semibold text-gray-900 truncate",children:e.displayName}),r.jsx("p",{className:"text-xs text-gray-500 mt-0.5 font-mono truncate",children:e.name})]}),r.jsx(l.Ct,{variant:{sveltekit:"warning",streamlit:"error",nextjs:"info",other:"gray"}[e.appType]||"gray",children:{sveltekit:"SvelteKit",streamlit:"Streamlit",nextjs:"Next.js",other:"Other"}[s=e.appType]||s})]}),(0,r.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-sm text-gray-600",children:"Status"}),r.jsx(T,{appId:e.id,pollInterval:3e4})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-sm text-gray-600",children:"Port"}),(0,r.jsxs)("span",{className:"text-sm font-mono text-gray-900",children:[":",e.targetPort]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-sm text-gray-600",children:"Path"}),(0,r.jsxs)("span",{className:"text-sm font-mono text-gray-900 truncate max-w-[150px]",children:["/proxy/",e.pathPrefix,"/"]})]}),e.websocketEnabled&&(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-sm text-gray-600",children:"WebSocket"}),r.jsx(l.Ct,{variant:"info",children:"Enabled"})]}),!e.enabled&&r.jsx("div",{className:"mt-2 py-1 px-2 bg-yellow-50 border border-yellow-200 rounded text-xs text-yellow-700",children:"This app is disabled"})]}),i?(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("p",{className:"text-sm text-gray-600",children:['Delete "',e.displayName,'"?']}),(0,r.jsxs)("div",{className:"flex gap-2",children:[r.jsx(l.zx,{variant:"danger",size:"sm",onClick:u,disabled:d,loading:d,children:"Delete"}),r.jsx(l.zx,{variant:"ghost",size:"sm",onClick:()=>o(!1),disabled:d,children:"Cancel"})]})]}):(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[r.jsx(l.zx,{variant:"primary",size:"sm",onClick:()=>window.open(m,"_blank"),disabled:!e.enabled,children:"Open"}),r.jsx(l.zx,{variant:"secondary",size:"sm",onClick:()=>t(e),children:"Settings"}),r.jsx(l.zx,{variant:"ghost",size:"sm",onClick:()=>o(!0),className:"text-red-600 hover:bg-red-50",children:"Delete"})]})]})}let R={MIN:1024,MAX:65535},E=/^[a-zA-Z0-9-]+$/,L={sveltekit:"SvelteKit",streamlit:"Streamlit",nextjs:"Next.js",other:"Other"},F=["sveltekit","streamlit","nextjs","other"].map(e=>({value:e,label:L[e]}));function O({isOpen:e,onClose:t,editApp:a,onSave:s}){let i=!!a,[o,d]=(0,n.useState)(""),[c,u]=(0,n.useState)(""),[m,h]=(0,n.useState)(""),[p,x]=(0,n.useState)(""),[g,f]=(0,n.useState)(""),[y,b]=(0,n.useState)(!1),[v,j]=(0,n.useState)(""),[w,N]=(0,n.useState)(!0),[k,C]=(0,n.useState)({}),[S,P]=(0,n.useState)(!1),[M,W]=(0,n.useState)(null),D=async e=>{e.preventDefault(),W(null);let r=function(e,t){var a;let r={};return e.displayName?.trim()||(r.displayName="Display name is required"),t||(e.name?.trim()?E.test(e.name)||(r.name="Only alphanumeric characters and hyphens are allowed"):r.name="Identifier name is required",e.pathPrefix?.trim()?E.test(e.pathPrefix)||(r.pathPrefix="Only alphanumeric characters and hyphens are allowed"):r.pathPrefix="Path prefix is required"),e.targetPort?"number"!=typeof e.targetPort||Number.isInteger(a=e.targetPort)&&a>=R.MIN&&a<=R.MAX||(r.targetPort=`Port must be between ${R.MIN} and ${R.MAX}`):r.targetPort="Port number is required",t||e.appType||(r.appType="App type is required"),r}({displayName:o,name:c,pathPrefix:m,targetPort:p,appType:g},i);if(Object.keys(r).length>0){C(r);return}C({}),P(!0);try{if(i&&a){let e=await fetch(`/api/external-apps/${a.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({displayName:o,description:v||void 0,targetPort:p||void 0,websocketEnabled:y,enabled:w})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to update app")}}else{let e=await fetch("/api/external-apps",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({displayName:o,name:c,pathPrefix:m,targetPort:p,appType:g,websocketEnabled:y,description:v||void 0})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to create app")}}s(),t()}catch(e){W(e instanceof Error?e.message:"An error occurred")}finally{P(!1)}};return r.jsx(l.u_,{isOpen:e,onClose:t,title:i?"Edit External App":"Add External App",size:"md",children:(0,r.jsxs)("form",{onSubmit:D,className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"displayName",className:"block text-sm font-medium text-gray-700 mb-1",children:["Display Name ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsx("input",{id:"displayName",type:"text",value:o,onChange:e=>d(e.target.value),className:`input w-full ${k.displayName?"border-red-500":""}`,placeholder:"My App",disabled:S}),k.displayName&&r.jsx("p",{className:"mt-1 text-xs text-red-500",children:k.displayName})]}),!i&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-1",children:["Identifier Name ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsx("input",{id:"name",type:"text",value:c,onChange:e=>u(e.target.value),className:`input w-full font-mono ${k.name?"border-red-500":""}`,placeholder:"my-app",disabled:S}),r.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Alphanumeric and hyphens only. Cannot be changed later."}),k.name&&r.jsx("p",{className:"mt-1 text-xs text-red-500",children:k.name})]}),!i&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"pathPrefix",className:"block text-sm font-medium text-gray-700 mb-1",children:["Path Prefix ",r.jsx("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("div",{className:"flex items-center",children:[r.jsx("span",{className:"text-sm text-gray-500 mr-1",children:"/proxy/"}),r.jsx("input",{id:"pathPrefix",type:"text",value:m,onChange:e=>h(e.target.value),className:`input flex-1 font-mono ${k.pathPrefix?"border-red-500":""}`,placeholder:"app-name",disabled:S}),r.jsx("span",{className:"text-sm text-gray-500 ml-1",children:"/"})]}),r.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"URL path for accessing this app. Cannot be changed later."}),k.pathPrefix&&r.jsx("p",{className:"mt-1 text-xs text-red-500",children:k.pathPrefix})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"targetPort",className:"block text-sm font-medium text-gray-700 mb-1",children:["Port Number ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsx("input",{id:"targetPort",type:"number",value:p,onChange:e=>x(e.target.value?parseInt(e.target.value,10):""),className:`input w-full font-mono ${k.targetPort?"border-red-500":""}`,placeholder:"5173",min:R.MIN,max:R.MAX,disabled:S}),(0,r.jsxs)("p",{className:"mt-1 text-xs text-gray-500",children:["Target port (",R.MIN,"-",R.MAX,")"]}),k.targetPort&&r.jsx("p",{className:"mt-1 text-xs text-red-500",children:k.targetPort})]}),!i&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"appType",className:"block text-sm font-medium text-gray-700 mb-1",children:["App Type ",r.jsx("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("select",{id:"appType",value:g,onChange:e=>f(e.target.value),className:`input w-full ${k.appType?"border-red-500":""}`,disabled:S,children:[r.jsx("option",{value:"",children:"Select app type..."}),F.map(e=>r.jsx("option",{value:e.value,children:e.label},e.value))]}),k.appType&&r.jsx("p",{className:"mt-1 text-xs text-red-500",children:k.appType})]}),(0,r.jsxs)("div",{children:[r.jsx("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700 mb-1",children:"Description"}),r.jsx("textarea",{id:"description",value:v,onChange:e=>j(e.target.value),className:"input w-full",placeholder:"Optional description...",rows:2,disabled:S})]}),(0,r.jsxs)("div",{className:"flex items-center",children:[r.jsx("input",{id:"websocketEnabled",type:"checkbox",checked:y,onChange:e=>b(e.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",disabled:S}),r.jsx("label",{htmlFor:"websocketEnabled",className:"ml-2 text-sm text-gray-700",children:"Enable WebSocket support"})]}),i&&(0,r.jsxs)("div",{className:"flex items-center",children:[r.jsx("input",{id:"enabled",type:"checkbox",checked:w,onChange:e=>N(e.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",disabled:S}),r.jsx("label",{htmlFor:"enabled",className:"ml-2 text-sm text-gray-700",children:"App is enabled"})]}),M&&r.jsx("div",{className:"p-3 bg-red-50 border border-red-200 rounded text-sm text-red-700",children:M}),(0,r.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-200",children:[r.jsx(l.zx,{type:"button",variant:"ghost",onClick:t,disabled:S,children:"Cancel"}),r.jsx(l.zx,{type:"submit",variant:"primary",loading:S,children:i?"Save Changes":"Add App"})]})]})})}function I(){let[e,t]=(0,n.useState)([]),[a,s]=(0,n.useState)(!0),[i,o]=(0,n.useState)(null),[d,c]=(0,n.useState)(!1),[u,m]=(0,n.useState)(null),h=(0,n.useCallback)(async()=>{try{o(null);let e=await fetch("/api/external-apps");if(!e.ok)throw Error("Failed to fetch external apps");let a=await e.json();t(a.apps||[])}catch(e){o(e instanceof Error?e.message:"An error occurred")}finally{s(!1)}},[]),p=(0,n.useCallback)(e=>{m(e),c(!0)},[]),x=(0,n.useCallback)(()=>{m(null),c(!0)},[]),g=(0,n.useCallback)(async e=>{try{let t=await fetch(`/api/external-apps/${e}`,{method:"DELETE"});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to delete app")}h()}catch(e){console.error("Failed to delete app:",e)}},[h]),f=(0,n.useCallback)(()=>{h()},[h]),y=(0,n.useCallback)(()=>{c(!1),m(null)},[]);return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"External Apps"}),r.jsx(l.zx,{variant:"primary",size:"sm",onClick:x,children:"+ Add App"})]}),a?r.jsx(l.Zb,{padding:"lg",children:(0,r.jsxs)("div",{className:"flex items-center justify-center py-8",children:[r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"}),r.jsx("span",{className:"ml-3 text-gray-600",children:"Loading apps..."})]})}):i?r.jsx(l.Zb,{padding:"lg",children:(0,r.jsxs)("div",{className:"text-center py-8",children:[r.jsx("p",{className:"text-red-600 mb-4",children:"Failed to load external apps"}),r.jsx(l.zx,{variant:"secondary",size:"sm",onClick:h,children:"Retry"})]})}):0===e.length?r.jsx(l.Zb,{padding:"lg",children:(0,r.jsxs)("div",{className:"text-center py-8",children:[r.jsx("p",{className:"text-gray-500 mb-4",children:"No external apps registered yet."}),r.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"Add an external app to proxy requests to other frontend applications."}),r.jsx(l.zx,{variant:"primary",size:"sm",onClick:x,children:"Add Your First App"})]})}):r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(e=>r.jsx($,{app:e,onEdit:p,onDelete:g},e.id))}),r.jsx(O,{isOpen:d,onClose:y,editApp:u,onSave:f})]})}function X(){let[e,t]=(0,n.useState)(0),a=(0,n.useCallback)(()=>{t(e=>e+1)},[]);return r.jsx(s.Vw,{children:(0,r.jsxs)("div",{className:"container-custom py-8 overflow-auto h-full",children:[(0,r.jsxs)("div",{className:"mb-8",children:[r.jsx("h1",{className:"mb-2",children:"CommandMate"}),r.jsx("p",{className:"text-lg text-gray-600",children:"Git worktree management with Claude CLI and tmux sessions"})]}),r.jsx("div",{className:"mb-8",children:r.jsx(A,{onRepositoryAdded:a})}),r.jsx(D,{},e),r.jsx("div",{className:"mt-8",children:r.jsx(I,{})})]})})}},35480:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>r});let r=(0,a(68570).createProxy)(String.raw`/home/runner/work/CommandMate/CommandMate/src/app/page.tsx#default`)}};var t=require("../webpack-runtime.js");t.C(e);var a=e=>t(t.s=e),r=t.X(0,[8948,4471,6621,434,3053,6550,9703],()=>a(37906));module.exports=r})();
16
+ Type "delete" to confirm:`)){N(e);try{await P.J1.delete(e),y===e&&b(null),await T(),await A()}catch(e){u((0,P.zG)(e))}finally{N(null)}}};return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,r.jsxs)(l.Ct,{variant:"gray",children:[t.length," branches"]}),s.length>0&&(0,r.jsxs)(l.Ct,{variant:"info",children:[s.length," ",1===s.length?"repository":"repositories"]}),"connected"===L&&r.jsx(l.Ct,{variant:"success",dot:!0,children:"Live"})]}),r.jsx("div",{className:"flex gap-2 w-full sm:w-auto",children:r.jsx(l.zx,{variant:"secondary",size:"sm",onClick:()=>T(),disabled:o,children:o?"Loading...":"Refresh"})})]}),r.jsx("div",{className:"flex flex-col sm:flex-row gap-3",children:r.jsx("input",{type:"text",placeholder:"Search worktrees...",value:m,onChange:e=>h(e.target.value),className:"input flex-1"})}),s.length>0&&(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap items-center",children:[(0,r.jsxs)(l.zx,{variant:null===y?"primary":"ghost",size:"sm",onClick:()=>b(null),children:["All (",t.length,")"]}),s.map(e=>(0,r.jsxs)("div",{className:"relative group inline-flex items-center",children:[(0,r.jsxs)(l.zx,{variant:y===e.path?"primary":"ghost",size:"sm",onClick:()=>b(e.path),className:"pr-6",children:[e.name," (",e.worktreeCount,")"]}),r.jsx("button",{className:"absolute right-1 opacity-0 group-hover:opacity-100 text-gray-400 hover:text-red-500 transition-opacity px-1",onClick:t=>{t.stopPropagation(),X(e.path,e.name)},disabled:w===e.path,title:"Delete repository",children:w===e.path?"...":"x"})]},e.path))]}),(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap items-center",children:[r.jsx(l.zx,{variant:null===v?"primary":"ghost",size:"sm",onClick:()=>j(null),children:"All"}),r.jsx(l.zx,{variant:"todo"===v?"primary":"ghost",size:"sm",onClick:()=>j("todo"),children:"\uD83D\uDCDD ToDo"}),r.jsx(l.zx,{variant:"doing"===v?"primary":"ghost",size:"sm",onClick:()=>j("doing"),children:"\uD83D\uDEA7 Doing"}),r.jsx(l.zx,{variant:"done"===v?"primary":"ghost",size:"sm",onClick:()=>j("done"),children:"✅ Done"}),r.jsx(l.zx,{variant:"unset"===v?"primary":"ghost",size:"sm",onClick:()=>j("unset"),children:"Not set"})]}),(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[r.jsx("span",{className:"text-sm text-gray-600 self-center",children:"Sort by:"}),(0,r.jsxs)(l.zx,{variant:"favorite"===p?"primary":"ghost",size:"sm",onClick:()=>F("favorite"),children:["⭐ Favorite ","favorite"===p&&("asc"===g?"↑":"↓")]}),(0,r.jsxs)(l.zx,{variant:"name"===p?"primary":"ghost",size:"sm",onClick:()=>F("name"),children:["Name ","name"===p&&("asc"===g?"↑":"↓")]}),(0,r.jsxs)(l.zx,{variant:"updated"===p?"primary":"ghost",size:"sm",onClick:()=>F("updated"),children:["Updated ","updated"===p&&("asc"===g?"↑":"↓")]})]}),c&&r.jsx("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:r.jsx("p",{className:"text-sm text-red-800",children:c})}),o&&!t.length&&(0,r.jsxs)("div",{className:"text-center py-12",children:[r.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"}),r.jsx("p",{className:"mt-4 text-gray-600",children:"Loading worktrees..."})]}),!o&&!c&&0===E.length&&(0,r.jsxs)("div",{className:"text-center py-12",children:[r.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),r.jsx("p",{className:"mt-4 text-gray-600",children:m?"No worktrees found matching your search":"No worktrees found"})]}),!o&&E.length>0&&r.jsx("div",{className:"space-y-8",children:Array.from(R.entries()).map(([e,t])=>{let a=s.find(t=>t.path===e),n=a?.name||"Unknown Repository";return(0,r.jsxs)("div",{className:"space-y-4",children:[(s.length>1||!y)&&(0,r.jsxs)("div",{className:"flex items-center gap-3 pb-2 border-b border-gray-200",children:[r.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:n}),r.jsx(l.Ct,{variant:"gray",children:t.length})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:t.map(e=>r.jsx(M,{worktree:e,onSessionKilled:T,onStatusChanged:T},e.id))})]},e)})}),k.length>0&&(0,r.jsxs)("div",{className:"border border-gray-200 rounded-lg",children:[(0,r.jsxs)("button",{className:"w-full flex items-center justify-between p-4 text-left hover:bg-gray-50 transition-colors",onClick:()=>W(!S),children:[(0,r.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Excluded Repositories (",k.length,")"]}),r.jsx("span",{className:"text-gray-400 text-sm",children:S?"Hide":"Show"})]}),S&&r.jsx("div",{className:"border-t border-gray-200 divide-y divide-gray-100",children:k.map(e=>(0,r.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,r.jsxs)("div",{children:[r.jsx("span",{className:"text-sm font-medium text-gray-700",children:e.name}),r.jsx("span",{className:"text-xs text-gray-500 ml-2",children:e.path})]}),r.jsx(l.zx,{variant:"secondary",size:"sm",onClick:()=>O(e.path),disabled:z===e.path,children:z===e.path?"Restoring...":"Restore"})]},e.id))})]})]})}a(35047),a(43053),a(15470);class z{constructor(){}static getInstance(){return z.instance||(z.instance=new z),z.instance}normalize(e){let t=e.match(/^ssh:\/\/git@([^:\/]+)(:\d+)?\/(.+?)(\.git)?$/);if(t)return`https://${t[1]}/${t[3]}`.toLowerCase().replace(/\/$/,"");let a=e.match(/^git@([^:]+):(.+?)(\.git)?$/);return a?`https://${a[1]}/${a[2]}`.toLowerCase().replace(/\/$/,""):e.replace(/\.git\/?$/,"").replace(/\/$/,"").toLowerCase()}isSameRepository(e,t){return this.normalize(e)===this.normalize(t)}extractRepoName(e){let t=e.match(/^ssh:\/\/git@[^\/]+\/(.+?)(\.git)?$/);if(t){let e=t[1].split("/");return e[e.length-1]}let a=e.match(/:(.+?)(\.git)?$/);if(a&&e.startsWith("git@")){let e=a[1].split("/");return e[e.length-1]}let r=e.match(/\/([^\/]+?)(\.git)?$/);return r?r[1]:""}getUrlType(e){return e.startsWith("https://")?"https":e.startsWith("git@")||e.startsWith("ssh://")?"ssh":null}validate(e){if(!e||"string"!=typeof e||""===e.trim())return{valid:!1,error:"EMPTY_URL"};let t=e.trim();return t.startsWith("https://")?/^https:\/\/[^\/]+\/[^\/]+\/[^\/]+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}:t.startsWith("git@")?/^git@[^:]+:.+\/.+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}:t.startsWith("ssh://")&&/^ssh:\/\/git@[^\/]+(:\d+)?\/[^\/]+\/.+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}}}function D({onRepositoryAdded:e}){let[t,a]=(0,n.useState)(!1),[s,i]=(0,n.useState)("local"),[o,d]=(0,n.useState)(""),[c,u]=(0,n.useState)(""),[m,h]=(0,n.useState)(!1),[p,x]=(0,n.useState)(!1),[g,f]=(0,n.useState)(!1),[y,b]=(0,n.useState)(null),[v,j]=(0,n.useState)(null),[w,N]=(0,n.useState)(null),k=z.getInstance(),C=(0,n.useCallback)(async t=>{try{let r=await P.J1.getCloneStatus(t);"completed"===r.status?(N("Repository cloned successfully"),f(!1),b(null),u(""),a(!1),e&&e()):"failed"===r.status?(j(r.error?.message||"Clone failed"),f(!1),b(null)):("running"===r.status||"pending"===r.status)&&setTimeout(()=>C(t),2e3)}catch(e){j((0,P.zG)(e)),f(!1),b(null)}},[e]),S=async t=>{if(t.preventDefault(),!o.trim()){j("Repository path is required");return}j(null),N(null),h(!0);try{let t=await P.J1.scan(o);N(t.message),d(""),a(!1),e&&e()}catch(e){j((0,P.zG)(e))}finally{h(!1)}},M=async e=>{if(e.preventDefault(),!c.trim()){j("Clone URL is required");return}let t=k.validate(c.trim());if(!t.valid){"EMPTY_URL"===t.error?j("Clone URL is required"):j("Invalid URL format");return}j(null),N(null),f(!0);try{let e=await P.J1.clone(c.trim());b(e.jobId)}catch(e){j((0,P.zG)(e)),f(!1)}},W=async()=>{j(null),N(null),x(!0);try{let t=await P.J1.sync();N(t.message),e&&e()}catch(e){j((0,P.zG)(e))}finally{x(!1)}},D=()=>{a(!1),d(""),u(""),j(null),i("local")};return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[!t&&r.jsx(l.zx,{variant:"primary",size:"sm",onClick:()=>a(!0),children:"+ Add Repository"}),r.jsx(l.zx,{variant:"secondary",size:"sm",onClick:W,disabled:p,children:p?"Syncing...":"Sync All"})]}),t&&r.jsx(l.Zb,{padding:"lg",children:(0,r.jsxs)("div",{className:"space-y-4",children:[r.jsx("div",{children:r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Add New Repository"})}),(0,r.jsxs)("div",{className:"flex border-b border-gray-200",role:"tablist",children:[r.jsx("button",{role:"tab","aria-selected":"local"===s,onClick:()=>i("local"),className:`px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors ${"local"===s?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:"Local Path"}),r.jsx("button",{role:"tab","aria-selected":"url"===s,onClick:()=>i("url"),className:`px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors ${"url"===s?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:"Clone URL"})]}),"local"===s&&(0,r.jsxs)("form",{onSubmit:S,className:"space-y-4",children:[(0,r.jsxs)("div",{children:[r.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Enter the absolute path to a git repository containing worktrees."}),r.jsx("label",{htmlFor:"repositoryPath",className:"block text-sm font-medium text-gray-700 mb-2",children:"Repository Path"}),r.jsx("input",{id:"repositoryPath",type:"text",value:o,onChange:e=>d(e.target.value),placeholder:"/absolute/path/to/repository",className:"input w-full font-mono text-sm",disabled:m}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Example: /Users/username/projects/my-repo"})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[r.jsx(l.zx,{type:"submit",variant:"primary",disabled:m||!o.trim(),children:m?"Scanning...":"Scan & Add"}),r.jsx(l.zx,{type:"button",variant:"ghost",onClick:D,disabled:m,children:"Cancel"})]})]}),"url"===s&&(0,r.jsxs)("form",{onSubmit:M,className:"space-y-4",children:[(0,r.jsxs)("div",{children:[r.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Enter a git clone URL to clone a remote repository."}),r.jsx("label",{htmlFor:"cloneUrl",className:"block text-sm font-medium text-gray-700 mb-2",children:"Clone URL"}),r.jsx("input",{id:"cloneUrl",type:"text",value:c,onChange:e=>u(e.target.value),placeholder:"https://github.com/user/repo.git",className:"input w-full font-mono text-sm",disabled:g}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Supports HTTPS and SSH URLs"})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[r.jsx(l.zx,{type:"submit",variant:"primary",disabled:g||!c.trim(),children:g?"Cloning...":"Clone"}),r.jsx(l.zx,{type:"button",variant:"ghost",onClick:D,disabled:g,children:"Cancel"})]})]})]})}),w&&r.jsx("div",{className:"p-4 bg-green-50 border border-green-200 rounded-lg",children:r.jsx("p",{className:"text-sm text-green-800",children:w})}),v&&r.jsx("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:r.jsx("p",{className:"text-sm text-red-800",children:v})})]})}function A({appId:e,pollInterval:t=3e4,showResponseTime:a=!1,compact:s=!1}){let[i,l]=(0,n.useState)(null),[o,d]=(0,n.useState)(!0);if((0,n.useCallback)(async()=>{try{let t=await fetch(`/api/external-apps/${e}/health`);if(t.ok){let e=await t.json();l(e)}else l({id:e,healthy:!1,lastChecked:Date.now(),error:"Failed to check health"})}catch{l({id:e,healthy:!1,lastChecked:Date.now(),error:"Network error"})}finally{d(!1)}},[e]),o)return(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-gray-300 animate-pulse"}),!s&&r.jsx("span",{className:"text-xs text-gray-400",children:"Checking..."})]});let c=i?.healthy??!1,u=c?"bg-green-500":"bg-gray-400",m=c?"Running":"Stopped";return s?r.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full ${u}`,title:m}):(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full ${u}`}),r.jsx("span",{className:`text-xs ${c?"text-green-600":"text-gray-500"}`,children:m}),a&&i?.responseTime!==void 0&&(0,r.jsxs)("span",{className:"text-xs text-gray-400",children:["(",i.responseTime,"ms)"]})]})}function T({app:e,onEdit:t,onDelete:a}){var s;let[i,o]=(0,n.useState)(!1),[d,c]=(0,n.useState)(!1),u=async()=>{c(!0);try{await a(e.id)}finally{c(!1),o(!1)}},m=`/proxy/${e.pathPrefix}/`;return(0,r.jsxs)(l.Zb,{padding:"md",className:"relative",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[r.jsx("h4",{className:"text-base font-semibold text-gray-900 truncate",children:e.displayName}),r.jsx("p",{className:"text-xs text-gray-500 mt-0.5 font-mono truncate",children:e.name})]}),r.jsx(l.Ct,{variant:{sveltekit:"warning",streamlit:"error",nextjs:"info",other:"gray"}[e.appType]||"gray",children:{sveltekit:"SvelteKit",streamlit:"Streamlit",nextjs:"Next.js",other:"Other"}[s=e.appType]||s})]}),(0,r.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-sm text-gray-600",children:"Status"}),r.jsx(A,{appId:e.id,pollInterval:3e4})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-sm text-gray-600",children:"Port"}),(0,r.jsxs)("span",{className:"text-sm font-mono text-gray-900",children:[":",e.targetPort]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-sm text-gray-600",children:"Path"}),(0,r.jsxs)("span",{className:"text-sm font-mono text-gray-900 truncate max-w-[150px]",children:["/proxy/",e.pathPrefix,"/"]})]}),e.websocketEnabled&&(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-sm text-gray-600",children:"WebSocket"}),r.jsx(l.Ct,{variant:"info",children:"Enabled"})]}),!e.enabled&&r.jsx("div",{className:"mt-2 py-1 px-2 bg-yellow-50 border border-yellow-200 rounded text-xs text-yellow-700",children:"This app is disabled"})]}),i?(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("p",{className:"text-sm text-gray-600",children:['Delete "',e.displayName,'"?']}),(0,r.jsxs)("div",{className:"flex gap-2",children:[r.jsx(l.zx,{variant:"danger",size:"sm",onClick:u,disabled:d,loading:d,children:"Delete"}),r.jsx(l.zx,{variant:"ghost",size:"sm",onClick:()=>o(!1),disabled:d,children:"Cancel"})]})]}):(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[r.jsx(l.zx,{variant:"primary",size:"sm",onClick:()=>window.open(m,"_blank"),disabled:!e.enabled,children:"Open"}),r.jsx(l.zx,{variant:"secondary",size:"sm",onClick:()=>t(e),children:"Settings"}),r.jsx(l.zx,{variant:"ghost",size:"sm",onClick:()=>o(!0),className:"text-red-600 hover:bg-red-50",children:"Delete"})]})]})}let $={MIN:1024,MAX:65535},L=/^[a-zA-Z0-9-]+$/,E={sveltekit:"SvelteKit",streamlit:"Streamlit",nextjs:"Next.js",other:"Other"},R=["sveltekit","streamlit","nextjs","other"].map(e=>({value:e,label:E[e]}));function F({isOpen:e,onClose:t,editApp:a,onSave:s}){let i=!!a,[o,d]=(0,n.useState)(""),[c,u]=(0,n.useState)(""),[m,h]=(0,n.useState)(""),[p,x]=(0,n.useState)(""),[g,f]=(0,n.useState)(""),[y,b]=(0,n.useState)(!1),[v,j]=(0,n.useState)(""),[w,N]=(0,n.useState)(!0),[k,C]=(0,n.useState)({}),[S,P]=(0,n.useState)(!1),[M,W]=(0,n.useState)(null),z=async e=>{e.preventDefault(),W(null);let r=function(e,t){var a;let r={};return e.displayName?.trim()||(r.displayName="Display name is required"),t||(e.name?.trim()?L.test(e.name)||(r.name="Only alphanumeric characters and hyphens are allowed"):r.name="Identifier name is required",e.pathPrefix?.trim()?L.test(e.pathPrefix)||(r.pathPrefix="Only alphanumeric characters and hyphens are allowed"):r.pathPrefix="Path prefix is required"),e.targetPort?"number"!=typeof e.targetPort||Number.isInteger(a=e.targetPort)&&a>=$.MIN&&a<=$.MAX||(r.targetPort=`Port must be between ${$.MIN} and ${$.MAX}`):r.targetPort="Port number is required",t||e.appType||(r.appType="App type is required"),r}({displayName:o,name:c,pathPrefix:m,targetPort:p,appType:g},i);if(Object.keys(r).length>0){C(r);return}C({}),P(!0);try{if(i&&a){let e=await fetch(`/api/external-apps/${a.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({displayName:o,description:v||void 0,targetPort:p||void 0,websocketEnabled:y,enabled:w})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to update app")}}else{let e=await fetch("/api/external-apps",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({displayName:o,name:c,pathPrefix:m,targetPort:p,appType:g,websocketEnabled:y,description:v||void 0})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to create app")}}s(),t()}catch(e){W(e instanceof Error?e.message:"An error occurred")}finally{P(!1)}};return r.jsx(l.u_,{isOpen:e,onClose:t,title:i?"Edit External App":"Add External App",size:"md",children:(0,r.jsxs)("form",{onSubmit:z,className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"displayName",className:"block text-sm font-medium text-gray-700 mb-1",children:["Display Name ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsx("input",{id:"displayName",type:"text",value:o,onChange:e=>d(e.target.value),className:`input w-full ${k.displayName?"border-red-500":""}`,placeholder:"My App",disabled:S}),k.displayName&&r.jsx("p",{className:"mt-1 text-xs text-red-500",children:k.displayName})]}),!i&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-1",children:["Identifier Name ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsx("input",{id:"name",type:"text",value:c,onChange:e=>u(e.target.value),className:`input w-full font-mono ${k.name?"border-red-500":""}`,placeholder:"my-app",disabled:S}),r.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Alphanumeric and hyphens only. Cannot be changed later."}),k.name&&r.jsx("p",{className:"mt-1 text-xs text-red-500",children:k.name})]}),!i&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"pathPrefix",className:"block text-sm font-medium text-gray-700 mb-1",children:["Path Prefix ",r.jsx("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("div",{className:"flex items-center",children:[r.jsx("span",{className:"text-sm text-gray-500 mr-1",children:"/proxy/"}),r.jsx("input",{id:"pathPrefix",type:"text",value:m,onChange:e=>h(e.target.value),className:`input flex-1 font-mono ${k.pathPrefix?"border-red-500":""}`,placeholder:"app-name",disabled:S}),r.jsx("span",{className:"text-sm text-gray-500 ml-1",children:"/"})]}),r.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"URL path for accessing this app. Cannot be changed later."}),k.pathPrefix&&r.jsx("p",{className:"mt-1 text-xs text-red-500",children:k.pathPrefix})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"targetPort",className:"block text-sm font-medium text-gray-700 mb-1",children:["Port Number ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsx("input",{id:"targetPort",type:"number",value:p,onChange:e=>x(e.target.value?parseInt(e.target.value,10):""),className:`input w-full font-mono ${k.targetPort?"border-red-500":""}`,placeholder:"5173",min:$.MIN,max:$.MAX,disabled:S}),(0,r.jsxs)("p",{className:"mt-1 text-xs text-gray-500",children:["Target port (",$.MIN,"-",$.MAX,")"]}),k.targetPort&&r.jsx("p",{className:"mt-1 text-xs text-red-500",children:k.targetPort})]}),!i&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"appType",className:"block text-sm font-medium text-gray-700 mb-1",children:["App Type ",r.jsx("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("select",{id:"appType",value:g,onChange:e=>f(e.target.value),className:`input w-full ${k.appType?"border-red-500":""}`,disabled:S,children:[r.jsx("option",{value:"",children:"Select app type..."}),R.map(e=>r.jsx("option",{value:e.value,children:e.label},e.value))]}),k.appType&&r.jsx("p",{className:"mt-1 text-xs text-red-500",children:k.appType})]}),(0,r.jsxs)("div",{children:[r.jsx("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700 mb-1",children:"Description"}),r.jsx("textarea",{id:"description",value:v,onChange:e=>j(e.target.value),className:"input w-full",placeholder:"Optional description...",rows:2,disabled:S})]}),(0,r.jsxs)("div",{className:"flex items-center",children:[r.jsx("input",{id:"websocketEnabled",type:"checkbox",checked:y,onChange:e=>b(e.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",disabled:S}),r.jsx("label",{htmlFor:"websocketEnabled",className:"ml-2 text-sm text-gray-700",children:"Enable WebSocket support"})]}),i&&(0,r.jsxs)("div",{className:"flex items-center",children:[r.jsx("input",{id:"enabled",type:"checkbox",checked:w,onChange:e=>N(e.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",disabled:S}),r.jsx("label",{htmlFor:"enabled",className:"ml-2 text-sm text-gray-700",children:"App is enabled"})]}),M&&r.jsx("div",{className:"p-3 bg-red-50 border border-red-200 rounded text-sm text-red-700",children:M}),(0,r.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-200",children:[r.jsx(l.zx,{type:"button",variant:"ghost",onClick:t,disabled:S,children:"Cancel"}),r.jsx(l.zx,{type:"submit",variant:"primary",loading:S,children:i?"Save Changes":"Add App"})]})]})})}function O(){let[e,t]=(0,n.useState)([]),[a,s]=(0,n.useState)(!0),[i,o]=(0,n.useState)(null),[d,c]=(0,n.useState)(!1),[u,m]=(0,n.useState)(null),h=(0,n.useCallback)(async()=>{try{o(null);let e=await fetch("/api/external-apps");if(!e.ok)throw Error("Failed to fetch external apps");let a=await e.json();t(a.apps||[])}catch(e){o(e instanceof Error?e.message:"An error occurred")}finally{s(!1)}},[]),p=(0,n.useCallback)(e=>{m(e),c(!0)},[]),x=(0,n.useCallback)(()=>{m(null),c(!0)},[]),g=(0,n.useCallback)(async e=>{try{let t=await fetch(`/api/external-apps/${e}`,{method:"DELETE"});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to delete app")}h()}catch(e){console.error("Failed to delete app:",e)}},[h]),f=(0,n.useCallback)(()=>{h()},[h]),y=(0,n.useCallback)(()=>{c(!1),m(null)},[]);return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"External Apps"}),r.jsx(l.zx,{variant:"primary",size:"sm",onClick:x,children:"+ Add App"})]}),a?r.jsx(l.Zb,{padding:"lg",children:(0,r.jsxs)("div",{className:"flex items-center justify-center py-8",children:[r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"}),r.jsx("span",{className:"ml-3 text-gray-600",children:"Loading apps..."})]})}):i?r.jsx(l.Zb,{padding:"lg",children:(0,r.jsxs)("div",{className:"text-center py-8",children:[r.jsx("p",{className:"text-red-600 mb-4",children:"Failed to load external apps"}),r.jsx(l.zx,{variant:"secondary",size:"sm",onClick:h,children:"Retry"})]})}):0===e.length?r.jsx(l.Zb,{padding:"lg",children:(0,r.jsxs)("div",{className:"text-center py-8",children:[r.jsx("p",{className:"text-gray-500 mb-4",children:"No external apps registered yet."}),r.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"Add an external app to proxy requests to other frontend applications."}),r.jsx(l.zx,{variant:"primary",size:"sm",onClick:x,children:"Add Your First App"})]})}):r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(e=>r.jsx(T,{app:e,onEdit:p,onDelete:g},e.id))}),r.jsx(F,{isOpen:d,onClose:y,editApp:u,onSave:f})]})}function X(){let[e,t]=(0,n.useState)(0),a=(0,n.useCallback)(()=>{t(e=>e+1)},[]);return r.jsx(s.Vw,{children:(0,r.jsxs)("div",{className:"container-custom py-8 overflow-auto h-full",children:[(0,r.jsxs)("div",{className:"mb-8",children:[r.jsx("h1",{className:"mb-2",children:"CommandMate"}),r.jsx("p",{className:"text-lg text-gray-600",children:"Git worktree management with Claude CLI and tmux sessions"})]}),r.jsx("div",{className:"mb-8",children:r.jsx(D,{onRepositoryAdded:a})}),r.jsx(W,{},e),r.jsx("div",{className:"mt-8",children:r.jsx(O,{})})]})})}},35480:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>r});let r=(0,a(68570).createProxy)(String.raw`/home/runner/work/CommandMate/CommandMate/src/app/page.tsx#default`)}};var t=require("../webpack-runtime.js");t.C(e);var a=e=>t(t.s=e),r=t.X(0,[8948,4471,6621,434,3053,6550,8174],()=>a(37906));module.exports=r})();