commandmate 0.2.0 → 0.2.2

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 (109) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +13 -13
  3. package/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/cache/config.json +3 -3
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/1.pack +0 -0
  9. package/.next/cache/webpack/client-production/2.pack +0 -0
  10. package/.next/cache/webpack/client-production/index.pack +0 -0
  11. package/.next/cache/webpack/client-production/index.pack.old +0 -0
  12. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  13. package/.next/cache/webpack/server-production/0.pack +0 -0
  14. package/.next/cache/webpack/server-production/index.pack +0 -0
  15. package/.next/next-server.js.nft.json +1 -1
  16. package/.next/prerender-manifest.json +1 -1
  17. package/.next/required-server-files.json +1 -1
  18. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/.next/server/app/_not-found.html +1 -1
  20. package/.next/server/app/_not-found.rsc +1 -1
  21. package/.next/server/app/api/external-apps/[id]/health/route.js.nft.json +1 -1
  22. package/.next/server/app/api/external-apps/[id]/route.js.nft.json +1 -1
  23. package/.next/server/app/api/external-apps/route.js.nft.json +1 -1
  24. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  25. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  26. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  27. package/.next/server/app/api/repositories/excluded/route.js +8 -8
  28. package/.next/server/app/api/repositories/excluded/route.js.nft.json +1 -1
  29. package/.next/server/app/api/repositories/restore/route.js +7 -7
  30. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  31. package/.next/server/app/api/repositories/route.js +5 -5
  32. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  33. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  34. package/.next/server/app/api/repositories/sync/route.js +5 -5
  35. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  36. package/.next/server/app/api/slash-commands.body +1 -1
  37. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  38. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  39. package/.next/server/app/api/worktrees/[id]/capture/route.js +2 -2
  40. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js.nft.json +1 -1
  41. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  42. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  43. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js.nft.json +1 -1
  44. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  45. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  46. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js.nft.json +1 -1
  47. package/.next/server/app/api/worktrees/[id]/logs/route.js.nft.json +1 -1
  48. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js.nft.json +1 -1
  49. package/.next/server/app/api/worktrees/[id]/memos/route.js.nft.json +1 -1
  50. package/.next/server/app/api/worktrees/[id]/messages/route.js.nft.json +1 -1
  51. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  52. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  53. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  54. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  55. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  56. package/.next/server/app/api/worktrees/[id]/search/route.js.nft.json +1 -1
  57. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  58. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js.nft.json +1 -1
  59. package/.next/server/app/api/worktrees/[id]/start-polling/route.js.nft.json +1 -1
  60. package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -1
  61. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js.nft.json +1 -1
  62. package/.next/server/app/api/worktrees/[id]/tree/route.js.nft.json +1 -1
  63. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js.nft.json +1 -1
  64. package/.next/server/app/api/worktrees/[id]/viewed/route.js.nft.json +1 -1
  65. package/.next/server/app/api/worktrees/route.js +1 -1
  66. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  67. package/.next/server/app/index.html +2 -2
  68. package/.next/server/app/index.rsc +2 -2
  69. package/.next/server/app/page_client-reference-manifest.js +1 -1
  70. package/.next/server/app/proxy/[...path]/route.js.nft.json +1 -1
  71. package/.next/server/app/worktrees/[id]/files/[...path]/page.js +1 -1
  72. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  73. package/.next/server/app/worktrees/[id]/page.js +5 -5
  74. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  75. package/.next/server/app/worktrees/[id]/simple-terminal/page_client-reference-manifest.js +1 -1
  76. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  77. package/.next/server/app-paths-manifest.json +9 -9
  78. package/.next/server/chunks/5488.js +5 -5
  79. package/.next/server/chunks/7536.js +1 -1
  80. package/.next/server/chunks/8174.js +6 -6
  81. package/.next/server/chunks/9367.js +2 -2
  82. package/.next/server/functions-config-manifest.json +1 -1
  83. package/.next/server/pages/404.html +1 -1
  84. package/.next/server/pages/500.html +1 -1
  85. package/.next/server/server-reference-manifest.json +1 -1
  86. package/.next/static/chunks/6568-c65d7e4d7db7655b.js +1 -0
  87. package/.next/static/chunks/{2957-327e43ef4c12808f.js → 9325-9e98829c1e75f42f.js} +1 -1
  88. package/.next/static/chunks/app/worktrees/[id]/files/[...path]/{page-9e5adf57cbbbdf05.js → page-7eb14f8043796805.js} +1 -1
  89. package/.next/static/chunks/app/worktrees/[id]/page-912c3c4c66821d99.js +1 -0
  90. package/.next/static/css/d4b58a1129eff6af.css +3 -0
  91. package/.next/trace +5 -5
  92. package/dist/server/server.js +25 -2
  93. package/dist/server/src/config/auto-yes-config.js +53 -0
  94. package/dist/server/src/lib/auto-yes-manager.js +94 -11
  95. package/dist/server/src/lib/claude-poller.js +4 -0
  96. package/dist/server/src/lib/claude-session.js +54 -19
  97. package/dist/server/src/lib/cli-patterns.js +100 -4
  98. package/dist/server/src/lib/cli-tools/codex.js +16 -3
  99. package/dist/server/src/lib/db-repository.js +482 -0
  100. package/dist/server/src/lib/pasted-text-helper.js +58 -0
  101. package/dist/server/src/lib/prompt-detector.js +199 -109
  102. package/dist/server/src/lib/response-poller.js +74 -27
  103. package/dist/server/src/lib/tmux.js +48 -0
  104. package/package.json +1 -1
  105. package/.next/static/chunks/6568-38a33aa67d82e12b.js +0 -1
  106. package/.next/static/chunks/app/worktrees/[id]/page-d64624eb67af57c0.js +0 -1
  107. package/.next/static/css/28be35e4727ae7ef.css +0 -3
  108. /package/.next/static/{bdUePCj-b9Gv5okYGp49O → HhG0EHeG9E4wTJ4sqnLdv}/_buildManifest.js +0 -0
  109. /package/.next/static/{bdUePCj-b9Gv5okYGp49O → HhG0EHeG9E4wTJ4sqnLdv}/_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}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"23103":{"*":{"id":"42772","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"55434":{"*":{"id":"64138","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"74622":{"*":{"id":"13185","name":"*","chunks":[],"async":false}},"89707":{"*":{"id":"54846","name":"*","chunks":[],"async":false}},"91795":{"*":{"id":"2108","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":["816","static/chunks/816-c254f4e2406e696a.js","3185","static/chunks/app/layout-4804cfba519283cf.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":91795,"name":"*","chunks":["816","static/chunks/816-c254f4e2406e696a.js","3185","static/chunks/app/layout-4804cfba519283cf.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/page.tsx":{"id":89707,"name":"*","chunks":["7648","static/chunks/7648-325564a6e12a3257.js","4343","static/chunks/4343-ebe884a2a80eb033.js","6725","static/chunks/6725-f7607851b7d57eb1.js","816","static/chunks/816-c254f4e2406e696a.js","6568","static/chunks/6568-38a33aa67d82e12b.js","1931","static/chunks/app/page-3926224c4cdf315b.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":23103,"name":"*","chunks":["7648","static/chunks/7648-325564a6e12a3257.js","4851","static/chunks/4851-45df4d388db5623f.js","4343","static/chunks/4343-ebe884a2a80eb033.js","2957","static/chunks/2957-327e43ef4c12808f.js","816","static/chunks/816-c254f4e2406e696a.js","6568","static/chunks/6568-38a33aa67d82e12b.js","130","static/chunks/app/worktrees/%5Bid%5D/page-d64624eb67af57c0.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/simple-terminal/page.tsx":{"id":74622,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":55434,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/28be35e4727ae7ef.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}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"55434":{"*":{"id":"64138","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"74622":{"*":{"id":"13185","name":"*","chunks":[],"async":false}},"89707":{"*":{"id":"54846","name":"*","chunks":[],"async":false}},"91795":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"96448":{"*":{"id":"49469","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":["816","static/chunks/816-c254f4e2406e696a.js","3185","static/chunks/app/layout-4804cfba519283cf.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":91795,"name":"*","chunks":["816","static/chunks/816-c254f4e2406e696a.js","3185","static/chunks/app/layout-4804cfba519283cf.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/page.tsx":{"id":89707,"name":"*","chunks":["7648","static/chunks/7648-325564a6e12a3257.js","4343","static/chunks/4343-ebe884a2a80eb033.js","6725","static/chunks/6725-f7607851b7d57eb1.js","816","static/chunks/816-c254f4e2406e696a.js","6568","static/chunks/6568-c65d7e4d7db7655b.js","1931","static/chunks/app/page-3926224c4cdf315b.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/simple-terminal/page.tsx":{"id":74622,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":96448,"name":"*","chunks":["7648","static/chunks/7648-325564a6e12a3257.js","4851","static/chunks/4851-45df4d388db5623f.js","4343","static/chunks/4343-ebe884a2a80eb033.js","9325","static/chunks/9325-9e98829c1e75f42f.js","816","static/chunks/816-c254f4e2406e696a.js","6568","static/chunks/6568-c65d7e4d7db7655b.js","130","static/chunks/app/worktrees/%5Bid%5D/page-912c3c4c66821d99.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":55434,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/d4b58a1129eff6af.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]/simple-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}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"23103":{"*":{"id":"42772","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"55434":{"*":{"id":"64138","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"74622":{"*":{"id":"13185","name":"*","chunks":[],"async":false}},"89707":{"*":{"id":"54846","name":"*","chunks":[],"async":false}},"91795":{"*":{"id":"2108","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":["816","static/chunks/816-c254f4e2406e696a.js","3185","static/chunks/app/layout-4804cfba519283cf.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":91795,"name":"*","chunks":["816","static/chunks/816-c254f4e2406e696a.js","3185","static/chunks/app/layout-4804cfba519283cf.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/page.tsx":{"id":89707,"name":"*","chunks":["7648","static/chunks/7648-325564a6e12a3257.js","4343","static/chunks/4343-ebe884a2a80eb033.js","6725","static/chunks/6725-f7607851b7d57eb1.js","816","static/chunks/816-c254f4e2406e696a.js","6568","static/chunks/6568-38a33aa67d82e12b.js","1931","static/chunks/app/page-3926224c4cdf315b.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":23103,"name":"*","chunks":["7648","static/chunks/7648-325564a6e12a3257.js","4851","static/chunks/4851-45df4d388db5623f.js","4343","static/chunks/4343-ebe884a2a80eb033.js","2957","static/chunks/2957-327e43ef4c12808f.js","816","static/chunks/816-c254f4e2406e696a.js","6568","static/chunks/6568-38a33aa67d82e12b.js","130","static/chunks/app/worktrees/%5Bid%5D/page-d64624eb67af57c0.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/simple-terminal/page.tsx":{"id":74622,"name":"*","chunks":["7648","static/chunks/7648-325564a6e12a3257.js","3791","static/chunks/app/worktrees/%5Bid%5D/simple-terminal/page-16feb3e86e42f4d1.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":55434,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/28be35e4727ae7ef.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]/simple-terminal/page":[]}}
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/worktrees/[id]/simple-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}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"55434":{"*":{"id":"64138","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"74622":{"*":{"id":"13185","name":"*","chunks":[],"async":false}},"89707":{"*":{"id":"54846","name":"*","chunks":[],"async":false}},"91795":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"96448":{"*":{"id":"49469","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":["816","static/chunks/816-c254f4e2406e696a.js","3185","static/chunks/app/layout-4804cfba519283cf.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":91795,"name":"*","chunks":["816","static/chunks/816-c254f4e2406e696a.js","3185","static/chunks/app/layout-4804cfba519283cf.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/page.tsx":{"id":89707,"name":"*","chunks":["7648","static/chunks/7648-325564a6e12a3257.js","4343","static/chunks/4343-ebe884a2a80eb033.js","6725","static/chunks/6725-f7607851b7d57eb1.js","816","static/chunks/816-c254f4e2406e696a.js","6568","static/chunks/6568-c65d7e4d7db7655b.js","1931","static/chunks/app/page-3926224c4cdf315b.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/simple-terminal/page.tsx":{"id":74622,"name":"*","chunks":["7648","static/chunks/7648-325564a6e12a3257.js","3791","static/chunks/app/worktrees/%5Bid%5D/simple-terminal/page-16feb3e86e42f4d1.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":96448,"name":"*","chunks":["7648","static/chunks/7648-325564a6e12a3257.js","4851","static/chunks/4851-45df4d388db5623f.js","4343","static/chunks/4343-ebe884a2a80eb033.js","9325","static/chunks/9325-9e98829c1e75f42f.js","816","static/chunks/816-c254f4e2406e696a.js","6568","static/chunks/6568-c65d7e4d7db7655b.js","130","static/chunks/app/worktrees/%5Bid%5D/page-912c3c4c66821d99.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":55434,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/d4b58a1129eff6af.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]/simple-terminal/page":[]}}
@@ -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}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"23103":{"*":{"id":"42772","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"55434":{"*":{"id":"64138","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"74622":{"*":{"id":"13185","name":"*","chunks":[],"async":false}},"89707":{"*":{"id":"54846","name":"*","chunks":[],"async":false}},"91795":{"*":{"id":"2108","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":["816","static/chunks/816-c254f4e2406e696a.js","3185","static/chunks/app/layout-4804cfba519283cf.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":91795,"name":"*","chunks":["816","static/chunks/816-c254f4e2406e696a.js","3185","static/chunks/app/layout-4804cfba519283cf.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/page.tsx":{"id":89707,"name":"*","chunks":["7648","static/chunks/7648-325564a6e12a3257.js","4343","static/chunks/4343-ebe884a2a80eb033.js","6725","static/chunks/6725-f7607851b7d57eb1.js","816","static/chunks/816-c254f4e2406e696a.js","6568","static/chunks/6568-38a33aa67d82e12b.js","1931","static/chunks/app/page-3926224c4cdf315b.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":23103,"name":"*","chunks":["7648","static/chunks/7648-325564a6e12a3257.js","4851","static/chunks/4851-45df4d388db5623f.js","4343","static/chunks/4343-ebe884a2a80eb033.js","2957","static/chunks/2957-327e43ef4c12808f.js","816","static/chunks/816-c254f4e2406e696a.js","6568","static/chunks/6568-38a33aa67d82e12b.js","130","static/chunks/app/worktrees/%5Bid%5D/page-d64624eb67af57c0.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/simple-terminal/page.tsx":{"id":74622,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":55434,"name":"*","chunks":["9838","static/chunks/30d07d85-393352a92199f695.js","7648","static/chunks/7648-325564a6e12a3257.js","1224","static/chunks/app/worktrees/%5Bid%5D/terminal/page-be802baffc84dbd2.js"],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/28be35e4727ae7ef.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}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"55434":{"*":{"id":"64138","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"74622":{"*":{"id":"13185","name":"*","chunks":[],"async":false}},"89707":{"*":{"id":"54846","name":"*","chunks":[],"async":false}},"91795":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"96448":{"*":{"id":"49469","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":["816","static/chunks/816-c254f4e2406e696a.js","3185","static/chunks/app/layout-4804cfba519283cf.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":91795,"name":"*","chunks":["816","static/chunks/816-c254f4e2406e696a.js","3185","static/chunks/app/layout-4804cfba519283cf.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/page.tsx":{"id":89707,"name":"*","chunks":["7648","static/chunks/7648-325564a6e12a3257.js","4343","static/chunks/4343-ebe884a2a80eb033.js","6725","static/chunks/6725-f7607851b7d57eb1.js","816","static/chunks/816-c254f4e2406e696a.js","6568","static/chunks/6568-c65d7e4d7db7655b.js","1931","static/chunks/app/page-3926224c4cdf315b.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/simple-terminal/page.tsx":{"id":74622,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":96448,"name":"*","chunks":["7648","static/chunks/7648-325564a6e12a3257.js","4851","static/chunks/4851-45df4d388db5623f.js","4343","static/chunks/4343-ebe884a2a80eb033.js","9325","static/chunks/9325-9e98829c1e75f42f.js","816","static/chunks/816-c254f4e2406e696a.js","6568","static/chunks/6568-c65d7e4d7db7655b.js","130","static/chunks/app/worktrees/%5Bid%5D/page-912c3c4c66821d99.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":55434,"name":"*","chunks":["9838","static/chunks/30d07d85-393352a92199f695.js","7648","static/chunks/7648-325564a6e12a3257.js","1224","static/chunks/app/worktrees/%5Bid%5D/terminal/page-be802baffc84dbd2.js"],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/d4b58a1129eff6af.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,9 +1,9 @@
1
1
  {
2
2
  "/_not-found/page": "app/_not-found/page.js",
3
- "/api/hooks/claude-done/route": "app/api/hooks/claude-done/route.js",
4
3
  "/api/repositories/clone/[jobId]/route": "app/api/repositories/clone/[jobId]/route.js",
5
- "/api/repositories/clone/route": "app/api/repositories/clone/route.js",
4
+ "/api/hooks/claude-done/route": "app/api/hooks/claude-done/route.js",
6
5
  "/api/repositories/excluded/route": "app/api/repositories/excluded/route.js",
6
+ "/api/repositories/clone/route": "app/api/repositories/clone/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
9
  "/api/repositories/scan/route": "app/api/repositories/scan/route.js",
@@ -13,21 +13,21 @@
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]/interrupt/route": "app/api/worktrees/[id]/interrupt/route.js",
17
16
  "/api/worktrees/[id]/kill-session/route": "app/api/worktrees/[id]/kill-session/route.js",
18
17
  "/api/worktrees/[id]/files/[...path]/route": "app/api/worktrees/[id]/files/[...path]/route.js",
18
+ "/api/worktrees/[id]/interrupt/route": "app/api/worktrees/[id]/interrupt/route.js",
19
19
  "/api/worktrees/[id]/logs/[filename]/route": "app/api/worktrees/[id]/logs/[filename]/route.js",
20
- "/api/worktrees/[id]/memos/[memoId]/route": "app/api/worktrees/[id]/memos/[memoId]/route.js",
21
- "/api/worktrees/[id]/memos/route": "app/api/worktrees/[id]/memos/route.js",
22
- "/api/worktrees/[id]/respond/route": "app/api/worktrees/[id]/respond/route.js",
23
20
  "/api/worktrees/[id]/logs/route": "app/api/worktrees/[id]/logs/route.js",
21
+ "/api/worktrees/[id]/memos/[memoId]/route": "app/api/worktrees/[id]/memos/[memoId]/route.js",
24
22
  "/api/worktrees/[id]/messages/route": "app/api/worktrees/[id]/messages/route.js",
23
+ "/api/worktrees/[id]/memos/route": "app/api/worktrees/[id]/memos/route.js",
25
24
  "/api/worktrees/[id]/prompt-response/route": "app/api/worktrees/[id]/prompt-response/route.js",
25
+ "/api/worktrees/[id]/respond/route": "app/api/worktrees/[id]/respond/route.js",
26
26
  "/api/worktrees/[id]/route": "app/api/worktrees/[id]/route.js",
27
- "/api/worktrees/[id]/search/route": "app/api/worktrees/[id]/search/route.js",
28
27
  "/api/worktrees/[id]/send/route": "app/api/worktrees/[id]/send/route.js",
29
- "/api/worktrees/[id]/slash-commands/route": "app/api/worktrees/[id]/slash-commands/route.js",
28
+ "/api/worktrees/[id]/search/route": "app/api/worktrees/[id]/search/route.js",
30
29
  "/api/worktrees/[id]/start-polling/route": "app/api/worktrees/[id]/start-polling/route.js",
30
+ "/api/worktrees/[id]/slash-commands/route": "app/api/worktrees/[id]/slash-commands/route.js",
31
31
  "/api/worktrees/[id]/terminal/route": "app/api/worktrees/[id]/terminal/route.js",
32
32
  "/api/worktrees/[id]/tree/[...path]/route": "app/api/worktrees/[id]/tree/[...path]/route.js",
33
33
  "/api/worktrees/[id]/tree/route": "app/api/worktrees/[id]/tree/route.js",
@@ -37,8 +37,8 @@
37
37
  "/icon.png/route": "app/icon.png/route.js",
38
38
  "/worktrees/[id]/files/[...path]/page": "app/worktrees/[id]/files/[...path]/page.js",
39
39
  "/page": "app/page.js",
40
- "/worktrees/[id]/page": "app/worktrees/[id]/page.js",
41
40
  "/worktrees/[id]/simple-terminal/page": "app/worktrees/[id]/simple-terminal/page.js",
41
+ "/worktrees/[id]/page": "app/worktrees/[id]/page.js",
42
42
  "/worktrees/[id]/terminal/page": "app/worktrees/[id]/terminal/page.js",
43
43
  "/api/external-apps/[id]/health/route": "app/api/external-apps/[id]/health/route.js",
44
44
  "/api/external-apps/route": "app/api/external-apps/route.js",
@@ -1,4 +1,4 @@
1
- "use strict";exports.id=5488,exports.ids=[5488],exports.modules={65488:(e,t,r)=>{r.d(t,{v:()=>g});var o=r(61282),s=r(92048),a=r(55315),n=r.n(a);class i{constructor(){}static getInstance(){return i.instance||(i.instance=new i),i.instance}normalize(e){let t=e.match(/^ssh:\/\/git@([^:\/]+)(:\d+)?\/(.+?)(\.git)?$/);if(t)return`https://${t[1]}/${t[3]}`.toLowerCase().replace(/\/$/,"");let r=e.match(/^git@([^:]+):(.+?)(\.git)?$/);return r?`https://${r[1]}/${r[2]}`.toLowerCase().replace(/\/$/,""):e.replace(/\.git\/?$/,"").replace(/\/$/,"").toLowerCase()}isSameRepository(e,t){return this.normalize(e)===this.normalize(t)}extractRepoName(e){let t=e.match(/^ssh:\/\/git@[^\/]+\/(.+?)(\.git)?$/);if(t){let e=t[1].split("/");return e[e.length-1]}let r=e.match(/:(.+?)(\.git)?$/);if(r&&e.startsWith("git@")){let e=r[1].split("/");return e[e.length-1]}let o=e.match(/\/([^\/]+?)(\.git)?$/);return o?o[1]:""}getUrlType(e){return e.startsWith("https://")?"https":e.startsWith("git@")||e.startsWith("ssh://")?"ssh":null}validate(e){if(!e||"string"!=typeof e||""===e.trim())return{valid:!1,error:"EMPTY_URL"};let t=e.trim();return t.startsWith("https://")?/^https:\/\/[^\/]+\/[^\/]+\/[^\/]+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}:t.startsWith("git@")?/^git@[^:]+:.+\/.+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}:t.startsWith("ssh://")&&/^ssh:\/\/git@[^\/]+(:\d+)?\/[^\/]+\/.+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}}}var l=r(57440),c=r(4709),d=r(67722);class u extends Error{constructor(e){super(e.message),this.name="CloneManagerError",this.category=e.category,this.code=e.code,this.recoverable=e.recoverable,this.suggestedAction=e.suggestedAction}}let p={EMPTY_URL:{category:"validation",code:"EMPTY_URL",message:"Clone URL is required",recoverable:!0,suggestedAction:"Please enter a valid git clone URL"},INVALID_URL_FORMAT:{category:"validation",code:"INVALID_URL_FORMAT",message:"Invalid URL format. Please use HTTPS or SSH URL.",recoverable:!0,suggestedAction:"Enter a valid URL like https://github.com/owner/repo or git@github.com:owner/repo"},DUPLICATE_CLONE_URL:{category:"validation",code:"DUPLICATE_CLONE_URL",message:"This repository is already registered",recoverable:!1,suggestedAction:"Use the existing repository instead"},CLONE_IN_PROGRESS:{category:"validation",code:"CLONE_IN_PROGRESS",message:"A clone operation is already in progress for this URL",recoverable:!1,suggestedAction:"Wait for the current clone to complete"},DIRECTORY_EXISTS:{category:"filesystem",code:"DIRECTORY_EXISTS",message:"Target directory already exists",recoverable:!0,suggestedAction:"Choose a different directory or remove the existing one"},INVALID_TARGET_PATH:{category:"validation",code:"INVALID_TARGET_PATH",message:"Target path is invalid or outside allowed directory",recoverable:!0,suggestedAction:"Use a path within the configured base directory"},AUTH_FAILED:{category:"auth",code:"AUTH_FAILED",message:"Authentication failed",recoverable:!0,suggestedAction:"Check your credentials or SSH keys"},NETWORK_ERROR:{category:"network",code:"NETWORK_ERROR",message:"Network error occurred",recoverable:!0,suggestedAction:"Check your internet connection and try again"},GIT_ERROR:{category:"git",code:"GIT_ERROR",message:"Git command failed",recoverable:!1,suggestedAction:"Check the error message for details"},CLONE_TIMEOUT:{category:"network",code:"CLONE_TIMEOUT",message:"Clone operation timed out",recoverable:!0,suggestedAction:"Try again or clone a smaller repository"}};class g{constructor(e,t={}){this.db=e,this.urlNormalizer=i.getInstance(),this.config={basePath:t.basePath||process.env.WORKTREE_BASE_PATH||"/tmp/repos",timeout:t.timeout||6e5},this.activeProcesses=new Map}validateCloneRequest(e){let t=this.urlNormalizer.validate(e);return t.valid?{valid:!0,normalizedUrl:this.urlNormalizer.normalize(e),repoName:this.urlNormalizer.extractRepoName(e)}:{valid:!1,error:p[t.error||"INVALID_URL_FORMAT"]}}checkDuplicateRepository(e){return(0,c.nb)(this.db,e)}checkActiveCloneJob(e){return(0,c.fC)(this.db,e)}createCloneJob(e){return(0,c.Bm)(this.db,e)}getTargetPath(e){return n().join(this.config.basePath,e)}async startCloneJob(e,t){let r=this.validateCloneRequest(e);if(!r.valid)return{success:!1,error:r.error};let o=r.normalizedUrl,a=r.repoName,n=this.checkDuplicateRepository(o);if(n)return{success:!1,error:{...p.DUPLICATE_CLONE_URL,message:`This repository is already registered as "${n.name}"`}};let i=this.checkActiveCloneJob(o);if(i)return{success:!1,jobId:i.id,error:p.CLONE_IN_PROGRESS};let c=t||this.getTargetPath(a);if(t&&!(0,l.j)(t,this.config.basePath))return{success:!1,error:{...p.INVALID_TARGET_PATH,message:`Target path must be within ${this.config.basePath}`}};if((0,s.existsSync)(c))return{success:!1,error:{...p.DIRECTORY_EXISTS,message:`Target directory already exists: ${c}`}};let d=this.createCloneJob({cloneUrl:e,normalizedCloneUrl:o,targetPath:c});return this.executeClone(d.id,e,c).catch(e=>{console.error(`[CloneManager] Clone failed for job ${d.id}:`,e)}),{success:!0,jobId:d.id}}async executeClone(e,t,r){(0,c.sN)(this.db,e,{status:"running",startedAt:new Date});let a=n().dirname(r);return(0,s.existsSync)(a)||(0,s.mkdirSync)(a,{recursive:!0}),new Promise((s,a)=>{let n=(0,o.spawn)("git",["clone","--progress",t,r],{stdio:["ignore","pipe","pipe"]});this.activeProcesses.set(e,n),n.pid&&(0,c.sN)(this.db,e,{pid:n.pid});let i="";n.stderr?.on("data",t=>{i+=t.toString();let r=this.parseGitProgress(t.toString());null!==r&&c.sN(this.db,e,{progress:r})});let l=setTimeout(()=>{n.kill("SIGTERM"),(0,c.sN)(this.db,e,{status:"failed",errorCategory:"network",errorCode:"CLONE_TIMEOUT",errorMessage:"Clone operation timed out",completedAt:new Date}),this.activeProcesses.delete(e),a(new u(p.CLONE_TIMEOUT))},this.config.timeout);n.on("close",async o=>{if(clearTimeout(l),this.activeProcesses.delete(e),0===o)await this.onCloneSuccess(e,t,r),s();else{let t=this.parseGitError(i,o);(0,c.sN)(this.db,e,{status:"failed",errorCategory:t.category,errorCode:t.code,errorMessage:t.message,completedAt:new Date}),a(new u(t))}}),n.on("error",t=>{clearTimeout(l),this.activeProcesses.delete(e);let r={category:"system",code:"SPAWN_ERROR",message:`Failed to spawn git process: ${t.message}`,recoverable:!1,suggestedAction:"Ensure git is installed and available in PATH"};(0,c.sN)(this.db,e,{status:"failed",errorCategory:r.category,errorCode:r.code,errorMessage:r.message,completedAt:new Date}),a(new u(r))})})}async onCloneSuccess(e,t,r){let o=(0,c.L_)(this.db,e);if(!o)return;let s=this.urlNormalizer.getUrlType(t),a=(0,c.h4)(this.db,{name:n().basename(r),path:r,cloneUrl:t,normalizedCloneUrl:o.normalizedCloneUrl,cloneSource:s||"https"});try{let e=await (0,d.e9)(r);e.length>0&&((0,d.h2)(this.db,e),console.log(`[CloneManager] Registered ${e.length} worktree(s) for ${r}`))}catch(e){console.error(`[CloneManager] Failed to scan worktrees for ${r}:`,e)}(0,c.sN)(this.db,e,{status:"completed",progress:100,repositoryId:a.id,completedAt:new Date})}parseGitProgress(e){let t=e.match(/(?:Receiving objects|Resolving deltas|Cloning into[^:]*?):\s*(\d+)%/);if(t){let e=parseInt(t[1],10);return isNaN(e)?null:e}return null}parseGitError(e,t){let r=e.toLowerCase(),o=e.substring(0,200);return["authentication failed","permission denied","could not read from remote repository"].some(e=>r.includes(e))?{...p.AUTH_FAILED,message:`Authentication failed: ${o}`}:["could not resolve host","connection refused","network is unreachable"].some(e=>r.includes(e))?{...p.NETWORK_ERROR,message:`Network error: ${o}`}:{...p.GIT_ERROR,message:`Git clone failed (exit code ${t}): ${o}`}}getCloneJobStatus(e){let t=(0,c.L_)(this.db,e);if(!t)return null;let r={jobId:t.id,status:t.status,progress:t.progress,repositoryId:t.repositoryId};return"failed"===t.status&&t.errorCode&&(r.error={category:t.errorCategory||"system",code:t.errorCode,message:t.errorMessage||"Unknown error"}),r}cancelCloneJob(e){let t=this.activeProcesses.get(e);if(t)return t.kill("SIGTERM"),this.activeProcesses.delete(e),(0,c.sN)(this.db,e,{status:"cancelled",completedAt:new Date}),!0;let r=(0,c.L_)(this.db,e);return!!r&&"pending"===r.status&&((0,c.sN)(this.db,e,{status:"cancelled",completedAt:new Date}),!0)}}},4709:(e,t,r)=>{r.d(t,{Bj:()=>f,Bm:()=>v,Hf:()=>E,L_:()=>b,RT:()=>R,VZ:()=>h,Xo:()=>m,fC:()=>y,h4:()=>c,mm:()=>_,nb:()=>d,sN:()=>C});var o=r(84770),s=r(55315),a=r.n(s),n=r(43753);function i(e){return{id:e.id,name:e.name,path:e.path,enabled:1===e.enabled,cloneUrl:e.clone_url||void 0,normalizedCloneUrl:e.normalized_clone_url||void 0,cloneSource:e.clone_source,isEnvManaged:1===e.is_env_managed,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at)}}function l(e){return{id:e.id,cloneUrl:e.clone_url,normalizedCloneUrl:e.normalized_clone_url,targetPath:e.target_path,repositoryId:e.repository_id||void 0,status:e.status,pid:e.pid||void 0,progress:e.progress,errorCategory:e.error_category||void 0,errorCode:e.error_code||void 0,errorMessage:e.error_message||void 0,startedAt:e.started_at?new Date(e.started_at):void 0,completedAt:e.completed_at?new Date(e.completed_at):void 0,createdAt:new Date(e.created_at)}}function c(e,t){let r=(0,o.randomUUID)(),s=Date.now();return e.prepare(`
1
+ "use strict";exports.id=5488,exports.ids=[5488],exports.modules={65488:(e,t,r)=>{r.d(t,{v:()=>g});var o=r(61282),s=r(92048),a=r(55315),n=r.n(a);class i{constructor(){}static getInstance(){return i.instance||(i.instance=new i),i.instance}normalize(e){let t=e.match(/^ssh:\/\/git@([^:\/]+)(:\d+)?\/(.+?)(\.git)?$/);if(t)return`https://${t[1]}/${t[3]}`.toLowerCase().replace(/\/$/,"");let r=e.match(/^git@([^:]+):(.+?)(\.git)?$/);return r?`https://${r[1]}/${r[2]}`.toLowerCase().replace(/\/$/,""):e.replace(/\.git\/?$/,"").replace(/\/$/,"").toLowerCase()}isSameRepository(e,t){return this.normalize(e)===this.normalize(t)}extractRepoName(e){let t=e.match(/^ssh:\/\/git@[^\/]+\/(.+?)(\.git)?$/);if(t){let e=t[1].split("/");return e[e.length-1]}let r=e.match(/:(.+?)(\.git)?$/);if(r&&e.startsWith("git@")){let e=r[1].split("/");return e[e.length-1]}let o=e.match(/\/([^\/]+?)(\.git)?$/);return o?o[1]:""}getUrlType(e){return e.startsWith("https://")?"https":e.startsWith("git@")||e.startsWith("ssh://")?"ssh":null}validate(e){if(!e||"string"!=typeof e||""===e.trim())return{valid:!1,error:"EMPTY_URL"};let t=e.trim();return t.startsWith("https://")?/^https:\/\/[^\/]+\/[^\/]+\/[^\/]+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}:t.startsWith("git@")?/^git@[^:]+:.+\/.+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}:t.startsWith("ssh://")&&/^ssh:\/\/git@[^\/]+(:\d+)?\/[^\/]+\/.+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}}}var l=r(57440),c=r(4709),d=r(67722);class u extends Error{constructor(e){super(e.message),this.name="CloneManagerError",this.category=e.category,this.code=e.code,this.recoverable=e.recoverable,this.suggestedAction=e.suggestedAction}}let p={EMPTY_URL:{category:"validation",code:"EMPTY_URL",message:"Clone URL is required",recoverable:!0,suggestedAction:"Please enter a valid git clone URL"},INVALID_URL_FORMAT:{category:"validation",code:"INVALID_URL_FORMAT",message:"Invalid URL format. Please use HTTPS or SSH URL.",recoverable:!0,suggestedAction:"Enter a valid URL like https://github.com/owner/repo or git@github.com:owner/repo"},DUPLICATE_CLONE_URL:{category:"validation",code:"DUPLICATE_CLONE_URL",message:"This repository is already registered",recoverable:!1,suggestedAction:"Use the existing repository instead"},CLONE_IN_PROGRESS:{category:"validation",code:"CLONE_IN_PROGRESS",message:"A clone operation is already in progress for this URL",recoverable:!1,suggestedAction:"Wait for the current clone to complete"},DIRECTORY_EXISTS:{category:"filesystem",code:"DIRECTORY_EXISTS",message:"Target directory already exists",recoverable:!0,suggestedAction:"Choose a different directory or remove the existing one"},INVALID_TARGET_PATH:{category:"validation",code:"INVALID_TARGET_PATH",message:"Target path is invalid or outside allowed directory",recoverable:!0,suggestedAction:"Use a path within the configured base directory"},AUTH_FAILED:{category:"auth",code:"AUTH_FAILED",message:"Authentication failed",recoverable:!0,suggestedAction:"Check your credentials or SSH keys"},NETWORK_ERROR:{category:"network",code:"NETWORK_ERROR",message:"Network error occurred",recoverable:!0,suggestedAction:"Check your internet connection and try again"},GIT_ERROR:{category:"git",code:"GIT_ERROR",message:"Git command failed",recoverable:!1,suggestedAction:"Check the error message for details"},CLONE_TIMEOUT:{category:"network",code:"CLONE_TIMEOUT",message:"Clone operation timed out",recoverable:!0,suggestedAction:"Try again or clone a smaller repository"}};class g{constructor(e,t={}){this.db=e,this.urlNormalizer=i.getInstance(),this.config={basePath:t.basePath||process.env.WORKTREE_BASE_PATH||"/tmp/repos",timeout:t.timeout||6e5},this.activeProcesses=new Map}validateCloneRequest(e){let t=this.urlNormalizer.validate(e);return t.valid?{valid:!0,normalizedUrl:this.urlNormalizer.normalize(e),repoName:this.urlNormalizer.extractRepoName(e)}:{valid:!1,error:p[t.error||"INVALID_URL_FORMAT"]}}checkDuplicateRepository(e){return(0,c.nb)(this.db,e)}checkActiveCloneJob(e){return(0,c.fC)(this.db,e)}createCloneJob(e){return(0,c.Bm)(this.db,e)}getTargetPath(e){return n().join(this.config.basePath,e)}async startCloneJob(e,t){let r=this.validateCloneRequest(e);if(!r.valid)return{success:!1,error:r.error};let o=r.normalizedUrl,a=r.repoName,n=this.checkDuplicateRepository(o);if(n)return{success:!1,error:{...p.DUPLICATE_CLONE_URL,message:`This repository is already registered as "${n.name}"`}};let i=this.checkActiveCloneJob(o);if(i)return{success:!1,jobId:i.id,error:p.CLONE_IN_PROGRESS};let c=t||this.getTargetPath(a);if(t&&!(0,l.j)(t,this.config.basePath))return{success:!1,error:{...p.INVALID_TARGET_PATH,message:`Target path must be within ${this.config.basePath}`}};if((0,s.existsSync)(c))return{success:!1,error:{...p.DIRECTORY_EXISTS,message:`Target directory already exists: ${c}`}};let d=this.createCloneJob({cloneUrl:e,normalizedCloneUrl:o,targetPath:c});return this.executeClone(d.id,e,c).catch(e=>{console.error(`[CloneManager] Clone failed for job ${d.id}:`,e)}),{success:!0,jobId:d.id}}async executeClone(e,t,r){(0,c.sN)(this.db,e,{status:"running",startedAt:new Date});let a=n().dirname(r);return(0,s.existsSync)(a)||(0,s.mkdirSync)(a,{recursive:!0}),new Promise((s,a)=>{let n=(0,o.spawn)("git",["clone","--progress",t,r],{stdio:["ignore","pipe","pipe"]});this.activeProcesses.set(e,n),n.pid&&(0,c.sN)(this.db,e,{pid:n.pid});let i="";n.stderr?.on("data",t=>{i+=t.toString();let r=this.parseGitProgress(t.toString());null!==r&&c.sN(this.db,e,{progress:r})});let l=setTimeout(()=>{n.kill("SIGTERM"),(0,c.sN)(this.db,e,{status:"failed",errorCategory:"network",errorCode:"CLONE_TIMEOUT",errorMessage:"Clone operation timed out",completedAt:new Date}),this.activeProcesses.delete(e),a(new u(p.CLONE_TIMEOUT))},this.config.timeout);n.on("close",async o=>{if(clearTimeout(l),this.activeProcesses.delete(e),0===o)await this.onCloneSuccess(e,t,r),s();else{let t=this.parseGitError(i,o);(0,c.sN)(this.db,e,{status:"failed",errorCategory:t.category,errorCode:t.code,errorMessage:t.message,completedAt:new Date}),a(new u(t))}}),n.on("error",t=>{clearTimeout(l),this.activeProcesses.delete(e);let r={category:"system",code:"SPAWN_ERROR",message:`Failed to spawn git process: ${t.message}`,recoverable:!1,suggestedAction:"Ensure git is installed and available in PATH"};(0,c.sN)(this.db,e,{status:"failed",errorCategory:r.category,errorCode:r.code,errorMessage:r.message,completedAt:new Date}),a(new u(r))})})}async onCloneSuccess(e,t,r){let o=(0,c.L_)(this.db,e);if(!o)return;let s=this.urlNormalizer.getUrlType(t),a=(0,c.h4)(this.db,{name:n().basename(r),path:r,cloneUrl:t,normalizedCloneUrl:o.normalizedCloneUrl,cloneSource:s||"https"});try{let e=await (0,d.e9)(r);e.length>0&&((0,d.h2)(this.db,e),console.log(`[CloneManager] Registered ${e.length} worktree(s) for ${r}`))}catch(e){console.error(`[CloneManager] Failed to scan worktrees for ${r}:`,e)}(0,c.sN)(this.db,e,{status:"completed",progress:100,repositoryId:a.id,completedAt:new Date})}parseGitProgress(e){let t=e.match(/(?:Receiving objects|Resolving deltas|Cloning into[^:]*?):\s*(\d+)%/);if(t){let e=parseInt(t[1],10);return isNaN(e)?null:e}return null}parseGitError(e,t){let r=e.toLowerCase(),o=e.substring(0,200);return["authentication failed","permission denied","could not read from remote repository"].some(e=>r.includes(e))?{...p.AUTH_FAILED,message:`Authentication failed: ${o}`}:["could not resolve host","connection refused","network is unreachable"].some(e=>r.includes(e))?{...p.NETWORK_ERROR,message:`Network error: ${o}`}:{...p.GIT_ERROR,message:`Git clone failed (exit code ${t}): ${o}`}}getCloneJobStatus(e){let t=(0,c.L_)(this.db,e);if(!t)return null;let r={jobId:t.id,status:t.status,progress:t.progress,repositoryId:t.repositoryId};return"failed"===t.status&&t.errorCode&&(r.error={category:t.errorCategory||"system",code:t.errorCode,message:t.errorMessage||"Unknown error"}),r}cancelCloneJob(e){let t=this.activeProcesses.get(e);if(t)return t.kill("SIGTERM"),this.activeProcesses.delete(e),(0,c.sN)(this.db,e,{status:"cancelled",completedAt:new Date}),!0;let r=(0,c.L_)(this.db,e);return!!r&&"pending"===r.status&&((0,c.sN)(this.db,e,{status:"cancelled",completedAt:new Date}),!0)}}},4709:(e,t,r)=>{r.d(t,{Bj:()=>_,Bm:()=>R,L_:()=>v,RT:()=>f,VZ:()=>h,fC:()=>C,h4:()=>c,mm:()=>E,nJ:()=>m,nb:()=>d,sN:()=>b});var o=r(84770),s=r(55315),a=r.n(s),n=r(43753);function i(e){return{id:e.id,name:e.name,path:e.path,enabled:1===e.enabled,cloneUrl:e.clone_url||void 0,normalizedCloneUrl:e.normalized_clone_url||void 0,cloneSource:e.clone_source,isEnvManaged:1===e.is_env_managed,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at)}}function l(e){return{id:e.id,cloneUrl:e.clone_url,normalizedCloneUrl:e.normalized_clone_url,targetPath:e.target_path,repositoryId:e.repository_id||void 0,status:e.status,pid:e.pid||void 0,progress:e.progress,errorCategory:e.error_category||void 0,errorCode:e.error_code||void 0,errorMessage:e.error_message||void 0,startedAt:e.started_at?new Date(e.started_at):void 0,completedAt:e.completed_at?new Date(e.completed_at):void 0,createdAt:new Date(e.created_at)}}function c(e,t){let r=(0,o.randomUUID)(),s=Date.now();return e.prepare(`
2
2
  INSERT INTO repositories (
3
3
  id, name, path, enabled, clone_url, normalized_clone_url,
4
4
  clone_source, is_env_managed, created_at, updated_at
@@ -14,20 +14,20 @@
14
14
  UPDATE repositories
15
15
  SET ${s.join(", ")}
16
16
  WHERE id = ?
17
- `).run(...a)}function g(e){return a().resolve(e)}function h(e){if(!e||"string"!=typeof e)return{valid:!1,error:"repositoryPath is required"};if(e.includes("\0"))return{valid:!1,error:"Invalid repository path"};let t=g(e);return(0,n.F)(t)?{valid:!1,error:"Invalid repository path"}:{valid:!0,resolvedPath:t}}function m(e,t){for(let r of t){let t=g(r);u(e,t)||c(e,{name:a().basename(t),path:t,cloneSource:"local",isEnvManaged:!0,enabled:!0})}}function E(e,t){let r=e.prepare("SELECT path FROM repositories WHERE enabled = 0").all().map(e=>e.path);return t.filter(e=>!r.includes(g(e)))}function _(e,t){let r=g(t),o=u(e,r);if(o)p(e,o.id,{enabled:!1});else{if(e.prepare("SELECT COUNT(*) as count FROM repositories WHERE enabled = 0").get().count>=1e3)throw Error("Disabled repository limit exceeded");c(e,{name:a().basename(r),path:r,cloneSource:"local",isEnvManaged:!1,enabled:!1})}}function f(e){return e.prepare("SELECT * FROM repositories WHERE enabled = 0 ORDER BY name ASC").all().map(i)}function R(e,t){let r=u(e,g(t));return r?(p(e,r.id,{enabled:!0}),{...r,enabled:!0}):null}function v(e,t){let r=(0,o.randomUUID)(),s=Date.now();return e.prepare(`
17
+ `).run(...a)}function g(e){return a().resolve(e)}function h(e){if(!e||"string"!=typeof e)return{valid:!1,error:"repositoryPath is required"};if(e.includes("\0"))return{valid:!1,error:"Invalid repository path"};let t=g(e);return(0,n.F)(t)?{valid:!1,error:"Invalid repository path"}:{valid:!0,resolvedPath:t}}function m(e,t){!function(e,t){for(let r of t){let t=g(r);u(e,t)||c(e,{name:a().basename(t),path:t,cloneSource:"local",isEnvManaged:!0,enabled:!0})}}(e,t);let r=function(e,t){let r=e.prepare("SELECT path FROM repositories WHERE enabled = 0").all().map(e=>e.path);return t.filter(e=>!r.includes(g(e)))}(e,t),o=t.filter(e=>!r.includes(e));return{filteredPaths:r,excludedPaths:o,excludedCount:o.length}}function E(e,t){let r=g(t),o=u(e,r);if(o)p(e,o.id,{enabled:!1});else{if(e.prepare("SELECT COUNT(*) as count FROM repositories WHERE enabled = 0").get().count>=1e3)throw Error("Disabled repository limit exceeded");c(e,{name:a().basename(r),path:r,cloneSource:"local",isEnvManaged:!1,enabled:!1})}}function _(e){return e.prepare("SELECT * FROM repositories WHERE enabled = 0 ORDER BY name ASC").all().map(i)}function f(e,t){let r=u(e,g(t));return r?(p(e,r.id,{enabled:!0}),{...r,enabled:!0}):null}function R(e,t){let r=(0,o.randomUUID)(),s=Date.now();return e.prepare(`
18
18
  INSERT INTO clone_jobs (
19
19
  id, clone_url, normalized_clone_url, target_path,
20
20
  status, progress, created_at
21
21
  )
22
22
  VALUES (?, ?, ?, ?, 'pending', 0, ?)
23
- `).run(r,t.cloneUrl,t.normalizedCloneUrl,t.targetPath,s),{id:r,cloneUrl:t.cloneUrl,normalizedCloneUrl:t.normalizedCloneUrl,targetPath:t.targetPath,status:"pending",progress:0,createdAt:new Date(s)}}function b(e,t){let r=e.prepare(`
23
+ `).run(r,t.cloneUrl,t.normalizedCloneUrl,t.targetPath,s),{id:r,cloneUrl:t.cloneUrl,normalizedCloneUrl:t.normalizedCloneUrl,targetPath:t.targetPath,status:"pending",progress:0,createdAt:new Date(s)}}function v(e,t){let r=e.prepare(`
24
24
  SELECT * FROM clone_jobs
25
25
  WHERE id = ?
26
- `).get(t);return r?l(r):null}function C(e,t,r){let o=[],s=[];void 0!==r.status&&(o.push("status = ?"),s.push(r.status)),void 0!==r.pid&&(o.push("pid = ?"),s.push(r.pid)),void 0!==r.progress&&(o.push("progress = ?"),s.push(r.progress)),void 0!==r.repositoryId&&(o.push("repository_id = ?"),s.push(r.repositoryId)),void 0!==r.errorCategory&&(o.push("error_category = ?"),s.push(r.errorCategory)),void 0!==r.errorCode&&(o.push("error_code = ?"),s.push(r.errorCode)),void 0!==r.errorMessage&&(o.push("error_message = ?"),s.push(r.errorMessage)),void 0!==r.startedAt&&(o.push("started_at = ?"),s.push(r.startedAt.getTime())),void 0!==r.completedAt&&(o.push("completed_at = ?"),s.push(r.completedAt.getTime())),0!==o.length&&(s.push(t),e.prepare(`
26
+ `).get(t);return r?l(r):null}function b(e,t,r){let o=[],s=[];void 0!==r.status&&(o.push("status = ?"),s.push(r.status)),void 0!==r.pid&&(o.push("pid = ?"),s.push(r.pid)),void 0!==r.progress&&(o.push("progress = ?"),s.push(r.progress)),void 0!==r.repositoryId&&(o.push("repository_id = ?"),s.push(r.repositoryId)),void 0!==r.errorCategory&&(o.push("error_category = ?"),s.push(r.errorCategory)),void 0!==r.errorCode&&(o.push("error_code = ?"),s.push(r.errorCode)),void 0!==r.errorMessage&&(o.push("error_message = ?"),s.push(r.errorMessage)),void 0!==r.startedAt&&(o.push("started_at = ?"),s.push(r.startedAt.getTime())),void 0!==r.completedAt&&(o.push("completed_at = ?"),s.push(r.completedAt.getTime())),0!==o.length&&(s.push(t),e.prepare(`
27
27
  UPDATE clone_jobs
28
28
  SET ${o.join(", ")}
29
29
  WHERE id = ?
30
- `).run(...s))}function y(e,t){let r=e.prepare(`
30
+ `).run(...s))}function C(e,t){let r=e.prepare(`
31
31
  SELECT * FROM clone_jobs
32
32
  WHERE normalized_clone_url = ?
33
33
  AND status IN ('pending', 'running')
@@ -1 +1 @@
1
- "use strict";exports.id=7536,exports.ids=[7536],exports.modules={43632:(e,t,s)=>{s.d(t,{FN:()=>o}),s(62648),s(97425),s(75748),s(25079),s(63661),s(76966);let n=new Map,i=new Map;function o(e){let t=n.get(e);t&&(clearInterval(t),n.delete(e),i.delete(e),console.log(`Stopped poller for ${e}`))}},89194:(e,t,s)=>{s.d(t,{Lg:()=>r,NA:()=>a});var n=s(10927),i=s(43839);let o=(0,s(43895).h)("cli-session");async function r(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 r=o.withContext({worktreeId:e,cliToolId:t});r.debug("captureSessionOutput:start",{requestedLines:s});let a=i.g.getInstance().getTool(t),l=a.getSessionName(e);if(!await (0,n.Hk)(l))throw r.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 r.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 r.error("captureSessionOutput:failed",{error:e}),Error(`Failed to capture ${a.name} output: ${e}`)}}},43839:(e,t,s)=>{s.d(t,{g:()=>w});var n=s(61282),i=s(21764);let o=/^[a-zA-Z0-9_-]+$/;var r=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(!o.test(e))throw Error(`Invalid session name format: ${e}`)}(t),t}async interrupt(e){let t=this.getSessionName(e);await (0,r.ZV)(t,"Escape")}}var m=s(62648);class u extends l{async isInstalled(){return await (0,m.Uv)()}async isRunning(e){return await (0,m.YI)(e)}async startSession(e,t){await (0,m.ym)({worktreeId:e,worktreePath:t})}async sendMessage(e,t){await (0,m.xd)(e,t)}async killSession(e){await (0,m._f)(e)}constructor(...e){super(...e),this.id="claude",this.name="Claude Code",this.command="claude"}}let c=(0,i.promisify)(n.exec);class p extends l{async isRunning(e){let t=this.getSessionName(e);return await (0,r.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,r.Hk)(s)){console.log(`Codex session ${s} already exists`);return}try{await (0,r.ed)({sessionName:s,workingDirectory:t,historyLimit:5e4}),await new Promise(e=>setTimeout(e,100)),await (0,r.Is)(s,"codex",!0),await new Promise(e=>setTimeout(e,3e3)),await (0,r.Is)(s,"2",!0),await new Promise(e=>setTimeout(e,200)),await c(`tmux send-keys -t "${s}" Down`),await new Promise(e=>setTimeout(e,200)),await c(`tmux send-keys -t "${s}" Enter`),await new Promise(e=>setTimeout(e,200)),console.log(`✓ Started Codex session: ${s}`)}catch(t){let e=t instanceof Error?t.message:String(t);throw Error(`Failed to start Codex session: ${e}`)}}async sendMessage(e,t){let s=this.getSessionName(e);if(!await (0,r.Hk)(s))throw Error(`Codex session ${s} does not exist. Start the session first.`);try{await (0,r.Is)(s,t,!1),await new Promise(e=>setTimeout(e,100)),await c(`tmux send-keys -t "${s}" C-m`),await new Promise(e=>setTimeout(e,200)),console.log(`✓ Sent message to Codex session: ${s}`)}catch(t){let e=t instanceof Error?t.message:String(t);throw Error(`Failed to send message to Codex: ${e}`)}}async killSession(e){let t=this.getSessionName(e);try{await (0,r.Hk)(t)&&(await c(`tmux send-keys -t "${t}" C-d`),await new Promise(e=>setTimeout(e,500))),await (0,r.AJ)(t)&&console.log(`✓ Stopped Codex session: ${t}`)}catch(t){let e=t instanceof Error?t.message:String(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 d=(0,i.promisify)(n.exec);class g extends l{async isRunning(e){let t=this.getSessionName(e);return await (0,r.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,r.Hk)(s)){console.log(`Gemini session ${s} already exists`);return}try{await (0,r.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,r.Hk)(s))throw Error(`Gemini session ${s} does not exist. Start the session first.`);try{let e=t.replace(/'/g,"'\\''");await (0,r.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,r.Hk)(t)&&(await d(`tmux send-keys -t "${t}" C-d`),await new Promise(e=>setTimeout(e,500))),await (0,r.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 f=s(59991),h=s(43632);class w{constructor(){this.tools=new Map,this.tools.set("claude",new u),this.tools.set("codex",new p),this.tools.set("gemini",new g)}static getInstance(){return w.instance||(w.instance=new w),w.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,f.FN)(e,t),"claude"===t&&(0,h.FN)(e)}}},63661:(e,t,s)=>{s.d(t,{F:()=>i,J:()=>l});let n=(0,s(43895).h)("prompt-detector");function i(e){n.debug("detectPrompt:start",{outputLength:e.length});let t=e.split("\n").slice(-10).join("\n"),s=function(e){let t=e.split("\n"),s=Math.max(0,t.length-50),n=!1;for(let e=s;e<t.length;e++){let s=t[e].trim();if(r.test(s)){n=!0;break}}if(!n)return{isPrompt:!1,cleanContent:e.trim()};let i=[],l=-1;for(let e=t.length-1;e>=s;e--){let s=t[e].trim(),n=s.match(r);if(n){let e=parseInt(n[1],10),t=n[2].trim();i.unshift({number:e,label:t,isDefault:!0});continue}let o=s.match(a);if(o){let e=parseInt(o[1],10),t=o[2].trim();i.unshift({number:e,label:t,isDefault:!1});continue}if(i.length>0&&s&&!s.match(/^[-─]+$/)){if(function(e,t){let s=e.match(/^\s{2,}[^\d]/)&&!e.match(/^\s*\d+\./),n=t.length<5&&!t.endsWith("?"),i=/^[\/~]/.test(t)||t.length>=2&&/^[a-zA-Z0-9_-]+$/.test(t);return!!s||n||i}(t[e],s))continue;l=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}(i.map(e=>e.number)))return{isPrompt:!1,cleanContent:e.trim()};let m=i.some(e=>e.isDefault);if(i.length<2||!m)return{isPrompt:!1,cleanContent:e.trim()};let u="";if(l>=0){let e=[];for(let s=Math.max(0,l-5);s<=l;s++){let n=t[s].trim();n&&!n.match(/^[-─]+$/)&&e.push(n)}u=e.join(" ")}else u="Please select an option:";return{isPrompt:!0,promptData:{type:"multiple_choice",question:u.trim(),options:i.map(e=>{let t=o.some(t=>t.test(e.label));return{number:e.number,label:e.label,isDefault:e.isDefault,requiresTextInput:t}}),status:"pending"},cleanContent:u.trim()}}(e);if(s.isPrompt)return n.info("detectPrompt:multipleChoice",{isPrompt:!0,question:s.promptData?.question,optionsCount:s.promptData?.options?.length}),s;let i=t.match(/^(.+)\s+\(y\/n\)\s*$/m);if(i)return{isPrompt:!0,promptData:{type:"yes_no",question:i[1].trim(),options:["yes","no"],status:"pending"},cleanContent:i[1].trim()};let l=t.match(/^(.+)\s+\[y\/N\]\s*$/m);if(l)return{isPrompt:!0,promptData:{type:"yes_no",question:l[1].trim(),options:["yes","no"],status:"pending",defaultOption:"no"},cleanContent:l[1].trim()};let m=t.match(/^(.+)\s+\[Y\/n\]\s*$/m);if(m)return{isPrompt:!0,promptData:{type:"yes_no",question:m[1].trim(),options:["yes","no"],status:"pending",defaultOption:"yes"},cleanContent:m[1].trim()};let u=t.match(/^(.+)\s+\(yes\/no\)\s*$/m);if(u)return{isPrompt:!0,promptData:{type:"yes_no",question:u[1].trim(),options:["yes","no"],status:"pending"},cleanContent:u[1].trim()};let c=t.match(/^(.*?)Approve\?\s*$/m);if(c){let e=c[1].trim();return{isPrompt:!0,promptData:{type:"yes_no",question:e?`${e} Approve?`:"Approve?",options:["yes","no"],status:"pending"},cleanContent:e||"Approve?"}}return n.debug("detectPrompt:complete",{isPrompt:!1}),{isPrompt:!1,cleanContent:e.trim()}}let o=[/type\s+here/i,/tell\s+(me|claude)/i,/enter\s+/i,/custom/i,/differently/i],r=/^\s*\u276F\s*(\d+)\.\s*(.+)$/,a=/^\s*(\d+)\.\s*(.+)$/;function l(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: ${e}. Expected a number.`)}if("yes"===s||"y"===s)return"y";if("no"===s||"n"===s)return"n";throw Error(`Invalid answer: ${e}. Expected 'yes', 'no', 'y', or 'n'.`)}},59991:(e,t,s)=>{s.d(t,{FN:()=>w,RJ:()=>g,ci:()=>d,cn:()=>h});var n=s(89194),i=s(97425),o=s(75748),r=s(25079),a=s(63661),l=s(76966),m=s(89287),u=s(19377);let c=new Map,p=new Map;function d(e){let t=(0,u.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),o=[/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*$/],r=[];for(let e of i)!o.some(t=>t.test(e))&&e.trim()&&r.push(e);return r.join("\n").trim()}function g(e){let t=e.split("\n"),s=[],n=[/^maenokota@.*%/,/^zsh:/,/^feature-issue-\d+/,/^\s*$/],i=!1,o=[];for(let e of t){if(e.includes("✦")){i=!0;let t=e.indexOf("✦"),s=e.substring(t+1).trim();s&&o.push(s);continue}if(i){if(n.some(t=>t.test(e)))continue;o.push(e)}}if(o.length>0)return o.join("\n").trim();for(let e of t)n.some(t=>t.test(e))||s.push(e);return s.join("\n").trim()}async function f(e,t){let s=(0,i.n)();try{if(!(0,o.gU)(s,e))return console.error(`Worktree ${e} not found, stopping poller`),w(e,t),!1;if(!await (0,n.Lg)(e,t))return w(e,t),!1;let i=(0,o.zl)(s,e,t),c=i?.lastCapturedLine||0,p=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 o=n.slice(0,i),r=o.length,l=r>0&&t>25&&r+25<t||r>0&&t>50&&r<50;if(!l&&r<t-5)return null;let m=o.slice(Math.max(0,r-20)).join("\n"),{promptPattern:c,separatorPattern:p,thinkingPattern:d,skipPatterns:g}=(0,u.bs)(s),f=(e=60)=>{let t="codex"===s?/^›\s+(?!Implement|Find and fix|Type|Summarize)/:/^[>❯]\s+\S/;for(let s=r-1;s>=Math.max(0,r-e);s--){let e=(0,u.vp)(o[s]);if(t.test(e))return s}return -1};if("claude"===s){let e=o.join("\n"),t=(0,u.vp)(e);if((0,a.F)(t).isPrompt)return{response:t,isComplete:!0,lineCount:r}}let h=(0,u.vp)(m),w=c.test(h),y=p.test(h),$=d.test(h),C=("codex"===s||"gemini"===s)&&w&&!$,x="claude"===s&&w&&y&&!$;if(C||x){let e;let n=[];if(t>=r||l){let t=f(40);e=t>=0?t+1:0}else if("codex"===s)e=Math.max(0,t);else if(t>=r-5){let t=f(50);e=t>=0?t+1:Math.max(0,r-40)}else e=Math.max(0,t);let i=r;for(let t=e;t<r;t++){let e=o[t],r=(0,u.vp)(e);if("codex"===s&&/^›\s+/.test(r)||"gemini"===s&&/^(%|\$|.*@.*[%$#])\s*$/.test(r)){i=t;break}g.some(e=>e.test(r))||n.push(e)}let a=n.join("\n").trim();if(d.test(a))return{response:"",isComplete:!1,lineCount:r};if("claude"===s){let e=(0,u.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,o=e.match(/^[>❯]\s+(\S.*)$/m);if(o){let t=e.indexOf(o[0]);if(0===e.substring(t+o[0].length).trim().split("\n").filter(e=>{let t=e.trim();return t&&!g.some(e=>e.test(t))&&!/^─+$/.test(t)}).length)return{response:"",isComplete:!1,lineCount:r}}else if((t||s||n||i)&&a.length<2e3)return{response:"",isComplete:!1,lineCount:r}}return"gemini"===s&&((a.match(/[░███]/g)||[]).length>.3*a.length||a.includes("Waiting for auth")||a.includes("⠋")||a.includes("⠙")||a.includes("⠹")||a.includes("⠸")||a.includes("⠼")||a.includes("⠴")||a.includes("⠦")||a.includes("⠧")||a.includes("⠇")||a.includes("⠏")||!a.includes("✦")&&a.length<10)?{response:"",isComplete:!1,lineCount:r}:{response:a,isComplete:!0,lineCount:i}}let S=o.join("\n");if((0,a.F)(S).isPrompt)return{response:S,isComplete:!0,lineCount:r};let I=[],P=l||t>=r-5,k=P?f(80):-1,v=P?k>=0?k+1:Math.max(0,r-80):Math.max(0,t);for(let e=v;e<r;e++){let t=o[e],s=(0,u.vp)(t);g.some(e=>e.test(s))||I.push(t)}let E=I.join("\n").trim();return E?{response:E,isComplete:!1,lineCount:r}:{response:"",isComplete:!1,lineCount:r}}(p,c,t);if(!f||!f.isComplete){let{thinkingPattern:n}=(0,u.bs)(t),i=(0,u.vp)(p);if(n.test(i)){let n=(0,o.GP)(s,e,t);n>0&&console.log(`Marked ${n} pending prompt(s) as answered (thinking detected) for ${e}`)}return!1}if(f.lineCount===c&&!i?.inProgressMessageId)return!1;if(f.lineCount<=c)return console.log(`[checkForResponse] Already saved up to line ${c}, skipping (result: ${f.lineCount})`),!1;let h=(0,a.F)(f.response);if(h.isPrompt){(0,o.Mf)(s,e,t);let n=(0,o.tn)(s,{worktreeId:e,role:"assistant",content:h.cleanContent,messageType:"prompt",promptData:h.promptData,timestamp:new Date,cliToolId:t});return(0,o.IH)(s,e,t,f.lineCount),(0,r.ps)("message",{worktreeId:e,message:n}),w(e,t),!0}if(!f.response||""===f.response.trim())return(0,o.IH)(s,e,t,f.lineCount),!1;let y="claude"===t?(0,m.Z)(f.response):void 0,$=f.response;if("gemini"===t?$=g(f.response):"claude"===t&&($=d(f.response)),!$||""===$.trim()||"[No content]"===$)return(0,o.IH)(s,e,t,f.lineCount),(0,o.Mf)(s,e,t),!1;$&&await (0,l.o)(s,e,$,t);let C=(0,o.GP)(s,e,t);C>0&&console.log(`Marked ${C} pending prompt(s) as answered for ${e}`);let x=(0,o.zl)(s,e,t);if(x&&f.lineCount<=x.lastCapturedLine)return console.log(`[checkForResponse] Race condition detected, skipping save (result: ${f.lineCount}, current: ${x.lastCapturedLine})`),!1;let S=(0,o.tn)(s,{worktreeId:e,role:"assistant",content:$,messageType:"normal",timestamp:new Date,cliToolId:t,summary:y?.summary,logFileName:y?.logFileName,requestId:y?.requestId});return(0,r.ps)("message",{worktreeId:e,message:S}),(0,o.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 h(e,t){let s=`${e}:${t}`;w(e,t),p.set(s,Date.now());let n=setInterval(async()=>{let n=p.get(s);if(n&&Date.now()-n>3e5){w(e,t);return}try{await f(e,t)}catch(e){console.error("[Poller] Error:",e)}},2e3);c.set(s,n)}function w(e,t){let s=`${e}:${t}`,n=c.get(s);n&&(clearInterval(n),c.delete(s),p.delete(s))}}};
1
+ "use strict";exports.id=7536,exports.ids=[7536],exports.modules={43632:(e,t,s)=>{s.d(t,{FN:()=>o}),s(62648),s(97425),s(75748),s(25079),s(63661),s(76966);let n=new Map,i=new Map;function o(e){let t=n.get(e);t&&(clearInterval(t),n.delete(e),i.delete(e),console.log(`Stopped poller for ${e}`))}},89194:(e,t,s)=>{s.d(t,{Lg:()=>r,NA:()=>a});var n=s(10927),i=s(43839);let o=(0,s(43895).h)("cli-session");async function r(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 r=o.withContext({worktreeId:e,cliToolId:t});r.debug("captureSessionOutput:start",{requestedLines:s});let a=i.g.getInstance().getTool(t),l=a.getSessionName(e);if(!await (0,n.Hk)(l))throw r.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 r.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 r.error("captureSessionOutput:failed",{error:e}),Error(`Failed to capture ${a.name} output: ${e}`)}}},43839:(e,t,s)=>{s.d(t,{g:()=>$});var n=s(61282),i=s(21764);let o=/^[a-zA-Z0-9_-]+$/;var r=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(!o.test(e))throw Error(`Invalid session name format: ${e}`)}(t),t}async interrupt(e){let t=this.getSessionName(e);await (0,r.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,r.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,r.Hk)(s)){console.log(`Codex session ${s} already exists`);return}try{await (0,r.ed)({sessionName:s,workingDirectory:t,historyLimit:5e4}),await new Promise(e=>setTimeout(e,100)),await (0,r.Is)(s,"codex",!0),await new Promise(e=>setTimeout(e,3e3)),await (0,r.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,r.Hk)(s))throw Error(`Codex session ${s} does not exist. Start the session first.`);try{await (0,r.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,r.Hk)(t)&&(await p(`tmux send-keys -t "${t}" C-d`),await new Promise(e=>setTimeout(e,500))),await (0,r.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,r.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,r.Hk)(s)){console.log(`Gemini session ${s} already exists`);return}try{await (0,r.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,r.Hk)(s))throw Error(`Gemini session ${s} does not exist. Start the session first.`);try{let e=t.replace(/'/g,"'\\''");await (0,r.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,r.Hk)(t)&&(await g(`tmux send-keys -t "${t}" C-d`),await new Promise(e=>setTimeout(e,500))),await (0,r.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),y=s(43632);class ${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 $.instance||($.instance=new $),$.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),"claude"===t&&(0,y.FN)(e)}}},63661:(e,t,s)=>{s.d(t,{F:()=>o,J:()=>p});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 o(e,t){n.debug("detectPrompt:start",{outputLength:e.length});let s=e.split("\n").slice(-10).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 o=Math.max(0,i-50);if(s){let t=!1;for(let e=o;e<i;e++){let s=n[e].trim();if(a.test(s)){t=!0;break}}if(!t)return c(e)}let p=[],d=-1;for(let e=i-1;e>=o;e--){let t=n[e].trim(),s=t.match(a);if(s){let e=parseInt(s[1],10),t=s[2].trim();p.unshift({number:e,label:t,isDefault:!0});continue}let i=t.match(l);if(i){let e=parseInt(i[1],10),t=i[2].trim();p.unshift({number:e,label:t,isDefault:!1});continue}if(p.length>0&&t&&!u.test(t)){if(function(e,t){let s=t.endsWith("?")||t.endsWith("?"),n=e.match(/^\s{2,}[^\d]/)&&!e.match(/^\s*\d+\./)&&!s,i=t.length<5&&!s,o=/^[\/~]/.test(t)||t.length>=2&&/^[a-zA-Z0-9_-]+$/.test(t);return!!n||i||o}(n[e],t))continue;d=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}(p.map(e=>e.number)))return c(e);let f=p.some(e=>e.isDefault);if(p.length<2||s&&!f)return c(e);if(!s){var g;if(-1===d||!(0!==(g=n[d]?.trim()??"").length&&(g.endsWith("?")||g.endsWith("?")||g.endsWith(":")&&m.test(g))))return c(e)}let h="";if(d>=0){let e=[];for(let t=Math.max(0,d-5);t<=d;t++){let s=n[t].trim();s&&!u.test(s)&&e.push(s)}h=e.join(" ")}else h="Please select an option:";return{isPrompt:!0,promptData:{type:"multiple_choice",question:h.trim(),options:p.map(e=>{let t=r.some(t=>t.test(e.label));return{number:e.number,label:e.label,isDefault:e.isDefault,requiresTextInput:t}}),status:"pending"},cleanContent:h.trim()}}(e,t);if(o.isPrompt)return n.info("detectPrompt:multipleChoice",{isPrompt:!0,question:o.promptData?.question,optionsCount:o.promptData?.options?.length}),o;for(let e of i){let t=s.match(e.regex);if(t){let s=t[1].trim();return{isPrompt:!0,promptData:{type:"yes_no",question:s,options:["yes","no"],status:"pending",...void 0!==e.defaultOption&&{defaultOption:e.defaultOption}},cleanContent:s}}}let p=s.match(/^(.*?)Approve\?\s*$/m);if(p){let e=p[1].trim();return{isPrompt:!0,promptData:{type:"yes_no",question:e?`${e} Approve?`:"Approve?",options:["yes","no"],status:"pending"},cleanContent:e||"Approve?"}}return n.debug("detectPrompt:complete",{isPrompt:!1}),{isPrompt:!1,cleanContent:e.trim()}}let r=[/type\s+here/i,/tell\s+(me|claude)/i,/enter\s+/i,/custom/i,/differently/i],a=/^\s*\u276F\s*(\d+)\.\s*(.+)$/,l=/^\s*(\d+)\.\s*(.+)$/,u=/^[-─]+$/;function c(e){return{isPrompt:!1,cleanContent:e.trim()}}let m=/(?:select|choose|pick|which|what|how|where|enter|type|specify|confirm|approve|accept|reject|decide|preference|option)/i;function p(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:()=>y,RJ:()=>g,ci:()=>f,cn:()=>w});var n=s(89194),i=s(97425),o=s(75748),r=s(25079),a=s(63661),l=s(76966),u=s(89287),c=s(19377);let m=new Map,p=new Map;function d(e,t){let s=(0,c.Sg)(t);return(0,a.F)((0,c.vp)(e),s)}function f(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),o=[/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],r=[];for(let e of i)!o.some(t=>t.test(e))&&e.trim()&&r.push(e);return r.join("\n").trim()}function g(e){let t=e.split("\n"),s=[],n=[/^maenokota@.*%/,/^zsh:/,/^feature-issue-\d+/,/^\s*$/],i=!1,o=[];for(let e of t){if(e.includes("✦")){i=!0;let t=e.indexOf("✦"),s=e.substring(t+1).trim();s&&o.push(s);continue}if(i){if(n.some(t=>t.test(e)))continue;o.push(e)}}if(o.length>0)return o.join("\n").trim();for(let e of t)n.some(t=>t.test(e))||s.push(e);return s.join("\n").trim()}async function h(e,t){let s=(0,i.n)();try{if(!(0,o.gU)(s,e))return console.error(`Worktree ${e} not found, stopping poller`),y(e,t),!1;if(!await (0,n.Lg)(e,t))return y(e,t),!1;let i=(0,o.zl)(s,e,t),a=i?.lastCapturedLine||0,m=await (0,n.NA)(e,t,1e4),p=function(e,t,s){let n=e.split("\n"),i=n.length;for(;i>0&&""===n[i-1].trim();)i--;let o=n.slice(0,i),r=o.length,a=r>0&&t>25&&r+25<t||r>0&&t>50&&r<50;if(!a&&r<t-5)return null;let l=o.slice(Math.max(0,r-20)).join("\n"),{promptPattern:u,separatorPattern:m,thinkingPattern:p,skipPatterns:f}=(0,c.bs)(s),g=(e=60)=>{let t="codex"===s?/^›\s+(?!Implement|Find and fix|Type|Summarize)/:/^[>❯]\s+\S/;for(let s=r-1;s>=Math.max(0,r-e);s--){let e=(0,c.vp)(o[s]);if(t.test(e))return s}return -1};if("claude"===s){let e=o.join("\n");if(d(e,s).isPrompt)return{response:(0,c.vp)(e),isComplete:!0,lineCount:r}}let h=(0,c.vp)(l),w=u.test(h),y=m.test(h),$=p.test(h),C=("codex"===s||"gemini"===s)&&w&&!$,x="claude"===s&&w&&y&&!$;if(C||x){let e;let n=[];if(t>=r||a){let t=g(40);e=t>=0?t+1:0}else if("codex"===s)e=Math.max(0,t);else if(t>=r-5){let t=g(50);e=t>=0?t+1:Math.max(0,r-40)}else e=Math.max(0,t);let i=r;for(let t=e;t<r;t++){let e=o[t],r=(0,c.vp)(e);if("codex"===s&&/^›\s+/.test(r)||"gemini"===s&&/^(%|\$|.*@.*[%$#])\s*$/.test(r)){i=t;break}f.some(e=>e.test(r))||n.push(e)}let l=n.join("\n").trim(),u=l.split("\n").slice(-5).join("\n");if(p.test(u))return{response:"",isComplete:!1,lineCount:r};if("claude"===s){let e=(0,c.vp)(l),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,o=e.match(/^[>❯]\s+(\S.*)$/m);if(o){let t=e.indexOf(o[0]);if(0===e.substring(t+o[0].length).trim().split("\n").filter(e=>{let t=e.trim();return t&&!f.some(e=>e.test(t))&&!/^─+$/.test(t)}).length)return{response:"",isComplete:!1,lineCount:r}}else if((t||s||n||i)&&l.length<2e3)return{response:"",isComplete:!1,lineCount:r}}return"gemini"===s&&((l.match(/[░███]/g)||[]).length>.3*l.length||["Waiting for auth","⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"].some(e=>l.includes(e))||!l.includes("✦")&&l.length<10)?{response:"",isComplete:!1,lineCount:r}:{response:l,isComplete:!0,lineCount:i}}let S=o.join("\n");if(d(S,s).isPrompt)return{response:S,isComplete:!0,lineCount:r};let I=[],v=a||t>=r-5,k=v?g(80):-1,P=v?k>=0?k+1:Math.max(0,r-80):Math.max(0,t);for(let e=P;e<r;e++){let t=o[e],s=(0,c.vp)(t);f.some(e=>e.test(s))||I.push(t)}let E=I.join("\n").trim();return E?{response:E,isComplete:!1,lineCount:r}:{response:"",isComplete:!1,lineCount:r}}(m,a,t);if(!p||!p.isComplete){let{thinkingPattern:n}=(0,c.bs)(t),i=(0,c.vp)(m).split("\n").slice(-5).join("\n");if(n.test(i)){let n=(0,o.GP)(s,e,t);n>0&&console.log(`Marked ${n} pending prompt(s) as answered (thinking detected) for ${e}`)}return!1}if(p.lineCount===a&&!i?.inProgressMessageId)return!1;if(p.lineCount<=a)return console.log(`[checkForResponse] Already saved up to line ${a}, skipping (result: ${p.lineCount})`),!1;let h=d(p.response,t);if(h.isPrompt){(0,o.Mf)(s,e,t);let n=(0,o.tn)(s,{worktreeId:e,role:"assistant",content:h.cleanContent,messageType:"prompt",promptData:h.promptData,timestamp:new Date,cliToolId:t});return(0,o.IH)(s,e,t,p.lineCount),(0,r.ps)("message",{worktreeId:e,message:n}),y(e,t),!0}if(!p.response||""===p.response.trim())return(0,o.IH)(s,e,t,p.lineCount),!1;let w="claude"===t?(0,u.Z)(p.response):void 0,$=p.response;if("gemini"===t?$=g(p.response):"claude"===t&&($=f(p.response)),!$||""===$.trim()||"[No content]"===$)return(0,o.IH)(s,e,t,p.lineCount),(0,o.Mf)(s,e,t),!1;$&&await (0,l.o)(s,e,$,t);let C=(0,o.GP)(s,e,t);C>0&&console.log(`Marked ${C} pending prompt(s) as answered for ${e}`);let x=(0,o.zl)(s,e,t);if(x&&p.lineCount<=x.lastCapturedLine)return console.log(`[checkForResponse] Race condition detected, skipping save (result: ${p.lineCount}, current: ${x.lastCapturedLine})`),!1;let S=(0,o.tn)(s,{worktreeId:e,role:"assistant",content:$,messageType:"normal",timestamp:new Date,cliToolId:t,summary:w?.summary,logFileName:w?.logFileName,requestId:w?.requestId});return(0,r.ps)("message",{worktreeId:e,message:S}),(0,o.IH)(s,e,t,p.lineCount),!0}catch(t){return console.error(`Error checking for response (${e}):`,t instanceof Error?t.message:String(t)),!1}}function w(e,t){let s=`${e}:${t}`;y(e,t),p.set(s,Date.now());let n=setInterval(async()=>{let n=p.get(s);if(n&&Date.now()-n>3e5){y(e,t);return}try{await h(e,t)}catch(e){console.error("[Poller] Error:",e)}},2e3);m.set(s,n)}function y(e,t){let s=`${e}:${t}`,n=m.get(s);n&&(clearInterval(n),m.delete(s),p.delete(s))}}};
@@ -3,21 +3,21 @@
3
3
  hover:bg-gray-800 transition-colors
4
4
  focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500
5
5
  ${t?"bg-gray-700 border-l-2 border-blue-500":"border-l-2 border-transparent"}
6
- `,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})})]})}),m=[{key:"updatedAt",label:"Updated"},{key:"repositoryName",label:"Repository"},{key:"branchName",label:"Branch"},{key:"status",label:"Status"}],x=(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]),x=(0,r.useCallback)(()=>{n("asc"===t?"desc":"asc")},[t,n]),g=m.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 ${g}`,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(p,{className:"w-3 h-3"}),s.jsx("span",{className:"hidden sm:inline",children:g})]}),s.jsx("button",{type:"button",onClick:x,"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(h,{className:"w-3 h-3"}):s.jsx(b,{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:m.map(a=>(0,s.jsxs)("button",{type:"button",role:"option","aria-selected":e===a.key,onClick:()=>u(a.key),className:`
6
+ `,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})})]})}),m=[{key:"updatedAt",label:"Updated"},{key:"repositoryName",label:"Repository"},{key:"branchName",label:"Branch"},{key:"status",label:"Status"}],x=(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]),x=(0,r.useCallback)(()=>{n("asc"===t?"desc":"asc")},[t,n]),f=m.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 ${f}`,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(p,{className:"w-3 h-3"}),s.jsx("span",{className:"hidden sm:inline",children:f})]}),s.jsx("button",{type:"button",onClick:x,"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(h,{className:"w-3 h-3"}):s.jsx(b,{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:m.map(a=>(0,s.jsxs)("button",{type:"button",role:"option","aria-selected":e===a.key,onClick:()=>u(a.key),className:`
7
7
  w-full px-3 py-2 text-left text-sm
8
8
  flex items-center justify-between
9
9
  hover:bg-gray-700 transition-colors
10
10
  ${e===a.key?"text-blue-400":"text-gray-300"}
11
- `,children:[s.jsx("span",{children:a.label}),e===a.key&&s.jsx("span",{className:"text-xs",children:"asc"===t?"ASC":"DESC"})]},a.key))})]})});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:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12"})})}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:"M5 15l7-7 7 7"})})}function b({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 g=a(18421);let f={waiting:0,ready:1,running:2,generating:3,idle:4},y=(0,r.memo)(function(){let e=(0,i.useRouter)(),{worktrees:t,selectedWorktreeId:a,selectWorktree:n}=(0,o.Mu)(),{closeMobileDrawer:c,sortKey:d,sortDirection:m}=(0,l.Sz)(),[p,h]=(0,r.useState)(""),b=(0,r.useMemo)(()=>{let e=t.map(g.I_),a=e;if(p.trim()){let t=p.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=f[e.status]-f[s.status]}return("updatedAt"===t?"desc"===a:"asc"===a)?r:-r}),s}(a,d,m)},[t,p,d,m]),y=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(x,{})]})}),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:p,onChange:e=>h(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===b.length?s.jsx("div",{className:"px-4 py-8 text-center text-gray-400",children:p?"No branches found":"No branches available"}):b.map(e=>s.jsx(u,{branch:e,isSelected:e.id===a,onClick:()=>y(e.id)},e.id))})]})});var w=a(22202);let v="transform transition-transform duration-300 ease-out",j=(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:`
11
+ `,children:[s.jsx("span",{children:a.label}),e===a.key&&s.jsx("span",{className:"text-xs",children:"asc"===t?"ASC":"DESC"})]},a.key))})]})});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:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12"})})}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:"M5 15l7-7 7 7"})})}function b({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 f=a(18421);let g={waiting:0,ready:1,running:2,generating:3,idle:4},y=(0,r.memo)(function(){let e=(0,i.useRouter)(),{worktrees:t,selectedWorktreeId:a,selectWorktree:n}=(0,o.Mu)(),{closeMobileDrawer:c,sortKey:d,sortDirection:m}=(0,l.Sz)(),[p,h]=(0,r.useState)(""),b=(0,r.useMemo)(()=>{let e=t.map(f.I_),a=e;if(p.trim()){let t=p.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=g[e.status]-g[s.status]}return("updatedAt"===t?"desc"===a:"asc"===a)?r:-r}),s}(a,d,m)},[t,p,d,m]),y=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(x,{})]})}),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:p,onChange:e=>h(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===b.length?s.jsx("div",{className:"px-4 py-8 text-center text-gray-400",children:p?"No branches found":"No branches available"}):b.map(e=>s.jsx(u,{branch:e,isSelected:e.id===a,onClick:()=>y(e.id)},e.id))})]})});var v=a(22202);let w="transform transition-transform duration-300 ease-out",j=(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:`
12
12
  fixed left-0 top-0 h-full w-72 z-50
13
- ${v}
13
+ ${w}
14
14
  ${a?"translate-x-0":"-translate-x-full"}
15
15
  `,role:"complementary",children:s.jsx(y,{})}),s.jsx("main",{className:"flex-1 min-h-0 overflow-hidden",role:"main",children:e})]}):(0,s.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex",children:[s.jsx("aside",{"data-testid":"sidebar-container",className:`
16
16
  fixed left-0 top-0 h-full w-72
17
- ${v}
17
+ ${w}
18
18
  ${t?"translate-x-0":"-translate-x-full"}
19
- `,style:{zIndex:w.k.SIDEBAR},role:"complementary","aria-hidden":!t,children:s.jsx(y,{})}),s.jsx("main",{className:`
19
+ `,style:{zIndex:v.k.SIDEBAR},role:"complementary","aria-hidden":!t,children:s.jsx(y,{})}),s.jsx("main",{className:`
20
20
  flex-1 min-w-0 h-full overflow-hidden
21
21
  transition-[padding] duration-300 ease-out
22
22
  ${t?"md:pl-72":"md:pl-0"}
23
- `,role:"main",children:e})]})})},28676:(e,t,a)=>{a.d(t,{u:()=>l});var s=a(10326),r=a(17577);function l({isOpen:e,onClose:t,title:a,children:l,size:n="lg",showCloseButton:i=!0,disableClose:o=!1}){let c=(0,r.useRef)(null);return e?(0,s.jsxs)("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:o?void 0:t}),s.jsx("div",{className:"flex min-h-full items-center justify-center p-2 sm:p-4",children:(0,s.jsxs)("div",{ref:c,className:`relative w-full ${{sm:"max-w-[calc(100vw-2rem)] sm:max-w-md",md:"max-w-[calc(100vw-2rem)] sm:max-w-2xl",lg:"max-w-[calc(100vw-2rem)] sm:max-w-4xl",xl:"max-w-[calc(100vw-2rem)] sm:max-w-6xl",full:"max-w-[calc(100vw-2rem)] sm:max-w-[95vw]"}[n]} 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",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",children:l})]})})]}):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)},15470:(e,t,a)=>{a.d(t,{R:()=>m});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,m]=(0,r.useState)(""),[x,p]=(0,r.useState)(0),h=(0,r.useRef)(null),b=(0,r.useMemo)(()=>n(t,u),[t,u]),g=(0,r.useMemo)(()=>b.flatMap(e=>e.commands),[b]),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(),p(e=>Math.min(e+1,g.length-1));break;case"ArrowUp":t.preventDefault(),p(e=>Math.max(e-1,0));break;case"Enter":t.preventDefault(),g[x]&&f(g[x])}},[e,g,x,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:h,type:"text",value:u,onChange:e=>m(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(i,{groups:b,onSelect:f,highlightedIndex:x,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:h,type:"text",value:u,onChange:e=>m(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(i,{groups:b,onSelect:f,highlightedIndex:x,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 m({worktreeId:e,onMessageSent:t,cliToolId:a,isSessionRunning:i=!1}){let[d,m]=(0,r.useState)(""),[x,p]=(0,r.useState)(!1),[h,b]=(0,r.useState)(null),[g,f]=(0,r.useState)(!1),[y,w]=(0,r.useState)(!1),v=(0,r.useRef)(null),j=(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)([]),[i,o]=(0,r.useState)(!0),[c,d]=(0,r.useState)(null),[u,m]=(0,r.useState)(""),[x,p]=(0,r.useState)(t||"claude"),h=(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),p(l.cliTool||t||"claude")}catch(e){d((0,l.zG)(e)),s([])}finally{o(!1)}},[e,t]),b=(0,r.useMemo)(()=>a.flatMap(e=>e.commands),[a]),g=(0,r.useMemo)(()=>n(a,u),[a,u]);return{groups:a,filteredGroups:g,allCommands:b,loading:i,error:c,filter:u,setFilter:m,refresh:(0,r.useCallback)(()=>{h()},[h]),cliTool:x}}(e,a),L=async()=>{if(!g&&d.trim()&&!x)try{p(!0),b(null);let s=a||"claude";await l.Iv.sendMessage(e,d.trim(),s),m(""),t?.(s)}catch(e){b((0,l.zG)(e))}finally{p(!1)}},M=async e=>{e.preventDefault(),await L()},E=()=>{w(!1),v.current?.focus()};return(0,s.jsxs)("div",{ref:k,className:"space-y-2 relative",children:[h&&s.jsx("div",{className:"p-2 bg-red-50 border border-red-200 rounded text-sm text-red-800",children:h}),(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:[C&&s.jsx("button",{type:"button",onClick:()=>w(!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:v,value:d,onChange:e=>{let t=e.target.value;m(t),"/"===t||t.startsWith("/")&&!t.includes(" ")?w(!0):w(!1)},onKeyDown:e=>{let{keyCode:t}=e.nativeEvent;if(229!==t){if("Escape"===e.key&&y){e.preventDefault(),E();return}if(N.current&&"Enter"===e.key){N.current=!1;return}if("Enter"===e.key&&!g&&!y){if(C)return;e.shiftKey||(e.preventDefault(),L())}}},onCompositionStart:()=>{f(!0),N.current=!1,j.current&&clearTimeout(j.current)},onCompositionEnd:()=>{f(!1),N.current=!0,j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{N.current=!1},300)},placeholder:C?"Type your message...":"Type your message... (/ for commands, Shift+Enter for line break)",disabled:x,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()||x,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:x?(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:S,onSelect:e=>{m(`/${e.name} `),w(!1),v.current?.focus()},onClose:E,isMobile:C,onFreeInput:()=>{w(!1),m("/"),setTimeout(()=>{v.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}},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"}]}};
23
+ `,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)},15470:(e,t,a)=>{a.d(t,{R:()=>m});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,m]=(0,r.useState)(""),[x,p]=(0,r.useState)(0),h=(0,r.useRef)(null),b=(0,r.useMemo)(()=>n(t,u),[t,u]),f=(0,r.useMemo)(()=>b.flatMap(e=>e.commands),[b]),g=(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(),p(e=>Math.min(e+1,f.length-1));break;case"ArrowUp":t.preventDefault(),p(e=>Math.max(e-1,0));break;case"Enter":t.preventDefault(),f[x]&&g(f[x])}},[e,f,x,l,g]),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:h,type:"text",value:u,onChange:e=>m(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(i,{groups:b,onSelect:g,highlightedIndex:x,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:h,type:"text",value:u,onChange:e=>m(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(i,{groups:b,onSelect:g,highlightedIndex:x,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 m({worktreeId:e,onMessageSent:t,cliToolId:a,isSessionRunning:i=!1}){let[d,m]=(0,r.useState)(""),[x,p]=(0,r.useState)(!1),[h,b]=(0,r.useState)(null),[f,g]=(0,r.useState)(!1),[y,v]=(0,r.useState)(!1),w=(0,r.useRef)(null),j=(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)([]),[i,o]=(0,r.useState)(!0),[c,d]=(0,r.useState)(null),[u,m]=(0,r.useState)(""),[x,p]=(0,r.useState)(t||"claude"),h=(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),p(l.cliTool||t||"claude")}catch(e){d((0,l.zG)(e)),s([])}finally{o(!1)}},[e,t]),b=(0,r.useMemo)(()=>a.flatMap(e=>e.commands),[a]),f=(0,r.useMemo)(()=>n(a,u),[a,u]);return{groups:a,filteredGroups:f,allCommands:b,loading:i,error:c,filter:u,setFilter:m,refresh:(0,r.useCallback)(()=>{h()},[h]),cliTool:x}}(e,a),L=async()=>{if(!f&&d.trim()&&!x)try{p(!0),b(null);let s=a||"claude";await l.Iv.sendMessage(e,d.trim(),s),m(""),t?.(s)}catch(e){b((0,l.zG)(e))}finally{p(!1)}},M=async e=>{e.preventDefault(),await L()},E=()=>{v(!1),w.current?.focus()};return(0,s.jsxs)("div",{ref:k,className:"space-y-2 relative",children:[h&&s.jsx("div",{className:"p-2 bg-red-50 border border-red-200 rounded text-sm text-red-800",children:h}),(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:[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:w,value:d,onChange:e=>{let t=e.target.value;m(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(),E();return}if(N.current&&"Enter"===e.key){N.current=!1;return}if("Enter"===e.key&&!f&&!y){if(C)return;e.shiftKey||(e.preventDefault(),L())}}},onCompositionStart:()=>{g(!0),N.current=!1,j.current&&clearTimeout(j.current)},onCompositionEnd:()=>{g(!1),N.current=!0,j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{N.current=!1},300)},placeholder:C?"Type your message...":"Type your message... (/ for commands, Shift+Enter for line break)",disabled:x,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()||x,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:x?(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:S,onSelect:e=>{m(`/${e.name} `),v(!1),w.current?.focus()},onClose:E,isMobile:C,onFreeInput:()=>{v(!1),m("/"),setTimeout(()=>{w.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}},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"}]}};