commandmate 0.3.3 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +13 -13
  3. package/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/cache/config.json +3 -3
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/1.pack +0 -0
  9. package/.next/cache/webpack/client-production/2.pack +0 -0
  10. package/.next/cache/webpack/client-production/index.pack +0 -0
  11. package/.next/cache/webpack/client-production/index.pack.old +0 -0
  12. package/.next/cache/webpack/edge-server-production/0.pack +0 -0
  13. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  14. package/.next/cache/webpack/server-production/0.pack +0 -0
  15. package/.next/cache/webpack/server-production/index.pack +0 -0
  16. package/.next/next-server.js.nft.json +1 -1
  17. package/.next/prerender-manifest.json +1 -1
  18. package/.next/react-loadable-manifest.json +13 -7
  19. package/.next/required-server-files.json +1 -1
  20. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/app/update-check/route.js +1 -1
  22. package/.next/server/app/api/repositories/route.js +2 -2
  23. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  24. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  25. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  26. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  27. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  28. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
  29. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js.nft.json +1 -1
  30. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +1 -1
  31. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js.nft.json +1 -1
  32. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  33. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  34. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  35. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  36. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  37. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  38. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  39. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  40. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  41. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  42. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +1 -1
  43. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js.nft.json +1 -1
  44. package/.next/server/app/api/worktrees/[id]/schedules/route.js +1 -1
  45. package/.next/server/app/api/worktrees/[id]/schedules/route.js.nft.json +1 -1
  46. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  47. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  48. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
  49. package/.next/server/app/api/worktrees/[id]/start-polling/route.js +1 -1
  50. package/.next/server/app/api/worktrees/[id]/start-polling/route.js.nft.json +1 -1
  51. package/.next/server/app/api/worktrees/route.js +1 -1
  52. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  53. package/.next/server/app/login/page.js +1 -1
  54. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  55. package/.next/server/app/page_client-reference-manifest.js +1 -1
  56. package/.next/server/app/proxy/[...path]/route.js +1 -1
  57. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  58. package/.next/server/app/worktrees/[id]/page.js +4 -4
  59. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  60. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  61. package/.next/server/app-paths-manifest.json +4 -4
  62. package/.next/server/chunks/2314.js +1 -1
  63. package/.next/server/chunks/3074.js +1 -1
  64. package/.next/server/chunks/4952.js +1 -0
  65. package/.next/server/chunks/539.js +3 -3
  66. package/.next/server/chunks/5795.js +1 -1
  67. package/.next/server/chunks/6228.js +1 -1
  68. package/.next/server/chunks/7425.js +52 -43
  69. package/.next/server/chunks/7566.js +1 -1
  70. package/.next/server/chunks/8693.js +1 -1
  71. package/.next/server/middleware-build-manifest.js +1 -1
  72. package/.next/server/middleware-manifest.json +5 -5
  73. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  74. package/.next/server/pages/500.html +1 -1
  75. package/.next/server/server-reference-manifest.json +1 -1
  76. package/.next/static/chunks/{4327.740cc7fe2d0b5049.js → 4327.157a4c226d919531.js} +14 -14
  77. package/.next/static/chunks/5970.0df906ad5a9c9147.js +1 -0
  78. package/.next/static/chunks/{8091-274bc0716106e7fc.js → 8091-d65d2ab6daed23c6.js} +1 -1
  79. package/.next/static/chunks/app/login/page-010f02fd4b0dbc48.js +1 -0
  80. package/.next/static/chunks/app/worktrees/[id]/page-8fb4dc30b58a5681.js +1 -0
  81. package/.next/static/chunks/webpack-81c97591dd5567ac.js +1 -0
  82. package/.next/static/css/45b3a41370668314.css +3 -0
  83. package/.next/trace +5 -5
  84. package/dist/server/src/lib/claude-executor.js +14 -3
  85. package/dist/server/src/lib/cli-patterns.js +99 -20
  86. package/dist/server/src/lib/cli-tools/manager.js +5 -3
  87. package/dist/server/src/lib/cli-tools/opencode-config.js +236 -0
  88. package/dist/server/src/lib/cli-tools/opencode.js +188 -0
  89. package/dist/server/src/lib/cli-tools/types.js +47 -6
  90. package/dist/server/src/lib/cli-tools/vibe-local.js +12 -3
  91. package/dist/server/src/lib/db-migrations.js +17 -1
  92. package/dist/server/src/lib/db.js +39 -2
  93. package/dist/server/src/lib/prompt-detector.js +23 -4
  94. package/dist/server/src/lib/response-poller.js +392 -28
  95. package/package.json +5 -4
  96. package/.next/server/chunks/9446.js +0 -1
  97. package/.next/static/chunks/app/login/page-2d42204ba87cd136.js +0 -1
  98. package/.next/static/chunks/app/worktrees/[id]/page-78580947c201d698.js +0 -1
  99. package/.next/static/chunks/webpack-3c0ee3ce5b546818.js +0 -1
  100. package/.next/static/css/e85de230ef5ddc40.css +0 -3
  101. /package/.next/static/chunks/app/{page-060057e02b841125.js → page-9e523a8f415bc707.js} +0 -0
  102. /package/.next/static/{O7EDFfAYQNe_HRbORxQAC → p3hosTZoJ22r35fWwUoLr}/_buildManifest.js +0 -0
  103. /package/.next/static/{O7EDFfAYQNe_HRbORxQAC → p3hosTZoJ22r35fWwUoLr}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/worktrees/[id]/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"80":{"*":{"id":"41868","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"79671","name":"*","chunks":[],"async":false}},"12846":{"*":{"id":"12994","name":"*","chunks":[],"async":false}},"18828":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"38991":{"*":{"id":"24146","name":"*","chunks":[],"async":false}},"40991":{"*":{"id":"27247","name":"*","chunks":[],"async":false}},"41845":{"*":{"id":"37398","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"66677":{"*":{"id":"42106","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx":{"id":38991,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","8091","static/chunks/8091-274bc0716106e7fc.js","1931","static/chunks/app/page-060057e02b841125.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/page.tsx":{"id":50653,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":40991,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","1038","static/chunks/1038-3509435b68c0967e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","9178","static/chunks/9178-88850a7c48deea07.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","8091","static/chunks/8091-274bc0716106e7fc.js","130","static/chunks/app/worktrees/%5Bid%5D/page-78580947c201d698.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":41845,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/e85de230ef5ddc40.css"],"/home/runner/work/CommandMate/CommandMate/src/app/page":[],"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page":["static/css/5eacd01f773eed7f.css"]}}
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/worktrees/[id]/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"80":{"*":{"id":"41868","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"79671","name":"*","chunks":[],"async":false}},"12846":{"*":{"id":"12994","name":"*","chunks":[],"async":false}},"18828":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"40991":{"*":{"id":"72964","name":"*","chunks":[],"async":false}},"41845":{"*":{"id":"37398","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"66677":{"*":{"id":"42106","name":"*","chunks":[],"async":false}},"88880":{"*":{"id":"25546","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx":{"id":88880,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","8091","static/chunks/8091-d65d2ab6daed23c6.js","1931","static/chunks/app/page-9e523a8f415bc707.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/page.tsx":{"id":50653,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":40991,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","1038","static/chunks/1038-3509435b68c0967e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","9178","static/chunks/9178-88850a7c48deea07.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","8091","static/chunks/8091-d65d2ab6daed23c6.js","130","static/chunks/app/worktrees/%5Bid%5D/page-8fb4dc30b58a5681.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":41845,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/45b3a41370668314.css"],"/home/runner/work/CommandMate/CommandMate/src/app/page":[],"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page":["static/css/5eacd01f773eed7f.css"]}}
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/worktrees/[id]/terminal/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"80":{"*":{"id":"41868","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"79671","name":"*","chunks":[],"async":false}},"12846":{"*":{"id":"12994","name":"*","chunks":[],"async":false}},"18828":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"38991":{"*":{"id":"24146","name":"*","chunks":[],"async":false}},"40991":{"*":{"id":"27247","name":"*","chunks":[],"async":false}},"41845":{"*":{"id":"37398","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"66677":{"*":{"id":"42106","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx":{"id":38991,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","8091","static/chunks/8091-274bc0716106e7fc.js","1931","static/chunks/app/page-060057e02b841125.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/page.tsx":{"id":50653,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":40991,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","1038","static/chunks/1038-3509435b68c0967e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","9178","static/chunks/9178-88850a7c48deea07.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","8091","static/chunks/8091-274bc0716106e7fc.js","130","static/chunks/app/worktrees/%5Bid%5D/page-78580947c201d698.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":41845,"name":"*","chunks":["9838","static/chunks/30d07d85-393352a92199f695.js","216","static/chunks/216-f18f4a9d8b04a91e.js","1224","static/chunks/app/worktrees/%5Bid%5D/terminal/page-5d85a7e508ce36d3.js"],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/e85de230ef5ddc40.css"],"/home/runner/work/CommandMate/CommandMate/src/app/page":[],"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page":["static/css/5eacd01f773eed7f.css"],"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page":["static/css/85fa6dafca566008.css"]}}
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/worktrees/[id]/terminal/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"80":{"*":{"id":"41868","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"79671","name":"*","chunks":[],"async":false}},"12846":{"*":{"id":"12994","name":"*","chunks":[],"async":false}},"18828":{"*":{"id":"2108","name":"*","chunks":[],"async":false}},"19107":{"*":{"id":"96114","name":"*","chunks":[],"async":false}},"36423":{"*":{"id":"84759","name":"*","chunks":[],"async":false}},"40991":{"*":{"id":"72964","name":"*","chunks":[],"async":false}},"41845":{"*":{"id":"37398","name":"*","chunks":[],"async":false}},"50653":{"*":{"id":"84442","name":"*","chunks":[],"async":false}},"61060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"66677":{"*":{"id":"42106","name":"*","chunks":[],"async":false}},"88880":{"*":{"id":"25546","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/app-router.js":{"id":12846,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/client-page.js":{"id":19107,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":61060,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":36423,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/globals.css":{"id":2778,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx":{"id":18828,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","3185","static/chunks/app/layout-9110f9a5e41c6bf4.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/login/page.tsx":{"id":88880,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/page.tsx":{"id":66677,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","8091","static/chunks/8091-d65d2ab6daed23c6.js","1931","static/chunks/app/page-9e523a8f415bc707.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/files/[...path]/page.tsx":{"id":50653,"name":"*","chunks":[],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page.tsx":{"id":40991,"name":"*","chunks":["9234","static/chunks/9234-b0304101384ca079.js","216","static/chunks/216-f18f4a9d8b04a91e.js","1038","static/chunks/1038-3509435b68c0967e.js","2335","static/chunks/2335-98a211e00b94c7ac.js","9178","static/chunks/9178-88850a7c48deea07.js","8528","static/chunks/8528-4d554d3b94d4cf9b.js","8091","static/chunks/8091-d65d2ab6daed23c6.js","130","static/chunks/app/worktrees/%5Bid%5D/page-8fb4dc30b58a5681.js"],"async":false},"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page.tsx":{"id":41845,"name":"*","chunks":["9838","static/chunks/30d07d85-393352a92199f695.js","216","static/chunks/216-f18f4a9d8b04a91e.js","1224","static/chunks/app/worktrees/%5Bid%5D/terminal/page-5d85a7e508ce36d3.js"],"async":false}},"entryCSSFiles":{"/home/runner/work/CommandMate/CommandMate/src/":[],"/home/runner/work/CommandMate/CommandMate/src/app/layout":["static/css/45b3a41370668314.css"],"/home/runner/work/CommandMate/CommandMate/src/app/page":[],"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/page":["static/css/5eacd01f773eed7f.css"],"/home/runner/work/CommandMate/CommandMate/src/app/worktrees/[id]/terminal/page":["static/css/85fa6dafca566008.css"]}}
@@ -10,13 +10,13 @@
10
10
  "/api/repositories/restore/route": "app/api/repositories/restore/route.js",
11
11
  "/api/repositories/route": "app/api/repositories/route.js",
12
12
  "/api/repositories/scan/route": "app/api/repositories/scan/route.js",
13
- "/api/repositories/sync/route": "app/api/repositories/sync/route.js",
14
13
  "/api/slash-commands/route": "app/api/slash-commands/route.js",
14
+ "/api/repositories/sync/route": "app/api/repositories/sync/route.js",
15
+ "/api/worktrees/[id]/auto-yes/route": "app/api/worktrees/[id]/auto-yes/route.js",
15
16
  "/api/worktrees/[id]/capture/route": "app/api/worktrees/[id]/capture/route.js",
16
17
  "/api/worktrees/[id]/cli-tool/route": "app/api/worktrees/[id]/cli-tool/route.js",
17
18
  "/api/worktrees/[id]/current-output/route": "app/api/worktrees/[id]/current-output/route.js",
18
19
  "/api/worktrees/[id]/execution-logs/[logId]/route": "app/api/worktrees/[id]/execution-logs/[logId]/route.js",
19
- "/api/worktrees/[id]/auto-yes/route": "app/api/worktrees/[id]/auto-yes/route.js",
20
20
  "/api/worktrees/[id]/execution-logs/route": "app/api/worktrees/[id]/execution-logs/route.js",
21
21
  "/api/worktrees/[id]/files/[...path]/route": "app/api/worktrees/[id]/files/[...path]/route.js",
22
22
  "/api/worktrees/[id]/interrupt/route": "app/api/worktrees/[id]/interrupt/route.js",
@@ -29,10 +29,10 @@
29
29
  "/api/worktrees/[id]/route": "app/api/worktrees/[id]/route.js",
30
30
  "/api/worktrees/[id]/schedules/[scheduleId]/route": "app/api/worktrees/[id]/schedules/[scheduleId]/route.js",
31
31
  "/api/worktrees/[id]/schedules/route": "app/api/worktrees/[id]/schedules/route.js",
32
- "/api/worktrees/[id]/search/route": "app/api/worktrees/[id]/search/route.js",
33
32
  "/api/worktrees/[id]/send/route": "app/api/worktrees/[id]/send/route.js",
34
- "/api/worktrees/[id]/start-polling/route": "app/api/worktrees/[id]/start-polling/route.js",
33
+ "/api/worktrees/[id]/search/route": "app/api/worktrees/[id]/search/route.js",
35
34
  "/api/worktrees/[id]/slash-commands/route": "app/api/worktrees/[id]/slash-commands/route.js",
35
+ "/api/worktrees/[id]/start-polling/route": "app/api/worktrees/[id]/start-polling/route.js",
36
36
  "/api/worktrees/[id]/terminal/route": "app/api/worktrees/[id]/terminal/route.js",
37
37
  "/api/worktrees/[id]/tree/[...path]/route": "app/api/worktrees/[id]/tree/[...path]/route.js",
38
38
  "/api/worktrees/[id]/tree/route": "app/api/worktrees/[id]/tree/route.js",
@@ -1 +1 @@
1
- "use strict";exports.id=2314,exports.ids=[2314],exports.modules={82314:e=>{e.exports=JSON.parse('{"title":"スケジュール","executionLogs":"実行ログ","noSchedules":"スケジュールが設定されていません。CMATE.mdにSchedulesセクションを追加してください。","noSchedulesTitle":"スケジュールが設定されていません","noSchedulesStep1":"Files タブに切り替えてください","noSchedulesStep2":"ツールバーの CMATE ボタンをクリックして CMATE.md を作成","noSchedulesStep3":"Schedules テーブルを編集(Name, Cron, Message, CLI Tool, Enabled, Permission)","noSchedulesStep4":"再度 CMATE をクリックしてバリデーション","noLogs":"実行ログはまだありません。","status":{"running":"実行中","completed":"完了","failed":"失敗","timeout":"タイムアウト","cancelled":"キャンセル"},"enabled":"有効","disabled":"無効","lastRun":"最終実行","cron":"Cron式","exitCode":"終了コード","noOutput":"(出力なし)","message":"メッセージ","response":"レスポンス","unknownSchedule":"(削除済みスケジュール)","retry":"再試行","loading":"読み込み中...","notes":"メモ","logs":"Schedules","notesAndLogs":"CMATE","agentTab":"Agent","agentSettings":"エージェント設定","selectAgents":"ターミナルヘッダーのタブに表示するエージェントを2つ選択してください。","agentSaveSuccess":"エージェント設定を保存しました。","agentSaveError":"エージェント設定の保存に失敗しました。","vibeLocalModel":"Ollamaモデル","vibeLocalModelDefault":"デフォルト","ollamaNotAvailable":"Ollamaが起動していません。モデルを選択するにはOllamaを起動してください。","cmateCreated":"CMATE.mdをテンプレートで作成しました。スケジュールを設定してください。","cmateValidation":{"noSchedulesSection":"CMATE.mdにSchedulesセクションがありません。","valid":"{count}件のスケジュールが正常に検証されました。","errors":"{errorCount}件の検証エラー: {details}","failed":"CMATE.mdの処理に失敗しました。"}}')}};
1
+ "use strict";exports.id=2314,exports.ids=[2314],exports.modules={82314:e=>{e.exports=JSON.parse('{"title":"スケジュール","executionLogs":"実行ログ","noSchedules":"スケジュールが設定されていません。CMATE.mdにSchedulesセクションを追加してください。","noSchedulesTitle":"スケジュールが設定されていません","noSchedulesStep1":"Files タブに切り替えてください","noSchedulesStep2":"ツールバーの CMATE ボタンをクリックして CMATE.md を作成","noSchedulesStep3":"Schedules テーブルを編集(Name, Cron, Message, CLI Tool, Enabled, Permission)","noSchedulesStep4":"再度 CMATE をクリックしてバリデーション","noLogs":"実行ログはまだありません。","status":{"running":"実行中","completed":"完了","failed":"失敗","timeout":"タイムアウト","cancelled":"キャンセル"},"enabled":"有効","disabled":"無効","lastRun":"最終実行","cron":"Cron式","exitCode":"終了コード","noOutput":"(出力なし)","message":"メッセージ","response":"レスポンス","unknownSchedule":"(削除済みスケジュール)","retry":"再試行","loading":"読み込み中...","notes":"メモ","logs":"Schedules","notesAndLogs":"CMATE","agentTab":"Agent","agentSettings":"エージェント設定","selectAgents":"ターミナルヘッダーのタブに表示するエージェントを2つ選択してください。","agentSaveSuccess":"エージェント設定を保存しました。","agentSaveError":"エージェント設定の保存に失敗しました。","vibeLocalModel":"Ollamaモデル","vibeLocalModelDefault":"デフォルト","vibeLocalContextWindow":"コンテキストウィンドウ","vibeLocalContextWindowDefault":"デフォルト(自動)","ollamaNotAvailable":"Ollamaが起動していません。モデルを選択するにはOllamaを起動してください。","cmateCreated":"CMATE.mdをテンプレートで作成しました。スケジュールを設定してください。","cmateValidation":{"noSchedulesSection":"CMATE.mdにSchedulesセクションがありません。","valid":"{count}件のスケジュールが正常に検証されました。","errors":"{errorCount}件の検証エラー: {details}","failed":"CMATE.mdの処理に失敗しました。"}}')}};
@@ -1 +1 @@
1
- "use strict";exports.id=3074,exports.ids=[3074],exports.modules={73074:t=>{t.exports=JSON.parse('{"login":{"title":"ログイン","tokenLabel":"認証トークン","tokenPlaceholder":"トークンをここに貼り付けてください","submitButton":"ログイン"},"error":{"invalidToken":"トークンが無効です。もう一度お試しください。","lockedOut":"ログイン試行回数が上限に達しました。しばらくしてからお試しください。","retryAfter":"{minutes}分後に再度お試しください","unknownError":"予期しないエラーが発生しました。もう一度お試しください。"},"logout":{"button":"ログアウト"}}')}};
1
+ "use strict";exports.id=3074,exports.ids=[3074],exports.modules={73074:e=>{e.exports=JSON.parse('{"login":{"title":"ログイン","tokenLabel":"認証トークン","tokenPlaceholder":"トークンをここに貼り付けてください","submitButton":"ログイン","qr":{"sectionTitle":"モバイルアクセス用QRコード","urlLabel":"ngrok URL","urlPlaceholder":"https://xxx.ngrok-free.app","tokenLabel":"認証トークン","tokenPlaceholder":"認証トークンを入力","securityNotice":"トークンはサーバーに送信されません","showQrButton":"QRコードを表示","hideQrButton":"QRコードを隠す","qrSecurityWarning":"このQRコードにはトークンが含まれています。周囲に注意してください。","autoLoginError":"自動ログインに失敗しました","tokenExpiredOrInvalid":"トークンが無効または期限切れです","rateLimited":"ログイン試行回数が上限に達しました。しばらくしてから再試行してください。","httpsWarning":"セキュリティのためHTTPS URLを使用してください"}},"error":{"invalidToken":"トークンが無効です。もう一度お試しください。","lockedOut":"ログイン試行回数が上限に達しました。しばらくしてからお試しください。","retryAfter":"{minutes}分後に再度お試しください","unknownError":"予期しないエラーが発生しました。もう一度お試しください。"},"logout":{"button":"ログアウト"}}')}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=4952,exports.ids=[4952],exports.modules={89194:(e,t,s)=>{s.d(t,{Lg:()=>r,NA:()=>a});var n=s(10927),i=s(55837);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}`)}}},11136:(e,t,s)=>{s.d(t,{b:()=>l});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")}}},55837:(e,t,s)=>{s.d(t,{g:()=>S});var n=s(11136),i=s(62648);class o extends n.b{async isInstalled(){return await (0,i.Uv)()}async isRunning(e){return await (0,i.YI)(e)}async startSession(e,t){await (0,i.ym)({worktreeId:e,worktreePath:t})}async sendMessage(e,t){await (0,i.xd)(e,t)}async killSession(e){await (0,i._f)(e)}constructor(...e){super(...e),this.id="claude",this.name="Claude Code",this.command="claude"}}var r=s(10927),a=s(61282),l=s(21764),c=s(92900);let u=(0,l.promisify)(a.exec);function m(e){return e instanceof Error?e.message:String(e)}class p extends n.b{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 u(`tmux send-keys -t "${s}" Down`),await new Promise(e=>setTimeout(e,200)),await u(`tmux send-keys -t "${s}" Enter`),await new Promise(e=>setTimeout(e,200)),console.log(`✓ Started Codex session: ${s}`)}catch(t){let e=m(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 u(`tmux send-keys -t "${s}" C-m`),await new Promise(e=>setTimeout(e,200)),t.includes("\n")&&await (0,c.N)(s),console.log(`✓ Sent message to Codex session: ${s}`)}catch(t){let e=m(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 u(`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=m(t);throw console.error(`Error stopping Codex session: ${e}`),t}}constructor(...e){super(...e),this.id="codex",this.name="Codex CLI",this.command="codex"}}function d(e){return e instanceof Error?e.message:String(e)}class f extends n.b{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}),await new Promise(e=>setTimeout(e,100)),await (0,r.Is)(s,"gemini",!0),await new Promise(e=>setTimeout(e,6e3)),await this.handleTrustDialog(s),console.log(`✓ Started Gemini session: ${s}`)}catch(t){let e=d(t);throw Error(`Failed to start Gemini session: ${e}`)}}async handleTrustDialog(e){for(let t=0;t<10;t++){try{let t=await (0,r.xq)(e,50);if(t.includes("Do you trust this folder?")){await (0,r.ZV)(e,"Enter"),await new Promise(e=>setTimeout(e,2e3)),console.log("✓ Auto-trusted folder for Gemini session");return}if(t.match(/^[>❯]\s*$/m)){console.log("✓ Gemini prompt detected - no trust dialog needed");return}}catch{}await new Promise(e=>setTimeout(e,1e3))}console.log("⚠ Trust dialog detection timed out - proceeding anyway")}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{await (0,r.Is)(s,t,!1),await new Promise(e=>setTimeout(e,100)),await (0,r.ZV)(s,"C-m"),await new Promise(e=>setTimeout(e,200)),t.includes("\n")&&await (0,c.N)(s),console.log(`✓ Sent message to Gemini session: ${s}`)}catch(t){let e=d(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 (0,r.ZV)(t,"C-c"),await new Promise(e=>setTimeout(e,300)),await (0,r.Is)(t,"/quit",!0),await new Promise(e=>setTimeout(e,500))),await (0,r.AJ)(t)&&console.log(`✓ Stopped Gemini session: ${t}`)}catch(t){let e=d(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 h=s(83513),g=s(97425),w=s(75748);function y(e){return e instanceof Error?e.message:String(e)}class $ extends n.b{async isRunning(e){let t=this.getSessionName(e);return await (0,r.Hk)(t)}async startSession(e,t){if(!await this.isInstalled())throw Error("vibe-local is not installed or not in PATH");let s=this.getSessionName(e);if(await (0,r.Hk)(s)){console.log(`Vibe Local session ${s} already exists`);return}try{await (0,r.ed)({sessionName:s,workingDirectory:t,historyLimit:5e4}),await new Promise(e=>setTimeout(e,100));let n="vibe-local -y";try{let t=(0,g.getDbInstance)(),s=(0,w.gU)(t,e);s?.vibeLocalModel&&h.Y1.test(s.vibeLocalModel)&&(n+=` -m ${s.vibeLocalModel}`);let i=s?.vibeLocalContextWindow;(0,h.ZP)(i)&&(n+=` --context-window ${Number(i)}`)}catch{}await (0,r.Is)(s,n,!0),await new Promise(e=>setTimeout(e,5e3)),console.log(`✓ Started Vibe Local session: ${s}`)}catch(t){let e=y(t);throw Error(`Failed to start Vibe Local session: ${e}`)}}async sendMessage(e,t){let s=this.getSessionName(e);if(!await (0,r.Hk)(s))throw Error(`Vibe Local 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 (0,r.ZV)(s,"C-m"),await new Promise(e=>setTimeout(e,200)),await (0,r.ZV)(s,"C-m"),await new Promise(e=>setTimeout(e,200)),t.includes("\n")&&await (0,c.N)(s),console.log(`✓ Sent message to Vibe Local session: ${s}`)}catch(t){let e=y(t);throw Error(`Failed to send message to Vibe Local: ${e}`)}}async killSession(e){let t=this.getSessionName(e);try{await (0,r.Hk)(t)&&(await (0,r.ZV)(t,"C-c"),await new Promise(e=>setTimeout(e,300)),await (0,r.ZV)(t,"C-c"),await new Promise(e=>setTimeout(e,500))),await (0,r.AJ)(t)&&console.log(`✓ Stopped Vibe Local session: ${t}`)}catch(t){let e=y(t);throw console.error(`Error stopping Vibe Local session: ${e}`),t}}constructor(...e){super(...e),this.id="vibe-local",this.name="Vibe Local",this.command="vibe-local"}}var x=s(2693),C=s(59991);class S{constructor(){this.tools=new Map,this.tools.set("claude",new o),this.tools.set("codex",new p),this.tools.set("gemini",new f),this.tools.set("vibe-local",new $),this.tools.set("opencode",new x.LX)}static getInstance(){return S.instance||(S.instance=new S),S.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,C.FN)(e,t)}}},2693:(e,t,s)=>{s.d(t,{uC:()=>d,LX:()=>f});var n=s(11136),i=s(10927),o=s(92900),r=s(92048),a=s(55315);let l=/^[a-zA-Z0-9._:/-]{1,100}$/;async function c(e){let t=function(e){let t=a.resolve(e);try{if(!r.lstatSync(t).isDirectory())throw Error(`Path is not a directory: ${t}`)}catch(e){if("ENOENT"===e.code)throw Error(`Path does not exist: ${t}`);throw e}return r.realpathSync(t)}(e),s=a.join(t,"opencode.json");if(r.existsSync(s))return;let n={};try{let e=new AbortController,t=setTimeout(()=>e.abort(),3e3),s=await fetch("http://localhost:11434/api/tags",{signal:e.signal}).finally(()=>{clearTimeout(t)});if(!s.ok){console.warn(`Ollama API returned status ${s.status}, skipping opencode.json generation`);return}let i=await s.text();if(i.length>1048576){console.warn("Ollama API response too large, skipping opencode.json generation");return}let o=JSON.parse(i);if(!o||!Array.isArray(o.models)){console.warn("Invalid Ollama API response structure, skipping opencode.json generation");return}for(let e of o.models.slice(0,100))"string"==typeof e?.name&&l.test(e.name)&&(n[e.name]={name:function(e){let t=String(e.name),s=e.details;if(!s)return t;let n=[t];return"string"==typeof s.parameter_size&&/^[\d.]+[BKMGT]?B?$/i.test(s.parameter_size)&&n.push(s.parameter_size),"string"==typeof s.quantization_level&&/^[A-Z0-9_]{1,20}$/i.test(s.quantization_level)&&n.push(s.quantization_level),n.length>1?`${t} (${n.slice(1).join(", ")})`:t}(e)})}catch(e){e instanceof Error&&"AbortError"===e.name?console.warn("Ollama API timeout, skipping opencode.json generation"):console.warn("Failed to fetch Ollama models, skipping opencode.json generation");return}try{r.writeFileSync(s,JSON.stringify({$schema:"https://opencode.ai/config.json",provider:{ollama:{npm:"@ai-sdk/openai-compatible",name:"Ollama (local)",options:{baseURL:"http://localhost:11434/v1"},models:n}}},null,2),{encoding:"utf-8",flag:"wx"})}catch(e){if("EEXIST"===e.code)return;console.warn(`Failed to write opencode.json: ${e instanceof Error?e.message:String(e)}`)}}var u=s(61282);let m=(0,s(21764).promisify)(u.execFile);function p(e){return e instanceof Error?e.message:String(e)}let d=200;class f extends n.b{async isRunning(e){let t=this.getSessionName(e);return await (0,i.Hk)(t)}async startSession(e,t){if(!await this.isInstalled())throw Error("OpenCode is not installed or not in PATH");let s=this.getSessionName(e);if(await (0,i.Hk)(s)){console.log(`OpenCode session ${s} already exists`);return}try{await c(t),await (0,i.ed)({sessionName:s,workingDirectory:t,historyLimit:5e4}),await new Promise(e=>setTimeout(e,100));try{await m("tmux",["resize-window","-t",s,"-x","80","-y",String(d)])}catch{}await (0,i.Is)(s,"opencode",!0),await new Promise(e=>setTimeout(e,15e3)),console.log(`Started OpenCode session: ${s}`)}catch(t){let e=p(t);throw Error(`Failed to start OpenCode session: ${e}`)}}async sendMessage(e,t){let s=this.getSessionName(e);if(!await (0,i.Hk)(s))throw Error(`OpenCode session ${s} does not exist. Start the session first.`);try{await (0,i.Is)(s,t,!1),await new Promise(e=>setTimeout(e,100)),await (0,i.ZV)(s,"C-m"),await new Promise(e=>setTimeout(e,200)),t.includes("\n")&&await (0,o.N)(s),console.log(`Sent message to OpenCode session: ${s}`)}catch(t){let e=p(t);throw Error(`Failed to send message to OpenCode: ${e}`)}}async killSession(e){let t=this.getSessionName(e);try{await (0,i.Hk)(t)?(await (0,i.Is)(t,"/exit",!0),await new Promise(e=>setTimeout(e,2e3)),await (0,i.Hk)(t)&&await (0,i.AJ)(t)):await (0,i.AJ)(t),console.log(`Stopped OpenCode session: ${t}`)}catch(t){let e=p(t);throw console.error(`Error stopping OpenCode session: ${e}`),t}}constructor(...e){super(...e),this.id="opencode",this.name="OpenCode",this.command="opencode"}}},63661:(e,t,s)=>{s.d(t,{F:()=>r,J:()=>f});let n=(0,s(43895).h)("prompt-detector"),i=[{regex:/^(.+)\s+\(y\/n\)\s*$/m},{regex:/^(.+)\s+\[y\/N\]\s*$/m,defaultOption:"no"},{regex:/^(.+)\s+\[Y\/n\]\s*$/m,defaultOption:"yes"},{regex:/^(.+)\s+\(yes\/no\)\s*$/m}];function o(e,t,s,n){return{isPrompt:!0,promptData:{type:"yes_no",question:e,options:["yes","no"],status:"pending",...void 0!==n&&{defaultOption:n},instructionText:s},cleanContent:t,rawContent:s}}function r(e,t){n.debug("detectPrompt:start",{outputLength:e.length});let s=e.split("\n").slice(-20).join("\n"),r=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(l.test(s)){t=!0;break}}if(!t)return m(e)}let r=[],p=-1,f=0;for(let t=i-1;t>=o;t--){let s=n[t].trim(),i=s.match(l);if(i){let e=parseInt(i[1],10),t=i[2].trim();r.unshift({number:e,label:t,isDefault:!0}),f=0;continue}let o=s.match(c);if(o){let e=parseInt(o[1],10),t=o[2].trim();r.unshift({number:e,label:t,isDefault:!1}),f=0;continue}if(0===r.length&&(s.startsWith("❯")||s.startsWith("●")||s.startsWith("›")))return m(e);if(r.length>0&&s&&!u.test(s)){if(d(s)){p=t;break}if(function(e,t){let s=t.endsWith("?")||t.endsWith("?");return!!(!s&&/^\s{2,}[^\d]/.test(e)&&!/^\s*\d+\./.test(e)||t.length<5&&!s||/^[\/~]/.test(t)||t.length>=2&&/^[a-zA-Z0-9_-]+$/.test(t))}(n[t],s)){if(++f>5){p=t;break}continue}p=t;break}}if(!function(e){if(0===e.length||1!==e[0])return!1;for(let t=1;t<e.length;t++)if(e[t]!==e[t-1]+1)return!1;return!0}(r.map(e=>e.number)))return m(e);let h=r.some(e=>e.isDefault);if(r.length<2||s&&!h||!s&&(-1===p||!d(n[p]?.trim()??"")&&!function(e,t,s,n){let i=Math.max(n,t-3);for(let s=t-1;s>=i;s--){let t=e[s]?.trim()??"";if(!(!t||u.test(t))&&d(t))return!0}return!1}(n,p,0,o)))return m(e);let g=function(e,t){if(t<0)return"Please select an option:";let s=[];for(let n=Math.max(0,t-5);n<=t;n++){let t=e[n].trim();t&&!u.test(t)&&s.push(t)}return s.join(" ")}(n,p),w=function(e,t,s){if(t<0)return;let n=e.slice(Math.max(0,t-19),s).map(e=>e.trimEnd()).join("\n").trim();return n.length>0?n:void 0}(n,p,i);return{isPrompt:!0,promptData:{type:"multiple_choice",question:g.trim(),options:r.map(e=>{let t=a.some(t=>t.test(e.label));return{number:e.number,label:e.label,isDefault:e.isDefault,requiresTextInput:t}}),status:"pending",instructionText:w},cleanContent:g.trim(),rawContent:function(e){let t=e.split("\n"),s=(t.length>200?t.slice(-200):t).join("\n");return s.length>5e3&&(s=s.slice(-5e3)),s}(e.trim())}}(e,t);if(r.isPrompt)return n.info("detectPrompt:multipleChoice",{isPrompt:!0,question:r.promptData?.question,optionsCount:r.promptData?.options?.length}),r;let p=s.trim();for(let e of i){let t=s.match(e.regex);if(t){let s=t[1].trim();return o(s,s,p,e.defaultOption)}}let f=s.match(/^(.*?)Approve\?\s*$/m);if(f){let e=f[1].trim();return o(e?`${e} Approve?`:"Approve?",e||"Approve?",p)}return n.debug("detectPrompt:complete",{isPrompt:!1}),{isPrompt:!1,cleanContent:e.trim()}}let a=[/type\s+here/i,/tell\s+(me|claude)/i,/enter\s+/i,/custom/i,/differently/i],l=/^\s*[\u276F\u25CF\u203A]\s*(\d+)\.\s*(.+)$/,c=/^\s*(\d+)\.\s*(.+)$/,u=/^[-─]+$/;function m(e){return{isPrompt:!1,cleanContent:e.trim()}}let p=/(?:select|choose|pick|which|what|how|where|enter|type|specify|confirm|approve|accept|reject|decide|preference|option)/i;function d(e){return 0!==e.length&&!!(e.includes("?")||e.includes("?")||p.test(e))}function f(e,t="yes_no"){let s=e.toLowerCase().trim();if("multiple_choice"===t){if(/^\d+$/.test(s))return s;throw Error("Invalid answer for multiple choice prompt. Expected a number.")}if("yes"===s||"y"===s)return"y";if("no"===s||"n"===s)return"n";throw Error("Invalid answer for yes/no prompt. Expected 'yes', 'no', 'y', or 'n'.")}},59991:(e,t,s)=>{s.d(t,{Di:()=>S,FN:()=>P,RJ:()=>C,ci:()=>x,cn:()=>v});var n=s(89194),i=s(97425),o=s(75748),r=s(68507),a=s(63661),l=s(76966),c=s(89287),u=s(19377);let m=["Waiting for auth","⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];function p(e){return{response:"",isComplete:!1,lineCount:e}}function d(e,t,s,n,i,o,r){let a=b(t,s,n,i,o),l=e.slice(a);return{response:(0,u.vp)(l.join("\n")),isComplete:!0,lineCount:s,promptDetection:r,bufferReset:n}}let f=new Map;function h(e){return(0,u.BN)((0,u.vp)(e)).replace(/^\u2503\s?/,"").replace(/\s*\u2503$/,"").trim()}let g=new Map,w=new Map;function y(e,t){return`${e}:${t}`}function $(e,t){let s=(0,u.Sg)(t);return(0,a.F)((0,u.BN)((0,u.vp)(e)),s)}function x(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*$/,u.d8],r=[];for(let e of i)!o.some(t=>t.test(e))&&e.trim()&&r.push(e);return r.join("\n").trim()}function C(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()}function S(e){let t=e.split("\n"),s=[];for(let e=0;e<t.length;e++){let n=h(t[e]);n&&u.n9.test(n)&&s.push(e)}let n=0;s.length>=2&&(n=s[s.length-2]+1);let i=[];for(let e=n;e<t.length;e++){let s=h(t[e]);!(!s||u.lr.some(e=>e.test(s)))&&(u.n9.test(s)||i.push(s))}return i.join("\n").trim()}function b(e,t,s,n,i){if(e=Math.max(0,e),"opencode"===n){let e=i(t);return e>=0?e+1:0}if(e>=t||s){let e=i(40);return e>=0?e+1:0}if("codex"===n)return Math.max(0,e);if(e>=t-5){let e=i(50);return e>=0?e+1:Math.max(0,t-40)}return Math.max(0,e)}async function T(e,t){let s=(0,i.getDbInstance)();try{if(!(0,o.gU)(s,e))return console.error(`Worktree ${e} not found, stopping poller`),P(e,t),!1;if(!await (0,n.Lg)(e,t))return console.log(`[checkForResponse] Session not running for ${e} (${t}), stopping poller`),P(e,t),!1;let i=(0,o.zl)(s,e,t),g=i?.lastCapturedLine||0,w=await (0,n.NA)(e,t,1e4);if("opencode"===t){let s=y(e,t);!function(e,t){let s=f.get(e);if(!s)return;let n=function(e){let t=e.split("\n"),s=[];for(let e of t){let t=h(e);!(!t||u.lr.some(e=>e.test(t)))&&(u.n9.test(t)||s.push(t))}return s}(t);if(0!==n.length){if(s.pollCount++,0===s.lines.length)s.lines=[...n];else{let e=function(e,t){if(0===e.length||0===t.length)return 0;let s=Math.min(e.length,t.length);for(let n=s;n>=1;n--){let s=e.slice(-n),i=t.slice(0,n),o=!0;for(let e=0;e<n;e++)if(s[e]!==i[e]){o=!1;break}if(o)return n}return 0}(s.lastFingerprint,n);if(e>0){let t=n.slice(e);s.lines.push(...t)}else s.lines.push(...n)}s.lastFingerprint=n.slice(-10)}}(s,w)}let T=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,l=r>0&&t>50&&r<50,c=a||l;if(!c&&r<t-5)return null;let f=Math.max(0,r-20),h=o.slice(f),g="opencode"===s?(0,u.vp)(o.join("\n")):h.join("\n"),{promptPattern:w,separatorPattern:y,thinkingPattern:x,skipPatterns:C}=(0,u.bs)(s),S=(e=60)=>{let t;if("codex"===s)t=/^›\s+(?!Implement|Find and fix|Type|Summarize)/;else if("opencode"===s){let t=0;for(let s=r-1;s>=Math.max(0,r-e);s--){let e=(0,u.vp)(o[s]);if(u.n9.test(e)&&2==++t)return s}return -1}else t=/^[>❯]\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||"codex"===s){let e=$(o.join("\n"),s);if(e.isPrompt)return d(o,t,r,c,s,S,e)}let T=(0,u.vp)(g),v=w.test(T),P=y.test(T),k=x.test(T),I=("codex"===s||"gemini"===s||"vibe-local"===s)&&v&&!k,E="claude"===s&&v&&P&&!k,N="opencode"===s&&u.n9.test(T)&&!u.nT.test(T);if(I||E||N){let e=[],n=b(t,r,c,s,S),i=r;for(let t=n;t<r;t++){let n=o[t],r=(0,u.vp)(n);if("codex"===s&&/^›\s+/.test(r)||"gemini"===s&&/^(%|\$|.*@.*[%$#])\s*$/.test(r)||"opencode"===s&&(u.Hm.test(r)||u.bl.test(r))){i=t;break}C.some(e=>e.test(r))||e.push(n)}let a=e.join("\n").trim(),l=a.split("\n").slice(-5).join("\n");if(x.test(l))return p(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&&!C.some(e=>e.test(t))&&!/^─+$/.test(t)}).length)return p(r)}else if((t||s||n||i)&&a.length<2e3)return p(r)}if("gemini"===s&&((a.match(/[░███]/g)||[]).length>.3*a.length||m.some(e=>a.includes(e))||!a.includes("✦")&&a.length<10))return p(r);if("opencode"===s){let e=(0,u.vp)(a);if((e.length<50||!u.n9.test(T))&&0===e.split("\n").filter(e=>{let t=e.trim();return t&&!u.lr.some(e=>e.test(t))}).length)return p(r)}return{response:a,isComplete:!0,lineCount:i,bufferReset:c}}if("opencode"!==s){let e=$(o.join("\n"),s);if(e.isPrompt)return d(o,t,r,c,s,S,e)}let A=[],L=c||t>=r-5,M=L?S(80):-1,O=L?M>=0?M+1:Math.max(0,r-80):Math.max(0,t);for(let e=O;e<r;e++){let t=o[e],s=(0,u.vp)(t);C.some(e=>e.test(s))||A.push(t)}let D=A.join("\n").trim();return D?{response:D,isComplete:!1,lineCount:r}:p(r)}(w,g,t);if(!T||!T.isComplete){let{thinkingPattern:n}=(0,u.bs)(t),i=(0,u.vp)(w).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}let v="opencode"===t;if(!v&&!T.bufferReset&&T.lineCount===g&&!i?.inProgressMessageId)return!1;if(!T.bufferReset&&!v&&T.lineCount<=g)return console.log(`[checkForResponse] Already saved up to line ${g}, skipping (result: ${T.lineCount})`),!1;let k=T.promptDetection??$(T.response,t);if(k.isPrompt){(0,o.Mf)(s,e,t);let n=(0,o.tn)(s,{worktreeId:e,role:"assistant",content:k.rawContent||k.cleanContent,messageType:"prompt",promptData:k.promptData,timestamp:new Date,cliToolId:t});return(0,o.IH)(s,e,t,T.lineCount),(0,r.ps)("message",{worktreeId:e,message:n}),P(e,t),!0}if(!T.response||""===T.response.trim())return(0,o.IH)(s,e,t,T.lineCount),!1;let I="claude"===t?(0,c.Z)(T.response):void 0,E=T.response;if("gemini"===t)E=C(T.response);else if("claude"===t)E=x(T.response);else if("opencode"===t){var a;E=S(T.response),a=y(e,t),f.delete(a)}if(!E||""===E.trim()||"[No content]"===E)return(0,o.IH)(s,e,t,T.lineCount),(0,o.Mf)(s,e,t),!1;E&&await (0,l.o)(s,e,E,t);let N=(0,o.GP)(s,e,t);N>0&&console.log(`Marked ${N} pending prompt(s) as answered for ${e}`);let A=(0,o.zl)(s,e,t);if(!v&&A&&T.lineCount<=A.lastCapturedLine)return console.log(`[checkForResponse] Race condition detected, skipping save (result: ${T.lineCount}, current: ${A.lastCapturedLine})`),!1;let L=(0,o.tn)(s,{worktreeId:e,role:"assistant",content:E,messageType:"normal",timestamp:new Date,cliToolId:t,summary:I?.summary,logFileName:I?.logFileName,requestId:I?.requestId});return(0,r.ps)("message",{worktreeId:e,message:L}),(0,o.IH)(s,e,t,T.lineCount),v&&P(e,t),!0}catch(t){return console.error(`Error checking for response (${e}):`,t instanceof Error?t.message:String(t)),!1}}function v(e,t){let s=y(e,t);P(e,t),w.set(s,Date.now()),"opencode"===t&&f.set(s,{lines:[],lastFingerprint:[],pollCount:0}),function e(t,s){let n=y(t,s),i=setTimeout(async()=>{let i=w.get(n);if(i&&Date.now()-i>18e5){P(t,s);return}try{await T(t,s)}catch(e){console.error("[Poller] Error:",e)}g.has(n)&&e(t,s)},2e3);g.set(n,i)}(e,t)}function P(e,t){let s=y(e,t),n=g.get(s);n&&(clearTimeout(n),g.delete(s),w.delete(s)),f.delete(s)}}};
@@ -15,12 +15,12 @@
15
15
  hover:bg-gray-800 transition-colors
16
16
  focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500
17
17
  ${t?"bg-gray-700 border-l-2 border-blue-500":"border-l-2 border-transparent"}
18
- `,children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[e.cliStatus&&Object.keys(e.cliStatus).length>0&&r.jsx("div",{className:"flex items-center gap-1 flex-shrink-0","aria-label":"CLI tool status",children:Object.entries(e.cliStatus).map(([e,t])=>r.jsx(u,{status:t??"idle",label:(0,d.Ds)(e)},e))}),(0,r.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[r.jsx("p",{className:"text-sm font-medium text-white truncate",children:e.name}),r.jsx("p",{className:"text-xs text-gray-400 truncate",children:e.repositoryName})]}),e.hasUnread&&r.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&&r.jsx("div",{"data-testid":"branch-description",className:"pl-6 pr-2 mt-1 text-left",children:r.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"}],h=(0,s.memo)(function(){let{sortKey:e,sortDirection:t,setSortKey:a,setSortDirection:n}=(0,l.Sz)(),[o,i]=(0,s.useState)(!1),c=(0,s.useRef)(null);(0,s.useEffect)(()=>{function e(e){c.current&&!c.current.contains(e.target)&&i(!1)}if(o)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[o]),(0,s.useEffect)(()=>{function e(e){"Escape"===e.key&&i(!1)}if(o)return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]);let d=(0,s.useCallback)(()=>{i(e=>!e)},[]),u=(0,s.useCallback)(r=>{r===e?n("asc"===t?"desc":"asc"):(a(r),n("updatedAt"===r?"desc":"asc")),i(!1)},[e,t,a,n]),x=(0,s.useCallback)(()=>{n("asc"===t?"desc":"asc")},[t,n]),h=m.find(t=>t.key===e)?.label||"Sort";return(0,r.jsxs)("div",{ref:c,className:"relative","data-testid":"sort-selector",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsxs)("button",{type:"button",onClick:d,"aria-expanded":o,"aria-haspopup":"listbox","aria-label":`Sort by ${h}`,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:[r.jsx(g,{className:"w-3 h-3"}),r.jsx("span",{className:"hidden sm:inline",children:h})]}),r.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?r.jsx(p,{className:"w-3 h-3"}):r.jsx(f,{className:"w-3 h-3"})})]}),o&&r.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,r.jsxs)("button",{type:"button",role:"option","aria-selected":e===a.key,onClick:()=>u(a.key),className:`
18
+ `,children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[e.cliStatus&&Object.keys(e.cliStatus).length>0&&r.jsx("div",{className:"flex items-center gap-1 flex-shrink-0","aria-label":"CLI tool status",children:Object.entries(e.cliStatus).map(([e,t])=>r.jsx(u,{status:t??"idle",label:(0,d.Ds)(e)},e))}),(0,r.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[r.jsx("p",{className:"text-sm font-medium text-white truncate",children:e.name}),r.jsx("p",{className:"text-xs text-gray-400 truncate",children:e.repositoryName})]}),e.hasUnread&&r.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&&r.jsx("div",{"data-testid":"branch-description",className:"pl-6 pr-2 mt-1 text-left",children:r.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"}],h=(0,s.memo)(function(){let{sortKey:e,sortDirection:t,setSortKey:a,setSortDirection:n}=(0,l.Sz)(),[o,i]=(0,s.useState)(!1),c=(0,s.useRef)(null);(0,s.useEffect)(()=>{function e(e){c.current&&!c.current.contains(e.target)&&i(!1)}if(o)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[o]),(0,s.useEffect)(()=>{function e(e){"Escape"===e.key&&i(!1)}if(o)return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]);let d=(0,s.useCallback)(()=>{i(e=>!e)},[]),u=(0,s.useCallback)(r=>{r===e?n("asc"===t?"desc":"asc"):(a(r),n("updatedAt"===r?"desc":"asc")),i(!1)},[e,t,a,n]),x=(0,s.useCallback)(()=>{n("asc"===t?"desc":"asc")},[t,n]),h=m.find(t=>t.key===e)?.label||"Sort";return(0,r.jsxs)("div",{ref:c,className:"relative","data-testid":"sort-selector",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsxs)("button",{type:"button",onClick:d,"aria-expanded":o,"aria-haspopup":"listbox","aria-label":`Sort by ${h}`,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:[r.jsx(p,{className:"w-3 h-3"}),r.jsx("span",{className:"hidden sm:inline",children:h})]}),r.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?r.jsx(g,{className:"w-3 h-3"}):r.jsx(f,{className:"w-3 h-3"})})]}),o&&r.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,r.jsxs)("button",{type:"button",role:"option","aria-selected":e===a.key,onClick:()=>u(a.key),className:`
19
19
  w-full px-3 py-2 text-left text-sm
20
20
  flex items-center justify-between
21
21
  hover:bg-gray-700 transition-colors
22
22
  ${e===a.key?"text-blue-400":"text-gray-300"}
23
- `,children:[r.jsx("span",{children:a.label}),e===a.key&&r.jsx("span",{className:"text-xs",children:"asc"===t?"ASC":"DESC"})]},a.key))})]})});function g({className:e}){return r.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12"})})}function p({className:e}){return r.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}function f({className:e}){return r.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}var b=a(34643);let y=["en","ja"],v={en:"English",ja:"日本語"};function j(){let{currentLocale:e,switchLocale:t}={currentLocale:(0,b.bU)(),switchLocale:e=>{y.includes(e)&&(function(e){let t="https:"===window.location.protocol;document.cookie=`locale=${e};path=/;max-age=31536000;SameSite=Lax${t?";Secure":""}`}(e),localStorage.setItem("locale",e),window.location.reload())}};return r.jsx("select",{value:e,onChange:e=>t(e.target.value),"aria-label":"Language",className:" w-full px-3 py-2 rounded-md bg-gray-800 text-white border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm ",children:y.map(e=>r.jsx("option",{value:e,children:v[e]},e))})}var w=a(6162),N=a(94001);function k(){let e=(0,w.T)("auth"),t=(0,N.m)(),[a,l]=(0,s.useState)(!1);if(!t)return null;async function n(){l(!0);try{await fetch("/api/auth/logout",{method:"POST"}),window.location.href="/login"}catch{window.location.href="/login"}}return r.jsx("button",{type:"button",onClick:n,disabled:a,"data-testid":"logout-button",className:" w-full px-3 py-2 text-sm text-left rounded-md text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-50 transition-colors ",children:a?"...":e("logout.button")})}var C=a(18421);let S={waiting:0,ready:1,running:2,generating:3,idle:4},L=(0,s.memo)(function(){let e=(0,o.useRouter)(),{worktrees:t,selectedWorktreeId:a,selectWorktree:n}=(0,i.Mu)(),{closeMobileDrawer:c,sortKey:d,sortDirection:u}=(0,l.Sz)(),[m,g]=(0,s.useState)(""),p=(0,s.useMemo)(()=>{let e=t.map(C.I_),a=e;if(m.trim()){let t=m.toLowerCase();a=e.filter(e=>e.name.toLowerCase().includes(t)||e.repositoryName.toLowerCase().includes(t))}return function(e,t,a){let r=[...e];return r.sort((e,r)=>{let s=0;switch(t){case"updatedAt":{let t=e=>e?e instanceof Date?e.getTime():new Date(e).getTime():0,a=t(e.lastActivity);s=t(r.lastActivity)-a;break}case"repositoryName":{let t=e.repositoryName.toLowerCase(),a=r.repositoryName.toLowerCase();s=t.localeCompare(a);break}case"branchName":{let t=e.name.toLowerCase(),a=r.name.toLowerCase();s=t.localeCompare(a);break}case"status":s=S[e.status]-S[r.status]}return("updatedAt"===t?"desc"===a:"asc"===a)?s:-s}),r}(a,d,u)},[t,m,d,u]),f=t=>{n(t),e.push(`/worktrees/${t}`),c()};return(0,r.jsxs)("nav",{"data-testid":"sidebar","aria-label":"Branch navigation",className:"h-full flex flex-col bg-gray-900 text-white",role:"navigation",children:[r.jsx("div",{"data-testid":"sidebar-header",className:"flex-shrink-0 px-4 py-4 border-b border-gray-700",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx("h2",{className:"text-lg font-semibold text-white",children:"Branches"}),r.jsx(h,{})]})}),r.jsx("div",{className:"flex-shrink-0 px-4 py-3 border-b border-gray-700",children:r.jsx("input",{type:"text",placeholder:"Search branches...",value:m,onChange:e=>g(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 "})}),r.jsx("div",{"data-testid":"branch-list",className:"flex-1 overflow-y-auto",children:0===p.length?r.jsx("div",{className:"px-4 py-8 text-center text-gray-400",children:m?"No branches found":"No branches available"}):p.map(e=>r.jsx(x,{branch:e,isSelected:e.id===a,onClick:()=>f(e.id)},e.id))}),(0,r.jsxs)("div",{className:"flex-shrink-0 px-4 py-3 border-t border-gray-700 space-y-2",children:[r.jsx(j,{}),r.jsx(k,{})]})]})});var z=a(22202);let $="transform transition-transform duration-300 ease-out",M=(0,s.memo)(function({children:e}){let{isOpen:t,isMobileDrawerOpen:a,closeMobileDrawer:s}=(0,l.Sz)();return(0,n.d)()?(0,r.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[a&&r.jsx("div",{"data-testid":"drawer-overlay",className:"fixed inset-0 bg-black/50 z-40",onClick:s,"aria-hidden":"true"}),r.jsx("aside",{"data-testid":"sidebar-container",className:`
23
+ `,children:[r.jsx("span",{children:a.label}),e===a.key&&r.jsx("span",{className:"text-xs",children:"asc"===t?"ASC":"DESC"})]},a.key))})]})});function p({className:e}){return r.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12"})})}function g({className:e}){return r.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}function f({className:e}){return r.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}var b=a(34643);let y=["en","ja"],v={en:"English",ja:"日本語"};function j(){let{currentLocale:e,switchLocale:t}={currentLocale:(0,b.bU)(),switchLocale:e=>{y.includes(e)&&(function(e){let t="https:"===window.location.protocol;document.cookie=`locale=${e};path=/;max-age=31536000;SameSite=Lax${t?";Secure":""}`}(e),localStorage.setItem("locale",e),window.location.reload())}};return r.jsx("select",{value:e,onChange:e=>t(e.target.value),"aria-label":"Language",className:" w-full px-3 py-2 rounded-md bg-gray-800 text-white border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm ",children:y.map(e=>r.jsx("option",{value:e,children:v[e]},e))})}var w=a(6162),N=a(94001);function k(){let e=(0,w.T)("auth"),t=(0,N.m)(),[a,l]=(0,s.useState)(!1);if(!t)return null;async function n(){l(!0);try{await fetch("/api/auth/logout",{method:"POST"}),window.location.href="/login"}catch{window.location.href="/login"}}return r.jsx("button",{type:"button",onClick:n,disabled:a,"data-testid":"logout-button",className:" w-full px-3 py-2 text-sm text-left rounded-md text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-50 transition-colors ",children:a?"...":e("logout.button")})}var C=a(18421);let S={waiting:0,ready:1,running:2,generating:3,idle:4},L=(0,s.memo)(function(){let e=(0,o.useRouter)(),{worktrees:t,selectedWorktreeId:a,selectWorktree:n}=(0,i.Mu)(),{closeMobileDrawer:c,sortKey:d,sortDirection:u}=(0,l.Sz)(),[m,p]=(0,s.useState)(""),g=(0,s.useMemo)(()=>{let e=t.map(C.I_),a=e;if(m.trim()){let t=m.toLowerCase();a=e.filter(e=>e.name.toLowerCase().includes(t)||e.repositoryName.toLowerCase().includes(t))}return function(e,t,a){let r=[...e];return r.sort((e,r)=>{let s=0;switch(t){case"updatedAt":{let t=e=>e?e instanceof Date?e.getTime():new Date(e).getTime():0,a=t(e.lastActivity);s=t(r.lastActivity)-a;break}case"repositoryName":{let t=e.repositoryName.toLowerCase(),a=r.repositoryName.toLowerCase();s=t.localeCompare(a);break}case"branchName":{let t=e.name.toLowerCase(),a=r.name.toLowerCase();s=t.localeCompare(a);break}case"status":s=S[e.status]-S[r.status]}return("updatedAt"===t?"desc"===a:"asc"===a)?s:-s}),r}(a,d,u)},[t,m,d,u]),f=t=>{n(t),e.push(`/worktrees/${t}`),c()};return(0,r.jsxs)("nav",{"data-testid":"sidebar","aria-label":"Branch navigation",className:"h-full flex flex-col bg-gray-900 text-white",role:"navigation",children:[r.jsx("div",{"data-testid":"sidebar-header",className:"flex-shrink-0 px-4 py-4 border-b border-gray-700",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx("h2",{className:"text-lg font-semibold text-white",children:"Branches"}),r.jsx(h,{})]})}),r.jsx("div",{className:"flex-shrink-0 px-4 py-3 border-b border-gray-700",children:r.jsx("input",{type:"text",placeholder:"Search branches...",value:m,onChange:e=>p(e.target.value),className:" w-full px-3 py-2 rounded-md bg-gray-800 text-white placeholder-gray-400 border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent "})}),r.jsx("div",{"data-testid":"branch-list",className:"flex-1 overflow-y-auto",children:0===g.length?r.jsx("div",{className:"px-4 py-8 text-center text-gray-400",children:m?"No branches found":"No branches available"}):g.map(e=>r.jsx(x,{branch:e,isSelected:e.id===a,onClick:()=>f(e.id)},e.id))}),(0,r.jsxs)("div",{className:"flex-shrink-0 px-4 py-3 border-t border-gray-700 space-y-2",children:[r.jsx(j,{}),r.jsx(k,{})]})]})});var z=a(22202);let $="transform transition-transform duration-300 ease-out",M=(0,s.memo)(function({children:e}){let{isOpen:t,isMobileDrawerOpen:a,closeMobileDrawer:s}=(0,l.Sz)();return(0,n.d)()?(0,r.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[a&&r.jsx("div",{"data-testid":"drawer-overlay",className:"fixed inset-0 bg-black/50 z-40",onClick:s,"aria-hidden":"true"}),r.jsx("aside",{"data-testid":"sidebar-container",className:`
24
24
  fixed left-0 top-0 h-full w-72 z-50
25
25
  ${$}
26
26
  ${a?"translate-x-0":"-translate-x-full"}
@@ -32,4 +32,4 @@
32
32
  flex-1 min-w-0 h-full overflow-hidden
33
33
  transition-[padding] duration-300 ease-out
34
34
  ${t?"md:pl-72":"md:pl-0"}
35
- `,role:"main",children:e})]})})},28676:(e,t,a)=>{a.d(t,{u:()=>o});var r=a(10326),s=a(17577),l=a(60962),n=a(22202);function o({isOpen:e,onClose:t,title:a,children:o,size:i="lg",showCloseButton:c=!0,disableClose:d=!1}){let u=(0,s.useRef)(null);return e?(0,l.createPortal)((0,r.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:n.k.MODAL},children:[r.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:d?void 0:t}),r.jsx("div",{className:"relative flex min-h-full items-center justify-center p-2 sm:p-4",children:(0,r.jsxs)("div",{ref:u,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||c)&&(0,r.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:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold text-gray-900 truncate pr-2",children:a}),c&&r.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 transition-colors flex-shrink-0",children:r.jsx("svg",{className:"w-5 h-5 sm:w-6 sm:h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),r.jsx("div",{className:"px-4 sm:px-6 py-3 sm:py-4 overflow-y-auto flex-1 min-h-0",children:o})]})})]}),document.body):null}},77758:(e,t,a)=>{a.d(t,{Ct:()=>c,zx:()=>s,Zb:()=>l,aY:()=>i,Ol:()=>n,ll:()=>o,u_:()=>d.u});var r=a(10326);function s({variant:e="primary",size:t="md",fullWidth:a=!1,loading:s=!1,disabled:l,className:n="",children:o,...i}){let c=["btn",{primary:"btn-primary",secondary:"btn-secondary",danger:"btn-danger",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500"}[e],{sm:"btn-sm",md:"",lg:"btn-lg"}[t],a?"w-full":"",l||s?"opacity-50 cursor-not-allowed":"",n].filter(Boolean).join(" ");return(0,r.jsxs)("button",{className:c,disabled:l||s,...i,children:[s&&(0,r.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:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),o]})}function l({hover:e=!1,padding:t="md",className:a="",children:s,...l}){let n=["card",e?"card-hover":"",{none:"",sm:"p-3",md:"p-4",lg:"p-6"}[t],a].filter(Boolean).join(" ");return r.jsx("div",{className:n,...l,children:s})}function n({className:e="",children:t,...a}){return r.jsx("div",{className:`mb-3 ${e}`,...a,children:t})}function o({className:e="",children:t,...a}){return r.jsx("h3",{className:`text-lg font-semibold text-gray-900 ${e}`,...a,children:t})}function i({className:e="",children:t,...a}){return r.jsx("div",{className:e,...a,children:t})}function c({variant:e="gray",dot:t=!1,className:a="",children:s,...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,r.jsxs)("span",{className:n,...l,children:[t&&r.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"}),s]})}a(17577);var d=a(28676)},11867:(e,t,a)=>{a.d(t,{n:()=>d});var r=a(10326),s=a(17577),l=a(77758),n=a(11865),o=a(73002),i=a(91515),c=a(51223);function d({worktreeId:e}){let[t,a]=(0,s.useState)([]),[d,u]=(0,s.useState)(null),[x,m]=(0,s.useState)(null),[h,g]=(0,s.useState)(!0),[p,f]=(0,s.useState)(null),[b,y]=(0,s.useState)(""),[v,j]=(0,s.useState)(0),[w,N]=(0,s.useState)("all"),[k,C]=(0,s.useState)(!1),{toasts:S,showToast:L,removeToast:z}=(0,n.pm)(),$=(0,s.useMemo)(()=>"all"===w?t:t.filter(e=>e.toLowerCase().includes(w)),[t,w]),M=async t=>{try{g(!0),f(null);let a=await o.Iv.getLogFile(e,t);m(a.content),u(t),y(""),j(0)}catch(e){f((0,o.zG)(e))}finally{g(!1)}},E=(0,s.useCallback)(async()=>{if(d)try{C(!0);let t=await o.Iv.getLogFile(e,d,{sanitize:!0});await (0,i.v)(t.content),L("Log copied to clipboard (sanitized)","success")}catch(e){L(`Failed to export log: ${(0,o.zG)(e)}`,"error")}finally{C(!1)}},[e,d,L]),T=(0,s.useMemo)(()=>{let e;if(!b||!x)return[];let t=RegExp((0,c.hr)(b),"gi"),a=[];for(;null!==(e=t.exec(x));)a.push({index:e.index,length:e[0].length});return a},[b,x]),A=()=>{T.length>0&&j(e=>(e+1)%T.length)},D=()=>{T.length>0&&j(e=>(e-1+T.length)%T.length)},I=(0,s.useMemo)(()=>{if(!x||!b||0===T.length)return x;let e="",t=0;return T.forEach((a,r)=>{e+=(0,c.Xv)(x.substring(t,a.index));let s=x.substring(a.index,a.index+a.length),l=r===v;e+=`<mark class="${l?"bg-yellow-400 text-black":"bg-yellow-200 text-black"}" data-match-index="${r}">${(0,c.Xv)(s)}</mark>`,t=a.index+a.length}),e+=(0,c.Xv)(x.substring(t))},[x,b,T,v]);return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)(l.Zb,{padding:"md",children:[r.jsx(l.Ol,{children:(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx(l.ll,{children:"Log Files"}),r.jsx(l.Ct,{variant:"gray",children:$.length})]}),(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,r.jsxs)(l.zx,{variant:"all"===w?"primary":"ghost",size:"sm",onClick:()=>N("all"),children:["All (",t.length,")"]}),(0,r.jsxs)(l.zx,{variant:"claude"===w?"primary":"ghost",size:"sm",onClick:()=>N("claude"),children:["Claude (",t.filter(e=>e.toLowerCase().includes("claude")).length,")"]}),(0,r.jsxs)(l.zx,{variant:"codex"===w?"primary":"ghost",size:"sm",onClick:()=>N("codex"),children:["Codex (",t.filter(e=>e.toLowerCase().includes("codex")).length,")"]}),(0,r.jsxs)(l.zx,{variant:"gemini"===w?"primary":"ghost",size:"sm",onClick:()=>N("gemini"),children:["Gemini (",t.filter(e=>e.toLowerCase().includes("gemini")).length,")"]})]})]})}),(0,r.jsxs)(l.aY,{children:[h&&0===t.length&&r.jsx("div",{className:"text-center py-4",children:r.jsx("div",{className:"inline-block animate-spin rounded-full h-6 w-6 border-4 border-gray-300 border-t-blue-600"})}),p&&r.jsx("div",{className:"p-3 bg-red-50 border border-red-200 rounded text-sm text-red-800",children:p}),!h&&0===$.length&&!p&&r.jsx("p",{className:"text-sm text-gray-600 text-center py-4",children:"all"===w?"No log files found":`No ${w} log files found`}),$.length>0&&r.jsx("div",{className:"space-y-2",children:$.map(e=>r.jsx("button",{onClick:()=>M(e),className:`w-full text-left px-3 py-2 rounded text-sm font-mono transition-colors ${d===e?"bg-blue-50 text-blue-700 border border-blue-200":"hover:bg-gray-50 border border-transparent"}`,children:e},e))})]})]}),d&&(0,r.jsxs)(l.Zb,{padding:"md",children:[r.jsx(l.Ol,{children:(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx(l.ll,{className:"font-mono text-base",children:d}),(0,r.jsxs)("div",{className:"flex gap-2",children:[r.jsx(l.zx,{variant:"ghost",size:"sm",onClick:E,disabled:!d||k,title:"Copy sanitized log to clipboard",children:k?"Exporting...":"Export"}),r.jsx(l.zx,{variant:"ghost",size:"sm",onClick:()=>{u(null),m(null),y(""),j(0)},children:"Close"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"relative flex-1",children:[r.jsx("input",{type:"text",value:b,onChange:e=>y(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.shiftKey?D():A())},placeholder:"Search in log file...",className:"input w-full pr-20"}),T.length>0&&(0,r.jsxs)("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-gray-500",children:[v+1," / ",T.length]})]}),T.length>0&&(0,r.jsxs)("div",{className:"flex gap-1",children:[r.jsx(l.zx,{variant:"ghost",size:"sm",onClick:D,disabled:0===T.length,title:"Previous match (Shift+Enter)",children:"↑"}),r.jsx(l.zx,{variant:"ghost",size:"sm",onClick:A,disabled:0===T.length,title:"Next match (Enter)",children:"↓"})]})]})]})}),(0,r.jsxs)(l.aY,{children:[h&&r.jsx("div",{className:"text-center py-8",children:r.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"})}),!h&&x&&r.jsx("div",{className:"bg-gray-900 text-gray-100 rounded p-4 overflow-x-auto max-h-[500px] scrollbar-thin",children:b&&T.length>0?r.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap",dangerouslySetInnerHTML:{__html:I||""}}):r.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap",children:x})}),!h&&b&&0===T.length&&x&&(0,r.jsxs)("div",{className:"text-center py-4 text-sm text-gray-500",children:['No matches found for "',b,'"']})]})]}),r.jsx(n.Ix,{toasts:S,onClose:z})]})}},15470:(e,t,a)=>{a.d(t,{R:()=>x});var r=a(10326),s=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),r=e.description.toLowerCase().includes(a);return t||r})})).filter(e=>e.commands.length>0)}function o({groups:e,onSelect:t,highlightedIndex:a=-1,className:s=""}){let l=0;return 0===e.length?r.jsx("div",{className:`text-sm text-gray-500 p-4 text-center ${s}`,children:"No commands available"}):r.jsx("div",{className:`overflow-y-auto ${s}`,children:e.map(e=>(0,r.jsxs)("div",{className:"mb-2",children:[r.jsx("div",{className:"px-3 py-1.5 text-xs font-semibold text-gray-500 uppercase tracking-wider bg-gray-50",children:e.label}),r.jsx("div",{children:e.commands.map(e=>{let s=l;l++;let n=s===a;return(0,r.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,r.jsxs)("span",{className:"text-blue-600 font-mono text-sm flex-shrink-0",children:["/",e.name]}),r.jsx("span",{className:"text-gray-600 text-sm truncate",children:e.description})]},e.name)})})]},e.category))})}function i({isOpen:e,groups:t,onSelect:a,onClose:l,isMobile:i=!1,position:c,onFreeInput:d}){let[u,x]=(0,s.useState)(""),[m,h]=(0,s.useState)(0),g=(0,s.useRef)(null),p=(0,s.useMemo)(()=>n(t,u),[t,u]),f=(0,s.useMemo)(()=>p.flatMap(e=>e.commands),[p]),b=(0,s.useCallback)(e=>{a(e),l()},[a,l]);return((0,s.useCallback)(t=>{if(e)switch(t.key){case"Escape":t.preventDefault(),l();break;case"ArrowDown":t.preventDefault(),h(e=>Math.min(e+1,f.length-1));break;case"ArrowUp":t.preventDefault(),h(e=>Math.max(e-1,0));break;case"Enter":t.preventDefault(),f[m]&&b(f[m])}},[e,f,m,l,b]),e)?i?(0,r.jsxs)(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:l,"aria-hidden":"true"}),(0,r.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,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200",children:[r.jsx("h2",{className:"text-lg font-semibold",children:"Commands"}),r.jsx("button",{type:"button",onClick:l,"aria-label":"Close",className:"p-2 rounded-full hover:bg-gray-100",children:r.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),r.jsx("div",{className:"px-4 py-2 border-b border-gray-100",children:r.jsx("input",{ref:g,type:"text",value:u,onChange:e=>x(e.target.value),placeholder:"Search commands...",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"})}),d&&(0,r.jsxs)("button",{type:"button","data-testid":"free-input-button",onClick:()=>d(u),className:"w-full px-4 py-3 text-left border-b border-gray-100 flex items-center gap-2 hover:bg-blue-50 transition-colors",children:[r.jsx("span",{className:"text-blue-600",children:r.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.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"})})}),r.jsx("span",{className:"text-gray-600",children:"Enter custom command..."})]}),r.jsx(o,{groups:p,onSelect:b,highlightedIndex:m,className:"flex-1 overflow-y-auto pb-20"})]})]}):(0,r.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:[r.jsx("div",{className:"px-3 py-2 border-b border-gray-100",children:r.jsx("input",{ref:g,type:"text",value:u,onChange:e=>x(e.target.value),placeholder:"Search commands...",className:"w-full px-3 py-1.5 text-sm border border-gray-300 rounded focus:outline-none focus:ring-1 focus:ring-blue-500"})}),d&&(0,r.jsxs)("button",{type:"button","data-testid":"free-input-button",onClick:()=>d(u),className:"w-full px-3 py-2 text-left border-b border-gray-100 flex items-center gap-2 hover:bg-blue-50 transition-colors text-sm",children:[r.jsx("span",{className:"text-blue-600",children:r.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"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"})})}),r.jsx("span",{className:"text-gray-600",children:"Enter custom command..."})]}),r.jsx(o,{groups:p,onSelect:b,highlightedIndex:m,className:"flex-1 overflow-y-auto"}),(0,r.jsxs)("div",{className:"px-3 py-1.5 border-t border-gray-100 text-xs text-gray-400 flex gap-3",children:[(0,r.jsxs)("span",{children:[r.jsx("kbd",{className:"px-1 py-0.5 bg-gray-100 rounded",children:"Enter"})," select"]}),(0,r.jsxs)("span",{children:[r.jsx("kbd",{className:"px-1 py-0.5 bg-gray-100 rounded",children:"Esc"})," close"]})]})]}):null}function c({worktreeId:e,cliToolId:t,disabled:a=!1,onInterrupt:l}){let[n,o]=(0,s.useState)(!1),i=(0,s.useRef)(0),c=(0,s.useCallback)(async()=>{let a=Date.now();if(!(a-i.current<1e3)){i.current=a,o(!0);try{let a=await fetch(`/api/worktrees/${e}/interrupt`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cliToolId:t})});if(a.ok)l?.();else{let e=await a.json().catch(()=>({}));console.error("[InterruptButton] Failed to send interrupt:",e.error||a.statusText)}}catch(e){console.error("[InterruptButton] Error sending interrupt:",e)}finally{o(!1)}}},[e,t,l]);return r.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,r.jsxs)("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.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"})]}):r.jsx(d,{})})}function d(){return r.jsx("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24",children:r.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}var u=a(2982);function x({worktreeId:e,onMessageSent:t,cliToolId:a,isSessionRunning:o=!1}){let[d,x]=(0,s.useState)(""),[m,h]=(0,s.useState)(!1),[g,p]=(0,s.useState)(null),[f,b]=(0,s.useState)(!1),[y,v]=(0,s.useState)(!1),[j,w]=(0,s.useState)(!1),N=(0,s.useRef)(null),k=(0,s.useRef)(null),C=(0,s.useRef)(!1),S=(0,s.useRef)(null),L=(0,u.d)(),{groups:z}=function(e,t){let[a,r]=(0,s.useState)([]),[o,i]=(0,s.useState)(!0),[c,d]=(0,s.useState)(null),[u,x]=(0,s.useState)(""),[m,h]=(0,s.useState)(t||"claude"),g=(0,s.useCallback)(async()=>{try{i(!0),d(null);let a=e?`/api/worktrees/${e}/slash-commands`:"/api/slash-commands";t&&(a+=`?cliTool=${t}`);let s=await fetch(a);if(!s.ok)throw Error(`HTTP error ${s.status}`);let l=await s.json();r(l.groups),h(l.cliTool||t||"claude")}catch(e){d((0,l.zG)(e)),r([])}finally{i(!1)}},[e,t]),p=(0,s.useMemo)(()=>a.flatMap(e=>e.commands),[a]),f=(0,s.useMemo)(()=>n(a,u),[a,u]);return{groups:a,filteredGroups:f,allCommands:p,loading:o,error:c,filter:u,setFilter:x,refresh:(0,s.useCallback)(()=>{g()},[g]),cliTool:m}}(e,a),$=async()=>{if(!f&&d.trim()&&!m)try{h(!0),p(null);let r=a||"claude";await l.Iv.sendMessage(e,d.trim(),r),x(""),w(!1),t?.(r)}catch(e){p((0,l.zG)(e))}finally{h(!1)}},M=async e=>{e.preventDefault(),await $()},E=()=>{v(!1),w(!1),N.current?.focus()};return(0,r.jsxs)("div",{ref:S,className:"space-y-2 relative",children:[g&&r.jsx("div",{className:"p-2 bg-red-50 border border-red-200 rounded text-sm text-red-800",children:g}),(0,r.jsxs)("form",{onSubmit:M,className:"flex items-end gap-2 bg-white border border-gray-300 rounded-lg px-4 py-2 focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500",children:[L&&r.jsx("button",{type:"button",onClick:()=>{j&&w(!1),v(!0)},className:"flex-shrink-0 p-2 text-gray-500 hover:text-blue-600 hover:bg-blue-50 rounded-full transition-colors","aria-label":"Show slash commands","data-testid":"mobile-command-button",children:r.jsx("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})})}),r.jsx("textarea",{ref:N,value:d,onChange:e=>{let t=e.target.value;if(x(t),""===t){w(!1),v(!1);return}j||("/"===t||t.startsWith("/")&&!t.includes(" ")?v(!0):v(!1))},onKeyDown:e=>{let{keyCode:t}=e.nativeEvent;if(229!==t){if("Escape"===e.key&&y){e.preventDefault(),E();return}if(C.current&&"Enter"===e.key){C.current=!1;return}if("Enter"===e.key&&!f&&(!y||j)){if(L)return;e.shiftKey||(e.preventDefault(),$())}}},onCompositionStart:()=>{b(!0),C.current=!1,k.current&&clearTimeout(k.current)},onCompositionEnd:()=>{b(!1),C.current=!0,k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{C.current=!1},300)},placeholder:L?"Type your message...":"Type your message... (/ for commands, Shift+Enter for line break)",disabled:m,rows:1,className:"flex-1 outline-none bg-transparent resize-none py-1 overflow-y-auto scrollbar-thin",style:{minHeight:"24px",maxHeight:"160px"}}),r.jsx(c,{worktreeId:e,cliToolId:a||"claude",disabled:!o}),r.jsx("button",{type:"submit",disabled:!d.trim()||m,className:"flex-shrink-0 p-2 text-blue-600 hover:bg-blue-50 rounded-full transition-colors disabled:text-gray-300 disabled:hover:bg-transparent","aria-label":"Send message",children:m?(0,r.jsxs)("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.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"})]}):r.jsx("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})})})]}),r.jsx(i,{isOpen:y,groups:z,onSelect:e=>{x(`/${e.name} `),v(!1),N.current?.focus()},onClose:E,isMobile:L,onFreeInput:e=>{v(!1),w(!0),x(e?`/${e}`:"/"),setTimeout(()=>{N.current?.focus()},50)}})]})}},61421:(e,t,a)=>{a.d(t,{F4:()=>s,Ie:()=>n,xh:()=>l});let r={idle:"bg-gray-500",ready:"bg-green-500",spinner:"border-blue-500",waiting:"bg-yellow-500",error:"bg-red-500"},s={idle:{className:r.idle,label:"Idle",type:"dot"},ready:{className:r.ready,label:"Ready",type:"dot"},running:{className:r.spinner,label:"Running",type:"spinner"},waiting:{className:r.waiting,label:"Waiting for response",type:"dot"},generating:{className:r.spinner,label:"Generating",type:"spinner"}},l={idle:{className:r.idle,label:"Idle",type:"dot"},ready:{className:r.ready,label:"Ready",type:"dot"},running:{className:r.spinner,label:"Running",type:"spinner"},waiting:{className:r.waiting,label:"Waiting for response",type:"dot"},error:{className:r.error,label:"Error",type:"dot"}},n={idle:{className:r.idle,label:"Idle - No active session",type:"dot"},ready:{className:r.ready,label:"Ready - Waiting for input",type:"dot"},running:{className:r.spinner,label:"Running - Processing",type:"spinner"},waiting:{className:r.waiting,label:"Waiting - User input required",type:"dot"},error:{className:r.error,label:"Error",type:"dot"}}},22202:(e,t,a)=>{a.d(t,{k:()=>r});let r={DROPDOWN:10,SIDEBAR:30,MODAL:50,MAXIMIZED_EDITOR:55,TOAST:60,CONTEXT_MENU:70}},2982:(e,t,a)=>{a.d(t,{G:()=>s,d:()=>l});var r=a(17577);let s=768;function l(e={}){let{breakpoint:t=s}=e,[a,l]=(0,r.useState)(!1);return a}},2491:(e,t,a)=>{a.d(t,{Ds:()=>l,tK:()=>r,ts:()=>n});let r=["claude","codex","gemini","vibe-local"],s={claude:"Claude",codex:"Codex",gemini:"Gemini","vibe-local":"Vibe Local"};function l(e){return s[e]??e}function n(e,t="Assistant"){return e&&r.includes(e)?l(e):t}},91515:(e,t,a)=>{a.d(t,{v:()=>s});let r=/\x1b\[[0-9;]*[a-zA-Z]|\x1b\][^\x07]*\x07|\[[0-9;]*m/g;async function s(e){if(!e||0===e.trim().length)return;let t=e.replace(r,"");await navigator.clipboard.writeText(t)}},41593:(e,t,a)=>{a.d(t,{G:()=>n});var r=a(27808),s=a(18811);let l={en:s._,ja:r.ja};function n(e){return l[e]??s._}},77465:(e,t,a)=>{a.d(t,{Fq:()=>r}),a(2491);let r=["claude","codex"]},51223:(e,t,a)=>{function r(e,t){let a=null;return(...r)=>{a&&clearTimeout(a),a=setTimeout(()=>{e(...r),a=null},t)}}function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function l(e){let t=new Set;for(let a of e){t.add(a);let e=a.split("/"),r="";for(let a=0;a<e.length-1;a++)r=r?`${r}/${e[a]}`:e[a],t.add(r)}return t}function n(e,t=30){return e.length<=t?e:`${e.substring(0,t-3)}...`}function o(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}a.d(t,{Ds:()=>r,Ps:()=>l,Xv:()=>o,aS:()=>n,hr:()=>s})},18421:(e,t,a)=>{a.d(t,{He:()=>s,I_:()=>l});var r=a(77465);function s(e){return e?e.isWaitingForResponse?"waiting":e.isProcessing?"running":e.isRunning?"ready":"idle":"idle"}function l(e){let t=!!e.lastAssistantMessageAt&&(!e.lastViewedAt||new Date(e.lastAssistantMessageAt)>new Date(e.lastViewedAt)),a=e.selectedAgents??r.Fq,l={};for(let t of a)l[t]=s(e.sessionStatusByCli?.[t]);return{id:e.id,name:e.name,repositoryName:e.repositoryName,status:"idle",hasUnread:t,lastActivity:e.updatedAt,description:e.description,cliStatus:l}}},63601:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var r=a(66621);let s=e=>[{type:"image/png",sizes:"180x180",url:(0,r.fillMetadataSegment)(".",e.params,"apple-icon.png")+"?31a89e65aa4ac65b"}]},71150:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var r=a(66621);let s=e=>[{type:"image/png",sizes:"32x32",url:(0,r.fillMetadataSegment)(".",e.params,"icon.png")+"?32d9127ba30ee286"}]}};
35
+ `,role:"main",children:e})]})})},28676:(e,t,a)=>{a.d(t,{u:()=>o});var r=a(10326),s=a(17577),l=a(60962),n=a(22202);function o({isOpen:e,onClose:t,title:a,children:o,size:i="lg",showCloseButton:c=!0,disableClose:d=!1}){let u=(0,s.useRef)(null);return e?(0,l.createPortal)((0,r.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:n.k.MODAL},children:[r.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:d?void 0:t}),r.jsx("div",{className:"relative flex min-h-full items-center justify-center p-2 sm:p-4",children:(0,r.jsxs)("div",{ref:u,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||c)&&(0,r.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:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold text-gray-900 truncate pr-2",children:a}),c&&r.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 transition-colors flex-shrink-0",children:r.jsx("svg",{className:"w-5 h-5 sm:w-6 sm:h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),r.jsx("div",{className:"px-4 sm:px-6 py-3 sm:py-4 overflow-y-auto flex-1 min-h-0",children:o})]})})]}),document.body):null}},77758:(e,t,a)=>{a.d(t,{Ct:()=>c,zx:()=>s,Zb:()=>l,aY:()=>i,Ol:()=>n,ll:()=>o,u_:()=>d.u});var r=a(10326);function s({variant:e="primary",size:t="md",fullWidth:a=!1,loading:s=!1,disabled:l,className:n="",children:o,...i}){let c=["btn",{primary:"btn-primary",secondary:"btn-secondary",danger:"btn-danger",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500"}[e],{sm:"btn-sm",md:"",lg:"btn-lg"}[t],a?"w-full":"",l||s?"opacity-50 cursor-not-allowed":"",n].filter(Boolean).join(" ");return(0,r.jsxs)("button",{className:c,disabled:l||s,...i,children:[s&&(0,r.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:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),o]})}function l({hover:e=!1,padding:t="md",className:a="",children:s,...l}){let n=["card",e?"card-hover":"",{none:"",sm:"p-3",md:"p-4",lg:"p-6"}[t],a].filter(Boolean).join(" ");return r.jsx("div",{className:n,...l,children:s})}function n({className:e="",children:t,...a}){return r.jsx("div",{className:`mb-3 ${e}`,...a,children:t})}function o({className:e="",children:t,...a}){return r.jsx("h3",{className:`text-lg font-semibold text-gray-900 ${e}`,...a,children:t})}function i({className:e="",children:t,...a}){return r.jsx("div",{className:e,...a,children:t})}function c({variant:e="gray",dot:t=!1,className:a="",children:s,...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,r.jsxs)("span",{className:n,...l,children:[t&&r.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"}),s]})}a(17577);var d=a(28676)},11867:(e,t,a)=>{a.d(t,{n:()=>d});var r=a(10326),s=a(17577),l=a(77758),n=a(11865),o=a(73002),i=a(91515),c=a(51223);function d({worktreeId:e}){let[t,a]=(0,s.useState)([]),[d,u]=(0,s.useState)(null),[x,m]=(0,s.useState)(null),[h,p]=(0,s.useState)(!0),[g,f]=(0,s.useState)(null),[b,y]=(0,s.useState)(""),[v,j]=(0,s.useState)(0),[w,N]=(0,s.useState)("all"),[k,C]=(0,s.useState)(!1),{toasts:S,showToast:L,removeToast:z}=(0,n.pm)(),$=(0,s.useMemo)(()=>"all"===w?t:t.filter(e=>e.toLowerCase().includes(w)),[t,w]),M=async t=>{try{p(!0),f(null);let a=await o.Iv.getLogFile(e,t);m(a.content),u(t),y(""),j(0)}catch(e){f((0,o.zG)(e))}finally{p(!1)}},E=(0,s.useCallback)(async()=>{if(d)try{C(!0);let t=await o.Iv.getLogFile(e,d,{sanitize:!0});await (0,i.v)(t.content),L("Log copied to clipboard (sanitized)","success")}catch(e){L(`Failed to export log: ${(0,o.zG)(e)}`,"error")}finally{C(!1)}},[e,d,L]),T=(0,s.useMemo)(()=>{let e;if(!b||!x)return[];let t=RegExp((0,c.hr)(b),"gi"),a=[];for(;null!==(e=t.exec(x));)a.push({index:e.index,length:e[0].length});return a},[b,x]),A=()=>{T.length>0&&j(e=>(e+1)%T.length)},D=()=>{T.length>0&&j(e=>(e-1+T.length)%T.length)},I=(0,s.useMemo)(()=>{if(!x||!b||0===T.length)return x;let e="",t=0;return T.forEach((a,r)=>{e+=(0,c.Xv)(x.substring(t,a.index));let s=x.substring(a.index,a.index+a.length),l=r===v;e+=`<mark class="${l?"bg-yellow-400 text-black":"bg-yellow-200 text-black"}" data-match-index="${r}">${(0,c.Xv)(s)}</mark>`,t=a.index+a.length}),e+=(0,c.Xv)(x.substring(t))},[x,b,T,v]);return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)(l.Zb,{padding:"md",children:[r.jsx(l.Ol,{children:(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx(l.ll,{children:"Log Files"}),r.jsx(l.Ct,{variant:"gray",children:$.length})]}),(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,r.jsxs)(l.zx,{variant:"all"===w?"primary":"ghost",size:"sm",onClick:()=>N("all"),children:["All (",t.length,")"]}),(0,r.jsxs)(l.zx,{variant:"claude"===w?"primary":"ghost",size:"sm",onClick:()=>N("claude"),children:["Claude (",t.filter(e=>e.toLowerCase().includes("claude")).length,")"]}),(0,r.jsxs)(l.zx,{variant:"codex"===w?"primary":"ghost",size:"sm",onClick:()=>N("codex"),children:["Codex (",t.filter(e=>e.toLowerCase().includes("codex")).length,")"]}),(0,r.jsxs)(l.zx,{variant:"gemini"===w?"primary":"ghost",size:"sm",onClick:()=>N("gemini"),children:["Gemini (",t.filter(e=>e.toLowerCase().includes("gemini")).length,")"]})]})]})}),(0,r.jsxs)(l.aY,{children:[h&&0===t.length&&r.jsx("div",{className:"text-center py-4",children:r.jsx("div",{className:"inline-block animate-spin rounded-full h-6 w-6 border-4 border-gray-300 border-t-blue-600"})}),g&&r.jsx("div",{className:"p-3 bg-red-50 border border-red-200 rounded text-sm text-red-800",children:g}),!h&&0===$.length&&!g&&r.jsx("p",{className:"text-sm text-gray-600 text-center py-4",children:"all"===w?"No log files found":`No ${w} log files found`}),$.length>0&&r.jsx("div",{className:"space-y-2",children:$.map(e=>r.jsx("button",{onClick:()=>M(e),className:`w-full text-left px-3 py-2 rounded text-sm font-mono transition-colors ${d===e?"bg-blue-50 text-blue-700 border border-blue-200":"hover:bg-gray-50 border border-transparent"}`,children:e},e))})]})]}),d&&(0,r.jsxs)(l.Zb,{padding:"md",children:[r.jsx(l.Ol,{children:(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx(l.ll,{className:"font-mono text-base",children:d}),(0,r.jsxs)("div",{className:"flex gap-2",children:[r.jsx(l.zx,{variant:"ghost",size:"sm",onClick:E,disabled:!d||k,title:"Copy sanitized log to clipboard",children:k?"Exporting...":"Export"}),r.jsx(l.zx,{variant:"ghost",size:"sm",onClick:()=>{u(null),m(null),y(""),j(0)},children:"Close"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"relative flex-1",children:[r.jsx("input",{type:"text",value:b,onChange:e=>y(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.shiftKey?D():A())},placeholder:"Search in log file...",className:"input w-full pr-20"}),T.length>0&&(0,r.jsxs)("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-gray-500",children:[v+1," / ",T.length]})]}),T.length>0&&(0,r.jsxs)("div",{className:"flex gap-1",children:[r.jsx(l.zx,{variant:"ghost",size:"sm",onClick:D,disabled:0===T.length,title:"Previous match (Shift+Enter)",children:"↑"}),r.jsx(l.zx,{variant:"ghost",size:"sm",onClick:A,disabled:0===T.length,title:"Next match (Enter)",children:"↓"})]})]})]})}),(0,r.jsxs)(l.aY,{children:[h&&r.jsx("div",{className:"text-center py-8",children:r.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"})}),!h&&x&&r.jsx("div",{className:"bg-gray-900 text-gray-100 rounded p-4 overflow-x-auto max-h-[500px] scrollbar-thin",children:b&&T.length>0?r.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap",dangerouslySetInnerHTML:{__html:I||""}}):r.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap",children:x})}),!h&&b&&0===T.length&&x&&(0,r.jsxs)("div",{className:"text-center py-4 text-sm text-gray-500",children:['No matches found for "',b,'"']})]})]}),r.jsx(n.Ix,{toasts:S,onClose:z})]})}},15470:(e,t,a)=>{a.d(t,{R:()=>x});var r=a(10326),s=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),r=e.description.toLowerCase().includes(a);return t||r})})).filter(e=>e.commands.length>0)}function o({groups:e,onSelect:t,highlightedIndex:a=-1,className:s=""}){let l=0;return 0===e.length?r.jsx("div",{className:`text-sm text-gray-500 p-4 text-center ${s}`,children:"No commands available"}):r.jsx("div",{className:`overflow-y-auto ${s}`,children:e.map(e=>(0,r.jsxs)("div",{className:"mb-2",children:[r.jsx("div",{className:"px-3 py-1.5 text-xs font-semibold text-gray-500 uppercase tracking-wider bg-gray-50",children:e.label}),r.jsx("div",{children:e.commands.map(e=>{let s=l;l++;let n=s===a;return(0,r.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,r.jsxs)("span",{className:"text-blue-600 font-mono text-sm flex-shrink-0",children:["/",e.name]}),r.jsx("span",{className:"text-gray-600 text-sm truncate",children:e.description})]},e.name)})})]},e.category))})}function i({isOpen:e,groups:t,onSelect:a,onClose:l,isMobile:i=!1,position:c,onFreeInput:d}){let[u,x]=(0,s.useState)(""),[m,h]=(0,s.useState)(0),p=(0,s.useRef)(null),g=(0,s.useMemo)(()=>n(t,u),[t,u]),f=(0,s.useMemo)(()=>g.flatMap(e=>e.commands),[g]),b=(0,s.useCallback)(e=>{a(e),l()},[a,l]);return((0,s.useCallback)(t=>{if(e)switch(t.key){case"Escape":t.preventDefault(),l();break;case"ArrowDown":t.preventDefault(),h(e=>Math.min(e+1,f.length-1));break;case"ArrowUp":t.preventDefault(),h(e=>Math.max(e-1,0));break;case"Enter":t.preventDefault(),f[m]&&b(f[m])}},[e,f,m,l,b]),e)?i?(0,r.jsxs)(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:l,"aria-hidden":"true"}),(0,r.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,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200",children:[r.jsx("h2",{className:"text-lg font-semibold",children:"Commands"}),r.jsx("button",{type:"button",onClick:l,"aria-label":"Close",className:"p-2 rounded-full hover:bg-gray-100",children:r.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),r.jsx("div",{className:"px-4 py-2 border-b border-gray-100",children:r.jsx("input",{ref:p,type:"text",value:u,onChange:e=>x(e.target.value),placeholder:"Search commands...",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"})}),d&&(0,r.jsxs)("button",{type:"button","data-testid":"free-input-button",onClick:()=>d(u),className:"w-full px-4 py-3 text-left border-b border-gray-100 flex items-center gap-2 hover:bg-blue-50 transition-colors",children:[r.jsx("span",{className:"text-blue-600",children:r.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.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"})})}),r.jsx("span",{className:"text-gray-600",children:"Enter custom command..."})]}),r.jsx(o,{groups:g,onSelect:b,highlightedIndex:m,className:"flex-1 overflow-y-auto pb-20"})]})]}):(0,r.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:[r.jsx("div",{className:"px-3 py-2 border-b border-gray-100",children:r.jsx("input",{ref:p,type:"text",value:u,onChange:e=>x(e.target.value),placeholder:"Search commands...",className:"w-full px-3 py-1.5 text-sm border border-gray-300 rounded focus:outline-none focus:ring-1 focus:ring-blue-500"})}),d&&(0,r.jsxs)("button",{type:"button","data-testid":"free-input-button",onClick:()=>d(u),className:"w-full px-3 py-2 text-left border-b border-gray-100 flex items-center gap-2 hover:bg-blue-50 transition-colors text-sm",children:[r.jsx("span",{className:"text-blue-600",children:r.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"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"})})}),r.jsx("span",{className:"text-gray-600",children:"Enter custom command..."})]}),r.jsx(o,{groups:g,onSelect:b,highlightedIndex:m,className:"flex-1 overflow-y-auto"}),(0,r.jsxs)("div",{className:"px-3 py-1.5 border-t border-gray-100 text-xs text-gray-400 flex gap-3",children:[(0,r.jsxs)("span",{children:[r.jsx("kbd",{className:"px-1 py-0.5 bg-gray-100 rounded",children:"Enter"})," select"]}),(0,r.jsxs)("span",{children:[r.jsx("kbd",{className:"px-1 py-0.5 bg-gray-100 rounded",children:"Esc"})," close"]})]})]}):null}function c({worktreeId:e,cliToolId:t,disabled:a=!1,onInterrupt:l}){let[n,o]=(0,s.useState)(!1),i=(0,s.useRef)(0),c=(0,s.useCallback)(async()=>{let a=Date.now();if(!(a-i.current<1e3)){i.current=a,o(!0);try{let a=await fetch(`/api/worktrees/${e}/interrupt`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cliToolId:t})});if(a.ok)l?.();else{let e=await a.json().catch(()=>({}));console.error("[InterruptButton] Failed to send interrupt:",e.error||a.statusText)}}catch(e){console.error("[InterruptButton] Error sending interrupt:",e)}finally{o(!1)}}},[e,t,l]);return r.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,r.jsxs)("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.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"})]}):r.jsx(d,{})})}function d(){return r.jsx("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24",children:r.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}var u=a(2982);function x({worktreeId:e,onMessageSent:t,cliToolId:a,isSessionRunning:o=!1}){let[d,x]=(0,s.useState)(""),[m,h]=(0,s.useState)(!1),[p,g]=(0,s.useState)(null),[f,b]=(0,s.useState)(!1),[y,v]=(0,s.useState)(!1),[j,w]=(0,s.useState)(!1),N=(0,s.useRef)(null),k=(0,s.useRef)(null),C=(0,s.useRef)(!1),S=(0,s.useRef)(null),L=(0,u.d)(),{groups:z}=function(e,t){let[a,r]=(0,s.useState)([]),[o,i]=(0,s.useState)(!0),[c,d]=(0,s.useState)(null),[u,x]=(0,s.useState)(""),[m,h]=(0,s.useState)(t||"claude"),p=(0,s.useCallback)(async()=>{try{i(!0),d(null);let a=e?`/api/worktrees/${e}/slash-commands`:"/api/slash-commands";t&&(a+=`?cliTool=${t}`);let s=await fetch(a);if(!s.ok)throw Error(`HTTP error ${s.status}`);let l=await s.json();r(l.groups),h(l.cliTool||t||"claude")}catch(e){d((0,l.zG)(e)),r([])}finally{i(!1)}},[e,t]),g=(0,s.useMemo)(()=>a.flatMap(e=>e.commands),[a]),f=(0,s.useMemo)(()=>n(a,u),[a,u]);return{groups:a,filteredGroups:f,allCommands:g,loading:o,error:c,filter:u,setFilter:x,refresh:(0,s.useCallback)(()=>{p()},[p]),cliTool:m}}(e,a),$=async()=>{if(!f&&d.trim()&&!m)try{h(!0),g(null);let r=a||"claude";await l.Iv.sendMessage(e,d.trim(),r),x(""),w(!1),t?.(r)}catch(e){g((0,l.zG)(e))}finally{h(!1)}},M=async e=>{e.preventDefault(),await $()},E=()=>{v(!1),w(!1),N.current?.focus()};return(0,r.jsxs)("div",{ref:S,className:"space-y-2 relative",children:[p&&r.jsx("div",{className:"p-2 bg-red-50 border border-red-200 rounded text-sm text-red-800",children:p}),(0,r.jsxs)("form",{onSubmit:M,className:"flex items-end gap-2 bg-white border border-gray-300 rounded-lg px-4 py-2 focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500",children:[L&&r.jsx("button",{type:"button",onClick:()=>{j&&w(!1),v(!0)},className:"flex-shrink-0 p-2 text-gray-500 hover:text-blue-600 hover:bg-blue-50 rounded-full transition-colors","aria-label":"Show slash commands","data-testid":"mobile-command-button",children:r.jsx("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})})}),r.jsx("textarea",{ref:N,value:d,onChange:e=>{let t=e.target.value;if(x(t),""===t){w(!1),v(!1);return}j||("/"===t||t.startsWith("/")&&!t.includes(" ")?v(!0):v(!1))},onKeyDown:e=>{let{keyCode:t}=e.nativeEvent;if(229!==t){if("Escape"===e.key&&y){e.preventDefault(),E();return}if(C.current&&"Enter"===e.key){C.current=!1;return}if("Enter"===e.key&&!f&&(!y||j)){if(L)return;e.shiftKey||(e.preventDefault(),$())}}},onCompositionStart:()=>{b(!0),C.current=!1,k.current&&clearTimeout(k.current)},onCompositionEnd:()=>{b(!1),C.current=!0,k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{C.current=!1},300)},placeholder:L?"Type your message...":"Type your message... (/ for commands, Shift+Enter for line break)",disabled:m,rows:1,className:"flex-1 outline-none bg-transparent resize-none py-1 overflow-y-auto scrollbar-thin",style:{minHeight:"24px",maxHeight:"160px"}}),r.jsx(c,{worktreeId:e,cliToolId:a||"claude",disabled:!o}),r.jsx("button",{type:"submit",disabled:!d.trim()||m,className:"flex-shrink-0 p-2 text-blue-600 hover:bg-blue-50 rounded-full transition-colors disabled:text-gray-300 disabled:hover:bg-transparent","aria-label":"Send message",children:m?(0,r.jsxs)("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.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"})]}):r.jsx("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})})})]}),r.jsx(i,{isOpen:y,groups:z,onSelect:e=>{x(`/${e.name} `),v(!1),N.current?.focus()},onClose:E,isMobile:L,onFreeInput:e=>{v(!1),w(!0),x(e?`/${e}`:"/"),setTimeout(()=>{N.current?.focus()},50)}})]})}},61421:(e,t,a)=>{a.d(t,{F4:()=>s,Ie:()=>n,xh:()=>l});let r={idle:"bg-gray-500",ready:"bg-green-500",spinner:"border-blue-500",waiting:"bg-yellow-500",error:"bg-red-500"},s={idle:{className:r.idle,label:"Idle",type:"dot"},ready:{className:r.ready,label:"Ready",type:"dot"},running:{className:r.spinner,label:"Running",type:"spinner"},waiting:{className:r.waiting,label:"Waiting for response",type:"dot"},generating:{className:r.spinner,label:"Generating",type:"spinner"}},l={idle:{className:r.idle,label:"Idle",type:"dot"},ready:{className:r.ready,label:"Ready",type:"dot"},running:{className:r.spinner,label:"Running",type:"spinner"},waiting:{className:r.waiting,label:"Waiting for response",type:"dot"},error:{className:r.error,label:"Error",type:"dot"}},n={idle:{className:r.idle,label:"Idle - No active session",type:"dot"},ready:{className:r.ready,label:"Ready - Waiting for input",type:"dot"},running:{className:r.spinner,label:"Running - Processing",type:"spinner"},waiting:{className:r.waiting,label:"Waiting - User input required",type:"dot"},error:{className:r.error,label:"Error",type:"dot"}}},22202:(e,t,a)=>{a.d(t,{k:()=>r});let r={DROPDOWN:10,SIDEBAR:30,MODAL:50,MAXIMIZED_EDITOR:55,TOAST:60,CONTEXT_MENU:70}},2982:(e,t,a)=>{a.d(t,{G:()=>s,d:()=>l});var r=a(17577);let s=768;function l(e={}){let{breakpoint:t=s}=e,[a,l]=(0,r.useState)(!1);return a}},2491:(e,t,a)=>{a.d(t,{Ds:()=>l,Ho:()=>o,Ns:()=>i,tK:()=>r,ts:()=>n});let r=["claude","codex","gemini","vibe-local","opencode"],s={claude:"Claude",codex:"Codex",gemini:"Gemini","vibe-local":"Vibe Local",opencode:"OpenCode"};function l(e){return s[e]??e}function n(e,t="Assistant"){return e&&r.includes(e)?l(e):t}let o=128,i=2097152},91515:(e,t,a)=>{a.d(t,{v:()=>s});let r=/\x1b\[[0-9;]*[a-zA-Z]|\x1b\][^\x07]*\x07|\[[0-9;]*m/g;async function s(e){if(!e||0===e.trim().length)return;let t=e.replace(r,"");await navigator.clipboard.writeText(t)}},41593:(e,t,a)=>{a.d(t,{G:()=>n});var r=a(27808),s=a(18811);let l={en:s._,ja:r.ja};function n(e){return l[e]??s._}},77465:(e,t,a)=>{a.d(t,{Fq:()=>r}),a(2491);let r=["claude","codex"]},51223:(e,t,a)=>{function r(e,t){let a=null;return(...r)=>{a&&clearTimeout(a),a=setTimeout(()=>{e(...r),a=null},t)}}function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function l(e){let t=new Set;for(let a of e){t.add(a);let e=a.split("/"),r="";for(let a=0;a<e.length-1;a++)r=r?`${r}/${e[a]}`:e[a],t.add(r)}return t}function n(e,t=30){return e.length<=t?e:`${e.substring(0,t-3)}...`}function o(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}a.d(t,{Ds:()=>r,Ps:()=>l,Xv:()=>o,aS:()=>n,hr:()=>s})},18421:(e,t,a)=>{a.d(t,{He:()=>s,I_:()=>l});var r=a(77465);function s(e){return e?e.isWaitingForResponse?"waiting":e.isProcessing?"running":e.isRunning?"ready":"idle":"idle"}function l(e){let t=!!e.lastAssistantMessageAt&&(!e.lastViewedAt||new Date(e.lastAssistantMessageAt)>new Date(e.lastViewedAt)),a=e.selectedAgents??r.Fq,l={};for(let t of a)l[t]=s(e.sessionStatusByCli?.[t]);return{id:e.id,name:e.name,repositoryName:e.repositoryName,status:"idle",hasUnread:t,lastActivity:e.updatedAt,description:e.description,cliStatus:l}}},63601:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var r=a(66621);let s=e=>[{type:"image/png",sizes:"180x180",url:(0,r.fillMetadataSegment)(".",e.params,"apple-icon.png")+"?31a89e65aa4ac65b"}]},71150:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var r=a(66621);let s=e=>[{type:"image/png",sizes:"32x32",url:(0,r.fillMetadataSegment)(".",e.params,"icon.png")+"?32d9127ba30ee286"}]}};
@@ -1 +1 @@
1
- "use strict";exports.id=5795,exports.ids=[5795],exports.modules={5795:e=>{e.exports=JSON.parse('{"login":{"title":"Login","tokenLabel":"Authentication Token","tokenPlaceholder":"Paste your token here","submitButton":"Login"},"error":{"invalidToken":"Invalid token. Please try again.","lockedOut":"Too many failed attempts. Please wait before trying again.","retryAfter":"Try again in {minutes} minutes","unknownError":"An unexpected error occurred. Please try again."},"logout":{"button":"Logout"}}')}};
1
+ "use strict";exports.id=5795,exports.ids=[5795],exports.modules={5795:e=>{e.exports=JSON.parse('{"login":{"title":"Login","tokenLabel":"Authentication Token","tokenPlaceholder":"Paste your token here","submitButton":"Login","qr":{"sectionTitle":"QR Code for Mobile Access","urlLabel":"ngrok URL","urlPlaceholder":"https://xxx.ngrok-free.app","tokenLabel":"Auth Token","tokenPlaceholder":"Enter auth token","securityNotice":"Token is not sent to the server","showQrButton":"Show QR Code","hideQrButton":"Hide QR Code","qrSecurityWarning":"This QR code contains your token. Be careful of shoulder surfing.","autoLoginError":"Auto login failed","tokenExpiredOrInvalid":"Token is invalid or expired","rateLimited":"Too many login attempts. Please try again later.","httpsWarning":"Please use an HTTPS URL for security"}},"error":{"invalidToken":"Invalid token. Please try again.","lockedOut":"Too many failed attempts. Please wait before trying again.","retryAfter":"Try again in {minutes} minutes","unknownError":"An unexpected error occurred. Please try again."},"logout":{"button":"Logout"}}')}};
@@ -1 +1 @@
1
- "use strict";exports.id=6228,exports.ids=[6228],exports.modules={86228:e=>{e.exports=JSON.parse('{"title":"Schedules","executionLogs":"Execution Logs","noSchedules":"No schedules configured. Add a CMATE.md with a Schedules section.","noSchedulesTitle":"No schedules configured","noSchedulesStep1":"Switch to the Files tab","noSchedulesStep2":"Click the CMATE button in the toolbar to create CMATE.md","noSchedulesStep3":"Edit the Schedules table (Name, Cron, Message, CLI Tool, Enabled, Permission)","noSchedulesStep4":"Click CMATE again to validate","noLogs":"No execution logs yet.","status":{"running":"Running","completed":"Completed","failed":"Failed","timeout":"Timeout","cancelled":"Cancelled"},"enabled":"Enabled","disabled":"Disabled","lastRun":"Last run","cron":"Cron","exitCode":"Exit","noOutput":"(no output)","message":"Message","response":"Response","unknownSchedule":"(deleted schedule)","retry":"Retry","loading":"Loading...","notes":"Notes","logs":"Schedules","notesAndLogs":"CMATE","agentTab":"Agent","agentSettings":"Agent Settings","selectAgents":"Select 2 agents to display in the terminal header tabs.","agentSaveSuccess":"Agent settings saved.","agentSaveError":"Failed to save agent settings.","vibeLocalModel":"Ollama Model","vibeLocalModelDefault":"Default","ollamaNotAvailable":"Ollama is not running. Start Ollama to select a model.","cmateCreated":"CMATE.md created with template. Edit it to configure schedules.","cmateValidation":{"noSchedulesSection":"CMATE.md has no Schedules section.","valid":"{count} schedule(s) validated successfully.","errors":"{errorCount} validation error(s) found: {details}","failed":"Failed to process CMATE.md."}}')}};
1
+ "use strict";exports.id=6228,exports.ids=[6228],exports.modules={86228:e=>{e.exports=JSON.parse('{"title":"Schedules","executionLogs":"Execution Logs","noSchedules":"No schedules configured. Add a CMATE.md with a Schedules section.","noSchedulesTitle":"No schedules configured","noSchedulesStep1":"Switch to the Files tab","noSchedulesStep2":"Click the CMATE button in the toolbar to create CMATE.md","noSchedulesStep3":"Edit the Schedules table (Name, Cron, Message, CLI Tool, Enabled, Permission)","noSchedulesStep4":"Click CMATE again to validate","noLogs":"No execution logs yet.","status":{"running":"Running","completed":"Completed","failed":"Failed","timeout":"Timeout","cancelled":"Cancelled"},"enabled":"Enabled","disabled":"Disabled","lastRun":"Last run","cron":"Cron","exitCode":"Exit","noOutput":"(no output)","message":"Message","response":"Response","unknownSchedule":"(deleted schedule)","retry":"Retry","loading":"Loading...","notes":"Notes","logs":"Schedules","notesAndLogs":"CMATE","agentTab":"Agent","agentSettings":"Agent Settings","selectAgents":"Select 2 agents to display in the terminal header tabs.","agentSaveSuccess":"Agent settings saved.","agentSaveError":"Failed to save agent settings.","vibeLocalModel":"Ollama Model","vibeLocalModelDefault":"Default","vibeLocalContextWindow":"Context Window","vibeLocalContextWindowDefault":"Default (auto)","ollamaNotAvailable":"Ollama is not running. Start Ollama to select a model.","cmateCreated":"CMATE.md created with template. Edit it to configure schedules.","cmateValidation":{"noSchedulesSection":"CMATE.md has no Schedules section.","valid":"{count} schedule(s) validated successfully.","errors":"{errorCount} validation error(s) found: {details}","failed":"Failed to process CMATE.md."}}')}};