commandmate 0.2.9 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +3 -3
  3. package/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/cache/config.json +3 -3
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/1.pack +0 -0
  9. package/.next/cache/webpack/client-production/2.pack +0 -0
  10. package/.next/cache/webpack/client-production/index.pack +0 -0
  11. package/.next/cache/webpack/client-production/index.pack.old +0 -0
  12. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  13. package/.next/cache/webpack/server-production/0.pack +0 -0
  14. package/.next/cache/webpack/server-production/index.pack +0 -0
  15. package/.next/next-minimal-server.js.nft.json +1 -1
  16. package/.next/next-server.js.nft.json +1 -1
  17. package/.next/prerender-manifest.json +1 -1
  18. package/.next/required-server-files.json +1 -1
  19. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/app/update-check/route.js +1 -1
  21. package/.next/server/app/api/repositories/route.js +10 -10
  22. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  23. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  24. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  25. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  26. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  27. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  28. package/.next/server/app/page_client-reference-manifest.js +1 -1
  29. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  30. package/.next/server/app/worktrees/[id]/page.js +3 -3
  31. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  32. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  33. package/.next/server/app-paths-manifest.json +7 -7
  34. package/.next/server/chunks/667.js +1 -0
  35. package/.next/server/chunks/7536.js +1 -1
  36. package/.next/server/chunks/9238.js +5 -5
  37. package/.next/server/functions-config-manifest.json +1 -1
  38. package/.next/server/pages/500.html +1 -1
  39. package/.next/server/server-reference-manifest.json +1 -1
  40. package/.next/static/chunks/{5970-9e999084275f2995.js → 5970-dc8fb1c8c0217636.js} +1 -1
  41. package/.next/static/chunks/app/worktrees/[id]/{page-5abc1e9b59430db1.js → page-1b8e4c49fbaf3f99.js} +1 -1
  42. package/.next/trace +5 -5
  43. package/README.md +232 -46
  44. package/dist/server/src/lib/auto-yes-manager.js +10 -59
  45. package/dist/server/src/lib/prompt-answer-sender.js +89 -0
  46. package/dist/server/src/lib/prompt-detector.js +9 -0
  47. package/package.json +1 -1
  48. /package/.next/static/{5sR3jeFe8ymnzcEan6Rdt → NGcx1ej6oVBba0MO0bwCg}/_buildManifest.js +0 -0
  49. /package/.next/static/{5sR3jeFe8ymnzcEan6Rdt → NGcx1ej6oVBba0MO0bwCg}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/worktrees/[id]/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"80":{"*":{"id":"41868","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"79671","name":"*","chunks":[],"async":false}},"12846":{"*":{"id":"12994","name":"*","chunks":[],"async":false}},"18828":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"41845":{"*":{"id":"37398","name":"*","chunks":[],"async":false}},"43095":{"*":{"id":"94881","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"66677":{"*":{"id":"42106","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","816","static/chunks/816-af44cb865b0c980e.js","3185","static/chunks/app/layout-07755491d5d57242.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","816","static/chunks/816-af44cb865b0c980e.js","3185","static/chunks/app/layout-07755491d5d57242.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","816","static/chunks/816-af44cb865b0c980e.js","5970","static/chunks/5970-9e999084275f2995.js","1931","static/chunks/app/page-a6593b9640df66a6.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/page.tsx":{"id":50653,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":43095,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","1038","static/chunks/1038-3509435b68c0967e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","8864","static/chunks/8864-2f60eadc8404fdd0.js","816","static/chunks/816-af44cb865b0c980e.js","5970","static/chunks/5970-9e999084275f2995.js","130","static/chunks/app/worktrees/%5Bid%5D/page-5abc1e9b59430db1.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":41845,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/a69d9c70fce558b4.css"],"/home/runner/work/CommandMate/CommandMate/src/app/page":[],"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page":["static/css/5eacd01f773eed7f.css"]}}
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/worktrees/[id]/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"80":{"*":{"id":"41868","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"79671","name":"*","chunks":[],"async":false}},"12846":{"*":{"id":"12994","name":"*","chunks":[],"async":false}},"18828":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36093":{"*":{"id":"56055","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"41845":{"*":{"id":"37398","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"66677":{"*":{"id":"42106","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","816","static/chunks/816-af44cb865b0c980e.js","3185","static/chunks/app/layout-07755491d5d57242.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","816","static/chunks/816-af44cb865b0c980e.js","3185","static/chunks/app/layout-07755491d5d57242.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","816","static/chunks/816-af44cb865b0c980e.js","5970","static/chunks/5970-dc8fb1c8c0217636.js","1931","static/chunks/app/page-a6593b9640df66a6.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/page.tsx":{"id":50653,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":36093,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","1038","static/chunks/1038-3509435b68c0967e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","8864","static/chunks/8864-2f60eadc8404fdd0.js","816","static/chunks/816-af44cb865b0c980e.js","5970","static/chunks/5970-dc8fb1c8c0217636.js","130","static/chunks/app/worktrees/%5Bid%5D/page-1b8e4c49fbaf3f99.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":41845,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/a69d9c70fce558b4.css"],"/home/runner/work/CommandMate/CommandMate/src/app/page":[],"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page":["static/css/5eacd01f773eed7f.css"]}}
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/worktrees/[id]/terminal/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"80":{"*":{"id":"41868","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"79671","name":"*","chunks":[],"async":false}},"12846":{"*":{"id":"12994","name":"*","chunks":[],"async":false}},"18828":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"41845":{"*":{"id":"37398","name":"*","chunks":[],"async":false}},"43095":{"*":{"id":"94881","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"66677":{"*":{"id":"42106","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","816","static/chunks/816-af44cb865b0c980e.js","3185","static/chunks/app/layout-07755491d5d57242.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","816","static/chunks/816-af44cb865b0c980e.js","3185","static/chunks/app/layout-07755491d5d57242.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","816","static/chunks/816-af44cb865b0c980e.js","5970","static/chunks/5970-9e999084275f2995.js","1931","static/chunks/app/page-a6593b9640df66a6.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/page.tsx":{"id":50653,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":43095,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","1038","static/chunks/1038-3509435b68c0967e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","8864","static/chunks/8864-2f60eadc8404fdd0.js","816","static/chunks/816-af44cb865b0c980e.js","5970","static/chunks/5970-9e999084275f2995.js","130","static/chunks/app/worktrees/%5Bid%5D/page-5abc1e9b59430db1.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":41845,"name":"*","chunks":["9838","static/chunks/30d07d85-393352a92199f695.js","216","static/chunks/216-f18f4a9d8b04a91e.js","1224","static/chunks/app/worktrees/%5Bid%5D/terminal/page-5d85a7e508ce36d3.js"],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/a69d9c70fce558b4.css"],"/home/runner/work/CommandMate/CommandMate/src/app/page":[],"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page":["static/css/5eacd01f773eed7f.css"],"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page":["static/css/85fa6dafca566008.css"]}}
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/worktrees/[id]/terminal/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"80":{"*":{"id":"41868","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"79671","name":"*","chunks":[],"async":false}},"12846":{"*":{"id":"12994","name":"*","chunks":[],"async":false}},"18828":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36093":{"*":{"id":"56055","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"41845":{"*":{"id":"37398","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"66677":{"*":{"id":"42106","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","816","static/chunks/816-af44cb865b0c980e.js","3185","static/chunks/app/layout-07755491d5d57242.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","816","static/chunks/816-af44cb865b0c980e.js","3185","static/chunks/app/layout-07755491d5d57242.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","816","static/chunks/816-af44cb865b0c980e.js","5970","static/chunks/5970-dc8fb1c8c0217636.js","1931","static/chunks/app/page-a6593b9640df66a6.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/page.tsx":{"id":50653,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":36093,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","1038","static/chunks/1038-3509435b68c0967e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","8864","static/chunks/8864-2f60eadc8404fdd0.js","816","static/chunks/816-af44cb865b0c980e.js","5970","static/chunks/5970-dc8fb1c8c0217636.js","130","static/chunks/app/worktrees/%5Bid%5D/page-1b8e4c49fbaf3f99.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":41845,"name":"*","chunks":["9838","static/chunks/30d07d85-393352a92199f695.js","216","static/chunks/216-f18f4a9d8b04a91e.js","1224","static/chunks/app/worktrees/%5Bid%5D/terminal/page-5d85a7e508ce36d3.js"],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/a69d9c70fce558b4.css"],"/home/runner/work/CommandMate/CommandMate/src/app/page":[],"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page":["static/css/5eacd01f773eed7f.css"],"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page":["static/css/85fa6dafca566008.css"]}}
@@ -6,18 +6,18 @@
6
6
  "/api/repositories/excluded/route": "app/api/repositories/excluded/route.js",
7
7
  "/api/repositories/restore/route": "app/api/repositories/restore/route.js",
8
8
  "/api/repositories/route": "app/api/repositories/route.js",
9
- "/api/repositories/sync/route": "app/api/repositories/sync/route.js",
10
9
  "/api/repositories/scan/route": "app/api/repositories/scan/route.js",
11
- "/api/slash-commands/route": "app/api/slash-commands/route.js",
10
+ "/api/repositories/sync/route": "app/api/repositories/sync/route.js",
12
11
  "/api/worktrees/[id]/auto-yes/route": "app/api/worktrees/[id]/auto-yes/route.js",
12
+ "/api/slash-commands/route": "app/api/slash-commands/route.js",
13
13
  "/api/worktrees/[id]/capture/route": "app/api/worktrees/[id]/capture/route.js",
14
14
  "/api/worktrees/[id]/cli-tool/route": "app/api/worktrees/[id]/cli-tool/route.js",
15
15
  "/api/worktrees/[id]/current-output/route": "app/api/worktrees/[id]/current-output/route.js",
16
- "/api/worktrees/[id]/files/[...path]/route": "app/api/worktrees/[id]/files/[...path]/route.js",
17
16
  "/api/worktrees/[id]/interrupt/route": "app/api/worktrees/[id]/interrupt/route.js",
17
+ "/api/worktrees/[id]/files/[...path]/route": "app/api/worktrees/[id]/files/[...path]/route.js",
18
18
  "/api/worktrees/[id]/kill-session/route": "app/api/worktrees/[id]/kill-session/route.js",
19
- "/api/worktrees/[id]/memos/[memoId]/route": "app/api/worktrees/[id]/memos/[memoId]/route.js",
20
19
  "/api/worktrees/[id]/memos/route": "app/api/worktrees/[id]/memos/route.js",
20
+ "/api/worktrees/[id]/memos/[memoId]/route": "app/api/worktrees/[id]/memos/[memoId]/route.js",
21
21
  "/api/worktrees/[id]/messages/route": "app/api/worktrees/[id]/messages/route.js",
22
22
  "/api/worktrees/[id]/prompt-response/route": "app/api/worktrees/[id]/prompt-response/route.js",
23
23
  "/api/worktrees/[id]/respond/route": "app/api/worktrees/[id]/respond/route.js",
@@ -25,21 +25,21 @@
25
25
  "/api/worktrees/[id]/search/route": "app/api/worktrees/[id]/search/route.js",
26
26
  "/api/worktrees/[id]/send/route": "app/api/worktrees/[id]/send/route.js",
27
27
  "/api/worktrees/[id]/slash-commands/route": "app/api/worktrees/[id]/slash-commands/route.js",
28
- "/api/worktrees/[id]/terminal/route": "app/api/worktrees/[id]/terminal/route.js",
29
28
  "/api/worktrees/[id]/start-polling/route": "app/api/worktrees/[id]/start-polling/route.js",
29
+ "/api/worktrees/[id]/terminal/route": "app/api/worktrees/[id]/terminal/route.js",
30
30
  "/api/worktrees/[id]/tree/[...path]/route": "app/api/worktrees/[id]/tree/[...path]/route.js",
31
31
  "/api/worktrees/[id]/tree/route": "app/api/worktrees/[id]/tree/route.js",
32
32
  "/api/worktrees/[id]/upload/[...path]/route": "app/api/worktrees/[id]/upload/[...path]/route.js",
33
33
  "/api/worktrees/[id]/viewed/route": "app/api/worktrees/[id]/viewed/route.js",
34
34
  "/apple-icon.png/route": "app/apple-icon.png/route.js",
35
- "/page": "app/page.js",
36
35
  "/icon.png/route": "app/icon.png/route.js",
36
+ "/page": "app/page.js",
37
37
  "/worktrees/[id]/files/[...path]/page": "app/worktrees/[id]/files/[...path]/page.js",
38
38
  "/worktrees/[id]/page": "app/worktrees/[id]/page.js",
39
39
  "/worktrees/[id]/terminal/page": "app/worktrees/[id]/terminal/page.js",
40
40
  "/api/app/update-check/route": "app/api/app/update-check/route.js",
41
- "/api/external-apps/[id]/health/route": "app/api/external-apps/[id]/health/route.js",
42
41
  "/api/external-apps/route": "app/api/external-apps/route.js",
42
+ "/api/external-apps/[id]/health/route": "app/api/external-apps/[id]/health/route.js",
43
43
  "/api/external-apps/[id]/route": "app/api/external-apps/[id]/route.js",
44
44
  "/api/worktrees/[id]/logs/route": "app/api/worktrees/[id]/logs/route.js",
45
45
  "/api/worktrees/[id]/logs/[filename]/route": "app/api/worktrees/[id]/logs/[filename]/route.js",
@@ -0,0 +1 @@
1
+ "use strict";exports.id=667,exports.ids=[667],exports.modules={87946:(e,t,r)=>{r.d(t,{Ad:()=>l,l1:()=>o});let n=[36e5,108e5,288e5],l=36e5;function o(e){return"number"==typeof e&&n.includes(e)}},60667:(e,t,r)=>{r.d(t,{bq:()=>m,gf:()=>w,m$:()=>p,bY:()=>g,w:()=>v,Qz:()=>A});var n=r(89194),l=r(63661),o=r(49528),s=r(43839),i=r(19377),a=r(87946);let u=/^[a-zA-Z0-9_-]+$/,c=globalThis.__autoYesStates??(globalThis.__autoYesStates=new Map),f=globalThis.__autoYesPollerStates??(globalThis.__autoYesPollerStates=new Map);function p(e){return!!e&&0!==e.length&&u.test(e)}function d(e){return Date.now()>e.expiresAt}function m(e){let t=c.get(e);if(!t)return null;if(d(t)){let r={...t,enabled:!1};return c.set(e,r),r}return t}function g(e,t,r){if(t){let t=Date.now(),n={enabled:!0,enabledAt:t,expiresAt:t+(r??a.Ad)};return c.set(e,n),n}{let t=c.get(e),r={enabled:!1,enabledAt:t?.enabledAt??0,expiresAt:t?.expiresAt??0};return c.set(e,r),r}}function w(e){let t=f.get(e);return t?.lastServerResponseTimestamp??null}async function b(e,t){if(!f.get(e))return;let r=m(e);if(!r?.enabled||d(r)){A(e);return}try{let r=await (0,n.NA)(e,t,5e3),a=(0,i.vp)(r),u=a.split("\n").slice(-50).join("\n");if((0,i.Wg)(t,u)){h(e,t);return}let c=(0,i.Sg)(t),p=(0,l.F)(a,c);if(!p.isPrompt||!p.promptData){h(e,t);return}let d=function(e){if("yes_no"===e.type)return"y";if("multiple_choice"===e.type){let t=e.options.find(e=>e.isDefault)??e.options[0];return!t||t.requiresTextInput?null:t.number.toString()}return null}(p.promptData);if(null===d){h(e,t);return}let m=s.g.getInstance().getTool(t).getSessionName(e);await (0,o.z)({sessionName:m,answer:d,cliToolId:t,promptData:p.promptData}),function(e,t){let r=f.get(e);r&&(r.lastServerResponseTimestamp=t)}(e,Date.now()),function(e){let t=f.get(e);t&&(t.consecutiveErrors=0,t.currentInterval=2e3)}(e),console.info(`[Auto-Yes Poller] Sent response for worktree: ${e}`)}catch(r){!function(e){let t=f.get(e);if(t){var r;t.consecutiveErrors++,t.currentInterval=(r=t.consecutiveErrors)<5?2e3:Math.min(2e3*Math.pow(2,r-5+1),6e4)}}(e);let t=r instanceof Error?r.message:"Unknown error";console.warn(`[Auto-Yes Poller] Error for worktree ${e}: ${t}`)}h(e,t)}function h(e,t){let r=f.get(e);r&&(r.timerId=setTimeout(()=>{b(e,t)},r.currentInterval))}function v(e,t){if(!p(e))return{started:!1,reason:"invalid worktree ID"};let r=m(e);if(!r?.enabled)return{started:!1,reason:"auto-yes not enabled"};let n=f.has(e);if(!n&&f.size>=50)return{started:!1,reason:"max concurrent pollers reached"};n&&A(e);let l={timerId:null,cliToolId:t,consecutiveErrors:0,currentInterval:2e3,lastServerResponseTimestamp:null};return f.set(e,l),l.timerId=setTimeout(()=>{b(e,t)},2e3),console.info(`[Auto-Yes Poller] Started for worktree: ${e}, cliTool: ${t}`),{started:!0}}function A(e){let t=f.get(e);t&&(t.timerId&&clearTimeout(t.timerId),f.delete(e),console.info(`[Auto-Yes Poller] Stopped for worktree: ${e}`))}},49528:(e,t,r)=>{r.d(t,{z:()=>s});var n=r(10927);let l=/^\[[ x]\] /;function o(e){if(0===e)return[];let t=e>0?"Down":"Up";return Array.from({length:Math.abs(e)},()=>t)}async function s(e){let{sessionName:t,answer:r,cliToolId:s,promptData:i,fallbackPromptType:a,fallbackDefaultOptionNumber:u}=e;if("claude"===s&&(i?.type==="multiple_choice"||"multiple_choice"===a)&&/^\d+$/.test(r)){let e;let s=parseInt(r,10),a=null;if(i?.type==="multiple_choice"){let t=(a=i.options).find(e=>e.isDefault);e=t?.number??1}else e=u??1;let c=s-e;if(null!==a&&a.some(e=>l.test(e.label))&&null!==a){let e=a.filter(e=>l.test(e.label)).length,r=[...o(c),"Space"];r.push(...o(e-s+1)),r.push("Enter"),await (0,n.hL)(t,r)}else{let e=[...o(c),"Enter"];await (0,n.hL)(t,e)}}else await (0,n.Is)(t,r,!1),await new Promise(e=>setTimeout(e,100)),await (0,n.Is)(t,"",!0)}}};
@@ -1 +1 @@
1
- "use strict";exports.id=7536,exports.ids=[7536],exports.modules={89194:(e,t,s)=>{s.d(t,{Lg:()=>o,NA:()=>a});var n=s(10927),i=s(43839);let r=(0,s(43895).h)("cli-session");async function o(e,t){let s=i.g.getInstance().getTool(t).getSessionName(e);return await (0,n.Hk)(s)}async function a(e,t,s=1e3){let o=r.withContext({worktreeId:e,cliToolId:t});o.debug("captureSessionOutput:start",{requestedLines:s});let a=i.g.getInstance().getTool(t),l=a.getSessionName(e);if(!await (0,n.Hk)(l))throw o.debug("captureSessionOutput:sessionNotFound",{sessionName:l}),Error(`${a.name} session ${l} does not exist`);try{let e=await (0,n.xq)(l,{startLine:-s}),t=e.split("\n").length;return o.debug("captureSessionOutput:success",{actualLines:t,lastFewLines:e.split("\n").slice(-3).join(" | ")}),e}catch(t){let e=t instanceof Error?t.message:String(t);throw o.error("captureSessionOutput:failed",{error:e}),Error(`Failed to capture ${a.name} output: ${e}`)}}},43839:(e,t,s)=>{s.d(t,{g:()=>y});var n=s(61282),i=s(21764);let r=/^[a-zA-Z0-9_-]+$/;var o=s(10927);let a=(0,i.promisify)(n.exec);class l{async isInstalled(){try{return await a(`which ${this.command}`,{timeout:5e3}),!0}catch{return!1}}getSessionName(e){let t=`mcbd-${this.id}-${e}`;return function(e){if(!r.test(e))throw Error(`Invalid session name format: ${e}`)}(t),t}async interrupt(e){let t=this.getSessionName(e);await (0,o.ZV)(t,"Escape")}}var u=s(62648);class c extends l{async isInstalled(){return await (0,u.Uv)()}async isRunning(e){return await (0,u.YI)(e)}async startSession(e,t){await (0,u.ym)({worktreeId:e,worktreePath:t})}async sendMessage(e,t){await (0,u.xd)(e,t)}async killSession(e){await (0,u._f)(e)}constructor(...e){super(...e),this.id="claude",this.name="Claude Code",this.command="claude"}}var m=s(92900);let p=(0,i.promisify)(n.exec);function d(e){return e instanceof Error?e.message:String(e)}class f extends l{async isRunning(e){let t=this.getSessionName(e);return await (0,o.Hk)(t)}async startSession(e,t){if(!await this.isInstalled())throw Error("Codex CLI is not installed or not in PATH");let s=this.getSessionName(e);if(await (0,o.Hk)(s)){console.log(`Codex session ${s} already exists`);return}try{await (0,o.ed)({sessionName:s,workingDirectory:t,historyLimit:5e4}),await new Promise(e=>setTimeout(e,100)),await (0,o.Is)(s,"codex",!0),await new Promise(e=>setTimeout(e,3e3)),await (0,o.Is)(s,"2",!0),await new Promise(e=>setTimeout(e,200)),await p(`tmux send-keys -t "${s}" Down`),await new Promise(e=>setTimeout(e,200)),await p(`tmux send-keys -t "${s}" Enter`),await new Promise(e=>setTimeout(e,200)),console.log(`✓ Started Codex session: ${s}`)}catch(t){let e=d(t);throw Error(`Failed to start Codex session: ${e}`)}}async sendMessage(e,t){let s=this.getSessionName(e);if(!await (0,o.Hk)(s))throw Error(`Codex session ${s} does not exist. Start the session first.`);try{await (0,o.Is)(s,t,!1),await new Promise(e=>setTimeout(e,100)),await p(`tmux send-keys -t "${s}" C-m`),await new Promise(e=>setTimeout(e,200)),t.includes("\n")&&await (0,m.N)(s),console.log(`✓ Sent message to Codex session: ${s}`)}catch(t){let e=d(t);throw Error(`Failed to send message to Codex: ${e}`)}}async killSession(e){let t=this.getSessionName(e);try{await (0,o.Hk)(t)&&(await p(`tmux send-keys -t "${t}" C-d`),await new Promise(e=>setTimeout(e,500))),await (0,o.AJ)(t)&&console.log(`✓ Stopped Codex session: ${t}`)}catch(t){let e=d(t);throw console.error(`Error stopping Codex session: ${e}`),t}}constructor(...e){super(...e),this.id="codex",this.name="Codex CLI",this.command="codex"}}let g=(0,i.promisify)(n.exec);class h extends l{async isRunning(e){let t=this.getSessionName(e);return await (0,o.Hk)(t)}async startSession(e,t){if(!await this.isInstalled())throw Error("Gemini CLI is not installed or not in PATH");let s=this.getSessionName(e);if(await (0,o.Hk)(s)){console.log(`Gemini session ${s} already exists`);return}try{await (0,o.ed)({sessionName:s,workingDirectory:t,historyLimit:5e4}),console.log(`✓ Started Gemini session: ${s}`)}catch(t){let e=t instanceof Error?t.message:String(t);throw Error(`Failed to start Gemini session: ${e}`)}}async sendMessage(e,t){let s=this.getSessionName(e);if(!await (0,o.Hk)(s))throw Error(`Gemini session ${s} does not exist. Start the session first.`);try{let e=t.replace(/'/g,"'\\''");await (0,o.Is)(s,`echo '${e}' | gemini`,!0),console.log(`✓ Sent message to Gemini session: ${s}`)}catch(t){let e=t instanceof Error?t.message:String(t);throw Error(`Failed to send message to Gemini: ${e}`)}}async killSession(e){let t=this.getSessionName(e);try{await (0,o.Hk)(t)&&(await g(`tmux send-keys -t "${t}" C-d`),await new Promise(e=>setTimeout(e,500))),await (0,o.AJ)(t)&&console.log(`✓ Stopped Gemini session: ${t}`)}catch(t){let e=t instanceof Error?t.message:String(t);throw console.error(`Error stopping Gemini session: ${e}`),t}}constructor(...e){super(...e),this.id="gemini",this.name="Gemini CLI",this.command="gemini"}}var w=s(59991);class y{constructor(){this.tools=new Map,this.tools.set("claude",new c),this.tools.set("codex",new f),this.tools.set("gemini",new h)}static getInstance(){return y.instance||(y.instance=new y),y.instance}getTool(e){let t=this.tools.get(e);if(!t)throw Error(`CLI tool '${e}' not found`);return t}getAllTools(){return Array.from(this.tools.values())}async getToolInfo(e){let t=this.getTool(e),s=await t.isInstalled();return{id:t.id,name:t.name,command:t.command,installed:s}}async getAllToolsInfo(){return Promise.all(this.getAllTools().map(async e=>{let t=await e.isInstalled();return{id:e.id,name:e.name,command:e.command,installed:t}}))}async getInstalledTools(){return(await this.getAllToolsInfo()).filter(e=>e.installed)}stopPollers(e,t){(0,w.FN)(e,t)}}},63661:(e,t,s)=>{s.d(t,{F:()=>o,J:()=>f});let n=(0,s(43895).h)("prompt-detector"),i=[{regex:/^(.+)\s+\(y\/n\)\s*$/m},{regex:/^(.+)\s+\[y\/N\]\s*$/m,defaultOption:"no"},{regex:/^(.+)\s+\[Y\/n\]\s*$/m,defaultOption:"yes"},{regex:/^(.+)\s+\(yes\/no\)\s*$/m}];function r(e,t,s,n){return{isPrompt:!0,promptData:{type:"yes_no",question:e,options:["yes","no"],status:"pending",...void 0!==n&&{defaultOption:n},instructionText:s},cleanContent:t,rawContent:s}}function o(e,t){n.debug("detectPrompt:start",{outputLength:e.length});let s=e.split("\n").slice(-20).join("\n"),o=function(e,t){let s=t?.requireDefaultIndicator??!0,n=e.split("\n"),i=n.length;for(;i>0&&""===n[i-1].trim();)i--;let r=Math.max(0,i-50);if(s){let t=!1;for(let e=r;e<i;e++){let s=n[e].trim();if(l.test(s)){t=!0;break}}if(!t)return m(e)}let o=[],p=-1;for(let e=i-1;e>=r;e--){let t=n[e].trim(),s=t.match(l);if(s){let e=parseInt(s[1],10),t=s[2].trim();o.unshift({number:e,label:t,isDefault:!0});continue}let i=t.match(u);if(i){let e=parseInt(i[1],10),t=i[2].trim();o.unshift({number:e,label:t,isDefault:!1});continue}if(o.length>0&&t&&!c.test(t)){if(d(t)){p=e;break}if(function(e,t){let s=t.endsWith("?")||t.endsWith("?");return!!(!s&&/^\s{2,}[^\d]/.test(e)&&!/^\s*\d+\./.test(e)||t.length<5&&!s||/^[\/~]/.test(t)||t.length>=2&&/^[a-zA-Z0-9_-]+$/.test(t))}(n[e],t))continue;p=e;break}}if(!function(e){if(0===e.length||1!==e[0])return!1;for(let t=1;t<e.length;t++)if(e[t]!==e[t-1]+1)return!1;return!0}(o.map(e=>e.number)))return m(e);let f=o.some(e=>e.isDefault);if(o.length<2||s&&!f||!s&&(-1===p||!d(n[p]?.trim()??"")&&!function(e,t,s,n){let i=Math.max(n,t-3);for(let s=t-1;s>=i;s--){let t=e[s]?.trim()??"";if(!(!t||c.test(t))&&d(t))return!0}return!1}(n,p,0,r)))return m(e);let g=function(e,t){if(t<0)return"Please select an option:";let s=[];for(let n=Math.max(0,t-5);n<=t;n++){let t=e[n].trim();t&&!c.test(t)&&s.push(t)}return s.join(" ")}(n,p),h=function(e,t,s){if(t<0)return;let n=e.slice(Math.max(0,t-19),s).map(e=>e.trimEnd()).join("\n").trim();return n.length>0?n:void 0}(n,p,i);return{isPrompt:!0,promptData:{type:"multiple_choice",question:g.trim(),options:o.map(e=>{let t=a.some(t=>t.test(e.label));return{number:e.number,label:e.label,isDefault:e.isDefault,requiresTextInput:t}}),status:"pending",instructionText:h},cleanContent:g.trim(),rawContent:function(e){let t=e.split("\n"),s=(t.length>200?t.slice(-200):t).join("\n");return s.length>5e3&&(s=s.slice(-5e3)),s}(e.trim())}}(e,t);if(o.isPrompt)return n.info("detectPrompt:multipleChoice",{isPrompt:!0,question:o.promptData?.question,optionsCount:o.promptData?.options?.length}),o;let p=s.trim();for(let e of i){let t=s.match(e.regex);if(t){let s=t[1].trim();return r(s,s,p,e.defaultOption)}}let f=s.match(/^(.*?)Approve\?\s*$/m);if(f){let e=f[1].trim();return r(e?`${e} Approve?`:"Approve?",e||"Approve?",p)}return n.debug("detectPrompt:complete",{isPrompt:!1}),{isPrompt:!1,cleanContent:e.trim()}}let a=[/type\s+here/i,/tell\s+(me|claude)/i,/enter\s+/i,/custom/i,/differently/i],l=/^\s*\u276F\s*(\d+)\.\s*(.+)$/,u=/^\s*(\d+)\.\s*(.+)$/,c=/^[-─]+$/;function m(e){return{isPrompt:!1,cleanContent:e.trim()}}let p=/(?:select|choose|pick|which|what|how|where|enter|type|specify|confirm|approve|accept|reject|decide|preference|option)/i;function d(e){return 0!==e.length&&!!(e.includes("?")||e.includes("?")||p.test(e))}function f(e,t="yes_no"){let s=e.toLowerCase().trim();if("multiple_choice"===t){if(/^\d+$/.test(s))return s;throw Error("Invalid answer for multiple choice prompt. Expected a number.")}if("yes"===s||"y"===s)return"y";if("no"===s||"n"===s)return"n";throw Error("Invalid answer for yes/no prompt. Expected 'yes', 'no', 'y', or 'n'.")}},59991:(e,t,s)=>{s.d(t,{FN:()=>x,RJ:()=>w,ci:()=>h,cn:()=>$});var n=s(89194),i=s(97425),r=s(75748),o=s(25079),a=s(63661),l=s(76966),u=s(89287),c=s(19377);let m=["Waiting for auth","⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];function p(e){return{response:"",isComplete:!1,lineCount:e}}let d=new Map,f=new Map;function g(e,t){let s=(0,c.Sg)(t);return(0,a.F)((0,c.vp)(e),s)}function h(e){let t=(0,c.vp)(e).split("\n"),s=-1;for(let e=t.length-1;e>=0;e--)if(/^❯\s+\S/.test(t[e])){s=e;break}let n=s>=0?s+1:0,i=t.slice(n),r=[/CLAUDE_HOOKS_/,/\/bin\/claude/,/^claude\s*$/,/@.*\s+%\s*$/,/^[^⏺]*curl.*POST/,/^[^⏺]*Content-Type/,/^[^⏺]*export\s+CLAUDE_/,/^\s*$/,/^[╭╮╰╯│─\s]+$/,/^[│╭╮╰╯].*[│╭╮╰╯]$/,/Claude Code v[\d.]+/,/^Tips for getting started/,/^Welcome back/,/Run \/init to create/,/^Recent activity/,/^No recent activity/,/▐▛███▜▌|▝▜█████▛▘|▘▘ ▝▝/,/^\s*Opus \d+\.\d+\s*·\s*Claude Max/,/\.com's Organization/,/\?\s*for shortcuts\s*$/,/^─{10,}$/,/^❯\s*$/,c.d8],o=[];for(let e of i)!r.some(t=>t.test(e))&&e.trim()&&o.push(e);return o.join("\n").trim()}function w(e){let t=e.split("\n"),s=[],n=[/^maenokota@.*%/,/^zsh:/,/^feature-issue-\d+/,/^\s*$/],i=!1,r=[];for(let e of t){if(e.includes("✦")){i=!0;let t=e.indexOf("✦"),s=e.substring(t+1).trim();s&&r.push(s);continue}if(i){if(n.some(t=>t.test(e)))continue;r.push(e)}}if(r.length>0)return r.join("\n").trim();for(let e of t)n.some(t=>t.test(e))||s.push(e);return s.join("\n").trim()}async function y(e,t){let s=(0,i.n)();try{if(!(0,r.gU)(s,e))return console.error(`Worktree ${e} not found, stopping poller`),x(e,t),!1;if(!await (0,n.Lg)(e,t))return x(e,t),!1;let i=(0,r.zl)(s,e,t),a=i?.lastCapturedLine||0,d=await (0,n.NA)(e,t,1e4),f=function(e,t,s){let n=e.split("\n"),i=n.length;for(;i>0&&""===n[i-1].trim();)i--;let r=n.slice(0,i),o=r.length,a=o>0&&t>25&&o+25<t,l=o>0&&t>50&&o<50,u=a||l;if(!u&&o<t-5)return null;let d=Math.max(0,o-20),f=r.slice(d).join("\n"),{promptPattern:h,separatorPattern:w,thinkingPattern:y,skipPatterns:$}=(0,c.bs)(s),x=(e=60)=>{let t="codex"===s?/^›\s+(?!Implement|Find and fix|Type|Summarize)/:/^[>❯]\s+\S/;for(let s=o-1;s>=Math.max(0,o-e);s--){let e=(0,c.vp)(r[s]);if(t.test(e))return s}return -1};if("claude"===s){let e=r.join("\n");if(g(e,s).isPrompt)return{response:(0,c.vp)(e),isComplete:!0,lineCount:o}}let C=(0,c.vp)(f),S=h.test(C),I=w.test(C),k=y.test(C),v=("codex"===s||"gemini"===s)&&S&&!k,P="claude"===s&&S&&I&&!k;if(v||P){let e;let n=[];if(t>=o||u){let t=x(40);e=t>=0?t+1:0}else if("codex"===s)e=Math.max(0,t);else if(t>=o-5){let t=x(50);e=t>=0?t+1:Math.max(0,o-40)}else e=Math.max(0,t);let i=o;for(let t=e;t<o;t++){let e=r[t],o=(0,c.vp)(e);if("codex"===s&&/^›\s+/.test(o)||"gemini"===s&&/^(%|\$|.*@.*[%$#])\s*$/.test(o)){i=t;break}$.some(e=>e.test(o))||n.push(e)}let a=n.join("\n").trim(),l=a.split("\n").slice(-5).join("\n");if(y.test(l))return p(o);if("claude"===s){let e=(0,c.vp)(a),t=/[╭╮╰╯│]/.test(e)||/░{3,}/.test(e)||/▓{3,}/.test(e),s=/Claude Code|claude\/|v\d+\.\d+/.test(e),n=/Tip:|for shortcuts|\?\s*for help/.test(e),i=/^\s*\/Users\/.*$/m.test(e)&&e.split("\n").length<30,r=e.match(/^[>❯]\s+(\S.*)$/m);if(r){let t=e.indexOf(r[0]);if(0===e.substring(t+r[0].length).trim().split("\n").filter(e=>{let t=e.trim();return t&&!$.some(e=>e.test(t))&&!/^─+$/.test(t)}).length)return p(o)}else if((t||s||n||i)&&a.length<2e3)return p(o)}return"gemini"===s&&((a.match(/[░███]/g)||[]).length>.3*a.length||m.some(e=>a.includes(e))||!a.includes("✦")&&a.length<10)?p(o):{response:a,isComplete:!0,lineCount:i}}let E=r.join("\n");if(g(E,s).isPrompt)return{response:E,isComplete:!0,lineCount:o};let T=[],b=u||t>=o-5,M=b?x(80):-1,N=b?M>=0?M+1:Math.max(0,o-80):Math.max(0,t);for(let e=N;e<o;e++){let t=r[e],s=(0,c.vp)(t);$.some(e=>e.test(s))||T.push(t)}let D=T.join("\n").trim();return D?{response:D,isComplete:!1,lineCount:o}:p(o)}(d,a,t);if(!f||!f.isComplete){let{thinkingPattern:n}=(0,c.bs)(t),i=(0,c.vp)(d).split("\n").slice(-5).join("\n");if(n.test(i)){let n=(0,r.GP)(s,e,t);n>0&&console.log(`Marked ${n} pending prompt(s) as answered (thinking detected) for ${e}`)}return!1}if(f.lineCount===a&&!i?.inProgressMessageId)return!1;if(f.lineCount<=a)return console.log(`[checkForResponse] Already saved up to line ${a}, skipping (result: ${f.lineCount})`),!1;let y=g(f.response,t);if(y.isPrompt){(0,r.Mf)(s,e,t);let n=(0,r.tn)(s,{worktreeId:e,role:"assistant",content:y.rawContent||y.cleanContent,messageType:"prompt",promptData:y.promptData,timestamp:new Date,cliToolId:t});return(0,r.IH)(s,e,t,f.lineCount),(0,o.ps)("message",{worktreeId:e,message:n}),x(e,t),!0}if(!f.response||""===f.response.trim())return(0,r.IH)(s,e,t,f.lineCount),!1;let $="claude"===t?(0,u.Z)(f.response):void 0,C=f.response;if("gemini"===t?C=w(f.response):"claude"===t&&(C=h(f.response)),!C||""===C.trim()||"[No content]"===C)return(0,r.IH)(s,e,t,f.lineCount),(0,r.Mf)(s,e,t),!1;C&&await (0,l.o)(s,e,C,t);let S=(0,r.GP)(s,e,t);S>0&&console.log(`Marked ${S} pending prompt(s) as answered for ${e}`);let I=(0,r.zl)(s,e,t);if(I&&f.lineCount<=I.lastCapturedLine)return console.log(`[checkForResponse] Race condition detected, skipping save (result: ${f.lineCount}, current: ${I.lastCapturedLine})`),!1;let k=(0,r.tn)(s,{worktreeId:e,role:"assistant",content:C,messageType:"normal",timestamp:new Date,cliToolId:t,summary:$?.summary,logFileName:$?.logFileName,requestId:$?.requestId});return(0,o.ps)("message",{worktreeId:e,message:k}),(0,r.IH)(s,e,t,f.lineCount),!0}catch(t){return console.error(`Error checking for response (${e}):`,t instanceof Error?t.message:String(t)),!1}}function $(e,t){let s=`${e}:${t}`;x(e,t),f.set(s,Date.now());let n=setInterval(async()=>{let n=f.get(s);if(n&&Date.now()-n>3e5){x(e,t);return}try{await y(e,t)}catch(e){console.error("[Poller] Error:",e)}},2e3);d.set(s,n)}function x(e,t){let s=`${e}:${t}`,n=d.get(s);n&&(clearInterval(n),d.delete(s),f.delete(s))}}};
1
+ "use strict";exports.id=7536,exports.ids=[7536],exports.modules={89194:(e,t,s)=>{s.d(t,{Lg:()=>o,NA:()=>a});var n=s(10927),i=s(43839);let r=(0,s(43895).h)("cli-session");async function o(e,t){let s=i.g.getInstance().getTool(t).getSessionName(e);return await (0,n.Hk)(s)}async function a(e,t,s=1e3){let o=r.withContext({worktreeId:e,cliToolId:t});o.debug("captureSessionOutput:start",{requestedLines:s});let a=i.g.getInstance().getTool(t),l=a.getSessionName(e);if(!await (0,n.Hk)(l))throw o.debug("captureSessionOutput:sessionNotFound",{sessionName:l}),Error(`${a.name} session ${l} does not exist`);try{let e=await (0,n.xq)(l,{startLine:-s}),t=e.split("\n").length;return o.debug("captureSessionOutput:success",{actualLines:t,lastFewLines:e.split("\n").slice(-3).join(" | ")}),e}catch(t){let e=t instanceof Error?t.message:String(t);throw o.error("captureSessionOutput:failed",{error:e}),Error(`Failed to capture ${a.name} output: ${e}`)}}},43839:(e,t,s)=>{s.d(t,{g:()=>y});var n=s(61282),i=s(21764);let r=/^[a-zA-Z0-9_-]+$/;var o=s(10927);let a=(0,i.promisify)(n.exec);class l{async isInstalled(){try{return await a(`which ${this.command}`,{timeout:5e3}),!0}catch{return!1}}getSessionName(e){let t=`mcbd-${this.id}-${e}`;return function(e){if(!r.test(e))throw Error(`Invalid session name format: ${e}`)}(t),t}async interrupt(e){let t=this.getSessionName(e);await (0,o.ZV)(t,"Escape")}}var u=s(62648);class c extends l{async isInstalled(){return await (0,u.Uv)()}async isRunning(e){return await (0,u.YI)(e)}async startSession(e,t){await (0,u.ym)({worktreeId:e,worktreePath:t})}async sendMessage(e,t){await (0,u.xd)(e,t)}async killSession(e){await (0,u._f)(e)}constructor(...e){super(...e),this.id="claude",this.name="Claude Code",this.command="claude"}}var m=s(92900);let p=(0,i.promisify)(n.exec);function d(e){return e instanceof Error?e.message:String(e)}class f extends l{async isRunning(e){let t=this.getSessionName(e);return await (0,o.Hk)(t)}async startSession(e,t){if(!await this.isInstalled())throw Error("Codex CLI is not installed or not in PATH");let s=this.getSessionName(e);if(await (0,o.Hk)(s)){console.log(`Codex session ${s} already exists`);return}try{await (0,o.ed)({sessionName:s,workingDirectory:t,historyLimit:5e4}),await new Promise(e=>setTimeout(e,100)),await (0,o.Is)(s,"codex",!0),await new Promise(e=>setTimeout(e,3e3)),await (0,o.Is)(s,"2",!0),await new Promise(e=>setTimeout(e,200)),await p(`tmux send-keys -t "${s}" Down`),await new Promise(e=>setTimeout(e,200)),await p(`tmux send-keys -t "${s}" Enter`),await new Promise(e=>setTimeout(e,200)),console.log(`✓ Started Codex session: ${s}`)}catch(t){let e=d(t);throw Error(`Failed to start Codex session: ${e}`)}}async sendMessage(e,t){let s=this.getSessionName(e);if(!await (0,o.Hk)(s))throw Error(`Codex session ${s} does not exist. Start the session first.`);try{await (0,o.Is)(s,t,!1),await new Promise(e=>setTimeout(e,100)),await p(`tmux send-keys -t "${s}" C-m`),await new Promise(e=>setTimeout(e,200)),t.includes("\n")&&await (0,m.N)(s),console.log(`✓ Sent message to Codex session: ${s}`)}catch(t){let e=d(t);throw Error(`Failed to send message to Codex: ${e}`)}}async killSession(e){let t=this.getSessionName(e);try{await (0,o.Hk)(t)&&(await p(`tmux send-keys -t "${t}" C-d`),await new Promise(e=>setTimeout(e,500))),await (0,o.AJ)(t)&&console.log(`✓ Stopped Codex session: ${t}`)}catch(t){let e=d(t);throw console.error(`Error stopping Codex session: ${e}`),t}}constructor(...e){super(...e),this.id="codex",this.name="Codex CLI",this.command="codex"}}let g=(0,i.promisify)(n.exec);class h extends l{async isRunning(e){let t=this.getSessionName(e);return await (0,o.Hk)(t)}async startSession(e,t){if(!await this.isInstalled())throw Error("Gemini CLI is not installed or not in PATH");let s=this.getSessionName(e);if(await (0,o.Hk)(s)){console.log(`Gemini session ${s} already exists`);return}try{await (0,o.ed)({sessionName:s,workingDirectory:t,historyLimit:5e4}),console.log(`✓ Started Gemini session: ${s}`)}catch(t){let e=t instanceof Error?t.message:String(t);throw Error(`Failed to start Gemini session: ${e}`)}}async sendMessage(e,t){let s=this.getSessionName(e);if(!await (0,o.Hk)(s))throw Error(`Gemini session ${s} does not exist. Start the session first.`);try{let e=t.replace(/'/g,"'\\''");await (0,o.Is)(s,`echo '${e}' | gemini`,!0),console.log(`✓ Sent message to Gemini session: ${s}`)}catch(t){let e=t instanceof Error?t.message:String(t);throw Error(`Failed to send message to Gemini: ${e}`)}}async killSession(e){let t=this.getSessionName(e);try{await (0,o.Hk)(t)&&(await g(`tmux send-keys -t "${t}" C-d`),await new Promise(e=>setTimeout(e,500))),await (0,o.AJ)(t)&&console.log(`✓ Stopped Gemini session: ${t}`)}catch(t){let e=t instanceof Error?t.message:String(t);throw console.error(`Error stopping Gemini session: ${e}`),t}}constructor(...e){super(...e),this.id="gemini",this.name="Gemini CLI",this.command="gemini"}}var w=s(59991);class y{constructor(){this.tools=new Map,this.tools.set("claude",new c),this.tools.set("codex",new f),this.tools.set("gemini",new h)}static getInstance(){return y.instance||(y.instance=new y),y.instance}getTool(e){let t=this.tools.get(e);if(!t)throw Error(`CLI tool '${e}' not found`);return t}getAllTools(){return Array.from(this.tools.values())}async getToolInfo(e){let t=this.getTool(e),s=await t.isInstalled();return{id:t.id,name:t.name,command:t.command,installed:s}}async getAllToolsInfo(){return Promise.all(this.getAllTools().map(async e=>{let t=await e.isInstalled();return{id:e.id,name:e.name,command:e.command,installed:t}}))}async getInstalledTools(){return(await this.getAllToolsInfo()).filter(e=>e.installed)}stopPollers(e,t){(0,w.FN)(e,t)}}},63661:(e,t,s)=>{s.d(t,{F:()=>o,J:()=>f});let n=(0,s(43895).h)("prompt-detector"),i=[{regex:/^(.+)\s+\(y\/n\)\s*$/m},{regex:/^(.+)\s+\[y\/N\]\s*$/m,defaultOption:"no"},{regex:/^(.+)\s+\[Y\/n\]\s*$/m,defaultOption:"yes"},{regex:/^(.+)\s+\(yes\/no\)\s*$/m}];function r(e,t,s,n){return{isPrompt:!0,promptData:{type:"yes_no",question:e,options:["yes","no"],status:"pending",...void 0!==n&&{defaultOption:n},instructionText:s},cleanContent:t,rawContent:s}}function o(e,t){n.debug("detectPrompt:start",{outputLength:e.length});let s=e.split("\n").slice(-20).join("\n"),o=function(e,t){let s=t?.requireDefaultIndicator??!0,n=e.split("\n"),i=n.length;for(;i>0&&""===n[i-1].trim();)i--;let r=Math.max(0,i-50);if(s){let t=!1;for(let e=r;e<i;e++){let s=n[e].trim();if(l.test(s)){t=!0;break}}if(!t)return m(e)}let o=[],p=-1;for(let t=i-1;t>=r;t--){let s=n[t].trim(),i=s.match(l);if(i){let e=parseInt(i[1],10),t=i[2].trim();o.unshift({number:e,label:t,isDefault:!0});continue}let r=s.match(u);if(r){let e=parseInt(r[1],10),t=r[2].trim();o.unshift({number:e,label:t,isDefault:!1});continue}if(0===o.length&&s.startsWith("❯"))return m(e);if(o.length>0&&s&&!c.test(s)){if(d(s)){p=t;break}if(function(e,t){let s=t.endsWith("?")||t.endsWith("?");return!!(!s&&/^\s{2,}[^\d]/.test(e)&&!/^\s*\d+\./.test(e)||t.length<5&&!s||/^[\/~]/.test(t)||t.length>=2&&/^[a-zA-Z0-9_-]+$/.test(t))}(n[t],s))continue;p=t;break}}if(!function(e){if(0===e.length||1!==e[0])return!1;for(let t=1;t<e.length;t++)if(e[t]!==e[t-1]+1)return!1;return!0}(o.map(e=>e.number)))return m(e);let f=o.some(e=>e.isDefault);if(o.length<2||s&&!f||!s&&(-1===p||!d(n[p]?.trim()??"")&&!function(e,t,s,n){let i=Math.max(n,t-3);for(let s=t-1;s>=i;s--){let t=e[s]?.trim()??"";if(!(!t||c.test(t))&&d(t))return!0}return!1}(n,p,0,r)))return m(e);let g=function(e,t){if(t<0)return"Please select an option:";let s=[];for(let n=Math.max(0,t-5);n<=t;n++){let t=e[n].trim();t&&!c.test(t)&&s.push(t)}return s.join(" ")}(n,p),h=function(e,t,s){if(t<0)return;let n=e.slice(Math.max(0,t-19),s).map(e=>e.trimEnd()).join("\n").trim();return n.length>0?n:void 0}(n,p,i);return{isPrompt:!0,promptData:{type:"multiple_choice",question:g.trim(),options:o.map(e=>{let t=a.some(t=>t.test(e.label));return{number:e.number,label:e.label,isDefault:e.isDefault,requiresTextInput:t}}),status:"pending",instructionText:h},cleanContent:g.trim(),rawContent:function(e){let t=e.split("\n"),s=(t.length>200?t.slice(-200):t).join("\n");return s.length>5e3&&(s=s.slice(-5e3)),s}(e.trim())}}(e,t);if(o.isPrompt)return n.info("detectPrompt:multipleChoice",{isPrompt:!0,question:o.promptData?.question,optionsCount:o.promptData?.options?.length}),o;let p=s.trim();for(let e of i){let t=s.match(e.regex);if(t){let s=t[1].trim();return r(s,s,p,e.defaultOption)}}let f=s.match(/^(.*?)Approve\?\s*$/m);if(f){let e=f[1].trim();return r(e?`${e} Approve?`:"Approve?",e||"Approve?",p)}return n.debug("detectPrompt:complete",{isPrompt:!1}),{isPrompt:!1,cleanContent:e.trim()}}let a=[/type\s+here/i,/tell\s+(me|claude)/i,/enter\s+/i,/custom/i,/differently/i],l=/^\s*\u276F\s*(\d+)\.\s*(.+)$/,u=/^\s*(\d+)\.\s*(.+)$/,c=/^[-─]+$/;function m(e){return{isPrompt:!1,cleanContent:e.trim()}}let p=/(?:select|choose|pick|which|what|how|where|enter|type|specify|confirm|approve|accept|reject|decide|preference|option)/i;function d(e){return 0!==e.length&&!!(e.includes("?")||e.includes("?")||p.test(e))}function f(e,t="yes_no"){let s=e.toLowerCase().trim();if("multiple_choice"===t){if(/^\d+$/.test(s))return s;throw Error("Invalid answer for multiple choice prompt. Expected a number.")}if("yes"===s||"y"===s)return"y";if("no"===s||"n"===s)return"n";throw Error("Invalid answer for yes/no prompt. Expected 'yes', 'no', 'y', or 'n'.")}},59991:(e,t,s)=>{s.d(t,{FN:()=>x,RJ:()=>w,ci:()=>h,cn:()=>$});var n=s(89194),i=s(97425),r=s(75748),o=s(25079),a=s(63661),l=s(76966),u=s(89287),c=s(19377);let m=["Waiting for auth","⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];function p(e){return{response:"",isComplete:!1,lineCount:e}}let d=new Map,f=new Map;function g(e,t){let s=(0,c.Sg)(t);return(0,a.F)((0,c.vp)(e),s)}function h(e){let t=(0,c.vp)(e).split("\n"),s=-1;for(let e=t.length-1;e>=0;e--)if(/^❯\s+\S/.test(t[e])){s=e;break}let n=s>=0?s+1:0,i=t.slice(n),r=[/CLAUDE_HOOKS_/,/\/bin\/claude/,/^claude\s*$/,/@.*\s+%\s*$/,/^[^⏺]*curl.*POST/,/^[^⏺]*Content-Type/,/^[^⏺]*export\s+CLAUDE_/,/^\s*$/,/^[╭╮╰╯│─\s]+$/,/^[│╭╮╰╯].*[│╭╮╰╯]$/,/Claude Code v[\d.]+/,/^Tips for getting started/,/^Welcome back/,/Run \/init to create/,/^Recent activity/,/^No recent activity/,/▐▛███▜▌|▝▜█████▛▘|▘▘ ▝▝/,/^\s*Opus \d+\.\d+\s*·\s*Claude Max/,/\.com's Organization/,/\?\s*for shortcuts\s*$/,/^─{10,}$/,/^❯\s*$/,c.d8],o=[];for(let e of i)!r.some(t=>t.test(e))&&e.trim()&&o.push(e);return o.join("\n").trim()}function w(e){let t=e.split("\n"),s=[],n=[/^maenokota@.*%/,/^zsh:/,/^feature-issue-\d+/,/^\s*$/],i=!1,r=[];for(let e of t){if(e.includes("✦")){i=!0;let t=e.indexOf("✦"),s=e.substring(t+1).trim();s&&r.push(s);continue}if(i){if(n.some(t=>t.test(e)))continue;r.push(e)}}if(r.length>0)return r.join("\n").trim();for(let e of t)n.some(t=>t.test(e))||s.push(e);return s.join("\n").trim()}async function y(e,t){let s=(0,i.n)();try{if(!(0,r.gU)(s,e))return console.error(`Worktree ${e} not found, stopping poller`),x(e,t),!1;if(!await (0,n.Lg)(e,t))return x(e,t),!1;let i=(0,r.zl)(s,e,t),a=i?.lastCapturedLine||0,d=await (0,n.NA)(e,t,1e4),f=function(e,t,s){let n=e.split("\n"),i=n.length;for(;i>0&&""===n[i-1].trim();)i--;let r=n.slice(0,i),o=r.length,a=o>0&&t>25&&o+25<t,l=o>0&&t>50&&o<50,u=a||l;if(!u&&o<t-5)return null;let d=Math.max(0,o-20),f=r.slice(d).join("\n"),{promptPattern:h,separatorPattern:w,thinkingPattern:y,skipPatterns:$}=(0,c.bs)(s),x=(e=60)=>{let t="codex"===s?/^›\s+(?!Implement|Find and fix|Type|Summarize)/:/^[>❯]\s+\S/;for(let s=o-1;s>=Math.max(0,o-e);s--){let e=(0,c.vp)(r[s]);if(t.test(e))return s}return -1};if("claude"===s){let e=r.join("\n");if(g(e,s).isPrompt)return{response:(0,c.vp)(e),isComplete:!0,lineCount:o}}let C=(0,c.vp)(f),S=h.test(C),I=w.test(C),k=y.test(C),v=("codex"===s||"gemini"===s)&&S&&!k,P="claude"===s&&S&&I&&!k;if(v||P){let e;let n=[];if(t>=o||u){let t=x(40);e=t>=0?t+1:0}else if("codex"===s)e=Math.max(0,t);else if(t>=o-5){let t=x(50);e=t>=0?t+1:Math.max(0,o-40)}else e=Math.max(0,t);let i=o;for(let t=e;t<o;t++){let e=r[t],o=(0,c.vp)(e);if("codex"===s&&/^›\s+/.test(o)||"gemini"===s&&/^(%|\$|.*@.*[%$#])\s*$/.test(o)){i=t;break}$.some(e=>e.test(o))||n.push(e)}let a=n.join("\n").trim(),l=a.split("\n").slice(-5).join("\n");if(y.test(l))return p(o);if("claude"===s){let e=(0,c.vp)(a),t=/[╭╮╰╯│]/.test(e)||/░{3,}/.test(e)||/▓{3,}/.test(e),s=/Claude Code|claude\/|v\d+\.\d+/.test(e),n=/Tip:|for shortcuts|\?\s*for help/.test(e),i=/^\s*\/Users\/.*$/m.test(e)&&e.split("\n").length<30,r=e.match(/^[>❯]\s+(\S.*)$/m);if(r){let t=e.indexOf(r[0]);if(0===e.substring(t+r[0].length).trim().split("\n").filter(e=>{let t=e.trim();return t&&!$.some(e=>e.test(t))&&!/^─+$/.test(t)}).length)return p(o)}else if((t||s||n||i)&&a.length<2e3)return p(o)}return"gemini"===s&&((a.match(/[░███]/g)||[]).length>.3*a.length||m.some(e=>a.includes(e))||!a.includes("✦")&&a.length<10)?p(o):{response:a,isComplete:!0,lineCount:i}}let E=r.join("\n");if(g(E,s).isPrompt)return{response:E,isComplete:!0,lineCount:o};let T=[],b=u||t>=o-5,M=b?x(80):-1,N=b?M>=0?M+1:Math.max(0,o-80):Math.max(0,t);for(let e=N;e<o;e++){let t=r[e],s=(0,c.vp)(t);$.some(e=>e.test(s))||T.push(t)}let D=T.join("\n").trim();return D?{response:D,isComplete:!1,lineCount:o}:p(o)}(d,a,t);if(!f||!f.isComplete){let{thinkingPattern:n}=(0,c.bs)(t),i=(0,c.vp)(d).split("\n").slice(-5).join("\n");if(n.test(i)){let n=(0,r.GP)(s,e,t);n>0&&console.log(`Marked ${n} pending prompt(s) as answered (thinking detected) for ${e}`)}return!1}if(f.lineCount===a&&!i?.inProgressMessageId)return!1;if(f.lineCount<=a)return console.log(`[checkForResponse] Already saved up to line ${a}, skipping (result: ${f.lineCount})`),!1;let y=g(f.response,t);if(y.isPrompt){(0,r.Mf)(s,e,t);let n=(0,r.tn)(s,{worktreeId:e,role:"assistant",content:y.rawContent||y.cleanContent,messageType:"prompt",promptData:y.promptData,timestamp:new Date,cliToolId:t});return(0,r.IH)(s,e,t,f.lineCount),(0,o.ps)("message",{worktreeId:e,message:n}),x(e,t),!0}if(!f.response||""===f.response.trim())return(0,r.IH)(s,e,t,f.lineCount),!1;let $="claude"===t?(0,u.Z)(f.response):void 0,C=f.response;if("gemini"===t?C=w(f.response):"claude"===t&&(C=h(f.response)),!C||""===C.trim()||"[No content]"===C)return(0,r.IH)(s,e,t,f.lineCount),(0,r.Mf)(s,e,t),!1;C&&await (0,l.o)(s,e,C,t);let S=(0,r.GP)(s,e,t);S>0&&console.log(`Marked ${S} pending prompt(s) as answered for ${e}`);let I=(0,r.zl)(s,e,t);if(I&&f.lineCount<=I.lastCapturedLine)return console.log(`[checkForResponse] Race condition detected, skipping save (result: ${f.lineCount}, current: ${I.lastCapturedLine})`),!1;let k=(0,r.tn)(s,{worktreeId:e,role:"assistant",content:C,messageType:"normal",timestamp:new Date,cliToolId:t,summary:$?.summary,logFileName:$?.logFileName,requestId:$?.requestId});return(0,o.ps)("message",{worktreeId:e,message:k}),(0,r.IH)(s,e,t,f.lineCount),!0}catch(t){return console.error(`Error checking for response (${e}):`,t instanceof Error?t.message:String(t)),!1}}function $(e,t){let s=`${e}:${t}`;x(e,t),f.set(s,Date.now());let n=setInterval(async()=>{let n=f.get(s);if(n&&Date.now()-n>3e5){x(e,t);return}try{await y(e,t)}catch(e){console.error("[Poller] Error:",e)}},2e3);d.set(s,n)}function x(e,t){let s=`${e}:${t}`,n=d.get(s);n&&(clearInterval(n),d.delete(s),f.delete(s))}}};
@@ -1,4 +1,4 @@
1
- "use strict";exports.id=9238,exports.ids=[9238],exports.modules={11865:(e,t,a)=>{a.d(t,{Ix:()=>x,pm:()=>m});var s=a(10326),r=a(17577),l=a(30361),n=a(69669),o=a(18019),i=a(94019);let c=3e3;function d({type:e,iconColor:t}){let a=`h-5 w-5 ${t}`;switch(e){case"success":return s.jsx(l.Z,{className:a,"data-testid":"toast-icon-success"});case"error":return s.jsx(n.Z,{className:a,"data-testid":"toast-icon-error"});default:return s.jsx(o.Z,{className:a,"data-testid":"toast-icon-info"})}}function u({id:e,message:t,type:a,onClose:l,duration:n=c}){let o=(0,r.useRef)(null),u=function(e){switch(e){case"success":return{bgColor:"bg-green-50",borderColor:"border-green-200",textColor:"text-green-800",iconColor:"text-green-500"};case"error":return{bgColor:"bg-red-50",borderColor:"border-red-200",textColor:"text-red-800",iconColor:"text-red-500"};default:return{bgColor:"bg-blue-50",borderColor:"border-blue-200",textColor:"text-blue-800",iconColor:"text-blue-500"}}}(a),x=(0,r.useCallback)(()=>{o.current&&clearTimeout(o.current),l(e)},[e,l]);return(0,s.jsxs)("div",{"data-testid":`toast-${e}`,role:"alert",className:`
1
+ "use strict";exports.id=9238,exports.ids=[9238],exports.modules={11865:(e,t,a)=>{a.d(t,{Ix:()=>x,pm:()=>m});var s=a(10326),r=a(17577),l=a(30361),n=a(69669),i=a(18019),o=a(94019);let c=3e3;function d({type:e,iconColor:t}){let a=`h-5 w-5 ${t}`;switch(e){case"success":return s.jsx(l.Z,{className:a,"data-testid":"toast-icon-success"});case"error":return s.jsx(n.Z,{className:a,"data-testid":"toast-icon-error"});default:return s.jsx(i.Z,{className:a,"data-testid":"toast-icon-info"})}}function u({id:e,message:t,type:a,onClose:l,duration:n=c}){let i=(0,r.useRef)(null),u=function(e){switch(e){case"success":return{bgColor:"bg-green-50",borderColor:"border-green-200",textColor:"text-green-800",iconColor:"text-green-500"};case"error":return{bgColor:"bg-red-50",borderColor:"border-red-200",textColor:"text-red-800",iconColor:"text-red-500"};default:return{bgColor:"bg-blue-50",borderColor:"border-blue-200",textColor:"text-blue-800",iconColor:"text-blue-500"}}}(a),x=(0,r.useCallback)(()=>{i.current&&clearTimeout(i.current),l(e)},[e,l]);return(0,s.jsxs)("div",{"data-testid":`toast-${e}`,role:"alert",className:`
2
2
  ${u.bgColor}
3
3
  ${u.borderColor}
4
4
  ${u.textColor}
@@ -10,17 +10,17 @@
10
10
  hover:opacity-70
11
11
  focus:outline-none focus:ring-2 focus:ring-offset-2
12
12
  transition-opacity
13
- `,children:s.jsx(i.Z,{className:"h-4 w-4"})})]})}function x({toasts:e,onClose:t}){return s.jsx("div",{"data-testid":"toast-container","aria-live":"polite",className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2",children:e.map(e=>s.jsx(u,{id:e.id,message:e.message,type:e.type,onClose:t,duration:e.duration},e.id))})}function m(){let[e,t]=(0,r.useState)([]),a=(0,r.useRef)(0);return{toasts:e,showToast:(0,r.useCallback)((e,s="info",r=c)=>{let l=`toast-${++a.current}-${Date.now()}`,n={id:l,message:e,type:s,duration:r};return t(e=>[...e,n]),l},[]),removeToast:(0,r.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]),clearToasts:(0,r.useCallback)(()=>{t([])},[])}}},2583:(e,t,a)=>{a.d(t,{Vw:()=>S});var s=a(10326),r=a(17577);a(90434);var l=a(87403),n=a(2982),o=a(35047),i=a(3885),c=a(61421);function d({status:e,label:t}){let a=c.F4[e],r=`${t}: ${a.label}`;return"spinner"===a.type?s.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 border-2 border-t-transparent animate-spin ${a.className}`,title:r,"aria-label":r}):s.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${a.className}`,title:r,"aria-label":r})}let u=(0,r.memo)(function({branch:e,isSelected:t,onClick:a}){return(0,s.jsxs)("button",{"data-testid":"branch-list-item",onClick:a,"aria-current":t?"true":void 0,className:`
13
+ `,children:s.jsx(o.Z,{className:"h-4 w-4"})})]})}function x({toasts:e,onClose:t}){return s.jsx("div",{"data-testid":"toast-container","aria-live":"polite",className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2",children:e.map(e=>s.jsx(u,{id:e.id,message:e.message,type:e.type,onClose:t,duration:e.duration},e.id))})}function m(){let[e,t]=(0,r.useState)([]),a=(0,r.useRef)(0);return{toasts:e,showToast:(0,r.useCallback)((e,s="info",r=c)=>{let l=`toast-${++a.current}-${Date.now()}`,n={id:l,message:e,type:s,duration:r};return t(e=>[...e,n]),l},[]),removeToast:(0,r.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]),clearToasts:(0,r.useCallback)(()=>{t([])},[])}}},2583:(e,t,a)=>{a.d(t,{Vw:()=>S});var s=a(10326),r=a(17577);a(90434);var l=a(87403),n=a(2982),i=a(35047),o=a(3885),c=a(61421);function d({status:e,label:t}){let a=c.F4[e],r=`${t}: ${a.label}`;return"spinner"===a.type?s.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 border-2 border-t-transparent animate-spin ${a.className}`,title:r,"aria-label":r}):s.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${a.className}`,title:r,"aria-label":r})}let u=(0,r.memo)(function({branch:e,isSelected:t,onClick:a}){return(0,s.jsxs)("button",{"data-testid":"branch-list-item",onClick:a,"aria-current":t?"true":void 0,className:`
14
14
  w-full px-4 py-3 flex flex-col gap-1
15
15
  hover:bg-gray-800 transition-colors
16
16
  focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500
17
17
  ${t?"bg-gray-700 border-l-2 border-blue-500":"border-l-2 border-transparent"}
18
- `,children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[e.cliStatus&&(0,s.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0","aria-label":"CLI tool status",children:[s.jsx(d,{status:e.cliStatus.claude,label:"Claude"}),s.jsx(d,{status:e.cliStatus.codex,label:"Codex"})]}),(0,s.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[s.jsx("p",{className:"text-sm font-medium text-white truncate",children:e.name}),s.jsx("p",{className:"text-xs text-gray-400 truncate",children:e.repositoryName})]}),e.hasUnread&&s.jsx("span",{"data-testid":"unread-indicator",className:"w-2 h-2 rounded-full bg-blue-500 flex-shrink-0","aria-label":"Has unread messages"})]}),e.description&&s.jsx("div",{"data-testid":"branch-description",className:"pl-6 pr-2 mt-1 text-left",children:s.jsx("p",{className:"text-xs text-gray-400 line-clamp-2",children:e.description})})]})}),x=[{key:"updatedAt",label:"Updated"},{key:"repositoryName",label:"Repository"},{key:"branchName",label:"Branch"},{key:"status",label:"Status"}],m=(0,r.memo)(function(){let{sortKey:e,sortDirection:t,setSortKey:a,setSortDirection:n}=(0,l.Sz)(),[o,i]=(0,r.useState)(!1),c=(0,r.useRef)(null);(0,r.useEffect)(()=>{function e(e){c.current&&!c.current.contains(e.target)&&i(!1)}if(o)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[o]),(0,r.useEffect)(()=>{function e(e){"Escape"===e.key&&i(!1)}if(o)return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]);let d=(0,r.useCallback)(()=>{i(e=>!e)},[]),u=(0,r.useCallback)(s=>{s===e?n("asc"===t?"desc":"asc"):(a(s),n("updatedAt"===s?"desc":"asc")),i(!1)},[e,t,a,n]),m=(0,r.useCallback)(()=>{n("asc"===t?"desc":"asc")},[t,n]),b=x.find(t=>t.key===e)?.label||"Sort";return(0,s.jsxs)("div",{ref:c,className:"relative","data-testid":"sort-selector",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsxs)("button",{type:"button",onClick:d,"aria-expanded":o,"aria-haspopup":"listbox","aria-label":`Sort by ${b}`,className:" flex items-center gap-1 px-2 py-1 rounded text-xs text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors ",children:[s.jsx(h,{className:"w-3 h-3"}),s.jsx("span",{className:"hidden sm:inline",children:b})]}),s.jsx("button",{type:"button",onClick:m,"aria-label":"asc"===t?"Sort ascending":"Sort descending",className:" p-1 rounded text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors ",children:"asc"===t?s.jsx(p,{className:"w-3 h-3"}):s.jsx(g,{className:"w-3 h-3"})})]}),o&&s.jsx("div",{role:"listbox","aria-label":"Sort options",className:" absolute right-0 top-full mt-1 z-50 min-w-[140px] py-1 rounded-md shadow-lg bg-gray-800 border border-gray-600 ",children:x.map(a=>(0,s.jsxs)("button",{type:"button",role:"option","aria-selected":e===a.key,onClick:()=>u(a.key),className:`
18
+ `,children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[e.cliStatus&&(0,s.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0","aria-label":"CLI tool status",children:[s.jsx(d,{status:e.cliStatus.claude,label:"Claude"}),s.jsx(d,{status:e.cliStatus.codex,label:"Codex"})]}),(0,s.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[s.jsx("p",{className:"text-sm font-medium text-white truncate",children:e.name}),s.jsx("p",{className:"text-xs text-gray-400 truncate",children:e.repositoryName})]}),e.hasUnread&&s.jsx("span",{"data-testid":"unread-indicator",className:"w-2 h-2 rounded-full bg-blue-500 flex-shrink-0","aria-label":"Has unread messages"})]}),e.description&&s.jsx("div",{"data-testid":"branch-description",className:"pl-6 pr-2 mt-1 text-left",children:s.jsx("p",{className:"text-xs text-gray-400 line-clamp-2",children:e.description})})]})}),x=[{key:"updatedAt",label:"Updated"},{key:"repositoryName",label:"Repository"},{key:"branchName",label:"Branch"},{key:"status",label:"Status"}],m=(0,r.memo)(function(){let{sortKey:e,sortDirection:t,setSortKey:a,setSortDirection:n}=(0,l.Sz)(),[i,o]=(0,r.useState)(!1),c=(0,r.useRef)(null);(0,r.useEffect)(()=>{function e(e){c.current&&!c.current.contains(e.target)&&o(!1)}if(i)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]),(0,r.useEffect)(()=>{function e(e){"Escape"===e.key&&o(!1)}if(i)return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]);let d=(0,r.useCallback)(()=>{o(e=>!e)},[]),u=(0,r.useCallback)(s=>{s===e?n("asc"===t?"desc":"asc"):(a(s),n("updatedAt"===s?"desc":"asc")),o(!1)},[e,t,a,n]),m=(0,r.useCallback)(()=>{n("asc"===t?"desc":"asc")},[t,n]),b=x.find(t=>t.key===e)?.label||"Sort";return(0,s.jsxs)("div",{ref:c,className:"relative","data-testid":"sort-selector",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsxs)("button",{type:"button",onClick:d,"aria-expanded":i,"aria-haspopup":"listbox","aria-label":`Sort by ${b}`,className:" flex items-center gap-1 px-2 py-1 rounded text-xs text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors ",children:[s.jsx(h,{className:"w-3 h-3"}),s.jsx("span",{className:"hidden sm:inline",children:b})]}),s.jsx("button",{type:"button",onClick:m,"aria-label":"asc"===t?"Sort ascending":"Sort descending",className:" p-1 rounded text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors ",children:"asc"===t?s.jsx(p,{className:"w-3 h-3"}):s.jsx(g,{className:"w-3 h-3"})})]}),i&&s.jsx("div",{role:"listbox","aria-label":"Sort options",className:" absolute right-0 top-full mt-1 z-50 min-w-[140px] py-1 rounded-md shadow-lg bg-gray-800 border border-gray-600 ",children:x.map(a=>(0,s.jsxs)("button",{type:"button",role:"option","aria-selected":e===a.key,onClick:()=>u(a.key),className:`
19
19
  w-full px-3 py-2 text-left text-sm
20
20
  flex items-center justify-between
21
21
  hover:bg-gray-700 transition-colors
22
22
  ${e===a.key?"text-blue-400":"text-gray-300"}
23
- `,children:[s.jsx("span",{children:a.label}),e===a.key&&s.jsx("span",{className:"text-xs",children:"asc"===t?"ASC":"DESC"})]},a.key))})]})});function h({className:e}){return s.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12"})})}function p({className:e}){return s.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}function g({className:e}){return s.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}var b=a(34643);let f=["en","ja"],y={en:"English",ja:"日本語"};function v(){let{currentLocale:e,switchLocale:t}={currentLocale:(0,b.bU)(),switchLocale:e=>{f.includes(e)&&(function(e){let t="https:"===window.location.protocol;document.cookie=`locale=${e};path=/;max-age=31536000;SameSite=Lax${t?";Secure":""}`}(e),localStorage.setItem("locale",e),window.location.reload())}};return s.jsx("select",{value:e,onChange:e=>t(e.target.value),"aria-label":"Language",className:" w-full px-3 py-2 rounded-md bg-gray-800 text-white border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm ",children:f.map(e=>s.jsx("option",{value:e,children:y[e]},e))})}var j=a(18421);let w={waiting:0,ready:1,running:2,generating:3,idle:4},N=(0,r.memo)(function(){let e=(0,o.useRouter)(),{worktrees:t,selectedWorktreeId:a,selectWorktree:n}=(0,i.Mu)(),{closeMobileDrawer:c,sortKey:d,sortDirection:x}=(0,l.Sz)(),[h,p]=(0,r.useState)(""),g=(0,r.useMemo)(()=>{let e=t.map(j.I_),a=e;if(h.trim()){let t=h.toLowerCase();a=e.filter(e=>e.name.toLowerCase().includes(t)||e.repositoryName.toLowerCase().includes(t))}return function(e,t,a){let s=[...e];return s.sort((e,s)=>{let r=0;switch(t){case"updatedAt":{let t=e=>e?e instanceof Date?e.getTime():new Date(e).getTime():0,a=t(e.lastActivity);r=t(s.lastActivity)-a;break}case"repositoryName":{let t=e.repositoryName.toLowerCase(),a=s.repositoryName.toLowerCase();r=t.localeCompare(a);break}case"branchName":{let t=e.name.toLowerCase(),a=s.name.toLowerCase();r=t.localeCompare(a);break}case"status":r=w[e.status]-w[s.status]}return("updatedAt"===t?"desc"===a:"asc"===a)?r:-r}),s}(a,d,x)},[t,h,d,x]),b=t=>{n(t),e.push(`/worktrees/${t}`),c()};return(0,s.jsxs)("nav",{"data-testid":"sidebar","aria-label":"Branch navigation",className:"h-full flex flex-col bg-gray-900 text-white",role:"navigation",children:[s.jsx("div",{"data-testid":"sidebar-header",className:"flex-shrink-0 px-4 py-4 border-b border-gray-700",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[s.jsx("h2",{className:"text-lg font-semibold text-white",children:"Branches"}),s.jsx(m,{})]})}),s.jsx("div",{className:"flex-shrink-0 px-4 py-3 border-b border-gray-700",children:s.jsx("input",{type:"text",placeholder:"Search branches...",value:h,onChange:e=>p(e.target.value),className:" w-full px-3 py-2 rounded-md bg-gray-800 text-white placeholder-gray-400 border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent "})}),s.jsx("div",{"data-testid":"branch-list",className:"flex-1 overflow-y-auto",children:0===g.length?s.jsx("div",{className:"px-4 py-8 text-center text-gray-400",children:h?"No branches found":"No branches available"}):g.map(e=>s.jsx(u,{branch:e,isSelected:e.id===a,onClick:()=>b(e.id)},e.id))}),s.jsx("div",{className:"flex-shrink-0 px-4 py-3 border-t border-gray-700",children:s.jsx(v,{})})]})});var k=a(22202);let C="transform transition-transform duration-300 ease-out",S=(0,r.memo)(function({children:e}){let{isOpen:t,isMobileDrawerOpen:a,closeMobileDrawer:r}=(0,l.Sz)();return(0,n.d)()?(0,s.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[a&&s.jsx("div",{"data-testid":"drawer-overlay",className:"fixed inset-0 bg-black/50 z-40",onClick:r,"aria-hidden":"true"}),s.jsx("aside",{"data-testid":"sidebar-container",className:`
23
+ `,children:[s.jsx("span",{children:a.label}),e===a.key&&s.jsx("span",{className:"text-xs",children:"asc"===t?"ASC":"DESC"})]},a.key))})]})});function h({className:e}){return s.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12"})})}function p({className:e}){return s.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}function g({className:e}){return s.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}var b=a(34643);let f=["en","ja"],y={en:"English",ja:"日本語"};function v(){let{currentLocale:e,switchLocale:t}={currentLocale:(0,b.bU)(),switchLocale:e=>{f.includes(e)&&(function(e){let t="https:"===window.location.protocol;document.cookie=`locale=${e};path=/;max-age=31536000;SameSite=Lax${t?";Secure":""}`}(e),localStorage.setItem("locale",e),window.location.reload())}};return s.jsx("select",{value:e,onChange:e=>t(e.target.value),"aria-label":"Language",className:" w-full px-3 py-2 rounded-md bg-gray-800 text-white border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm ",children:f.map(e=>s.jsx("option",{value:e,children:y[e]},e))})}var j=a(18421);let w={waiting:0,ready:1,running:2,generating:3,idle:4},N=(0,r.memo)(function(){let e=(0,i.useRouter)(),{worktrees:t,selectedWorktreeId:a,selectWorktree:n}=(0,o.Mu)(),{closeMobileDrawer:c,sortKey:d,sortDirection:x}=(0,l.Sz)(),[h,p]=(0,r.useState)(""),g=(0,r.useMemo)(()=>{let e=t.map(j.I_),a=e;if(h.trim()){let t=h.toLowerCase();a=e.filter(e=>e.name.toLowerCase().includes(t)||e.repositoryName.toLowerCase().includes(t))}return function(e,t,a){let s=[...e];return s.sort((e,s)=>{let r=0;switch(t){case"updatedAt":{let t=e=>e?e instanceof Date?e.getTime():new Date(e).getTime():0,a=t(e.lastActivity);r=t(s.lastActivity)-a;break}case"repositoryName":{let t=e.repositoryName.toLowerCase(),a=s.repositoryName.toLowerCase();r=t.localeCompare(a);break}case"branchName":{let t=e.name.toLowerCase(),a=s.name.toLowerCase();r=t.localeCompare(a);break}case"status":r=w[e.status]-w[s.status]}return("updatedAt"===t?"desc"===a:"asc"===a)?r:-r}),s}(a,d,x)},[t,h,d,x]),b=t=>{n(t),e.push(`/worktrees/${t}`),c()};return(0,s.jsxs)("nav",{"data-testid":"sidebar","aria-label":"Branch navigation",className:"h-full flex flex-col bg-gray-900 text-white",role:"navigation",children:[s.jsx("div",{"data-testid":"sidebar-header",className:"flex-shrink-0 px-4 py-4 border-b border-gray-700",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[s.jsx("h2",{className:"text-lg font-semibold text-white",children:"Branches"}),s.jsx(m,{})]})}),s.jsx("div",{className:"flex-shrink-0 px-4 py-3 border-b border-gray-700",children:s.jsx("input",{type:"text",placeholder:"Search branches...",value:h,onChange:e=>p(e.target.value),className:" w-full px-3 py-2 rounded-md bg-gray-800 text-white placeholder-gray-400 border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent "})}),s.jsx("div",{"data-testid":"branch-list",className:"flex-1 overflow-y-auto",children:0===g.length?s.jsx("div",{className:"px-4 py-8 text-center text-gray-400",children:h?"No branches found":"No branches available"}):g.map(e=>s.jsx(u,{branch:e,isSelected:e.id===a,onClick:()=>b(e.id)},e.id))}),s.jsx("div",{className:"flex-shrink-0 px-4 py-3 border-t border-gray-700",children:s.jsx(v,{})})]})});var k=a(22202);let C="transform transition-transform duration-300 ease-out",S=(0,r.memo)(function({children:e}){let{isOpen:t,isMobileDrawerOpen:a,closeMobileDrawer:r}=(0,l.Sz)();return(0,n.d)()?(0,s.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[a&&s.jsx("div",{"data-testid":"drawer-overlay",className:"fixed inset-0 bg-black/50 z-40",onClick:r,"aria-hidden":"true"}),s.jsx("aside",{"data-testid":"sidebar-container",className:`
24
24
  fixed left-0 top-0 h-full w-72 z-50
25
25
  ${C}
26
26
  ${a?"translate-x-0":"-translate-x-full"}
@@ -32,4 +32,4 @@
32
32
  flex-1 min-w-0 h-full overflow-hidden
33
33
  transition-[padding] duration-300 ease-out
34
34
  ${t?"md:pl-72":"md:pl-0"}
35
- `,role:"main",children:e})]})})},28676:(e,t,a)=>{a.d(t,{u:()=>n});var s=a(10326),r=a(17577),l=a(60962);function n({isOpen:e,onClose:t,title:a,children:n,size:o="lg",showCloseButton:i=!0,disableClose:c=!1}){let d=(0,r.useRef)(null);return e?(0,l.createPortal)((0,s.jsxs)("div",{className:"fixed inset-0 z-[9999] overflow-y-auto",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:c?void 0:t}),s.jsx("div",{className:"relative flex min-h-full items-center justify-center p-2 sm:p-4",children:(0,s.jsxs)("div",{ref:d,className:`relative w-full ${{sm:"max-w-[calc(100vw-2rem)] sm:max-w-md",md:"max-w-[calc(100vw-2rem)] sm:max-w-2xl",lg:"max-w-[calc(100vw-2rem)] sm:max-w-4xl",xl:"max-w-[calc(100vw-2rem)] sm:max-w-6xl",full:"max-w-[calc(100vw-2rem)] sm:max-w-[95vw]"}[o]} max-h-[calc(100vh-1rem)] sm:max-h-[calc(100vh-2rem)] flex flex-col bg-white rounded-lg shadow-xl transform transition-all`,children:[(a||i)&&(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-gray-200 flex-shrink-0",children:[s.jsx("h3",{className:"text-base sm:text-lg font-semibold text-gray-900 truncate pr-2",children:a}),i&&s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 transition-colors flex-shrink-0",children:s.jsx("svg",{className:"w-5 h-5 sm:w-6 sm:h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),s.jsx("div",{className:"px-4 sm:px-6 py-3 sm:py-4 overflow-y-auto flex-1 min-h-0",children:n})]})})]}),document.body):null}},77758:(e,t,a)=>{a.d(t,{Ct:()=>c,zx:()=>r,Zb:()=>l,aY:()=>i,Ol:()=>n,ll:()=>o,u_:()=>d.u});var s=a(10326);function r({variant:e="primary",size:t="md",fullWidth:a=!1,loading:r=!1,disabled:l,className:n="",children:o,...i}){let c=["btn",{primary:"btn-primary",secondary:"btn-secondary",danger:"btn-danger",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500"}[e],{sm:"btn-sm",md:"",lg:"btn-lg"}[t],a?"w-full":"",l||r?"opacity-50 cursor-not-allowed":"",n].filter(Boolean).join(" ");return(0,s.jsxs)("button",{className:c,disabled:l||r,...i,children:[r&&(0,s.jsxs)("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),o]})}function l({hover:e=!1,padding:t="md",className:a="",children:r,...l}){let n=["card",e?"card-hover":"",{none:"",sm:"p-3",md:"p-4",lg:"p-6"}[t],a].filter(Boolean).join(" ");return s.jsx("div",{className:n,...l,children:r})}function n({className:e="",children:t,...a}){return s.jsx("div",{className:`mb-3 ${e}`,...a,children:t})}function o({className:e="",children:t,...a}){return s.jsx("h3",{className:`text-lg font-semibold text-gray-900 ${e}`,...a,children:t})}function i({className:e="",children:t,...a}){return s.jsx("div",{className:e,...a,children:t})}function c({variant:e="gray",dot:t=!1,className:a="",children:r,...l}){let n=["badge",{success:"badge-success",warning:"badge-warning",error:"badge-error",info:"badge-info",gray:"badge-gray"}[e],a].filter(Boolean).join(" ");return(0,s.jsxs)("span",{className:n,...l,children:[t&&s.jsx("span",{className:`mr-1.5 inline-block h-2 w-2 rounded-full ${{success:"bg-green-600",warning:"bg-yellow-600",error:"bg-red-600",info:"bg-blue-600",gray:"bg-gray-600"}[e]}`,"aria-hidden":"true"}),r]})}a(17577);var d=a(28676)},11867:(e,t,a)=>{a.d(t,{n:()=>d});var s=a(10326),r=a(17577),l=a(77758),n=a(11865),o=a(73002),i=a(91515),c=a(51223);function d({worktreeId:e}){let[t,a]=(0,r.useState)([]),[d,u]=(0,r.useState)(null),[x,m]=(0,r.useState)(null),[h,p]=(0,r.useState)(!0),[g,b]=(0,r.useState)(null),[f,y]=(0,r.useState)(""),[v,j]=(0,r.useState)(0),[w,N]=(0,r.useState)("all"),[k,C]=(0,r.useState)(!1),{toasts:S,showToast:L,removeToast:z}=(0,n.pm)(),$=(0,r.useMemo)(()=>"all"===w?t:t.filter(e=>e.toLowerCase().includes(w)),[t,w]),M=async t=>{try{p(!0),b(null);let a=await o.Iv.getLogFile(e,t);m(a.content),u(t),y(""),j(0)}catch(e){b((0,o.zG)(e))}finally{p(!1)}},E=(0,r.useCallback)(async()=>{if(d)try{C(!0);let t=await o.Iv.getLogFile(e,d,{sanitize:!0});await (0,i.v)(t.content),L("Log copied to clipboard (sanitized)","success")}catch(e){L(`Failed to export log: ${(0,o.zG)(e)}`,"error")}finally{C(!1)}},[e,d,L]),T=(0,r.useMemo)(()=>{let e;if(!f||!x)return[];let t=RegExp((0,c.hr)(f),"gi"),a=[];for(;null!==(e=t.exec(x));)a.push({index:e.index,length:e[0].length});return a},[f,x]),A=()=>{T.length>0&&j(e=>(e+1)%T.length)},I=()=>{T.length>0&&j(e=>(e-1+T.length)%T.length)},B=(0,r.useMemo)(()=>{if(!x||!f||0===T.length)return x;let e="",t=0;return T.forEach((a,s)=>{e+=(0,c.Xv)(x.substring(t,a.index));let r=x.substring(a.index,a.index+a.length),l=s===v;e+=`<mark class="${l?"bg-yellow-400 text-black":"bg-yellow-200 text-black"}" data-match-index="${s}">${(0,c.Xv)(r)}</mark>`,t=a.index+a.length}),e+=(0,c.Xv)(x.substring(t))},[x,f,T,v]);return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)(l.Zb,{padding:"md",children:[s.jsx(l.Ol,{children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[s.jsx(l.ll,{children:"Log Files"}),s.jsx(l.Ct,{variant:"gray",children:$.length})]}),(0,s.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,s.jsxs)(l.zx,{variant:"all"===w?"primary":"ghost",size:"sm",onClick:()=>N("all"),children:["All (",t.length,")"]}),(0,s.jsxs)(l.zx,{variant:"claude"===w?"primary":"ghost",size:"sm",onClick:()=>N("claude"),children:["Claude (",t.filter(e=>e.toLowerCase().includes("claude")).length,")"]}),(0,s.jsxs)(l.zx,{variant:"codex"===w?"primary":"ghost",size:"sm",onClick:()=>N("codex"),children:["Codex (",t.filter(e=>e.toLowerCase().includes("codex")).length,")"]}),(0,s.jsxs)(l.zx,{variant:"gemini"===w?"primary":"ghost",size:"sm",onClick:()=>N("gemini"),children:["Gemini (",t.filter(e=>e.toLowerCase().includes("gemini")).length,")"]})]})]})}),(0,s.jsxs)(l.aY,{children:[h&&0===t.length&&s.jsx("div",{className:"text-center py-4",children:s.jsx("div",{className:"inline-block animate-spin rounded-full h-6 w-6 border-4 border-gray-300 border-t-blue-600"})}),g&&s.jsx("div",{className:"p-3 bg-red-50 border border-red-200 rounded text-sm text-red-800",children:g}),!h&&0===$.length&&!g&&s.jsx("p",{className:"text-sm text-gray-600 text-center py-4",children:"all"===w?"No log files found":`No ${w} log files found`}),$.length>0&&s.jsx("div",{className:"space-y-2",children:$.map(e=>s.jsx("button",{onClick:()=>M(e),className:`w-full text-left px-3 py-2 rounded text-sm font-mono transition-colors ${d===e?"bg-blue-50 text-blue-700 border border-blue-200":"hover:bg-gray-50 border border-transparent"}`,children:e},e))})]})]}),d&&(0,s.jsxs)(l.Zb,{padding:"md",children:[s.jsx(l.Ol,{children:(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[s.jsx(l.ll,{className:"font-mono text-base",children:d}),(0,s.jsxs)("div",{className:"flex gap-2",children:[s.jsx(l.zx,{variant:"ghost",size:"sm",onClick:E,disabled:!d||k,title:"Copy sanitized log to clipboard",children:k?"Exporting...":"Export"}),s.jsx(l.zx,{variant:"ghost",size:"sm",onClick:()=>{u(null),m(null),y(""),j(0)},children:"Close"})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[s.jsx("input",{type:"text",value:f,onChange:e=>y(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.shiftKey?I():A())},placeholder:"Search in log file...",className:"input w-full pr-20"}),T.length>0&&(0,s.jsxs)("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-gray-500",children:[v+1," / ",T.length]})]}),T.length>0&&(0,s.jsxs)("div",{className:"flex gap-1",children:[s.jsx(l.zx,{variant:"ghost",size:"sm",onClick:I,disabled:0===T.length,title:"Previous match (Shift+Enter)",children:"↑"}),s.jsx(l.zx,{variant:"ghost",size:"sm",onClick:A,disabled:0===T.length,title:"Next match (Enter)",children:"↓"})]})]})]})}),(0,s.jsxs)(l.aY,{children:[h&&s.jsx("div",{className:"text-center py-8",children:s.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"})}),!h&&x&&s.jsx("div",{className:"bg-gray-900 text-gray-100 rounded p-4 overflow-x-auto max-h-[500px] scrollbar-thin",children:f&&T.length>0?s.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap",dangerouslySetInnerHTML:{__html:B||""}}):s.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap",children:x})}),!h&&f&&0===T.length&&x&&(0,s.jsxs)("div",{className:"text-center py-4 text-sm text-gray-500",children:['No matches found for "',f,'"']})]})]}),s.jsx(n.Ix,{toasts:S,onClose:z})]})}},15470:(e,t,a)=>{a.d(t,{R:()=>x});var s=a(10326),r=a(17577),l=a(73002);function n(e,t){if(!t.trim())return e;let a=t.toLowerCase();return e.map(e=>({...e,commands:e.commands.filter(e=>{let t=e.name.toLowerCase().includes(a),s=e.description.toLowerCase().includes(a);return t||s})})).filter(e=>e.commands.length>0)}function o({groups:e,onSelect:t,highlightedIndex:a=-1,className:r=""}){let l=0;return 0===e.length?s.jsx("div",{className:`text-sm text-gray-500 p-4 text-center ${r}`,children:"No commands available"}):s.jsx("div",{className:`overflow-y-auto ${r}`,children:e.map(e=>(0,s.jsxs)("div",{className:"mb-2",children:[s.jsx("div",{className:"px-3 py-1.5 text-xs font-semibold text-gray-500 uppercase tracking-wider bg-gray-50",children:e.label}),s.jsx("div",{children:e.commands.map(e=>{let r=l;l++;let n=r===a;return(0,s.jsxs)("button",{type:"button","data-command-item":!0,"data-highlighted":n,onClick:()=>t(e),className:`w-full px-3 py-2 text-left flex items-start gap-2 hover:bg-blue-50 transition-colors ${n?"bg-blue-100":""}`,children:[(0,s.jsxs)("span",{className:"text-blue-600 font-mono text-sm flex-shrink-0",children:["/",e.name]}),s.jsx("span",{className:"text-gray-600 text-sm truncate",children:e.description})]},e.name)})})]},e.category))})}function i({isOpen:e,groups:t,onSelect:a,onClose:l,isMobile:i=!1,position:c,onFreeInput:d}){let[u,x]=(0,r.useState)(""),[m,h]=(0,r.useState)(0),p=(0,r.useRef)(null),g=(0,r.useMemo)(()=>n(t,u),[t,u]),b=(0,r.useMemo)(()=>g.flatMap(e=>e.commands),[g]),f=(0,r.useCallback)(e=>{a(e),l()},[a,l]);return((0,r.useCallback)(t=>{if(e)switch(t.key){case"Escape":t.preventDefault(),l();break;case"ArrowDown":t.preventDefault(),h(e=>Math.min(e+1,b.length-1));break;case"ArrowUp":t.preventDefault(),h(e=>Math.max(e-1,0));break;case"Enter":t.preventDefault(),b[m]&&f(b[m])}},[e,b,m,l,f]),e)?i?(0,s.jsxs)(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:l,"aria-hidden":"true"}),(0,s.jsxs)("div",{"data-testid":"slash-command-bottom-sheet",className:"fixed bottom-0 left-0 right-0 bg-white rounded-t-xl z-50 max-h-[70vh] flex flex-col shadow-xl",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200",children:[s.jsx("h2",{className:"text-lg font-semibold",children:"Commands"}),s.jsx("button",{type:"button",onClick:l,"aria-label":"Close",className:"p-2 rounded-full hover:bg-gray-100",children:s.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),s.jsx("div",{className:"px-4 py-2 border-b border-gray-100",children:s.jsx("input",{ref:p,type:"text",value:u,onChange:e=>x(e.target.value),placeholder:"Search commands...",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"})}),d&&(0,s.jsxs)("button",{type:"button","data-testid":"free-input-button",onClick:d,className:"w-full px-4 py-3 text-left border-b border-gray-100 flex items-center gap-2 hover:bg-blue-50 transition-colors",children:[s.jsx("span",{className:"text-blue-600",children:s.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),s.jsx("span",{className:"text-gray-600",children:"Enter custom command..."})]}),s.jsx(o,{groups:g,onSelect:f,highlightedIndex:m,className:"flex-1 overflow-y-auto pb-20"})]})]}):(0,s.jsxs)("div",{role:"listbox",className:"absolute bg-white border border-gray-200 rounded-lg shadow-lg z-50 w-80 max-h-96 flex flex-col",style:c?{top:c.top,left:c.left}:{bottom:"100%",left:0,marginBottom:"4px"},children:[s.jsx("div",{className:"px-3 py-2 border-b border-gray-100",children:s.jsx("input",{ref:p,type:"text",value:u,onChange:e=>x(e.target.value),placeholder:"Search commands...",className:"w-full px-3 py-1.5 text-sm border border-gray-300 rounded focus:outline-none focus:ring-1 focus:ring-blue-500"})}),d&&(0,s.jsxs)("button",{type:"button","data-testid":"free-input-button",onClick:d,className:"w-full px-3 py-2 text-left border-b border-gray-100 flex items-center gap-2 hover:bg-blue-50 transition-colors text-sm",children:[s.jsx("span",{className:"text-blue-600",children:s.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),s.jsx("span",{className:"text-gray-600",children:"Enter custom command..."})]}),s.jsx(o,{groups:g,onSelect:f,highlightedIndex:m,className:"flex-1 overflow-y-auto"}),(0,s.jsxs)("div",{className:"px-3 py-1.5 border-t border-gray-100 text-xs text-gray-400 flex gap-3",children:[(0,s.jsxs)("span",{children:[s.jsx("kbd",{className:"px-1 py-0.5 bg-gray-100 rounded",children:"Enter"})," select"]}),(0,s.jsxs)("span",{children:[s.jsx("kbd",{className:"px-1 py-0.5 bg-gray-100 rounded",children:"Esc"})," close"]})]})]}):null}function c({worktreeId:e,cliToolId:t,disabled:a=!1,onInterrupt:l}){let[n,o]=(0,r.useState)(!1),i=(0,r.useRef)(0),c=(0,r.useCallback)(async()=>{let a=Date.now();if(!(a-i.current<1e3)){i.current=a,o(!0);try{let a=await fetch(`/api/worktrees/${e}/interrupt`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cliToolId:t})});if(a.ok)l?.();else{let e=await a.json().catch(()=>({}));console.error("[InterruptButton] Failed to send interrupt:",e.error||a.statusText)}}catch(e){console.error("[InterruptButton] Error sending interrupt:",e)}finally{o(!1)}}},[e,t,l]);return s.jsx("button",{type:"button",onClick:c,disabled:a||n,className:"flex-shrink-0 p-2 text-orange-600 hover:bg-orange-50 rounded-full transition-colors disabled:text-gray-300 disabled:hover:bg-transparent","aria-label":"Stop processing","data-testid":"interrupt-button",children:n?(0,s.jsxs)("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):s.jsx(d,{})})}function d(){return s.jsx("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24",children:s.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}var u=a(2982);function x({worktreeId:e,onMessageSent:t,cliToolId:a,isSessionRunning:o=!1}){let[d,x]=(0,r.useState)(""),[m,h]=(0,r.useState)(!1),[p,g]=(0,r.useState)(null),[b,f]=(0,r.useState)(!1),[y,v]=(0,r.useState)(!1),j=(0,r.useRef)(null),w=(0,r.useRef)(null),N=(0,r.useRef)(!1),k=(0,r.useRef)(null),C=(0,u.d)(),{groups:S}=function(e,t){let[a,s]=(0,r.useState)([]),[o,i]=(0,r.useState)(!0),[c,d]=(0,r.useState)(null),[u,x]=(0,r.useState)(""),[m,h]=(0,r.useState)(t||"claude"),p=(0,r.useCallback)(async()=>{try{i(!0),d(null);let a=e?`/api/worktrees/${e}/slash-commands`:"/api/slash-commands";t&&(a+=`?cliTool=${t}`);let r=await fetch(a);if(!r.ok)throw Error(`HTTP error ${r.status}`);let l=await r.json();s(l.groups),h(l.cliTool||t||"claude")}catch(e){d((0,l.zG)(e)),s([])}finally{i(!1)}},[e,t]),g=(0,r.useMemo)(()=>a.flatMap(e=>e.commands),[a]),b=(0,r.useMemo)(()=>n(a,u),[a,u]);return{groups:a,filteredGroups:b,allCommands:g,loading:o,error:c,filter:u,setFilter:x,refresh:(0,r.useCallback)(()=>{p()},[p]),cliTool:m}}(e,a),L=async()=>{if(!b&&d.trim()&&!m)try{h(!0),g(null);let s=a||"claude";await l.Iv.sendMessage(e,d.trim(),s),x(""),t?.(s)}catch(e){g((0,l.zG)(e))}finally{h(!1)}},z=async e=>{e.preventDefault(),await L()},$=()=>{v(!1),j.current?.focus()};return(0,s.jsxs)("div",{ref:k,className:"space-y-2 relative",children:[p&&s.jsx("div",{className:"p-2 bg-red-50 border border-red-200 rounded text-sm text-red-800",children:p}),(0,s.jsxs)("form",{onSubmit:z,className:"flex items-end gap-2 bg-white border border-gray-300 rounded-lg px-4 py-2 focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500",children:[C&&s.jsx("button",{type:"button",onClick:()=>v(!0),className:"flex-shrink-0 p-2 text-gray-500 hover:text-blue-600 hover:bg-blue-50 rounded-full transition-colors","aria-label":"Show slash commands","data-testid":"mobile-command-button",children:s.jsx("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})})}),s.jsx("textarea",{ref:j,value:d,onChange:e=>{let t=e.target.value;x(t),"/"===t||t.startsWith("/")&&!t.includes(" ")?v(!0):v(!1)},onKeyDown:e=>{let{keyCode:t}=e.nativeEvent;if(229!==t){if("Escape"===e.key&&y){e.preventDefault(),$();return}if(N.current&&"Enter"===e.key){N.current=!1;return}if("Enter"===e.key&&!b&&!y){if(C)return;e.shiftKey||(e.preventDefault(),L())}}},onCompositionStart:()=>{f(!0),N.current=!1,w.current&&clearTimeout(w.current)},onCompositionEnd:()=>{f(!1),N.current=!0,w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{N.current=!1},300)},placeholder:C?"Type your message...":"Type your message... (/ for commands, Shift+Enter for line break)",disabled:m,rows:1,className:"flex-1 outline-none bg-transparent resize-none py-1 overflow-y-auto scrollbar-thin",style:{minHeight:"24px",maxHeight:"160px"}}),s.jsx(c,{worktreeId:e,cliToolId:a||"claude",disabled:!o}),s.jsx("button",{type:"submit",disabled:!d.trim()||m,className:"flex-shrink-0 p-2 text-blue-600 hover:bg-blue-50 rounded-full transition-colors disabled:text-gray-300 disabled:hover:bg-transparent","aria-label":"Send message",children:m?(0,s.jsxs)("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):s.jsx("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})})})]}),s.jsx(i,{isOpen:y,groups:S,onSelect:e=>{x(`/${e.name} `),v(!1),j.current?.focus()},onClose:$,isMobile:C,onFreeInput:()=>{v(!1),x("/"),setTimeout(()=>{j.current?.focus()},50)}})]})}},61421:(e,t,a)=>{a.d(t,{F4:()=>r,Ie:()=>n,xh:()=>l});let s={idle:"bg-gray-500",ready:"bg-green-500",spinner:"border-blue-500",waiting:"bg-yellow-500",error:"bg-red-500"},r={idle:{className:s.idle,label:"Idle",type:"dot"},ready:{className:s.ready,label:"Ready",type:"dot"},running:{className:s.spinner,label:"Running",type:"spinner"},waiting:{className:s.waiting,label:"Waiting for response",type:"dot"},generating:{className:s.spinner,label:"Generating",type:"spinner"}},l={idle:{className:s.idle,label:"Idle",type:"dot"},ready:{className:s.ready,label:"Ready",type:"dot"},running:{className:s.spinner,label:"Running",type:"spinner"},waiting:{className:s.waiting,label:"Waiting for response",type:"dot"},error:{className:s.error,label:"Error",type:"dot"}},n={idle:{className:s.idle,label:"Idle - No active session",type:"dot"},ready:{className:s.ready,label:"Ready - Waiting for input",type:"dot"},running:{className:s.spinner,label:"Running - Processing",type:"spinner"},waiting:{className:s.waiting,label:"Waiting - User input required",type:"dot"},error:{className:s.error,label:"Error",type:"dot"}}},22202:(e,t,a)=>{a.d(t,{k:()=>s});let s={DROPDOWN:10,SIDEBAR:30,MODAL:50,MAXIMIZED_EDITOR:55,TOAST:60,CONTEXT_MENU:70}},2982:(e,t,a)=>{a.d(t,{d:()=>r});var s=a(17577);function r(e={}){let{breakpoint:t=768}=e,[a,r]=(0,s.useState)(!1);return a}},91515:(e,t,a)=>{a.d(t,{v:()=>r});let s=/\x1b\[[0-9;]*[a-zA-Z]|\x1b\][^\x07]*\x07|\[[0-9;]*m/g;async function r(e){if(!e||0===e.trim().length)return;let t=e.replace(s,"");await navigator.clipboard.writeText(t)}},41593:(e,t,a)=>{a.d(t,{G:()=>n});var s=a(27808),r=a(18811);let l={en:r._,ja:s.ja};function n(e){return l[e]??r._}},51223:(e,t,a)=>{function s(e,t){let a=null;return(...s)=>{a&&clearTimeout(a),a=setTimeout(()=>{e(...s),a=null},t)}}function r(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function l(e){let t=new Set;for(let a of e){t.add(a);let e=a.split("/"),s="";for(let a=0;a<e.length-1;a++)s=s?`${s}/${e[a]}`:e[a],t.add(s)}return t}function n(e,t=30){return e.length<=t?e:`${e.substring(0,t-3)}...`}function o(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}a.d(t,{Ds:()=>s,Ps:()=>l,Xv:()=>o,aS:()=>n,hr:()=>r})},18421:(e,t,a)=>{function s(e){return e?e.isWaitingForResponse?"waiting":e.isProcessing?"running":e.isRunning?"ready":"idle":"idle"}function r(e){let t=!!e.lastAssistantMessageAt&&(!e.lastViewedAt||new Date(e.lastAssistantMessageAt)>new Date(e.lastViewedAt));return{id:e.id,name:e.name,repositoryName:e.repositoryName,status:"idle",hasUnread:t,lastActivity:e.updatedAt,description:e.description,cliStatus:{claude:s(e.sessionStatusByCli?.claude),codex:s(e.sessionStatusByCli?.codex)}}}a.d(t,{He:()=>s,I_:()=>r})},63601:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var s=a(66621);let r=e=>[{type:"image/png",sizes:"180x180",url:(0,s.fillMetadataSegment)(".",e.params,"apple-icon.png")+"?31a89e65aa4ac65b"}]},71150:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var s=a(66621);let r=e=>[{type:"image/png",sizes:"32x32",url:(0,s.fillMetadataSegment)(".",e.params,"icon.png")+"?32d9127ba30ee286"}]}};
35
+ `,role:"main",children:e})]})})},28676:(e,t,a)=>{a.d(t,{u:()=>n});var s=a(10326),r=a(17577),l=a(60962);function n({isOpen:e,onClose:t,title:a,children:n,size:i="lg",showCloseButton:o=!0,disableClose:c=!1}){let d=(0,r.useRef)(null);return e?(0,l.createPortal)((0,s.jsxs)("div",{className:"fixed inset-0 z-[9999] overflow-y-auto",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:c?void 0:t}),s.jsx("div",{className:"relative flex min-h-full items-center justify-center p-2 sm:p-4",children:(0,s.jsxs)("div",{ref:d,className:`relative w-full ${{sm:"max-w-[calc(100vw-2rem)] sm:max-w-md",md:"max-w-[calc(100vw-2rem)] sm:max-w-2xl",lg:"max-w-[calc(100vw-2rem)] sm:max-w-4xl",xl:"max-w-[calc(100vw-2rem)] sm:max-w-6xl",full:"max-w-[calc(100vw-2rem)] sm:max-w-[95vw]"}[i]} max-h-[calc(100vh-1rem)] sm:max-h-[calc(100vh-2rem)] flex flex-col bg-white rounded-lg shadow-xl transform transition-all`,children:[(a||o)&&(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-gray-200 flex-shrink-0",children:[s.jsx("h3",{className:"text-base sm:text-lg font-semibold text-gray-900 truncate pr-2",children:a}),o&&s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 transition-colors flex-shrink-0",children:s.jsx("svg",{className:"w-5 h-5 sm:w-6 sm:h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),s.jsx("div",{className:"px-4 sm:px-6 py-3 sm:py-4 overflow-y-auto flex-1 min-h-0",children:n})]})})]}),document.body):null}},77758:(e,t,a)=>{a.d(t,{Ct:()=>c,zx:()=>r,Zb:()=>l,aY:()=>o,Ol:()=>n,ll:()=>i,u_:()=>d.u});var s=a(10326);function r({variant:e="primary",size:t="md",fullWidth:a=!1,loading:r=!1,disabled:l,className:n="",children:i,...o}){let c=["btn",{primary:"btn-primary",secondary:"btn-secondary",danger:"btn-danger",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500"}[e],{sm:"btn-sm",md:"",lg:"btn-lg"}[t],a?"w-full":"",l||r?"opacity-50 cursor-not-allowed":"",n].filter(Boolean).join(" ");return(0,s.jsxs)("button",{className:c,disabled:l||r,...o,children:[r&&(0,s.jsxs)("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),i]})}function l({hover:e=!1,padding:t="md",className:a="",children:r,...l}){let n=["card",e?"card-hover":"",{none:"",sm:"p-3",md:"p-4",lg:"p-6"}[t],a].filter(Boolean).join(" ");return s.jsx("div",{className:n,...l,children:r})}function n({className:e="",children:t,...a}){return s.jsx("div",{className:`mb-3 ${e}`,...a,children:t})}function i({className:e="",children:t,...a}){return s.jsx("h3",{className:`text-lg font-semibold text-gray-900 ${e}`,...a,children:t})}function o({className:e="",children:t,...a}){return s.jsx("div",{className:e,...a,children:t})}function c({variant:e="gray",dot:t=!1,className:a="",children:r,...l}){let n=["badge",{success:"badge-success",warning:"badge-warning",error:"badge-error",info:"badge-info",gray:"badge-gray"}[e],a].filter(Boolean).join(" ");return(0,s.jsxs)("span",{className:n,...l,children:[t&&s.jsx("span",{className:`mr-1.5 inline-block h-2 w-2 rounded-full ${{success:"bg-green-600",warning:"bg-yellow-600",error:"bg-red-600",info:"bg-blue-600",gray:"bg-gray-600"}[e]}`,"aria-hidden":"true"}),r]})}a(17577);var d=a(28676)},11867:(e,t,a)=>{a.d(t,{n:()=>d});var s=a(10326),r=a(17577),l=a(77758),n=a(11865),i=a(73002),o=a(91515),c=a(51223);function d({worktreeId:e}){let[t,a]=(0,r.useState)([]),[d,u]=(0,r.useState)(null),[x,m]=(0,r.useState)(null),[h,p]=(0,r.useState)(!0),[g,b]=(0,r.useState)(null),[f,y]=(0,r.useState)(""),[v,j]=(0,r.useState)(0),[w,N]=(0,r.useState)("all"),[k,C]=(0,r.useState)(!1),{toasts:S,showToast:L,removeToast:z}=(0,n.pm)(),$=(0,r.useMemo)(()=>"all"===w?t:t.filter(e=>e.toLowerCase().includes(w)),[t,w]),M=async t=>{try{p(!0),b(null);let a=await i.Iv.getLogFile(e,t);m(a.content),u(t),y(""),j(0)}catch(e){b((0,i.zG)(e))}finally{p(!1)}},E=(0,r.useCallback)(async()=>{if(d)try{C(!0);let t=await i.Iv.getLogFile(e,d,{sanitize:!0});await (0,o.v)(t.content),L("Log copied to clipboard (sanitized)","success")}catch(e){L(`Failed to export log: ${(0,i.zG)(e)}`,"error")}finally{C(!1)}},[e,d,L]),T=(0,r.useMemo)(()=>{let e;if(!f||!x)return[];let t=RegExp((0,c.hr)(f),"gi"),a=[];for(;null!==(e=t.exec(x));)a.push({index:e.index,length:e[0].length});return a},[f,x]),A=()=>{T.length>0&&j(e=>(e+1)%T.length)},I=()=>{T.length>0&&j(e=>(e-1+T.length)%T.length)},B=(0,r.useMemo)(()=>{if(!x||!f||0===T.length)return x;let e="",t=0;return T.forEach((a,s)=>{e+=(0,c.Xv)(x.substring(t,a.index));let r=x.substring(a.index,a.index+a.length),l=s===v;e+=`<mark class="${l?"bg-yellow-400 text-black":"bg-yellow-200 text-black"}" data-match-index="${s}">${(0,c.Xv)(r)}</mark>`,t=a.index+a.length}),e+=(0,c.Xv)(x.substring(t))},[x,f,T,v]);return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)(l.Zb,{padding:"md",children:[s.jsx(l.Ol,{children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[s.jsx(l.ll,{children:"Log Files"}),s.jsx(l.Ct,{variant:"gray",children:$.length})]}),(0,s.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,s.jsxs)(l.zx,{variant:"all"===w?"primary":"ghost",size:"sm",onClick:()=>N("all"),children:["All (",t.length,")"]}),(0,s.jsxs)(l.zx,{variant:"claude"===w?"primary":"ghost",size:"sm",onClick:()=>N("claude"),children:["Claude (",t.filter(e=>e.toLowerCase().includes("claude")).length,")"]}),(0,s.jsxs)(l.zx,{variant:"codex"===w?"primary":"ghost",size:"sm",onClick:()=>N("codex"),children:["Codex (",t.filter(e=>e.toLowerCase().includes("codex")).length,")"]}),(0,s.jsxs)(l.zx,{variant:"gemini"===w?"primary":"ghost",size:"sm",onClick:()=>N("gemini"),children:["Gemini (",t.filter(e=>e.toLowerCase().includes("gemini")).length,")"]})]})]})}),(0,s.jsxs)(l.aY,{children:[h&&0===t.length&&s.jsx("div",{className:"text-center py-4",children:s.jsx("div",{className:"inline-block animate-spin rounded-full h-6 w-6 border-4 border-gray-300 border-t-blue-600"})}),g&&s.jsx("div",{className:"p-3 bg-red-50 border border-red-200 rounded text-sm text-red-800",children:g}),!h&&0===$.length&&!g&&s.jsx("p",{className:"text-sm text-gray-600 text-center py-4",children:"all"===w?"No log files found":`No ${w} log files found`}),$.length>0&&s.jsx("div",{className:"space-y-2",children:$.map(e=>s.jsx("button",{onClick:()=>M(e),className:`w-full text-left px-3 py-2 rounded text-sm font-mono transition-colors ${d===e?"bg-blue-50 text-blue-700 border border-blue-200":"hover:bg-gray-50 border border-transparent"}`,children:e},e))})]})]}),d&&(0,s.jsxs)(l.Zb,{padding:"md",children:[s.jsx(l.Ol,{children:(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[s.jsx(l.ll,{className:"font-mono text-base",children:d}),(0,s.jsxs)("div",{className:"flex gap-2",children:[s.jsx(l.zx,{variant:"ghost",size:"sm",onClick:E,disabled:!d||k,title:"Copy sanitized log to clipboard",children:k?"Exporting...":"Export"}),s.jsx(l.zx,{variant:"ghost",size:"sm",onClick:()=>{u(null),m(null),y(""),j(0)},children:"Close"})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[s.jsx("input",{type:"text",value:f,onChange:e=>y(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.shiftKey?I():A())},placeholder:"Search in log file...",className:"input w-full pr-20"}),T.length>0&&(0,s.jsxs)("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-gray-500",children:[v+1," / ",T.length]})]}),T.length>0&&(0,s.jsxs)("div",{className:"flex gap-1",children:[s.jsx(l.zx,{variant:"ghost",size:"sm",onClick:I,disabled:0===T.length,title:"Previous match (Shift+Enter)",children:"↑"}),s.jsx(l.zx,{variant:"ghost",size:"sm",onClick:A,disabled:0===T.length,title:"Next match (Enter)",children:"↓"})]})]})]})}),(0,s.jsxs)(l.aY,{children:[h&&s.jsx("div",{className:"text-center py-8",children:s.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"})}),!h&&x&&s.jsx("div",{className:"bg-gray-900 text-gray-100 rounded p-4 overflow-x-auto max-h-[500px] scrollbar-thin",children:f&&T.length>0?s.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap",dangerouslySetInnerHTML:{__html:B||""}}):s.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap",children:x})}),!h&&f&&0===T.length&&x&&(0,s.jsxs)("div",{className:"text-center py-4 text-sm text-gray-500",children:['No matches found for "',f,'"']})]})]}),s.jsx(n.Ix,{toasts:S,onClose:z})]})}},15470:(e,t,a)=>{a.d(t,{R:()=>x});var s=a(10326),r=a(17577),l=a(73002);function n(e,t){if(!t.trim())return e;let a=t.toLowerCase();return e.map(e=>({...e,commands:e.commands.filter(e=>{let t=e.name.toLowerCase().includes(a),s=e.description.toLowerCase().includes(a);return t||s})})).filter(e=>e.commands.length>0)}function i({groups:e,onSelect:t,highlightedIndex:a=-1,className:r=""}){let l=0;return 0===e.length?s.jsx("div",{className:`text-sm text-gray-500 p-4 text-center ${r}`,children:"No commands available"}):s.jsx("div",{className:`overflow-y-auto ${r}`,children:e.map(e=>(0,s.jsxs)("div",{className:"mb-2",children:[s.jsx("div",{className:"px-3 py-1.5 text-xs font-semibold text-gray-500 uppercase tracking-wider bg-gray-50",children:e.label}),s.jsx("div",{children:e.commands.map(e=>{let r=l;l++;let n=r===a;return(0,s.jsxs)("button",{type:"button","data-command-item":!0,"data-highlighted":n,onClick:()=>t(e),className:`w-full px-3 py-2 text-left flex items-start gap-2 hover:bg-blue-50 transition-colors ${n?"bg-blue-100":""}`,children:[(0,s.jsxs)("span",{className:"text-blue-600 font-mono text-sm flex-shrink-0",children:["/",e.name]}),s.jsx("span",{className:"text-gray-600 text-sm truncate",children:e.description})]},e.name)})})]},e.category))})}function o({isOpen:e,groups:t,onSelect:a,onClose:l,isMobile:o=!1,position:c,onFreeInput:d}){let[u,x]=(0,r.useState)(""),[m,h]=(0,r.useState)(0),p=(0,r.useRef)(null),g=(0,r.useMemo)(()=>n(t,u),[t,u]),b=(0,r.useMemo)(()=>g.flatMap(e=>e.commands),[g]),f=(0,r.useCallback)(e=>{a(e),l()},[a,l]);return((0,r.useCallback)(t=>{if(e)switch(t.key){case"Escape":t.preventDefault(),l();break;case"ArrowDown":t.preventDefault(),h(e=>Math.min(e+1,b.length-1));break;case"ArrowUp":t.preventDefault(),h(e=>Math.max(e-1,0));break;case"Enter":t.preventDefault(),b[m]&&f(b[m])}},[e,b,m,l,f]),e)?o?(0,s.jsxs)(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:l,"aria-hidden":"true"}),(0,s.jsxs)("div",{"data-testid":"slash-command-bottom-sheet",className:"fixed bottom-0 left-0 right-0 bg-white rounded-t-xl z-50 max-h-[70vh] flex flex-col shadow-xl",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200",children:[s.jsx("h2",{className:"text-lg font-semibold",children:"Commands"}),s.jsx("button",{type:"button",onClick:l,"aria-label":"Close",className:"p-2 rounded-full hover:bg-gray-100",children:s.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),s.jsx("div",{className:"px-4 py-2 border-b border-gray-100",children:s.jsx("input",{ref:p,type:"text",value:u,onChange:e=>x(e.target.value),placeholder:"Search commands...",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"})}),d&&(0,s.jsxs)("button",{type:"button","data-testid":"free-input-button",onClick:()=>d(u),className:"w-full px-4 py-3 text-left border-b border-gray-100 flex items-center gap-2 hover:bg-blue-50 transition-colors",children:[s.jsx("span",{className:"text-blue-600",children:s.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),s.jsx("span",{className:"text-gray-600",children:"Enter custom command..."})]}),s.jsx(i,{groups:g,onSelect:f,highlightedIndex:m,className:"flex-1 overflow-y-auto pb-20"})]})]}):(0,s.jsxs)("div",{role:"listbox",className:"absolute bg-white border border-gray-200 rounded-lg shadow-lg z-50 w-80 max-h-96 flex flex-col",style:c?{top:c.top,left:c.left}:{bottom:"100%",left:0,marginBottom:"4px"},children:[s.jsx("div",{className:"px-3 py-2 border-b border-gray-100",children:s.jsx("input",{ref:p,type:"text",value:u,onChange:e=>x(e.target.value),placeholder:"Search commands...",className:"w-full px-3 py-1.5 text-sm border border-gray-300 rounded focus:outline-none focus:ring-1 focus:ring-blue-500"})}),d&&(0,s.jsxs)("button",{type:"button","data-testid":"free-input-button",onClick:()=>d(u),className:"w-full px-3 py-2 text-left border-b border-gray-100 flex items-center gap-2 hover:bg-blue-50 transition-colors text-sm",children:[s.jsx("span",{className:"text-blue-600",children:s.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),s.jsx("span",{className:"text-gray-600",children:"Enter custom command..."})]}),s.jsx(i,{groups:g,onSelect:f,highlightedIndex:m,className:"flex-1 overflow-y-auto"}),(0,s.jsxs)("div",{className:"px-3 py-1.5 border-t border-gray-100 text-xs text-gray-400 flex gap-3",children:[(0,s.jsxs)("span",{children:[s.jsx("kbd",{className:"px-1 py-0.5 bg-gray-100 rounded",children:"Enter"})," select"]}),(0,s.jsxs)("span",{children:[s.jsx("kbd",{className:"px-1 py-0.5 bg-gray-100 rounded",children:"Esc"})," close"]})]})]}):null}function c({worktreeId:e,cliToolId:t,disabled:a=!1,onInterrupt:l}){let[n,i]=(0,r.useState)(!1),o=(0,r.useRef)(0),c=(0,r.useCallback)(async()=>{let a=Date.now();if(!(a-o.current<1e3)){o.current=a,i(!0);try{let a=await fetch(`/api/worktrees/${e}/interrupt`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cliToolId:t})});if(a.ok)l?.();else{let e=await a.json().catch(()=>({}));console.error("[InterruptButton] Failed to send interrupt:",e.error||a.statusText)}}catch(e){console.error("[InterruptButton] Error sending interrupt:",e)}finally{i(!1)}}},[e,t,l]);return s.jsx("button",{type:"button",onClick:c,disabled:a||n,className:"flex-shrink-0 p-2 text-orange-600 hover:bg-orange-50 rounded-full transition-colors disabled:text-gray-300 disabled:hover:bg-transparent","aria-label":"Stop processing","data-testid":"interrupt-button",children:n?(0,s.jsxs)("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):s.jsx(d,{})})}function d(){return s.jsx("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24",children:s.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}var u=a(2982);function x({worktreeId:e,onMessageSent:t,cliToolId:a,isSessionRunning:i=!1}){let[d,x]=(0,r.useState)(""),[m,h]=(0,r.useState)(!1),[p,g]=(0,r.useState)(null),[b,f]=(0,r.useState)(!1),[y,v]=(0,r.useState)(!1),[j,w]=(0,r.useState)(!1),N=(0,r.useRef)(null),k=(0,r.useRef)(null),C=(0,r.useRef)(!1),S=(0,r.useRef)(null),L=(0,u.d)(),{groups:z}=function(e,t){let[a,s]=(0,r.useState)([]),[i,o]=(0,r.useState)(!0),[c,d]=(0,r.useState)(null),[u,x]=(0,r.useState)(""),[m,h]=(0,r.useState)(t||"claude"),p=(0,r.useCallback)(async()=>{try{o(!0),d(null);let a=e?`/api/worktrees/${e}/slash-commands`:"/api/slash-commands";t&&(a+=`?cliTool=${t}`);let r=await fetch(a);if(!r.ok)throw Error(`HTTP error ${r.status}`);let l=await r.json();s(l.groups),h(l.cliTool||t||"claude")}catch(e){d((0,l.zG)(e)),s([])}finally{o(!1)}},[e,t]),g=(0,r.useMemo)(()=>a.flatMap(e=>e.commands),[a]),b=(0,r.useMemo)(()=>n(a,u),[a,u]);return{groups:a,filteredGroups:b,allCommands:g,loading:i,error:c,filter:u,setFilter:x,refresh:(0,r.useCallback)(()=>{p()},[p]),cliTool:m}}(e,a),$=async()=>{if(!b&&d.trim()&&!m)try{h(!0),g(null);let s=a||"claude";await l.Iv.sendMessage(e,d.trim(),s),x(""),w(!1),t?.(s)}catch(e){g((0,l.zG)(e))}finally{h(!1)}},M=async e=>{e.preventDefault(),await $()},E=()=>{v(!1),w(!1),N.current?.focus()};return(0,s.jsxs)("div",{ref:S,className:"space-y-2 relative",children:[p&&s.jsx("div",{className:"p-2 bg-red-50 border border-red-200 rounded text-sm text-red-800",children:p}),(0,s.jsxs)("form",{onSubmit:M,className:"flex items-end gap-2 bg-white border border-gray-300 rounded-lg px-4 py-2 focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500",children:[L&&s.jsx("button",{type:"button",onClick:()=>{j&&w(!1),v(!0)},className:"flex-shrink-0 p-2 text-gray-500 hover:text-blue-600 hover:bg-blue-50 rounded-full transition-colors","aria-label":"Show slash commands","data-testid":"mobile-command-button",children:s.jsx("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})})}),s.jsx("textarea",{ref:N,value:d,onChange:e=>{let t=e.target.value;if(x(t),""===t){w(!1),v(!1);return}j||("/"===t||t.startsWith("/")&&!t.includes(" ")?v(!0):v(!1))},onKeyDown:e=>{let{keyCode:t}=e.nativeEvent;if(229!==t){if("Escape"===e.key&&y){e.preventDefault(),E();return}if(C.current&&"Enter"===e.key){C.current=!1;return}if("Enter"===e.key&&!b&&(!y||j)){if(L)return;e.shiftKey||(e.preventDefault(),$())}}},onCompositionStart:()=>{f(!0),C.current=!1,k.current&&clearTimeout(k.current)},onCompositionEnd:()=>{f(!1),C.current=!0,k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{C.current=!1},300)},placeholder:L?"Type your message...":"Type your message... (/ for commands, Shift+Enter for line break)",disabled:m,rows:1,className:"flex-1 outline-none bg-transparent resize-none py-1 overflow-y-auto scrollbar-thin",style:{minHeight:"24px",maxHeight:"160px"}}),s.jsx(c,{worktreeId:e,cliToolId:a||"claude",disabled:!i}),s.jsx("button",{type:"submit",disabled:!d.trim()||m,className:"flex-shrink-0 p-2 text-blue-600 hover:bg-blue-50 rounded-full transition-colors disabled:text-gray-300 disabled:hover:bg-transparent","aria-label":"Send message",children:m?(0,s.jsxs)("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):s.jsx("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})})})]}),s.jsx(o,{isOpen:y,groups:z,onSelect:e=>{x(`/${e.name} `),v(!1),N.current?.focus()},onClose:E,isMobile:L,onFreeInput:e=>{v(!1),w(!0),x(e?`/${e}`:"/"),setTimeout(()=>{N.current?.focus()},50)}})]})}},61421:(e,t,a)=>{a.d(t,{F4:()=>r,Ie:()=>n,xh:()=>l});let s={idle:"bg-gray-500",ready:"bg-green-500",spinner:"border-blue-500",waiting:"bg-yellow-500",error:"bg-red-500"},r={idle:{className:s.idle,label:"Idle",type:"dot"},ready:{className:s.ready,label:"Ready",type:"dot"},running:{className:s.spinner,label:"Running",type:"spinner"},waiting:{className:s.waiting,label:"Waiting for response",type:"dot"},generating:{className:s.spinner,label:"Generating",type:"spinner"}},l={idle:{className:s.idle,label:"Idle",type:"dot"},ready:{className:s.ready,label:"Ready",type:"dot"},running:{className:s.spinner,label:"Running",type:"spinner"},waiting:{className:s.waiting,label:"Waiting for response",type:"dot"},error:{className:s.error,label:"Error",type:"dot"}},n={idle:{className:s.idle,label:"Idle - No active session",type:"dot"},ready:{className:s.ready,label:"Ready - Waiting for input",type:"dot"},running:{className:s.spinner,label:"Running - Processing",type:"spinner"},waiting:{className:s.waiting,label:"Waiting - User input required",type:"dot"},error:{className:s.error,label:"Error",type:"dot"}}},22202:(e,t,a)=>{a.d(t,{k:()=>s});let s={DROPDOWN:10,SIDEBAR:30,MODAL:50,MAXIMIZED_EDITOR:55,TOAST:60,CONTEXT_MENU:70}},2982:(e,t,a)=>{a.d(t,{d:()=>r});var s=a(17577);function r(e={}){let{breakpoint:t=768}=e,[a,r]=(0,s.useState)(!1);return a}},91515:(e,t,a)=>{a.d(t,{v:()=>r});let s=/\x1b\[[0-9;]*[a-zA-Z]|\x1b\][^\x07]*\x07|\[[0-9;]*m/g;async function r(e){if(!e||0===e.trim().length)return;let t=e.replace(s,"");await navigator.clipboard.writeText(t)}},41593:(e,t,a)=>{a.d(t,{G:()=>n});var s=a(27808),r=a(18811);let l={en:r._,ja:s.ja};function n(e){return l[e]??r._}},51223:(e,t,a)=>{function s(e,t){let a=null;return(...s)=>{a&&clearTimeout(a),a=setTimeout(()=>{e(...s),a=null},t)}}function r(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function l(e){let t=new Set;for(let a of e){t.add(a);let e=a.split("/"),s="";for(let a=0;a<e.length-1;a++)s=s?`${s}/${e[a]}`:e[a],t.add(s)}return t}function n(e,t=30){return e.length<=t?e:`${e.substring(0,t-3)}...`}function i(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}a.d(t,{Ds:()=>s,Ps:()=>l,Xv:()=>i,aS:()=>n,hr:()=>r})},18421:(e,t,a)=>{function s(e){return e?e.isWaitingForResponse?"waiting":e.isProcessing?"running":e.isRunning?"ready":"idle":"idle"}function r(e){let t=!!e.lastAssistantMessageAt&&(!e.lastViewedAt||new Date(e.lastAssistantMessageAt)>new Date(e.lastViewedAt));return{id:e.id,name:e.name,repositoryName:e.repositoryName,status:"idle",hasUnread:t,lastActivity:e.updatedAt,description:e.description,cliStatus:{claude:s(e.sessionStatusByCli?.claude),codex:s(e.sessionStatusByCli?.codex)}}}a.d(t,{He:()=>s,I_:()=>r})},63601:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var s=a(66621);let r=e=>[{type:"image/png",sizes:"180x180",url:(0,s.fillMetadataSegment)(".",e.params,"apple-icon.png")+"?31a89e65aa4ac65b"}]},71150:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var s=a(66621);let r=e=>[{type:"image/png",sizes:"32x32",url:(0,s.fillMetadataSegment)(".",e.params,"icon.png")+"?32d9127ba30ee286"}]}};
@@ -1 +1 @@
1
- {"version":1,"functions":{"/api/app/update-check":{},"/api/external-apps/[id]/health":{},"/api/external-apps/[id]":{},"/api/external-apps":{},"/api/worktrees/[id]/logs/[filename]":{},"/api/worktrees/[id]/logs":{},"/api/worktrees":{},"/proxy/[...path]":{}}}
1
+ {"version":1,"functions":{"/api/app/update-check":{},"/api/external-apps":{},"/api/external-apps/[id]":{},"/api/worktrees/[id]/logs/[filename]":{},"/api/worktrees/[id]/logs":{},"/api/external-apps/[id]/health":{},"/api/worktrees":{},"/proxy/[...path]":{}}}
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>500: Internal Server Error</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-af8567a485ade35a.js" defer=""></script><script src="/_next/static/chunks/framework-8e0e0f4a6b83a956.js" defer=""></script><script src="/_next/static/chunks/main-f00f82f1cf18dd99.js" defer=""></script><script src="/_next/static/chunks/pages/_app-3c9ca398d360b709.js" defer=""></script><script src="/_next/static/chunks/pages/_error-cf5ca766ac8f493f.js" defer=""></script><script src="/_next/static/5sR3jeFe8ymnzcEan6Rdt/_buildManifest.js" defer=""></script><script src="/_next/static/5sR3jeFe8ymnzcEan6Rdt/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>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)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"5sR3jeFe8ymnzcEan6Rdt","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>500: Internal Server Error</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-af8567a485ade35a.js" defer=""></script><script src="/_next/static/chunks/framework-8e0e0f4a6b83a956.js" defer=""></script><script src="/_next/static/chunks/main-f00f82f1cf18dd99.js" defer=""></script><script src="/_next/static/chunks/pages/_app-3c9ca398d360b709.js" defer=""></script><script src="/_next/static/chunks/pages/_error-cf5ca766ac8f493f.js" defer=""></script><script src="/_next/static/NGcx1ej6oVBba0MO0bwCg/_buildManifest.js" defer=""></script><script src="/_next/static/NGcx1ej6oVBba0MO0bwCg/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>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)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"NGcx1ej6oVBba0MO0bwCg","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -1 +1 @@
1
- {"node":{},"edge":{},"encryptionKey":"K4iWuPJs9O5yxwhzXnATQKX/wV+W92k2XvgMpCkgfM0="}
1
+ {"node":{},"edge":{},"encryptionKey":"JqopZPzkPnfbQy2jvDge1DbyMj4oVZgGQA0WoqlgZVw="}