commandmate 0.12.1 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +157 -157
  3. package/.next/app-path-routes-manifest.json +29 -29
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +9 -9
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  9. package/.next/server/app/api/app/update-check/route.js +1 -1
  10. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  11. package/.next/server/app/api/assistant/conversation/route_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/assistant/current-output/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/assistant/messages/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/assistant/session/route_client-reference-manifest.js +1 -1
  15. package/.next/server/app/api/assistant/start/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/assistant/terminal/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/assistant/tools/route_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/daily-summary/route.js +1 -1
  22. package/.next/server/app/api/daily-summary/route.js.nft.json +1 -1
  23. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/daily-summary/status/route.js +1 -1
  25. package/.next/server/app/api/daily-summary/status/route.js.nft.json +1 -1
  26. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  29. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  32. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/repositories/[id]/todos/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  38. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  39. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/repositories/clone/route.js +1 -1
  41. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  42. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  46. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  51. package/.next/server/app/api/slash-commands/route.js +1 -1
  52. package/.next/server/app/api/slash-commands/route.js.nft.json +1 -1
  53. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  54. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/todos/route_client-reference-manifest.js +1 -1
  57. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  58. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  60. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  61. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  63. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  64. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js +1 -1
  66. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js.nft.json +1 -1
  67. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js +1 -1
  69. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js.nft.json +1 -1
  70. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/worktrees/[id]/git/branches/route.js +1 -1
  72. package/.next/server/app/api/worktrees/[id]/git/branches/route.js.nft.json +1 -1
  73. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/worktrees/[id]/git/checkout/route.js +1 -1
  75. package/.next/server/app/api/worktrees/[id]/git/checkout/route.js.nft.json +1 -1
  76. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/worktrees/[id]/git/commit/route.js +1 -1
  78. package/.next/server/app/api/worktrees/[id]/git/commit/route.js.nft.json +1 -1
  79. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/worktrees/[id]/git/diff/route.js +1 -1
  81. package/.next/server/app/api/worktrees/[id]/git/diff/route.js.nft.json +1 -1
  82. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js +1 -1
  84. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js.nft.json +1 -1
  85. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/api/worktrees/[id]/git/log/route.js +1 -1
  87. package/.next/server/app/api/worktrees/[id]/git/log/route.js.nft.json +1 -1
  88. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/worktrees/[id]/git/pull/route.js +1 -1
  90. package/.next/server/app/api/worktrees/[id]/git/pull/route.js.nft.json +1 -1
  91. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/api/worktrees/[id]/git/push/route.js +1 -1
  93. package/.next/server/app/api/worktrees/[id]/git/push/route.js.nft.json +1 -1
  94. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/api/worktrees/[id]/git/reset/route.js +1 -1
  96. package/.next/server/app/api/worktrees/[id]/git/reset/route.js.nft.json +1 -1
  97. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/worktrees/[id]/git/revert/route.js +1 -1
  99. package/.next/server/app/api/worktrees/[id]/git/revert/route.js.nft.json +1 -1
  100. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js +1 -1
  102. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js.nft.json +1 -1
  103. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/worktrees/[id]/git/stage/route.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/git/stage/route.js.nft.json +1 -1
  106. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  107. package/.next/server/app/api/worktrees/[id]/git/staged/route.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/git/staged/route.js.nft.json +1 -1
  109. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  110. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js.nft.json +1 -1
  112. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  113. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js.nft.json +1 -1
  115. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  116. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js.nft.json +1 -1
  118. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js.nft.json +1 -1
  121. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  122. package/.next/server/app/api/worktrees/[id]/git/stash/route.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/git/stash/route.js.nft.json +1 -1
  124. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  125. package/.next/server/app/api/worktrees/[id]/git/status/route.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/git/status/route.js.nft.json +1 -1
  127. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js.nft.json +1 -1
  130. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js.nft.json +1 -1
  133. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/marp-render/route.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  146. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  147. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  149. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  151. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  152. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  153. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  154. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  155. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  156. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  157. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  158. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  160. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
  161. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js.nft.json +1 -1
  162. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  164. package/.next/server/app/api/worktrees/[id]/start-polling/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  167. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  168. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  170. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  172. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  173. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  174. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  175. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  176. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  177. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  178. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  179. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  180. package/.next/server/app/page.js +1 -1
  181. package/.next/server/app/page_client-reference-manifest.js +1 -1
  182. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  183. package/.next/server/app/repositories/page.js +1 -1
  184. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  185. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  186. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  187. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  188. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  189. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  190. package/.next/server/app/worktrees/[id]/page.js +3 -3
  191. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  192. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  193. package/.next/server/app-paths-manifest.json +29 -29
  194. package/.next/server/chunks/186.js +1 -1
  195. package/.next/server/chunks/2119.js +1 -1
  196. package/.next/server/chunks/2404.js +2 -1
  197. package/.next/server/chunks/2445.js +1 -1
  198. package/.next/server/chunks/3270.js +1 -1
  199. package/.next/server/chunks/3543.js +1 -1
  200. package/.next/server/chunks/3945.js +1 -1
  201. package/.next/server/chunks/5381.js +1 -1
  202. package/.next/server/chunks/5959.js +1 -1
  203. package/.next/server/chunks/6130.js +1 -1
  204. package/.next/server/chunks/9123.js +1 -1
  205. package/.next/server/chunks/9192.js +1 -0
  206. package/.next/server/middleware-manifest.json +5 -5
  207. package/.next/server/pages/500.html +1 -1
  208. package/.next/server/server-reference-manifest.json +1 -1
  209. package/.next/static/chunks/1668-e703b8b55775844b.js +1 -0
  210. package/.next/static/chunks/{6488-624d4b6d2d4cc236.js → 6488-1a37ccee1d444c10.js} +1 -1
  211. package/.next/static/chunks/app/page-a34d26812f085b6c.js +1 -0
  212. package/.next/static/chunks/app/repositories/{page-75f0d70452c6b6c0.js → page-70d4b997492884b8.js} +1 -1
  213. package/.next/static/chunks/app/worktrees/[id]/page-f2801662a721faab.js +1 -0
  214. package/.next/trace +11 -11
  215. package/package.json +3 -2
  216. package/.next/server/chunks/5312.js +0 -1
  217. package/.next/static/chunks/1668-7484081c45a44f89.js +0 -1
  218. package/.next/static/chunks/app/page-af457ca5876ed616.js +0 -1
  219. package/.next/static/chunks/app/worktrees/[id]/page-7dd929bfc978742e.js +0 -1
  220. /package/.next/static/{ZYti9g9gICKnjtmkfvvB2 → Etea8LidpB8eWOTac-R8b}/_buildManifest.js +0 -0
  221. /package/.next/static/{ZYti9g9gICKnjtmkfvvB2 → Etea8LidpB8eWOTac-R8b}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";exports.id=3945,exports.ids=[3945],exports.modules={53945:a=>{a.exports=JSON.parse('{"sessions":{"idleAgents":"アイドル {count} 件","activeAgents":"稼働 {count} 件","title":"セッション","description":"全リポジトリの worktree セッション。","filterPlaceholder":"名前またはリポジトリで絞り込み...","filterAriaLabel":"名前またはリポジトリでセッションを絞り込む","sortByAriaLabel":"並び替え","sortAscending":"昇順に並び替え","sortDescending":"降順に並び替え","loadingAriaLabel":"セッションを読み込み中","refreshError":"セッションの更新に失敗しました: {message}","loadError":"セッションの読み込みに失敗しました: {message}","noMatching":"一致するセッションがありません。","empty":"セッションがまだありません。"},"nav":{"home":"ホーム","chat":"チャット","sessions":"セッション","repositories":"リポジトリ","repositoriesShort":"リポジトリ","review":"レビュー","reviewReport":"レビュー/レポート","more":"その他","skills":"スキル"},"repositories":{"empty":"リポジトリが登録されていません。","add":"リポジトリを追加","syncAll":"すべて同期","syncing":"同期中...","addNewTitle":"リポジトリを新規追加","localPathTab":"ローカルパス","cloneUrlTab":"クローン URL","localPathDescription":"worktree を含む git リポジトリの絶対パスを入力してください。","localPathLabel":"リポジトリパス","localPathExample":"例: /Users/username/projects/my-repo","scan":"スキャンして追加","scanning":"スキャン中...","cloneUrlDescription":"リモートリポジトリをクローンする git の URL を入力してください。","cloneUrlLabel":"クローン URL","cloneUrlHelp":"HTTPS と SSH の URL に対応しています","clone":"クローン","cloning":"クローン中...","cloneSuccess":"リポジトリをクローンしました","cloneFailed":"クローンに失敗しました","pathRequired":"リポジトリパスを入力してください","urlRequired":"クローン URL を入力してください","urlInvalid":"URL の形式が正しくありません","loading":"リポジトリを読み込み中"},"cancel":"キャンセル","send":"送信","sending":"送信中...","sendMessagePlaceholder":"メッセージを送信...","end":"終了する","ending":"終了中...","retry":"再試行","reload":"再読み込み","reconnect":"再接続","close":"閉じる","back":"戻る","menu":"メニュー","sidebar":{"open":"サイドバーを開く","close":"サイドバーを閉じる","branchNavigation":"ブランチナビゲーション","branches":"ブランチ","searchBranches":"ブランチを検索...","noBranchesFound":"ブランチが見つかりません","noBranchesAvailable":"ブランチがありません","dragToReorderGroup":"ドラッグでグループを並べ替え","switchToFlatView":"フラット表示に切り替え","switchToGroupedView":"グループ表示に切り替え"},"confirmDelete":"「{name}」を削除しますか?","favorites":{"add":"お気に入りに追加","remove":"お気に入りを解除"},"syncSuccess":"{count}件のworktreeを同期しました","syncError":"同期に失敗しました","syncAuthError":"認証エラー","syncButtonLabel":"ブランチを同期","tooltips":{"viewMode":"表示モード切替(グループ / フラット)","sort":"ブランチの並び替え","sync":"worktree を同期","repositories":"リポジトリを管理(追加・同期)"},"displaySize":{"ariaLabel":"表示サイズ","large":"大","medium":"中","small":"小","xsmall":"極小"},"confirmDialog":{"title":"確認","confirm":"OK"},"language":"言語","loadingPage":"ページを読み込み中","closeNotification":"通知を閉じる","status":{"idle":"アイドル","ready":"準備完了","running":"実行中","generating":"生成中","waiting":"応答待ち","error":"エラー","unknown":"不明"},"sort":{"options":"並び替えオプション","updatedAt":"更新日時","repositoryName":"リポジトリ","branchName":"ブランチ","status":"ステータス","lastSent":"最終送信"},"branchItem":{"cliToolStatus":"CLI ツールのステータス","hasUnread":"未読メッセージあり"},"connection":{"reconnecting":"再接続中","offline":"オフライン","reconnectingTooltip":"ライブ接続を再確立しています(ポーリングで動作中)","offlineTooltip":"ライブ接続なし(ポーリングで動作中)"},"versionMismatch":{"title":"新しいバージョンが起動しています","description":"サーバーは {serverVersion} になりましたが、このタブは {clientVersion} のままです。最新の状態にするには再読み込みしてください。","reload":"再読み込み","dismiss":"閉じる"},"meta":{"description":"Claude CLI と tmux セッションによる Git worktree 管理"}}')}};
1
+ "use strict";exports.id=3945,exports.ids=[3945],exports.modules={53945:a=>{a.exports=JSON.parse('{"sessions":{"idleAgents":"アイドル {count} 件","activeAgents":"稼働 {count} 件","title":"セッション","description":"全リポジトリの worktree セッション。","filterPlaceholder":"名前またはリポジトリで絞り込み...","filterAriaLabel":"名前またはリポジトリでセッションを絞り込む","sortByAriaLabel":"並び替え","sortAscending":"昇順に並び替え","sortDescending":"降順に並び替え","loadingAriaLabel":"セッションを読み込み中","refreshError":"セッションの更新に失敗しました: {message}","loadError":"セッションの読み込みに失敗しました: {message}","noMatching":"一致するセッションがありません。","empty":"セッションがまだありません。"},"nav":{"home":"ホーム","chat":"チャット","sessions":"セッション","repositories":"リポジトリ","repositoriesShort":"リポジトリ","review":"レビュー","reviewReport":"レビュー/レポート","more":"その他","skills":"スキル"},"repositories":{"empty":"リポジトリが登録されていません。","add":"リポジトリを追加","syncAll":"すべて同期","syncing":"同期中...","addNewTitle":"リポジトリを新規追加","localPathTab":"ローカルパス","cloneUrlTab":"クローン URL","localPathDescription":"worktree を含む git リポジトリの絶対パスを入力してください。","localPathLabel":"リポジトリパス","localPathExample":"例: /Users/username/projects/my-repo","scan":"スキャンして追加","scanning":"スキャン中...","cloneUrlDescription":"リモートリポジトリをクローンする git の URL を入力してください。","cloneUrlLabel":"クローン URL","cloneUrlHelp":"HTTPS と SSH の URL に対応しています","clone":"クローン","forkAndClone":"Fork して追加","forkOptionLabel":"追加前に fork する(gh repo fork)","forkOptionHelp":"自分の GitHub アカウントに fork を作成し、それをクローンします(origin=自分の fork、upstream=元リポジトリ)。認証済みの GitHub CLI(gh)が必要です。","cloning":"クローン中...","cloneSuccess":"リポジトリをクローンしました","cloneFailed":"クローンに失敗しました","pathRequired":"リポジトリパスを入力してください","urlRequired":"クローン URL を入力してください","urlInvalid":"URL の形式が正しくありません","loading":"リポジトリを読み込み中"},"cancel":"キャンセル","send":"送信","sending":"送信中...","sendMessagePlaceholder":"メッセージを送信...","end":"終了する","ending":"終了中...","retry":"再試行","reload":"再読み込み","reconnect":"再接続","close":"閉じる","back":"戻る","menu":"メニュー","sidebar":{"open":"サイドバーを開く","close":"サイドバーを閉じる","branchNavigation":"ブランチナビゲーション","branches":"ブランチ","searchBranches":"ブランチを検索...","noBranchesFound":"ブランチが見つかりません","noBranchesAvailable":"ブランチがありません","dragToReorderGroup":"ドラッグでグループを並べ替え","switchToFlatView":"フラット表示に切り替え","switchToGroupedView":"グループ表示に切り替え"},"confirmDelete":"「{name}」を削除しますか?","favorites":{"add":"お気に入りに追加","remove":"お気に入りを解除"},"syncSuccess":"{count}件のworktreeを同期しました","syncError":"同期に失敗しました","syncAuthError":"認証エラー","syncButtonLabel":"ブランチを同期","tooltips":{"viewMode":"表示モード切替(グループ / フラット)","sort":"ブランチの並び替え","sync":"worktree を同期","repositories":"リポジトリを管理(追加・同期)"},"displaySize":{"ariaLabel":"表示サイズ","large":"大","medium":"中","small":"小","xsmall":"極小"},"confirmDialog":{"title":"確認","confirm":"OK"},"language":"言語","loadingPage":"ページを読み込み中","closeNotification":"通知を閉じる","status":{"idle":"アイドル","ready":"準備完了","running":"実行中","generating":"生成中","waiting":"応答待ち","error":"エラー","unknown":"不明"},"sort":{"options":"並び替えオプション","updatedAt":"更新日時","repositoryName":"リポジトリ","branchName":"ブランチ","status":"ステータス","lastSent":"最終送信"},"branchItem":{"cliToolStatus":"CLI ツールのステータス","hasUnread":"未読メッセージあり"},"connection":{"reconnecting":"再接続中","offline":"オフライン","reconnectingTooltip":"ライブ接続を再確立しています(ポーリングで動作中)","offlineTooltip":"ライブ接続なし(ポーリングで動作中)"},"versionMismatch":{"title":"新しいバージョンが起動しています","description":"サーバーは {serverVersion} になりましたが、このタブは {clientVersion} のままです。最新の状態にするには再読み込みしてください。","reload":"再読み込み","dismiss":"閉じる"},"meta":{"description":"Claude CLI と tmux セッションによる Git worktree 管理"}}')}};
@@ -9,7 +9,7 @@
9
9
  UPDATE daily_reports
10
10
  SET content = ?, updated_at = ?
11
11
  WHERE date = ?
12
- `).run(c,d,b).changes)throw Error(`Daily report not found for date: ${b}`)}c.d(b,{IF:()=>f,ap:()=>d,tt:()=>e})},20137:(a,b,c)=>{c.d(b,{Ar:()=>d,Hf:()=>k,Ww:()=>e,XI:()=>l,eb:()=>i,iI:()=>n,kd:()=>f,o1:()=>g,oN:()=>h});let d=100,e=1e4,f=["default","acceptEdits","plan","dontAsk","bypassPermissions"],g=["read-only","workspace-write","danger-full-access"],h=["allow-all-tools","yolo"],i=["--dangerously-skip-permissions"],j=[],k={claude:"acceptEdits",codex:"workspace-write",gemini:"","vibe-local":"",copilot:"allow-all-tools",antigravity:"--dangerously-skip-permissions"};function l(a){switch(a){case"codex":return g;case"copilot":return h;case"antigravity":return i;case"claude":return f;default:return j}}let m=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function n(a){return m.test(a)}},21586:(a,b,c)=>{c.d(b,{$h:()=>h,Cy:()=>r,DE:()=>s,F5:()=>k,IH:()=>f,JK:()=>d,Nb:()=>i,R7:()=>e,RP:()=>n,VU:()=>q,W9:()=>o,Xb:()=>m,bO:()=>p,bm:()=>j,qw:()=>l,t7:()=>g});let d=3e5,e=6e4,f=["claude","codex","copilot","antigravity"],g=1e3,h=5,i=100,j=1e3,k=3e3,l=15e3,m=15e3,n=6e3,o=3e3,p=500,q=20,r=1e4,s=15e3},25381:(a,b,c)=>{c.d(b,{GI:()=>D,qw:()=>E,xF:()=>A,Hw:()=>F,T5:()=>G,sZ:()=>C,XT:()=>B});var d=c(29021),e=c(33873),f=c(72626),g=c(34207),h=c(21586);let i=h.RP,j=["user_data","commit_log","issue_context"];function k(a){let b=a.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"");for(let a of j){let c=RegExp(`</?${a}>`,"gi");b=b.replace(c,a=>a.replace(/</g,"&lt;").replace(/>/g,"&gt;"))}return b.slice(0,g.uv)}var l=c(20137),m=c(52660),n=c(4868),o=c(73753),p=c(10406),q=c(45312),r=c(79646),s=c(28354);let t=(0,f.h)("github-api"),u=(0,s.promisify)(r.execFile);async function v(){try{return await u("gh",["--version"],{timeout:5e3}),!0}catch{return!1}}async function w(a,b,c){try{if(!await v())return t.debug("gh-cli-unavailable",{issueNumber:a}),null;let{stdout:d}=await u("gh",["issue","view",String(a),"--json","number,title,body,labels,state"],{cwd:b,timeout:h.Cy}),e=JSON.parse(d),f=e.labels.map(a=>"string"==typeof a?a:a.name),g=(e.body??"").slice(0,h.bO);return{repositoryName:c,number:e.number,title:e.title,labels:f,state:e.state,bodySummary:g}}catch(b){return t.debug("get-issue-info-failed",{issueNumber:a,repositoryName:c,error:String(b)}),null}}async function x(a,b){let c=(0,q.Pt)(b).slice(0,h.VU);if(0===c.length||0===a.length)return[];let d=[];for(let b of a)for(let a of c)d.push(w(a,b.path,b.name));let e=await Promise.allSettled(d),f=[];for(let a of e)"fulfilled"===a.status&&null!==a.value&&f.push(a.value);return f}var y=c(70673);let z=(0,f.h)("daily-summary"),A=2*g.uv;function B(){let a=globalThis.__dailySummaryGenerating;return!!a?.active&&(!(Date.now()-a.startedAt>h.R7+1e4)||(z.warn("failsafe-reset",{startedAt:a.startedAt}),globalThis.__dailySummaryGenerating=void 0,!1))}function C(){return B()?globalThis.__dailySummaryGenerating??null:null}class D extends Error{constructor(){super("Summary generation is already in progress"),this.name="ConcurrentGenerationError"}}class E extends Error{constructor(){super("Summary generation timed out"),this.name="GenerationTimeoutError"}}class F extends Error{constructor(a){super(a),this.name="OutputValidationError"}}async function G(a,b){let{date:c,tool:f,model:j,userInstruction:r}=b;if(B())throw z.warn("concurrent-rejected",{date:c}),new D;globalThis.__dailySummaryGenerating={active:!0,startedAt:Date.now(),date:c,tool:f};try{z.info("generation-started",{date:c,tool:f});let b=new Date(c+"T00:00:00"),s=new Date(c+"T23:59:59.999"),t=(0,m.lr)(a,{after:b,before:s});if(0===t.length)throw new F("No messages found for the specified date");let u=(0,o.vi)(a),v=new Map;for(let a of u)v.set(a.id,a.name);let w=(0,p.Yg)(a),B=w.filter(a=>!!a.enabled&&!!(0,d.existsSync)(a.path)&&!!(0,d.existsSync)((0,e.join)(a.path,".git")));B.length<w.length&&z.info("repositories-filtered",{total:w.length,valid:B.length,skipped:w.length-B.length});let C=b.toISOString(),D=s.toISOString(),G=await (0,y.wj)((0,q.z0)(B,C,D),h.qw,new Map),H=Array.from(G.values()).flatMap(({commits:a})=>a.map(a=>a.message)),I=await (0,y.wj)(x(B,H).catch(()=>[]),h.DE,[]),J=function(a,b,c,d,e){let f=`You are a technical report generator. Summarize the following work logs into a concise daily report in Japanese Markdown format.
12
+ `).run(c,d,b).changes)throw Error(`Daily report not found for date: ${b}`)}c.d(b,{IF:()=>f,ap:()=>d,tt:()=>e})},20137:(a,b,c)=>{c.d(b,{Ar:()=>d,Hf:()=>k,Ww:()=>e,XI:()=>l,eb:()=>i,iI:()=>n,kd:()=>f,o1:()=>g,oN:()=>h});let d=100,e=1e4,f=["default","acceptEdits","plan","dontAsk","bypassPermissions"],g=["read-only","workspace-write","danger-full-access"],h=["allow-all-tools","yolo"],i=["--dangerously-skip-permissions"],j=[],k={claude:"acceptEdits",codex:"workspace-write",gemini:"","vibe-local":"",copilot:"allow-all-tools",antigravity:"--dangerously-skip-permissions"};function l(a){switch(a){case"codex":return g;case"copilot":return h;case"antigravity":return i;case"claude":return f;default:return j}}let m=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function n(a){return m.test(a)}},21586:(a,b,c)=>{c.d(b,{$h:()=>h,Cy:()=>r,DE:()=>s,F5:()=>k,IH:()=>f,JK:()=>d,Nb:()=>i,R7:()=>e,RP:()=>n,VU:()=>q,W9:()=>o,Xb:()=>m,bO:()=>p,bm:()=>j,qw:()=>l,t7:()=>g});let d=3e5,e=6e4,f=["claude","codex","copilot","antigravity"],g=1e3,h=5,i=100,j=1e3,k=3e3,l=15e3,m=15e3,n=6e3,o=3e3,p=500,q=20,r=1e4,s=15e3},25381:(a,b,c)=>{c.d(b,{GI:()=>D,qw:()=>E,xF:()=>A,Hw:()=>F,T5:()=>G,sZ:()=>C,XT:()=>B});var d=c(29021),e=c(33873),f=c(72626),g=c(34207),h=c(21586);let i=h.RP,j=["user_data","commit_log","issue_context"];function k(a){let b=a.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"");for(let a of j){let c=RegExp(`</?${a}>`,"gi");b=b.replace(c,a=>a.replace(/</g,"&lt;").replace(/>/g,"&gt;"))}return b.slice(0,g.uv)}var l=c(20137),m=c(52660),n=c(4868),o=c(73753),p=c(10406),q=c(99192),r=c(79646),s=c(28354);let t=(0,f.h)("github-api"),u=(0,s.promisify)(r.execFile);async function v(){try{return await u("gh",["--version"],{timeout:5e3}),!0}catch{return!1}}async function w(a,b,c){try{if(!await v())return t.debug("gh-cli-unavailable",{issueNumber:a}),null;let{stdout:d}=await u("gh",["issue","view",String(a),"--json","number,title,body,labels,state"],{cwd:b,timeout:h.Cy}),e=JSON.parse(d),f=e.labels.map(a=>"string"==typeof a?a:a.name),g=(e.body??"").slice(0,h.bO);return{repositoryName:c,number:e.number,title:e.title,labels:f,state:e.state,bodySummary:g}}catch(b){return t.debug("get-issue-info-failed",{issueNumber:a,repositoryName:c,error:String(b)}),null}}async function x(a,b){let c=(0,q.Pt)(b).slice(0,h.VU);if(0===c.length||0===a.length)return[];let d=[];for(let b of a)for(let a of c)d.push(w(a,b.path,b.name));let e=await Promise.allSettled(d),f=[];for(let a of e)"fulfilled"===a.status&&null!==a.value&&f.push(a.value);return f}var y=c(70673);let z=(0,f.h)("daily-summary"),A=2*g.uv;function B(){let a=globalThis.__dailySummaryGenerating;return!!a?.active&&(!(Date.now()-a.startedAt>h.R7+1e4)||(z.warn("failsafe-reset",{startedAt:a.startedAt}),globalThis.__dailySummaryGenerating=void 0,!1))}function C(){return B()?globalThis.__dailySummaryGenerating??null:null}class D extends Error{constructor(){super("Summary generation is already in progress"),this.name="ConcurrentGenerationError"}}class E extends Error{constructor(){super("Summary generation timed out"),this.name="GenerationTimeoutError"}}class F extends Error{constructor(a){super(a),this.name="OutputValidationError"}}async function G(a,b){let{date:c,tool:f,model:j,userInstruction:r}=b;if(B())throw z.warn("concurrent-rejected",{date:c}),new D;globalThis.__dailySummaryGenerating={active:!0,startedAt:Date.now(),date:c,tool:f};try{z.info("generation-started",{date:c,tool:f});let b=new Date(c+"T00:00:00"),s=new Date(c+"T23:59:59.999"),t=(0,m.lr)(a,{after:b,before:s});if(0===t.length)throw new F("No messages found for the specified date");let u=(0,o.vi)(a),v=new Map;for(let a of u)v.set(a.id,a.name);let w=(0,p.Yg)(a),B=w.filter(a=>!!a.enabled&&!!(0,d.existsSync)(a.path)&&!!(0,d.existsSync)((0,e.join)(a.path,".git")));B.length<w.length&&z.info("repositories-filtered",{total:w.length,valid:B.length,skipped:w.length-B.length});let C=b.toISOString(),D=s.toISOString(),G=await (0,y.wj)((0,q.z0)(B,C,D),h.qw,new Map),H=Array.from(G.values()).flatMap(({commits:a})=>a.map(a=>a.message)),I=await (0,y.wj)(x(B,H).catch(()=>[]),h.DE,[]),J=function(a,b,c,d,e){let f=`You are a technical report generator. Summarize the following work logs into a concise daily report in Japanese Markdown format.
13
13
 
14
14
  Rules:
15
15
  - Summarize by worktree/branch
@@ -1,4 +1,4 @@
1
- exports.id=5959,exports.ids=[1296,5959,9358],exports.modules={60:(a,b,c)=>{"use strict";c.d(b,{Q:()=>f,b:()=>e});var d=c(26283);function e(a){return d.Md.test(a)&&!d.kD.test(a)}function f(a,b,c,d,e){if(a=Math.max(0,a),"opencode"===d||"copilot"===d){let a=e(b);return a>=0?a+1:0}if("antigravity"===d){let c=e(b);return c>=0?c+1:Math.max(0,a)}if(a>=b||c){let a=e(40);return a>=0?a+1:0}if("codex"===d)return Math.max(0,a);if(a>=b-5){let a=e(50);return a>=0?a+1:Math.max(0,b-40)}return Math.max(0,a)}},3523:(a,b,c)=>{"use strict";c.d(b,{z$:()=>A,zX:()=>B});var d=c(31766),e=c(88807),f=c(56791),g=c(49997),h=c(25129),i=c(18778),j=c(15194),k=c(8988),l=c(26283),m=c(72626),n=c(46423),o=c(60),p=c(82450),q=c(56263),r=c(13033),s=c(72457),t=c(71080),u=c(45146),v=c(63865);let w=(0,m.h)("response-poller");function x(a){return{response:"",isComplete:!1,lineCount:a}}function y(a,b,c,d,e,f,g){let h=(0,o.Q)(b,c,d,e,f),i=a.slice(h);return{response:(0,l.aJ)(i.join("\n")),isComplete:!0,lineCount:c,promptDetection:g,bufferReset:d}}function z(a,b){let c=(0,l.KO)(b);return(0,h.gF)((0,l._A)((0,l.aJ)(a)),c)}function A(a,b,c){let d=a.split("\n"),e=d.length;for(;e>0&&""===d[e-1].trim();)e--;let f=d.slice(0,e),g=f.length,h="claude"===c?(0,l.GT)(f):-1,i=h>=0?h:g,j=g>0&&b>25&&g+25<b,k=g>0&&b>50&&g<50,m=j||k;if(!m&&g<b-5)return null;let p=Math.max(0,g-20),q=f.slice(p),r="opencode"===c?(0,l.aJ)(f.join("\n")):q.join("\n"),{promptPattern:s,separatorPattern:t,thinkingPattern:v,skipPatterns:w}=(0,l._X)(c),A=(a=60)=>{let b;if("codex"===c)b=/^›\s+(?!Implement|Find and fix|Type|Summarize)/;else if("opencode"===c){let b=0;for(let c=g-1;c>=Math.max(0,g-a);c--){let a=(0,l.aJ)(f[c]);if(l.Md.test(a)&&2==++b)return c}return -1}else b=/^[>❯]\s+\S/;for(let c=i-1;c>=Math.max(0,i-a);c--){let a=(0,l.aJ)(f[c]);if(b.test(a))return c}return -1};if("claude"===c||"codex"===c||"copilot"===c){let a=z(f.join("\n"),c);if(a.isPrompt)return y(f,b,g,m,c,A,a)}let B=(0,l.aJ)(r),C=s.test(B),D=t.test(B),E=v.test(B),F=("codex"===c||"gemini"===c||"vibe-local"===c||"copilot"===c||"antigravity"===c)&&C&&!E,G="claude"===c&&C&&D&&!E,H="opencode"===c&&(0,o.b)(B);if(F||G||H){let a=[],d=(0,o.Q)(b,g,m,c,A),e=g;for(let b=d;b<i;b++){let d=f[b],g=(0,l.aJ)(d);if("codex"===c&&/^›\s+/.test(g)||"gemini"===c&&/^(%|\$|.*@.*[%$#])\s*$/.test(g)||"antigravity"===c&&/^>\s*$/.test(g)||"opencode"===c&&(l.sy.test(g)||l.uA.test(g))){e=b;break}w.some(a=>a.test(g))||a.push(d)}let h=a.join("\n").trim(),j=h.split("\n").slice(-n.$).join("\n");if(v.test(j))return x(g);if("claude"===c){let a=(0,l.aJ)(h),b=/[╭╮╰╯│]/.test(a)||/░{3,}/.test(a)||/▓{3,}/.test(a),c=/Claude Code|claude\/|v\d+\.\d+/.test(a),d=/Tip:|for shortcuts|\?\s*for help/.test(a),e=/^\s*\/Users\/.*$/m.test(a)&&a.split("\n").length<30,f=a.match(/^[>❯]\s+(\S.*)$/m);if(f){let b=a.indexOf(f[0]);if(0===a.substring(b+f[0].length).trim().split("\n").filter(a=>{let b=a.trim();return b&&!w.some(a=>a.test(b))&&!/^─+$/.test(b)}).length)return x(g)}else if((b||c||d||e)&&h.length<2e3)return x(g)}if("gemini"===c&&((h.match(/[░███]/g)||[]).length>.3*h.length||u.SI.some(a=>h.includes(a))||!h.includes("✦")&&h.length<10))return x(g);if("opencode"===c){let a=(0,l.aJ)(h);if((a.length<50||!l.Md.test(B))&&0===a.split("\n").filter(a=>{let b=a.trim();return b&&!l.sx.some(a=>a.test(b))}).length)return x(g)}return{response:h,isComplete:!0,lineCount:e,bufferReset:m}}if("opencode"!==c){let a=z(f.join("\n"),c);if(a.isPrompt)return y(f,b,g,m,c,A,a)}let I=[],J=m||b>=g-5,K=J?A(80):-1,L=J?K>=0?K+1:Math.max(0,g-80):Math.max(0,b);for(let a=L;a<Math.min(g,i);a++){let b=f[a],c=(0,l.aJ)(b);w.some(a=>a.test(c))||I.push(b)}let M=I.join("\n").trim();return M?{response:M,isComplete:!1,lineCount:g}:x(g)}async function B(a,b,c){let h=(0,e.getDbInstance)(),m=c??b;try{let e=(0,f.Ui)(h,a);if(!e)return w.error("worktree-worktreeid-not"),(0,u.Et)(a,b,c),!1;if(!await (0,d.K1)(a,b,c))return w.info("session-not-running"),(0,u.Et)(a,b,c),!1;let o=(0,f.y1)(h,a,m),x=o?.lastCapturedLine||0,y=await (0,d.Wh)(a,b,1e4,c);if("opencode"===b||"copilot"===b){let d=(0,u.MN)(a,b,c);(0,r.IZ)(d,y,b)}let B=A(y,x,b);if(!B||!B.isComplete){let{thinkingPattern:c}=(0,l._X)(b),d=(0,l.aJ)(y).split("\n").slice(-n.$).join("\n");return c.test(d)&&(0,f.PL)(h,a,b,m)>0&&w.info("marked-answeredcount-pending"),!1}let C="opencode"===b||"copilot"===b,D=!(0,j.VA)(b);if(D&&!B.bufferReset&&B.lineCount===x&&!o?.inProgressMessageId)return!1;if(D&&!B.bufferReset&&B.lineCount<=x)return w.info("already-saved-up-to-line-lastcapturedlin"),!1;let E=B.promptDetection??z(B.response,b);if(E.isPrompt){let d=E.rawContent||E.cleanContent,i=(0,u.MN)(a,b,c),j=(0,s.zm)(d,b);if((0,s.gv)(i,j))return w.info("duplicate-prompt-skipped",{worktreeId:a,cliToolId:b}),!1;let k=d;"copilot"===b&&(k=(0,p.LH)(d),k=(0,p.Sj)(k,q.Rf,q.ky)),(0,f.YX)(h,a,b,m);let l=(0,f.oH)(h,{worktreeId:a,role:"assistant",content:k,messageType:"prompt",promptData:E.promptData,timestamp:new Date,cliToolId:b,instanceId:m});return(0,f.gb)(h,a,b,B.lineCount,m),(0,g.Lo)("message",{worktreeId:a,message:l}),(0,v.J$)({worktreeId:a,worktreeName:e.name,kind:"prompt",agentName:m,excerpt:E.promptData?.question??k}).catch(()=>{}),C||(0,u.Et)(a,b,c),!0}if(!B.response||""===B.response.trim())return(0,f.gb)(h,a,b,B.lineCount,m),!1;let F="claude"===b?(0,k.R)(B.response):void 0,G=B.response;if("gemini"===b)G=(0,p.IS)(B.response);else if("claude"===b)G=(0,p.NN)(B.response);else if("copilot"===b){let d=(0,u.MN)(a,b,c),e=(0,r.Uz)(d)||B.response;G=(0,p.LH)(e),G=(0,p.Sj)(G,q.Rf,q.ky),(0,r.q1)(d)}else if("opencode"===b){G=(0,p.aW)(B.response);let d=(0,u.MN)(a,b,c);(0,r.q1)(d)}if(!G||""===G.trim()||"[No content]"===G)return(0,f.gb)(h,a,b,B.lineCount,m),(0,f.YX)(h,a,b,m),!1;if((0,j.VA)(b)){let d=(0,u.MN)(a,b,c);if((0,t.j)(d,G))return(0,f.gb)(h,a,b,B.lineCount,m),!1}G&&await (0,i.T)(h,a,G,b),(0,f.PL)(h,a,b,m)>0&&w.info("marked-answeredcount-pending");let H=(0,f.y1)(h,a,m);if(D&&H&&B.lineCount<=H.lastCapturedLine)return w.info("race-condition-detected-skipping-save-re"),!1;let I=(0,f.oH)(h,{worktreeId:a,role:"assistant",content:G,messageType:"normal",timestamp:new Date,cliToolId:b,instanceId:m,summary:F?.summary,logFileName:F?.logFileName,requestId:F?.requestId});return(0,g.Lo)("message",{worktreeId:a,message:I}),(0,v.J$)({worktreeId:a,worktreeName:e.name,kind:"completion",agentName:m,excerpt:G}).catch(()=>{}),(0,f.gb)(h,a,b,B.lineCount,m),C&&(0,u.Et)(a,b,c),!0}catch(a){return w.error("response:check-failed",{error:a instanceof Error?a.message:String(a)}),!1}}},5344:(a,b,c)=>{"use strict";c.d(b,{v7:()=>i,LP:()=>s,pL:()=>k,GE:()=>l,aq:()=>n,kC:()=>r,xU:()=>D,bZ:()=>E,W8:()=>o,W5:()=>K,_i:()=>L,_C:()=>M});var d=c(68901),e=c(66007),f=c(15194),g=c(72626);let h=(0,g.h)("auto-yes-state");function i(a,b,c){if(a.includes(":"))throw Error(`worktreeId must not contain ':': ${a}`);if(!c||c===b)return`${a}:${b}`;if(c.includes(":"))throw Error(`instanceId must not contain ':': ${c}`);return`${a}:${b}:${c}`}function j(a){let b=a.indexOf(":");return -1===b?a:a.substring(0,b)}function k(a){let b=a.split(":")[1];return void 0===b?null:(0,f.hR)(b)?b:null}function l(a){let b=a.split(":");return b[2]??b[1]??null}let m=globalThis.__autoYesStates??(globalThis.__autoYesStates=new Map);function n(a,b="claude",c){let d=i(a,b,c),e=m.get(d);return e?Date.now()>=e.expiresAt?p(a,b,"expired",c):e:null}function o(a,b,c,e,f,g){let h=i(a,b,g);if(!c)return p(a,b,void 0,g);{let a=Date.now(),b={enabled:!0,enabledAt:a,expiresAt:a+(e??d.t6),stopPattern:f};return m.set(h,b),b}}function p(a,b="claude",c,d){let e=i(a,b,d),f=m.get(e),g={enabled:!1,enabledAt:f?.enabledAt??0,expiresAt:f?.expiresAt??0,stopPattern:f?.stopPattern,stopReason:c};return m.set(e,g),g}function q(a,b){return a.filter(a=>j(a)===b)}function r(a){return q(Array.from(m.keys()),a)}function s(a){let b=r(a);return b.forEach(a=>m.delete(a)),b.length}var t=c(31766),u=c(25129),v=c(63869),w=c(31268),x=c(26283),y=c(77093),z=c(93997);let A=(0,g.h)("auto-yes-poller"),B=globalThis.__autoYesPollerStates??(globalThis.__autoYesPollerStates=new Map);function C(a){return B.get(a)}function D(a){let b=C(a);return b?.lastServerResponseTimestamp??null}function E(a){return B.has(a)}function F(a){let b=C(a);if(b){var c;if(b.consecutiveErrors++,b.currentInterval=(c=b.consecutiveErrors)<5?2e3:Math.min(2e3*Math.pow(2,c-5+1),6e4),b.consecutiveErrors>=d.ul){let b=j(a),c=k(a);c&&p(b,c,"consecutive_errors",l(a)??void 0),L(a)}}}async function G(a,b,c,e){let f=c??d.FW,g=await (0,t.Wh)(a,b,f,e);return(0,x._A)((0,x.aJ)(g))}async function H(a,b,d,e,f,g){let h=i(a,d,g);try{let i=(0,x.KO)(d),l=(0,u.gF)(e,{...i,...f&&{precomputedLines:f}});if(!l.isPrompt||!l.promptData)return b.lastAnsweredPromptKey=null,b.lastAnsweredAt=null,"no_prompt";let m=(j=l.promptData,`${j.type}:${j.question}`);if(b.lastAnsweredPromptKey===m&&null!==b.lastAnsweredAt&&Date.now()-b.lastAnsweredAt<1e4)return"duplicate";let n=function(a){if("yes_no"===a.type)return"y";if("multiple_choice"===a.type){let b=a.options.find(a=>a.isDefault)??a.options[0];return!b||b.requiresTextInput?null:b.number.toString()}return null}(l.promptData);if(null===n)return"no_answer";let o=w.s.getInstance().getTool(d).getSessionName(a,g);try{await (0,v.t)({sessionName:o,answer:n,cliToolId:d,promptData:l.promptData})}finally{(0,z.gm)(o)}var j,k=Date.now();let p=C(h);p&&(p.lastServerResponseTimestamp=k);let q=C(h);q&&(q.consecutiveErrors=0,q.currentInterval=2e3),b.lastAnsweredPromptKey=m,b.lastAnsweredAt=Date.now(),A.info("poller:response-sent",{worktreeId:a,cliToolId:d,instanceId:g});let[{startPolling:r},{broadcastTerminalSnapshotAfterInteraction:s}]=await Promise.all([Promise.resolve().then(c.bind(c,95220)),Promise.resolve().then(c.bind(c,99508))]);return r(a,d,g),s(a,d,g),"responded"}catch{return F(h),A.warn("poller:detect-respond-error",{worktreeId:a,cliToolId:d,instanceId:g}),"error"}}async function I(a,b,c){let e=i(a,b,c),f=C(e);if("valid"===function(a,b){if(!b)return"stopped";let c=j(a),d=k(a);if(!d)return L(a),"expired";let e=n(c,d,l(a)??void 0);return e?.enabled?"valid":(L(a),"expired")}(e,f)){try{let g=n(a,b,c),i=g?.stopPattern?d.FW:d.Ke,m=await G(a,b,i,c),o=m.split("\n");if(function(a,b,c){if(b.stopCheckBaselineLength<0)return b.stopCheckBaselineLength=c.length,!1;let e=b.stopCheckBaselineLength;if(c.length>e){let f=c.substring(e);return b.stopCheckBaselineLength=c.length,function(a,b,c){let e=j(a),f=k(a);if(!f)return!1;let g=l(a)??void 0,i=n(e,f,g);if(!i?.stopPattern)return!1;if(!(0,d.P0)(i.stopPattern).valid)return h.warn("invalid-stop-pattern",{detail:String({compositeKey:a})}),p(e,f,void 0,g),!1;try{let d=new RegExp(i.stopPattern),j=function(a,b,c=100){try{return a.test(b)}catch{return null}}(d,b);if(null===j)return h.warn("stop-condition-check",{detail:String({compositeKey:a})}),p(e,f,void 0,g),!1;if(j)return p(e,f,"stop_pattern_matched",g),c&&c(a),h.warn("stop-condition-matched",{detail:String({compositeKey:a})}),!0}catch{h.warn("stop-condition-check",{detail:String({compositeKey:a})})}return!1}(a,f,L)}return c.length<e&&(b.stopCheckBaselineLength=c.length),!1}(e,f,m))return;let q=await H(a,f,b,m,o,c);if("responded"===q)return void J(a,b,c,5e3);if("no_prompt"===q){let e=o.slice(-50).join("\n");if((0,x.ut)(b,e))return void J(a,b,c,d.QN)}}catch(d){F(e),A.warn("poller:poll-error",{worktreeId:a,cliToolId:b,instanceId:c,error:(0,y.u1)(d)})}J(a,b,c)}}function J(a,b,c,d){let e=C(i(a,b,c));if(!e)return;let f=Math.max(d??e.currentInterval,2e3);e.timerId=setTimeout(()=>{I(a,b,c)},f)}function K(a,b,c){if(!(0,e.h6)(a))return{started:!1,reason:"invalid worktree ID"};let d=c??b,f=n(a,b,d);if(!f?.enabled)return{started:!1,reason:"auto-yes not enabled"};let g=i(a,b,d),h=C(g);if(!h&&B.size>=50)return{started:!1,reason:"max concurrent pollers reached"};if(h&&h.cliToolId===b)return{started:!0,reason:"already_running"};h&&L(g);let j={timerId:null,cliToolId:b,instanceId:d,consecutiveErrors:0,currentInterval:2e3,lastServerResponseTimestamp:null,lastAnsweredPromptKey:null,lastAnsweredAt:null,stopCheckBaselineLength:-1};return B.set(g,j),j.timerId=setTimeout(()=>{I(a,b,d)},2e3),A.info("poller:started",{worktreeId:a,cliToolId:b,instanceId:d}),{started:!0}}function L(a){let b=C(a);b&&(b.timerId&&clearTimeout(b.timerId),B.delete(a),A.info("poller:stopped",{compositeKey:a}))}function M(a){q(Array.from(B.keys()),a).forEach(a=>L(a))}},7015:(a,b,c)=>{"use strict";c.d(b,{Ds:()=>g});var d=c(81719);class e{constructor(a,b=3e4){this.cache=new Map,this.allAppsCache=null,this.lastRefresh=0,this.db=a,this.ttl=b}getTTL(){return this.ttl}isStale(){return Date.now()-this.lastRefresh>this.ttl}async refresh(){let a=(0,d.$i)(this.db);for(let b of(this.cache.clear(),a))this.cache.set(b.pathPrefix,b);this.allAppsCache=a,this.lastRefresh=Date.now()}async getByPathPrefix(a){return this.isStale()&&await this.refresh(),this.cache.get(a)??null}async getAll(){return this.isStale()&&await this.refresh(),this.allAppsCache??[]}invalidate(){this.cache.clear(),this.allAppsCache=null,this.lastRefresh=0}invalidateByIssueNo(a){this.invalidate()}}let f=null;function g(a){if(!f){if(!a)throw Error("Database instance required to initialize cache");f=new e(a)}return f}},8988:(a,b,c)=>{"use strict";c.d(b,{R:()=>g});let d=/📄 Session log: (.+?\/([^\/\s]+\.jsonl))/,e=/Request ID: ([^\s\n]+)/,f=/Summary: (.+?)(?:\n─|$)/s;function g(a){let b={content:a},c=d.exec(a);c&&(b.logFileName=c[2]);let g=e.exec(a);g&&(b.requestId=g[1]);let h=f.exec(a);return h&&(b.summary=h[1].trim()),b}},11508:(a,b,c)=>{"use strict";c.d(b,{H:()=>m,m:()=>n});var d=c(44265),e=c(11665),f=c(40236),g=c(93997),h=c(26283),i=c(72626),j=c(20610);let k=(0,i.h)("cli-tools/gemini");function l(a){return a instanceof Error?a.message:String(a)}let m=200;class n extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,e.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("Gemini CLI is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,e.N)(d)){await this.reconcileExistingSession(d),k.info("gemini-session-sessionname");return}try{await (0,e.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,j.Uc)),await (0,e.V1)(d,"gemini",!0),await new Promise(a=>setTimeout(a,6e3)),await this.waitForReady(d),k.info("started-gemini-session:sessionname")}catch(b){let a=l(b);throw Error(`Failed to start Gemini session: ${a}`)}}async waitForReady(a){let b=!1;for(let c=0;c<30;c++){try{let c=await (0,e.Xg)(a,m),d=(0,h.aJ)(c);if(h.wN.test(d))return void k.info("gemini-prompt-detected");!b&&d.includes("Do you trust this folder?")&&(await (0,e.ds)(a,"Enter"),b=!0,k.info("auto-trusted-folder-for"))}catch{}await new Promise(a=>setTimeout(a,1e3))}k.info("gemini-prompt-detection")}async waitForPrompt(a){let b=Date.now();for(;Date.now()-b<15e3;){try{let b=await (0,e.Xg)(a,m),c=(0,h.aJ)(b);if(h.wN.test(c))return}catch{}await new Promise(a=>setTimeout(a,500))}k.info("gemini-prompt-not")}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,e.N)(d))throw Error(`Gemini session ${d} does not exist. Start the session first.`);try{await this.waitForPrompt(d),await (0,f.F)({sessionName:d,message:b,cliToolId:"gemini"}),(0,g.gm)(d),k.info("sent-message-to-gemini-session:sessionna")}catch(b){let a=l(b);throw Error(`Failed to send message to Gemini: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,e.N)(c)&&(await (0,e.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,j.Is)),await (0,e.V1)(c,"/quit",!0),await new Promise(a=>setTimeout(a,j.Zf))),await (0,e.fY)(c)&&k.info("stopped-gemini-session:sessionname")}catch(a){throw k.error("session:stop-failed",{error:l(a)}),a}}constructor(...a){super(...a),this.id="gemini",this.name="Gemini CLI",this.command="gemini"}}},11665:(a,b,c)=>{"use strict";c.d(b,{GW:()=>n,KB:()=>r,N:()=>m,N6:()=>x,Sb:()=>y,V1:()=>p,Xg:()=>s,ds:()=>v,fY:()=>t,jw:()=>o,lA:()=>k,zT:()=>l});var d=c(79646),e=c(28354),f=c(93997),g=c(16983),h=c(72626);let i=(0,e.promisify)(d.execFile),j=(0,h.h)("tmux");function k(a){return`=${a}:`}async function l(a,b={}){let c,d,e,f=b.windowWidth??g.J,h=b.windowHeight??g.s,m=k(a);try{c=(await i("tmux",["show-window-options","-v","-t",m,"window-size"],{timeout:5e3})).stdout.trim();let[a,b]=(await i("tmux",["display-message","-p","-t",m,"#{window_width}|#{window_height}"],{timeout:5e3})).stdout.trim().split("|").map(Number);Number.isFinite(a)&&(d=a),Number.isFinite(b)&&(e=b)}catch{}let n="manual"===c,o=d===f&&e===h;if(n&&o)return!1;try{return n||await i("tmux",["set-window-option","-t",m,"window-size","manual"],{timeout:5e3}),o||await i("tmux",["resize-window","-t",m,"-x",String(f),"-y",String(h)],{timeout:5e3}),!0}catch(b){return j.warn("session-geometry:reconcile-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)}),!1}}async function m(a){try{return await i("tmux",["has-session","-t",k(a)],{timeout:5e3}),!0}catch{return!1}}async function n(){try{let{stdout:a}=await i("tmux",["list-sessions","-F","#{session_name}|#{session_windows}|#{session_attached}"],{timeout:5e3});if(!a||""===a.trim())return[];return a.trim().split("\n").map(a=>{let[b,c,d]=a.split("|");return{name:b,windows:parseInt(c,10)||0,attached:"1"===d}})}catch{return[]}}async function o(a,b){let c,d,e,f,h;"string"==typeof a?(c=a,d=b,e=5e4,f=g.J,h=g.s):(c=a.sessionName,d=a.workingDirectory,e=a.historyLimit||5e4,f=a.windowWidth||g.J,h=a.windowHeight||g.s);try{await i("tmux",["new-session","-d","-s",c,"-c",d,"-x",String(f),"-y",String(h)],{timeout:5e3}),await l(c,{windowWidth:f,windowHeight:h}),await i("tmux",["set-option","-t",k(c),"history-limit",String(e)],{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to create tmux session: ${a}`)}}async function p(a,b,c=!0){let d=c?["send-keys","-t",k(a),b,"C-m"]:["send-keys","-t",k(a),b];try{await i("tmux",d,{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send keys to tmux session: ${a}`)}}let q=new Set(["Up","Down","Left","Right","Enter","Space","Tab","Escape","BSpace","DC","PageUp","PageDown","Home","End","q"]);async function r(a,b){if(0!==b.length){for(let a of b)if(!q.has(a))throw Error(`Invalid special key: ${a}`);try{for(let c=0;c<b.length;c++)await i("tmux",["send-keys","-t",k(a),b[c]],{timeout:5e3}),c<b.length-1&&await new Promise(a=>setTimeout(a,100))}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send special keys to tmux session: ${a}`)}}}async function s(a,b){let c,d;"number"==typeof b?(c=-b,d="-"):b?(c=b.startLine??-1e4,d=b.endLine??"-"):(c=-1e3,d="-");try{let{stdout:b}=await i("tmux",["capture-pane","-t",k(a),"-p","-e","-S",String(c),"-E",String(d)],{timeout:5e3,maxBuffer:0xa00000});return b}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to capture pane: ${a}`)}}async function t(a){try{return await i("tmux",["kill-session","-t",k(a)],{timeout:5e3}),!0}catch(b){let a=b instanceof Error?b.message:String(b);if(a?.includes("no server running")||a?.includes("can't find session"))return!1;throw Error(`Failed to kill tmux session: ${a}`)}}let u=new Set(["Escape","C-c","C-d","C-m","Enter"]);async function v(a,b){if(!u.has(b))throw Error(`Invalid special key: ${b}`);try{await i("tmux",["send-keys","-t",k(a),b],{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send special key: ${a}`)}}let w=["Up","Down","Left","Right","Enter","Escape","Tab","BTab","PageUp","PageDown","Home","End","q"];function x(a){return w.includes(a)}async function y(a,b){await r(a,b),(0,f.gm)(a)}},13033:(a,b,c)=>{"use strict";c.d(b,{IW:()=>h,IZ:()=>l,K0:()=>g,Uz:()=>m,l1:()=>f,o0:()=>i,q1:()=>n,tb:()=>k,vQ:()=>j});var d=c(26283);let e=new Map;function f(a){return(0,d._A)((0,d.aJ)(a)).replace(/^\u2503\s?/,"").replace(/\s*\u2503$/,"").trim()}function g(a){let b=a.split("\n"),c=[];for(let a of b){let b=f(a);!(!b||d.sx.some(a=>a.test(b)))&&(d.Md.test(b)||c.push(b))}return c}function h(a){return a.replace(/[\u2500-\u257F]/g,"").replace(/\s{2,}/g," ").trim()}function i(a){let b=(0,d.aJ)(a).split("\n"),c=[];for(let a of b){let b=h(a);b&&(d.J7.some(a=>a.test(b))||c.push(b))}return c}function j(a,b){if(0===a.length||0===b.length)return 0;let c=Math.min(a.length,b.length);for(let d=c;d>=1;d--){let c=a.slice(-d),e=b.slice(0,d),f=!0;for(let a=0;a<d;a++)if(c[a]!==e[a]){f=!1;break}if(f)return d}return 0}function k(a){e.set(a,{lines:[],lastFingerprint:[],pollCount:0})}function l(a,b,c="opencode"){let d=e.get(a);if(!d)return;let f="copilot"===c?i(b):g(b);if(0!==f.length){if(d.pollCount++,0===d.lines.length)d.lines=[...f];else{let a=j(d.lastFingerprint,f);if(a>0){let b=f.slice(a);d.lines.push(...b)}else d.lines.push(...f)}d.lastFingerprint=f.slice(-10)}}function m(a){let b=e.get(a);return b&&0!==b.lines.length?b.lines.join("\n"):""}function n(a){e.delete(a)}},16983:(a,b,c)=>{"use strict";c.d(b,{J:()=>e,s:()=>d});let d=1e3,e=200},18778:(a,b,c)=>{"use strict";c.d(b,{T:()=>g});var d=c(56791),e=c(41364);let f=(0,c(72626).h)("conversation-logger");async function g(a,b,c,h="claude"){let i=(0,d.r8)(a,b);if(i)try{await (0,e.hM)(b,i.content,c,h)}catch(a){f.error("conversation:log-failed",{error:a instanceof Error?a.message:String(a)})}}},20610:(a,b,c)=>{"use strict";c.d(b,{CV:()=>i,Em:()=>l,Is:()=>g,KI:()=>j,PY:()=>k,Uc:()=>d,Zf:()=>h,pL:()=>e,x9:()=>f});let d=100,e=100,f=200,g=300,h=500,i=500,j=2e3,k=200,l=100},21684:(a,b,c)=>{"use strict";c.d(b,{U:()=>g});var d=c(33873),e=c.n(d),f=c(87447);function g(){return(0,f._p)("CM_LOG_DIR")||e().join(process.cwd(),"data","logs")}},25129:(a,b,c)=>{"use strict";c.d(b,{gF:()=>A,xn:()=>u});var d=c(72626),e=c(68652);let f=/^\s*[\u276F\u25CF\u203A][^\d]*(\d+)(?:\.(?!\d)|\s{2,})\s*(.+)$/,g=/^\s*[^\d]{0,3}(\d+)(?:\.(?!\d)|\s+)\s*(.+)$/,h=/^[-─]+$/,i=/^\s*\[[^\]]*\d+\s+lines?\]/i,j=/^\s*[…]?\s*[+\-↑↓⏵⏷]?\s*\d+\s+(?:pending|more)\b/i,k=/Esc\s+to\s+cancel\s*[·•]\s*Tab\s+to\s+amend/i,l=/Enter\s+to\s+select\b.*\bnavigate\b/i,m=/press\s+(?:enter|number)\s+to\s+confirm/i,n=/press\s+number\s+to\s+confirm/i,o=/(?:select|choose|pick|which|what|how|where|enter|type|specify|confirm|approve|accept|reject|decide|preference|option)/i,p=[/type\s+here/i,/tell\s+(me|claude)/i,/enter\s+/i,/custom/i,/differently/i];function q(a,b){if(0===b.length)return!0;let c=b[0].number;return a<c&&a>=c-2}function r(a){return{isPrompt:!1,cleanContent:a.trim()}}function s(a){return 0!==a.length&&!!(a.includes("?")||a.includes("?")||o.test(a))}function t(a,b){let c=b.endsWith("?")||b.endsWith("?");return!!(!c&&/^\s{2,}[^\d]/.test(a)&&!/^\s*\d+\./.test(a)||!c&&/^\s{4,}/.test(a)&&!/^\s*\d+\.\s/.test(a)||b.length<5&&!c||/^[\/~]/.test(b)||b.length>=2&&/^[a-zA-Z0-9_-]+$/.test(b))}function u(a,b="yes_no"){let c=a.toLowerCase().trim();if("multiple_choice"===b){if(/^\d+$/.test(c))return c;throw Error("Invalid answer for multiple choice prompt. Expected a number.")}if("yes"===c||"y"===c)return"y";if("no"===c||"n"===c)return"n";throw Error("Invalid answer for yes/no prompt. Expected 'yes', 'no', 'y', or 'n'.")}let v=(0,d.h)("prompt-detector"),w=null;function x(a){let b=a.split("\n"),c=(b.length>200?b.slice(-200):b).join("\n");return c.length>5e3&&(c=c.slice(-5e3)),c}let y=[{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 z(a,b,c,d){return{isPrompt:!0,promptData:{type:"yes_no",question:a,options:["yes","no"],status:"pending",...void 0!==d&&{defaultOption:d},instructionText:c},cleanContent:b,rawContent:c}}function A(a,b){let c=(0,e.N)(a),d=c===a&&b?.precomputedLines?b.precomputedLines:c.split("\n"),o=d.slice(-50).join("\n"),u=o===w;u||v.debug("detectPrompt:start",{outputLength:c.length}),w=o;let A=d.slice(-20).join("\n"),B=function(a,b,c){var d,o;a=(0,e.N)(a);let u=b?.requireDefaultIndicator??!0,v=a.split("\n"),w=v.length;for(;w>0&&""===v[w-1].trim();)w--;let x=Math.max(0,w-50),y=!1;for(let a=w-1;a>=x;a--){let b=l.test(v[a]);if(k.test(v[a])||b){w=a,y=b;break}}let z=v.slice(x,w),A=!1,B=!1;for(let a of z){let b=a.trim();if(!A&&m.test(b)){A=!0,n.test(b)&&(B=!0);break}}if(u){let b=!1;for(let a of z){let c=a.trim();if(f.test(c)){b=!0;break}}if(!b&&!A)return r(a)}let C=[],D=-1,E=0;for(let b=w-1;b>=x;b--){let c=v[b].trim();if(i.test(c)||j.test(c)){E++;continue}let d=c.match(f);if(d){let a=parseInt(d[1],10);if(a<=20&&q(a,C)){let b=d[2].trim();C.unshift({number:a,label:b,isDefault:!0}),E=0;continue}}let e=c.match(g);if(e){let a=parseInt(e[1],10);if(a>20);else if(q(a,C)){let b=e[2].trim();C.unshift({number:a,label:b,isDefault:!1}),E=0;continue}}if(0===C.length&&(c.startsWith("❯")||c.startsWith("●")||c.startsWith("›")))return r(a);if(C.length>0&&c&&!h.test(c)){let a=v[b];if(/^\s{4,}/.test(a)&&t(a,c)){if(++E>25){D=b;break}continue}if(s(c)){D=b;break}if(t(a,c)){if(++E>(/^\s{4,}/.test(a)?25:5)){D=b;break}continue}D=b;break}}if(!function(a){if(0===a.length||1!==a[0])return!1;let b=0;for(let c=1;c<a.length;c++){let d=a[c]-a[c-1];if(d<1||d>2||(2===d&&b++,b>1))return!1}return!0}(C.map(a=>a.number)))return r(a);let F=C.some(a=>a.isDefault),G=u&&A;if(C.length<2||u&&!F&&!G||!u&&(-1===D||!s(v[D]?.trim()??"")&&!function(a,b,c,d){let e=Math.max(d,b-3);for(let c=b-1;c>=e;c--){let b=a[c]?.trim()??"";if(!(!b||h.test(b))&&s(b))return!0}return!1}(v,D,0,x)))return r(a);let H=function(a,b){if(b<0)return"Please select an option:";let c=[];for(let d=Math.max(0,b-5);d<=b;d++){let b=a[d].trim();b&&!h.test(b)&&c.push(b)}return c.join(" ")}(v,D),I=function(a,b,c){if(b<0)return;let d=Math.max(0,b-19),e=a.slice(d,c).map(a=>a.trimEnd()).join("\n").trim();return e.length>0?e:void 0}(v,D,w),J=A?B?"answer_only":"answer_then_enter":void 0;return d=a,o=y,{isPrompt:!0,promptData:{type:"multiple_choice",question:H.trim(),options:C.map(a=>{let b=p.some(b=>b.test(a.label));return{number:a.number,label:a.label,isDefault:a.isDefault,requiresTextInput:b}}),status:"pending",instructionText:I,...J?{submitMode:J}:{},...o?{isAskUserQuestion:!0}:{}},cleanContent:H.trim(),rawContent:c(d.trim())}}(c,b,x);if(B.isPrompt)return u||v.info("detectPrompt:multipleChoice",{isPrompt:!0,question:B.promptData?.question,optionsCount:B.promptData?.options?.length}),B;let C=A.trim();for(let a of y){let b=A.match(a.regex);if(b){let c=b[1].trim();return z(c,c,C,a.defaultOption)}}let D=A.match(/^(.*?)Approve\?\s*$/m);if(D){let a=D[1].trim();return z(a?`${a} Approve?`:"Approve?",a||"Approve?",C)}return u||v.debug("detectPrompt:complete",{isPrompt:!1}),{isPrompt:!1,cleanContent:c.trim()}}},25754:(a,b,c)=>{"use strict";c.d(b,{Xn:()=>e,d9:()=>g,gB:()=>f,rv:()=>h});let d=["en","ja"],e="en",f="locale";function g(a){return"string"==typeof a&&d.includes(a)}function h(a,b){return g(a)?a:d.find(a=>(b??"").includes(a))??e}},26838:(a,b,c)=>{"use strict";c.d(b,{Mj:()=>k,Sw:()=>j,lX:()=>l});var d=c(29021),e=c(33873),f=c(90164);let g=/^v?\d+\.\d+\.\d+$/,h=/^[a-zA-Z0-9.\-\s_v]+$/,i=globalThis.__versionCheckCache??(globalThis.__versionCheckCache={result:null,fetchedAt:0,rateLimitResetAt:null});function j(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.12.1"}function k(){return j()}async function l(){try{var a,b,c;if(null!==i.result&&Date.now()-i.fetchedAt<36e5||i.rateLimitResetAt&&(!(Date.now()>=i.rateLimitResetAt)||(i.rateLimitResetAt=null,0)))return i.result;let d=await fetch("https://api.github.com/repos/Kewton/CommandMate/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":`CommandMate/${k()}`},cache:"no-store",signal:AbortSignal.timeout(5e3)});if(403===d.status)return function(a){let b=a.headers.get("X-RateLimit-Reset");b?i.rateLimitResetAt=1e3*parseInt(b,10):i.rateLimitResetAt=Date.now()+36e5}(d),i.result;if(!d.ok)return i.result;let e=await d.json(),j=k(),l=e.tag_name.replace(/^v/,""),m={hasUpdate:function(a,b){if(!g.test(a)||!g.test(b))return!1;let c=a=>a.replace(/^v/,"").split(".").map(Number),[d,e,f]=c(a),[h,i,j]=c(b);return h!==d?h>d:i!==e?i>e:j>f}(j,e.tag_name),currentVersion:j,latestVersion:l,releaseUrl:(a=e.html_url).startsWith(f.Dk)?a:null,releaseName:(b=e.name,c=e.tag_name,h.test(b)&&b.length<=128?b:c),publishedAt:e.published_at};return i.result=m,i.fetchedAt=Date.now(),m}catch{return i.result}}},30618:(a,b,c)=>{"use strict";c.d(b,{xT:()=>w,Ui:()=>x});var d=c(44265),e=c(11665),f=c(40236),g=c(93997),h=c(29021),i=c(33873),j=c(72626);let k=(0,j.h)("cli-tools/opencode-config"),l=/^[a-zA-Z0-9._:/-]{1,100}$/,m=/^[a-zA-Z0-9._:/@-]{1,200}$/;async function n(){let a={};try{let b=new AbortController,c=setTimeout(()=>b.abort(),3e3),d=await fetch("http://localhost:11434/api/tags",{signal:b.signal}).finally(()=>{clearTimeout(c)});if(!d.ok)return k.warn("ollama-api-returned"),{};let e=await d.text();if(e.length>1048576)return k.warn("ollama-api-response"),{};let f=JSON.parse(e);if(!f||!Array.isArray(f.models))return k.warn("invalid-ollama-api"),{};for(let b of f.models.slice(0,100))"string"==typeof b?.name&&l.test(b.name)&&(a[b.name]={name:function(a){let b=String(a.name),c=a.details;if(!c)return b;let d=[b];return"string"==typeof c.parameter_size&&/^[\d.]+[BKMGT]?B?$/i.test(c.parameter_size)&&d.push(c.parameter_size),"string"==typeof c.quantization_level&&/^[A-Z0-9_]{1,20}$/i.test(c.quantization_level)&&d.push(c.quantization_level),d.length>1?`${b} (${d.slice(1).join(", ")})`:b}(b)})}catch(a){a instanceof Error&&"AbortError"===a.name?k.warn("ollama-api-timeout"):k.warn("failed-to-fetch")}return a}async function o(){let a={};try{let b=new AbortController,c=setTimeout(()=>b.abort(),3e3),d=await fetch("http://localhost:1234/v1/models",{signal:b.signal}).finally(()=>{clearTimeout(c)});if(!d.ok)return k.warn("lm-studio-api"),{};let e=await d.text();if(e.length>1048576)return k.warn("lm-studio-api"),{};let f=JSON.parse(e);if(!f||!Array.isArray(f.data))return k.warn("invalid-lm-studio"),{};for(let b of f.data.slice(0,100))"string"==typeof b?.id&&m.test(b.id)&&(a[b.id]={name:b.id})}catch(a){a instanceof Error&&"AbortError"===a.name?k.warn("lm-studio-api"):k.warn("failed-to-fetch")}return a}async function p(a){let b=function(a){let b=i.resolve(a);try{if(!h.lstatSync(b).isDirectory())throw Error(`Path is not a directory: ${b}`)}catch(a){if("ENOENT"===a.code)throw Error(`Path does not exist: ${b}`);throw a}return h.realpathSync(b)}(a),c=i.join(b,"opencode.json");if(h.existsSync(c))return;let[d,e]=await Promise.all([n(),o()]),f={};if(Object.keys(d).length>0&&(f.ollama={npm:"@ai-sdk/openai-compatible",name:"Ollama (local)",options:{baseURL:"http://localhost:11434/v1"},models:d}),Object.keys(e).length>0&&(f.lmstudio={npm:"@ai-sdk/openai-compatible",name:"LM Studio (local)",options:{baseURL:"http://localhost:1234/v1"},models:e}),0!==Object.keys(f).length)try{h.writeFileSync(c,JSON.stringify({$schema:"https://opencode.ai/config.json",provider:f},null,2),{encoding:"utf-8",flag:"wx"})}catch(a){if("EEXIST"===a.code)return;k.warn("failed-to-write-opencodejson:error-insta")}}var q=c(79646),r=c(28354),s=c(20610);let t=(0,j.h)("cli-tools/opencode"),u=(0,r.promisify)(q.execFile);function v(a){return a instanceof Error?a.message:String(a)}let w=200;class x extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,e.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("OpenCode is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,e.N)(d)){await this.reconcileExistingSession(d,{windowWidth:80,windowHeight:w}),t.info("opencode-session-sessionname");return}try{await p(b),await (0,e.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,s.Uc));try{await u("tmux",["resize-window","-t",(0,e.lA)(d),"-x","80","-y",String(w)])}catch{}await (0,e.V1)(d,"opencode",!0),await new Promise(a=>setTimeout(a,15e3)),t.info("started-opencode-session:sessionname")}catch(b){let a=v(b);throw Error(`Failed to start OpenCode session: ${a}`)}}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,e.N)(d))throw Error(`OpenCode session ${d} does not exist. Start the session first.`);try{await (0,f.F)({sessionName:d,message:b,cliToolId:"opencode"}),(0,g.gm)(d),t.info("sent-message-to-opencode-session:session")}catch(b){let a=v(b);throw Error(`Failed to send message to OpenCode: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,e.N)(c)?(await (0,e.V1)(c,"/exit",!0),await new Promise(a=>setTimeout(a,s.KI)),await (0,e.N)(c)&&await (0,e.fY)(c)):await (0,e.fY)(c),(0,g.gm)(c),t.info("stopped-opencode-session:sessionname")}catch(a){throw t.error("session:stop-failed",{error:v(a)}),a}}constructor(...a){super(...a),this.id="opencode",this.name="OpenCode",this.command="opencode"}}},31268:(a,b,c)=>{"use strict";c.d(b,{s:()=>K});var d=c(44265),e=c(57905);class f extends d.M{async isInstalled(){return await (0,e.zw)()}async isRunning(a,b){return await (0,e.Yq)(a,b)}async startSession(a,b,c){await (0,e.R7)({worktreeId:a,worktreePath:b,instanceId:c})}async sendMessage(a,b,c){await (0,e.pU)(a,b,c)}supportsImage(){return!0}async sendMessageWithImage(a,b,c,d){let e=`
1
+ exports.id=5959,exports.ids=[1296,5959,9358],exports.modules={60:(a,b,c)=>{"use strict";c.d(b,{Q:()=>f,b:()=>e});var d=c(26283);function e(a){return d.Md.test(a)&&!d.kD.test(a)}function f(a,b,c,d,e){if(a=Math.max(0,a),"opencode"===d||"copilot"===d){let a=e(b);return a>=0?a+1:0}if("antigravity"===d){let c=e(b);return c>=0?c+1:Math.max(0,a)}if(a>=b||c){let a=e(40);return a>=0?a+1:0}if("codex"===d)return Math.max(0,a);if(a>=b-5){let a=e(50);return a>=0?a+1:Math.max(0,b-40)}return Math.max(0,a)}},3523:(a,b,c)=>{"use strict";c.d(b,{z$:()=>A,zX:()=>B});var d=c(31766),e=c(88807),f=c(56791),g=c(49997),h=c(25129),i=c(18778),j=c(15194),k=c(8988),l=c(26283),m=c(72626),n=c(46423),o=c(60),p=c(82450),q=c(56263),r=c(13033),s=c(72457),t=c(71080),u=c(45146),v=c(63865);let w=(0,m.h)("response-poller");function x(a){return{response:"",isComplete:!1,lineCount:a}}function y(a,b,c,d,e,f,g){let h=(0,o.Q)(b,c,d,e,f),i=a.slice(h);return{response:(0,l.aJ)(i.join("\n")),isComplete:!0,lineCount:c,promptDetection:g,bufferReset:d}}function z(a,b){let c=(0,l.KO)(b);return(0,h.gF)((0,l._A)((0,l.aJ)(a)),c)}function A(a,b,c){let d=a.split("\n"),e=d.length;for(;e>0&&""===d[e-1].trim();)e--;let f=d.slice(0,e),g=f.length,h="claude"===c?(0,l.GT)(f):-1,i=h>=0?h:g,j=g>0&&b>25&&g+25<b,k=g>0&&b>50&&g<50,m=j||k;if(!m&&g<b-5)return null;let p=Math.max(0,g-20),q=f.slice(p),r="opencode"===c?(0,l.aJ)(f.join("\n")):q.join("\n"),{promptPattern:s,separatorPattern:t,thinkingPattern:v,skipPatterns:w}=(0,l._X)(c),A=(a=60)=>{let b;if("codex"===c)b=/^›\s+(?!Implement|Find and fix|Type|Summarize)/;else if("opencode"===c){let b=0;for(let c=g-1;c>=Math.max(0,g-a);c--){let a=(0,l.aJ)(f[c]);if(l.Md.test(a)&&2==++b)return c}return -1}else b=/^[>❯]\s+\S/;for(let c=i-1;c>=Math.max(0,i-a);c--){let a=(0,l.aJ)(f[c]);if(b.test(a))return c}return -1};if("claude"===c||"codex"===c||"copilot"===c){let a=z(f.join("\n"),c);if(a.isPrompt)return y(f,b,g,m,c,A,a)}let B=(0,l.aJ)(r),C=s.test(B),D=t.test(B),E=v.test(B),F=("codex"===c||"gemini"===c||"vibe-local"===c||"copilot"===c||"antigravity"===c)&&C&&!E,G="claude"===c&&C&&D&&!E,H="opencode"===c&&(0,o.b)(B);if(F||G||H){let a=[],d=(0,o.Q)(b,g,m,c,A),e=g;for(let b=d;b<i;b++){let d=f[b],g=(0,l.aJ)(d);if("codex"===c&&/^›\s+/.test(g)||"gemini"===c&&/^(%|\$|.*@.*[%$#])\s*$/.test(g)||"antigravity"===c&&/^>\s*$/.test(g)||"opencode"===c&&(l.sy.test(g)||l.uA.test(g))){e=b;break}w.some(a=>a.test(g))||a.push(d)}let h=a.join("\n").trim(),j=h.split("\n").slice(-n.$).join("\n");if(v.test(j))return x(g);if("claude"===c){let a=(0,l.aJ)(h),b=/[╭╮╰╯│]/.test(a)||/░{3,}/.test(a)||/▓{3,}/.test(a),c=/Claude Code|claude\/|v\d+\.\d+/.test(a),d=/Tip:|for shortcuts|\?\s*for help/.test(a),e=/^\s*\/Users\/.*$/m.test(a)&&a.split("\n").length<30,f=a.match(/^[>❯]\s+(\S.*)$/m);if(f){let b=a.indexOf(f[0]);if(0===a.substring(b+f[0].length).trim().split("\n").filter(a=>{let b=a.trim();return b&&!w.some(a=>a.test(b))&&!/^─+$/.test(b)}).length)return x(g)}else if((b||c||d||e)&&h.length<2e3)return x(g)}if("gemini"===c&&((h.match(/[░███]/g)||[]).length>.3*h.length||u.SI.some(a=>h.includes(a))||!h.includes("✦")&&h.length<10))return x(g);if("opencode"===c){let a=(0,l.aJ)(h);if((a.length<50||!l.Md.test(B))&&0===a.split("\n").filter(a=>{let b=a.trim();return b&&!l.sx.some(a=>a.test(b))}).length)return x(g)}return{response:h,isComplete:!0,lineCount:e,bufferReset:m}}if("opencode"!==c){let a=z(f.join("\n"),c);if(a.isPrompt)return y(f,b,g,m,c,A,a)}let I=[],J=m||b>=g-5,K=J?A(80):-1,L=J?K>=0?K+1:Math.max(0,g-80):Math.max(0,b);for(let a=L;a<Math.min(g,i);a++){let b=f[a],c=(0,l.aJ)(b);w.some(a=>a.test(c))||I.push(b)}let M=I.join("\n").trim();return M?{response:M,isComplete:!1,lineCount:g}:x(g)}async function B(a,b,c){let h=(0,e.getDbInstance)(),m=c??b;try{let e=(0,f.Ui)(h,a);if(!e)return w.error("worktree-worktreeid-not"),(0,u.Et)(a,b,c),!1;if(!await (0,d.K1)(a,b,c))return w.info("session-not-running"),(0,u.Et)(a,b,c),!1;let o=(0,f.y1)(h,a,m),x=o?.lastCapturedLine||0,y=await (0,d.Wh)(a,b,1e4,c);if("opencode"===b||"copilot"===b){let d=(0,u.MN)(a,b,c);(0,r.IZ)(d,y,b)}let B=A(y,x,b);if(!B||!B.isComplete){let{thinkingPattern:c}=(0,l._X)(b),d=(0,l.aJ)(y).split("\n").slice(-n.$).join("\n");return c.test(d)&&(0,f.PL)(h,a,b,m)>0&&w.info("marked-answeredcount-pending"),!1}let C="opencode"===b||"copilot"===b,D=!(0,j.VA)(b);if(D&&!B.bufferReset&&B.lineCount===x&&!o?.inProgressMessageId)return!1;if(D&&!B.bufferReset&&B.lineCount<=x)return w.info("already-saved-up-to-line-lastcapturedlin"),!1;let E=B.promptDetection??z(B.response,b);if(E.isPrompt){let d=E.rawContent||E.cleanContent,i=(0,u.MN)(a,b,c),j=(0,s.zm)(d,b);if((0,s.gv)(i,j))return w.info("duplicate-prompt-skipped",{worktreeId:a,cliToolId:b}),!1;let k=d;"copilot"===b&&(k=(0,p.LH)(d),k=(0,p.Sj)(k,q.Rf,q.ky)),(0,f.YX)(h,a,b,m);let l=(0,f.oH)(h,{worktreeId:a,role:"assistant",content:k,messageType:"prompt",promptData:E.promptData,timestamp:new Date,cliToolId:b,instanceId:m});return(0,f.gb)(h,a,b,B.lineCount,m),(0,g.Lo)("message",{worktreeId:a,message:l}),(0,v.J$)({worktreeId:a,worktreeName:e.name,kind:"prompt",agentName:m,excerpt:E.promptData?.question??k}).catch(()=>{}),C||(0,u.Et)(a,b,c),!0}if(!B.response||""===B.response.trim())return(0,f.gb)(h,a,b,B.lineCount,m),!1;let F="claude"===b?(0,k.R)(B.response):void 0,G=B.response;if("gemini"===b)G=(0,p.IS)(B.response);else if("claude"===b)G=(0,p.NN)(B.response);else if("copilot"===b){let d=(0,u.MN)(a,b,c),e=(0,r.Uz)(d)||B.response;G=(0,p.LH)(e),G=(0,p.Sj)(G,q.Rf,q.ky),(0,r.q1)(d)}else if("opencode"===b){G=(0,p.aW)(B.response);let d=(0,u.MN)(a,b,c);(0,r.q1)(d)}if(!G||""===G.trim()||"[No content]"===G)return(0,f.gb)(h,a,b,B.lineCount,m),(0,f.YX)(h,a,b,m),!1;if((0,j.VA)(b)){let d=(0,u.MN)(a,b,c);if((0,t.j)(d,G))return(0,f.gb)(h,a,b,B.lineCount,m),!1}G&&await (0,i.T)(h,a,G,b),(0,f.PL)(h,a,b,m)>0&&w.info("marked-answeredcount-pending");let H=(0,f.y1)(h,a,m);if(D&&H&&B.lineCount<=H.lastCapturedLine)return w.info("race-condition-detected-skipping-save-re"),!1;let I=(0,f.oH)(h,{worktreeId:a,role:"assistant",content:G,messageType:"normal",timestamp:new Date,cliToolId:b,instanceId:m,summary:F?.summary,logFileName:F?.logFileName,requestId:F?.requestId});return(0,g.Lo)("message",{worktreeId:a,message:I}),(0,v.J$)({worktreeId:a,worktreeName:e.name,kind:"completion",agentName:m,excerpt:G}).catch(()=>{}),(0,f.gb)(h,a,b,B.lineCount,m),C&&(0,u.Et)(a,b,c),!0}catch(a){return w.error("response:check-failed",{error:a instanceof Error?a.message:String(a)}),!1}}},5344:(a,b,c)=>{"use strict";c.d(b,{v7:()=>i,LP:()=>s,pL:()=>k,GE:()=>l,aq:()=>n,kC:()=>r,xU:()=>D,bZ:()=>E,W8:()=>o,W5:()=>K,_i:()=>L,_C:()=>M});var d=c(68901),e=c(66007),f=c(15194),g=c(72626);let h=(0,g.h)("auto-yes-state");function i(a,b,c){if(a.includes(":"))throw Error(`worktreeId must not contain ':': ${a}`);if(!c||c===b)return`${a}:${b}`;if(c.includes(":"))throw Error(`instanceId must not contain ':': ${c}`);return`${a}:${b}:${c}`}function j(a){let b=a.indexOf(":");return -1===b?a:a.substring(0,b)}function k(a){let b=a.split(":")[1];return void 0===b?null:(0,f.hR)(b)?b:null}function l(a){let b=a.split(":");return b[2]??b[1]??null}let m=globalThis.__autoYesStates??(globalThis.__autoYesStates=new Map);function n(a,b="claude",c){let d=i(a,b,c),e=m.get(d);return e?Date.now()>=e.expiresAt?p(a,b,"expired",c):e:null}function o(a,b,c,e,f,g){let h=i(a,b,g);if(!c)return p(a,b,void 0,g);{let a=Date.now(),b={enabled:!0,enabledAt:a,expiresAt:a+(e??d.t6),stopPattern:f};return m.set(h,b),b}}function p(a,b="claude",c,d){let e=i(a,b,d),f=m.get(e),g={enabled:!1,enabledAt:f?.enabledAt??0,expiresAt:f?.expiresAt??0,stopPattern:f?.stopPattern,stopReason:c};return m.set(e,g),g}function q(a,b){return a.filter(a=>j(a)===b)}function r(a){return q(Array.from(m.keys()),a)}function s(a){let b=r(a);return b.forEach(a=>m.delete(a)),b.length}var t=c(31766),u=c(25129),v=c(63869),w=c(31268),x=c(26283),y=c(77093),z=c(93997);let A=(0,g.h)("auto-yes-poller"),B=globalThis.__autoYesPollerStates??(globalThis.__autoYesPollerStates=new Map);function C(a){return B.get(a)}function D(a){let b=C(a);return b?.lastServerResponseTimestamp??null}function E(a){return B.has(a)}function F(a){let b=C(a);if(b){var c;if(b.consecutiveErrors++,b.currentInterval=(c=b.consecutiveErrors)<5?2e3:Math.min(2e3*Math.pow(2,c-5+1),6e4),b.consecutiveErrors>=d.ul){let b=j(a),c=k(a);c&&p(b,c,"consecutive_errors",l(a)??void 0),L(a)}}}async function G(a,b,c,e){let f=c??d.FW,g=await (0,t.Wh)(a,b,f,e);return(0,x._A)((0,x.aJ)(g))}async function H(a,b,d,e,f,g){let h=i(a,d,g);try{let i=(0,x.KO)(d),l=(0,u.gF)(e,{...i,...f&&{precomputedLines:f}});if(!l.isPrompt||!l.promptData)return b.lastAnsweredPromptKey=null,b.lastAnsweredAt=null,"no_prompt";let m=(j=l.promptData,`${j.type}:${j.question}`);if(b.lastAnsweredPromptKey===m&&null!==b.lastAnsweredAt&&Date.now()-b.lastAnsweredAt<1e4)return"duplicate";let n=function(a){if("yes_no"===a.type)return"y";if("multiple_choice"===a.type){let b=a.options.find(a=>a.isDefault)??a.options[0];return!b||b.requiresTextInput?null:b.number.toString()}return null}(l.promptData);if(null===n)return"no_answer";let o=w.s.getInstance().getTool(d).getSessionName(a,g);try{await (0,v.t)({sessionName:o,answer:n,cliToolId:d,promptData:l.promptData})}finally{(0,z.gm)(o)}var j,k=Date.now();let p=C(h);p&&(p.lastServerResponseTimestamp=k);let q=C(h);q&&(q.consecutiveErrors=0,q.currentInterval=2e3),b.lastAnsweredPromptKey=m,b.lastAnsweredAt=Date.now(),A.info("poller:response-sent",{worktreeId:a,cliToolId:d,instanceId:g});let[{startPolling:r},{broadcastTerminalSnapshotAfterInteraction:s}]=await Promise.all([Promise.resolve().then(c.bind(c,95220)),Promise.resolve().then(c.bind(c,99508))]);return r(a,d,g),s(a,d,g),"responded"}catch{return F(h),A.warn("poller:detect-respond-error",{worktreeId:a,cliToolId:d,instanceId:g}),"error"}}async function I(a,b,c){let e=i(a,b,c),f=C(e);if("valid"===function(a,b){if(!b)return"stopped";let c=j(a),d=k(a);if(!d)return L(a),"expired";let e=n(c,d,l(a)??void 0);return e?.enabled?"valid":(L(a),"expired")}(e,f)){try{let g=n(a,b,c),i=g?.stopPattern?d.FW:d.Ke,m=await G(a,b,i,c),o=m.split("\n");if(function(a,b,c){if(b.stopCheckBaselineLength<0)return b.stopCheckBaselineLength=c.length,!1;let e=b.stopCheckBaselineLength;if(c.length>e){let f=c.substring(e);return b.stopCheckBaselineLength=c.length,function(a,b,c){let e=j(a),f=k(a);if(!f)return!1;let g=l(a)??void 0,i=n(e,f,g);if(!i?.stopPattern)return!1;if(!(0,d.P0)(i.stopPattern).valid)return h.warn("invalid-stop-pattern",{detail:String({compositeKey:a})}),p(e,f,void 0,g),!1;try{let d=new RegExp(i.stopPattern),j=function(a,b,c=100){try{return a.test(b)}catch{return null}}(d,b);if(null===j)return h.warn("stop-condition-check",{detail:String({compositeKey:a})}),p(e,f,void 0,g),!1;if(j)return p(e,f,"stop_pattern_matched",g),c&&c(a),h.warn("stop-condition-matched",{detail:String({compositeKey:a})}),!0}catch{h.warn("stop-condition-check",{detail:String({compositeKey:a})})}return!1}(a,f,L)}return c.length<e&&(b.stopCheckBaselineLength=c.length),!1}(e,f,m))return;let q=await H(a,f,b,m,o,c);if("responded"===q)return void J(a,b,c,5e3);if("no_prompt"===q){let e=o.slice(-50).join("\n");if((0,x.ut)(b,e))return void J(a,b,c,d.QN)}}catch(d){F(e),A.warn("poller:poll-error",{worktreeId:a,cliToolId:b,instanceId:c,error:(0,y.u1)(d)})}J(a,b,c)}}function J(a,b,c,d){let e=C(i(a,b,c));if(!e)return;let f=Math.max(d??e.currentInterval,2e3);e.timerId=setTimeout(()=>{I(a,b,c)},f)}function K(a,b,c){if(!(0,e.h6)(a))return{started:!1,reason:"invalid worktree ID"};let d=c??b,f=n(a,b,d);if(!f?.enabled)return{started:!1,reason:"auto-yes not enabled"};let g=i(a,b,d),h=C(g);if(!h&&B.size>=50)return{started:!1,reason:"max concurrent pollers reached"};if(h&&h.cliToolId===b)return{started:!0,reason:"already_running"};h&&L(g);let j={timerId:null,cliToolId:b,instanceId:d,consecutiveErrors:0,currentInterval:2e3,lastServerResponseTimestamp:null,lastAnsweredPromptKey:null,lastAnsweredAt:null,stopCheckBaselineLength:-1};return B.set(g,j),j.timerId=setTimeout(()=>{I(a,b,d)},2e3),A.info("poller:started",{worktreeId:a,cliToolId:b,instanceId:d}),{started:!0}}function L(a){let b=C(a);b&&(b.timerId&&clearTimeout(b.timerId),B.delete(a),A.info("poller:stopped",{compositeKey:a}))}function M(a){q(Array.from(B.keys()),a).forEach(a=>L(a))}},7015:(a,b,c)=>{"use strict";c.d(b,{Ds:()=>g});var d=c(81719);class e{constructor(a,b=3e4){this.cache=new Map,this.allAppsCache=null,this.lastRefresh=0,this.db=a,this.ttl=b}getTTL(){return this.ttl}isStale(){return Date.now()-this.lastRefresh>this.ttl}async refresh(){let a=(0,d.$i)(this.db);for(let b of(this.cache.clear(),a))this.cache.set(b.pathPrefix,b);this.allAppsCache=a,this.lastRefresh=Date.now()}async getByPathPrefix(a){return this.isStale()&&await this.refresh(),this.cache.get(a)??null}async getAll(){return this.isStale()&&await this.refresh(),this.allAppsCache??[]}invalidate(){this.cache.clear(),this.allAppsCache=null,this.lastRefresh=0}invalidateByIssueNo(a){this.invalidate()}}let f=null;function g(a){if(!f){if(!a)throw Error("Database instance required to initialize cache");f=new e(a)}return f}},8988:(a,b,c)=>{"use strict";c.d(b,{R:()=>g});let d=/📄 Session log: (.+?\/([^\/\s]+\.jsonl))/,e=/Request ID: ([^\s\n]+)/,f=/Summary: (.+?)(?:\n─|$)/s;function g(a){let b={content:a},c=d.exec(a);c&&(b.logFileName=c[2]);let g=e.exec(a);g&&(b.requestId=g[1]);let h=f.exec(a);return h&&(b.summary=h[1].trim()),b}},11508:(a,b,c)=>{"use strict";c.d(b,{H:()=>m,m:()=>n});var d=c(44265),e=c(11665),f=c(40236),g=c(93997),h=c(26283),i=c(72626),j=c(20610);let k=(0,i.h)("cli-tools/gemini");function l(a){return a instanceof Error?a.message:String(a)}let m=200;class n extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,e.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("Gemini CLI is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,e.N)(d)){await this.reconcileExistingSession(d),k.info("gemini-session-sessionname");return}try{await (0,e.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,j.Uc)),await (0,e.V1)(d,"gemini",!0),await new Promise(a=>setTimeout(a,6e3)),await this.waitForReady(d),k.info("started-gemini-session:sessionname")}catch(b){let a=l(b);throw Error(`Failed to start Gemini session: ${a}`)}}async waitForReady(a){let b=!1;for(let c=0;c<30;c++){try{let c=await (0,e.Xg)(a,m),d=(0,h.aJ)(c);if(h.wN.test(d))return void k.info("gemini-prompt-detected");!b&&d.includes("Do you trust this folder?")&&(await (0,e.ds)(a,"Enter"),b=!0,k.info("auto-trusted-folder-for"))}catch{}await new Promise(a=>setTimeout(a,1e3))}k.info("gemini-prompt-detection")}async waitForPrompt(a){let b=Date.now();for(;Date.now()-b<15e3;){try{let b=await (0,e.Xg)(a,m),c=(0,h.aJ)(b);if(h.wN.test(c))return}catch{}await new Promise(a=>setTimeout(a,500))}k.info("gemini-prompt-not")}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,e.N)(d))throw Error(`Gemini session ${d} does not exist. Start the session first.`);try{await this.waitForPrompt(d),await (0,f.F)({sessionName:d,message:b,cliToolId:"gemini"}),(0,g.gm)(d),k.info("sent-message-to-gemini-session:sessionna")}catch(b){let a=l(b);throw Error(`Failed to send message to Gemini: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,e.N)(c)&&(await (0,e.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,j.Is)),await (0,e.V1)(c,"/quit",!0),await new Promise(a=>setTimeout(a,j.Zf))),await (0,e.fY)(c)&&k.info("stopped-gemini-session:sessionname")}catch(a){throw k.error("session:stop-failed",{error:l(a)}),a}}constructor(...a){super(...a),this.id="gemini",this.name="Gemini CLI",this.command="gemini"}}},11665:(a,b,c)=>{"use strict";c.d(b,{GW:()=>n,KB:()=>r,N:()=>m,N6:()=>x,Sb:()=>y,V1:()=>p,Xg:()=>s,ds:()=>v,fY:()=>t,jw:()=>o,lA:()=>k,zT:()=>l});var d=c(79646),e=c(28354),f=c(93997),g=c(16983),h=c(72626);let i=(0,e.promisify)(d.execFile),j=(0,h.h)("tmux");function k(a){return`=${a}:`}async function l(a,b={}){let c,d,e,f=b.windowWidth??g.J,h=b.windowHeight??g.s,m=k(a);try{c=(await i("tmux",["show-window-options","-v","-t",m,"window-size"],{timeout:5e3})).stdout.trim();let[a,b]=(await i("tmux",["display-message","-p","-t",m,"#{window_width}|#{window_height}"],{timeout:5e3})).stdout.trim().split("|").map(Number);Number.isFinite(a)&&(d=a),Number.isFinite(b)&&(e=b)}catch{}let n="manual"===c,o=d===f&&e===h;if(n&&o)return!1;try{return n||await i("tmux",["set-window-option","-t",m,"window-size","manual"],{timeout:5e3}),o||await i("tmux",["resize-window","-t",m,"-x",String(f),"-y",String(h)],{timeout:5e3}),!0}catch(b){return j.warn("session-geometry:reconcile-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)}),!1}}async function m(a){try{return await i("tmux",["has-session","-t",k(a)],{timeout:5e3}),!0}catch{return!1}}async function n(){try{let{stdout:a}=await i("tmux",["list-sessions","-F","#{session_name}|#{session_windows}|#{session_attached}"],{timeout:5e3});if(!a||""===a.trim())return[];return a.trim().split("\n").map(a=>{let[b,c,d]=a.split("|");return{name:b,windows:parseInt(c,10)||0,attached:"1"===d}})}catch{return[]}}async function o(a,b){let c,d,e,f,h;"string"==typeof a?(c=a,d=b,e=5e4,f=g.J,h=g.s):(c=a.sessionName,d=a.workingDirectory,e=a.historyLimit||5e4,f=a.windowWidth||g.J,h=a.windowHeight||g.s);try{await i("tmux",["new-session","-d","-s",c,"-c",d,"-x",String(f),"-y",String(h)],{timeout:5e3}),await l(c,{windowWidth:f,windowHeight:h}),await i("tmux",["set-option","-t",k(c),"history-limit",String(e)],{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to create tmux session: ${a}`)}}async function p(a,b,c=!0){let d=c?["send-keys","-t",k(a),b,"C-m"]:["send-keys","-t",k(a),b];try{await i("tmux",d,{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send keys to tmux session: ${a}`)}}let q=new Set(["Up","Down","Left","Right","Enter","Space","Tab","Escape","BSpace","DC","PageUp","PageDown","Home","End","q"]);async function r(a,b){if(0!==b.length){for(let a of b)if(!q.has(a))throw Error(`Invalid special key: ${a}`);try{for(let c=0;c<b.length;c++)await i("tmux",["send-keys","-t",k(a),b[c]],{timeout:5e3}),c<b.length-1&&await new Promise(a=>setTimeout(a,100))}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send special keys to tmux session: ${a}`)}}}async function s(a,b){let c,d;"number"==typeof b?(c=-b,d="-"):b?(c=b.startLine??-1e4,d=b.endLine??"-"):(c=-1e3,d="-");try{let{stdout:b}=await i("tmux",["capture-pane","-t",k(a),"-p","-e","-S",String(c),"-E",String(d)],{timeout:5e3,maxBuffer:0xa00000});return b}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to capture pane: ${a}`)}}async function t(a){try{return await i("tmux",["kill-session","-t",k(a)],{timeout:5e3}),!0}catch(b){let a=b instanceof Error?b.message:String(b);if(a?.includes("no server running")||a?.includes("can't find session"))return!1;throw Error(`Failed to kill tmux session: ${a}`)}}let u=new Set(["Escape","C-c","C-d","C-m","Enter"]);async function v(a,b){if(!u.has(b))throw Error(`Invalid special key: ${b}`);try{await i("tmux",["send-keys","-t",k(a),b],{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send special key: ${a}`)}}let w=["Up","Down","Left","Right","Enter","Escape","Tab","BTab","PageUp","PageDown","Home","End","q"];function x(a){return w.includes(a)}async function y(a,b){await r(a,b),(0,f.gm)(a)}},13033:(a,b,c)=>{"use strict";c.d(b,{IW:()=>h,IZ:()=>l,K0:()=>g,Uz:()=>m,l1:()=>f,o0:()=>i,q1:()=>n,tb:()=>k,vQ:()=>j});var d=c(26283);let e=new Map;function f(a){return(0,d._A)((0,d.aJ)(a)).replace(/^\u2503\s?/,"").replace(/\s*\u2503$/,"").trim()}function g(a){let b=a.split("\n"),c=[];for(let a of b){let b=f(a);!(!b||d.sx.some(a=>a.test(b)))&&(d.Md.test(b)||c.push(b))}return c}function h(a){return a.replace(/[\u2500-\u257F]/g,"").replace(/\s{2,}/g," ").trim()}function i(a){let b=(0,d.aJ)(a).split("\n"),c=[];for(let a of b){let b=h(a);b&&(d.J7.some(a=>a.test(b))||c.push(b))}return c}function j(a,b){if(0===a.length||0===b.length)return 0;let c=Math.min(a.length,b.length);for(let d=c;d>=1;d--){let c=a.slice(-d),e=b.slice(0,d),f=!0;for(let a=0;a<d;a++)if(c[a]!==e[a]){f=!1;break}if(f)return d}return 0}function k(a){e.set(a,{lines:[],lastFingerprint:[],pollCount:0})}function l(a,b,c="opencode"){let d=e.get(a);if(!d)return;let f="copilot"===c?i(b):g(b);if(0!==f.length){if(d.pollCount++,0===d.lines.length)d.lines=[...f];else{let a=j(d.lastFingerprint,f);if(a>0){let b=f.slice(a);d.lines.push(...b)}else d.lines.push(...f)}d.lastFingerprint=f.slice(-10)}}function m(a){let b=e.get(a);return b&&0!==b.lines.length?b.lines.join("\n"):""}function n(a){e.delete(a)}},16983:(a,b,c)=>{"use strict";c.d(b,{J:()=>e,s:()=>d});let d=1e3,e=200},18778:(a,b,c)=>{"use strict";c.d(b,{T:()=>g});var d=c(56791),e=c(41364);let f=(0,c(72626).h)("conversation-logger");async function g(a,b,c,h="claude"){let i=(0,d.r8)(a,b);if(i)try{await (0,e.hM)(b,i.content,c,h)}catch(a){f.error("conversation:log-failed",{error:a instanceof Error?a.message:String(a)})}}},20610:(a,b,c)=>{"use strict";c.d(b,{CV:()=>i,Em:()=>l,Is:()=>g,KI:()=>j,PY:()=>k,Uc:()=>d,Zf:()=>h,pL:()=>e,x9:()=>f});let d=100,e=100,f=200,g=300,h=500,i=500,j=2e3,k=200,l=100},21684:(a,b,c)=>{"use strict";c.d(b,{U:()=>g});var d=c(33873),e=c.n(d),f=c(87447);function g(){return(0,f._p)("CM_LOG_DIR")||e().join(process.cwd(),"data","logs")}},25129:(a,b,c)=>{"use strict";c.d(b,{gF:()=>A,xn:()=>u});var d=c(72626),e=c(68652);let f=/^\s*[\u276F\u25CF\u203A][^\d]*(\d+)(?:\.(?!\d)|\s{2,})\s*(.+)$/,g=/^\s*[^\d]{0,3}(\d+)(?:\.(?!\d)|\s+)\s*(.+)$/,h=/^[-─]+$/,i=/^\s*\[[^\]]*\d+\s+lines?\]/i,j=/^\s*[…]?\s*[+\-↑↓⏵⏷]?\s*\d+\s+(?:pending|more)\b/i,k=/Esc\s+to\s+cancel\s*[·•]\s*Tab\s+to\s+amend/i,l=/Enter\s+to\s+select\b.*\bnavigate\b/i,m=/press\s+(?:enter|number)\s+to\s+confirm/i,n=/press\s+number\s+to\s+confirm/i,o=/(?:select|choose|pick|which|what|how|where|enter|type|specify|confirm|approve|accept|reject|decide|preference|option)/i,p=[/type\s+here/i,/tell\s+(me|claude)/i,/enter\s+/i,/custom/i,/differently/i];function q(a,b){if(0===b.length)return!0;let c=b[0].number;return a<c&&a>=c-2}function r(a){return{isPrompt:!1,cleanContent:a.trim()}}function s(a){return 0!==a.length&&!!(a.includes("?")||a.includes("?")||o.test(a))}function t(a,b){let c=b.endsWith("?")||b.endsWith("?");return!!(!c&&/^\s{2,}[^\d]/.test(a)&&!/^\s*\d+\./.test(a)||!c&&/^\s{4,}/.test(a)&&!/^\s*\d+\.\s/.test(a)||b.length<5&&!c||/^[\/~]/.test(b)||b.length>=2&&/^[a-zA-Z0-9_-]+$/.test(b))}function u(a,b="yes_no"){let c=a.toLowerCase().trim();if("multiple_choice"===b){if(/^\d+$/.test(c))return c;throw Error("Invalid answer for multiple choice prompt. Expected a number.")}if("yes"===c||"y"===c)return"y";if("no"===c||"n"===c)return"n";throw Error("Invalid answer for yes/no prompt. Expected 'yes', 'no', 'y', or 'n'.")}let v=(0,d.h)("prompt-detector"),w=null;function x(a){let b=a.split("\n"),c=(b.length>200?b.slice(-200):b).join("\n");return c.length>5e3&&(c=c.slice(-5e3)),c}let y=[{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 z(a,b,c,d){return{isPrompt:!0,promptData:{type:"yes_no",question:a,options:["yes","no"],status:"pending",...void 0!==d&&{defaultOption:d},instructionText:c},cleanContent:b,rawContent:c}}function A(a,b){let c=(0,e.N)(a),d=c===a&&b?.precomputedLines?b.precomputedLines:c.split("\n"),o=d.slice(-50).join("\n"),u=o===w;u||v.debug("detectPrompt:start",{outputLength:c.length}),w=o;let A=d.slice(-20).join("\n"),B=function(a,b,c){var d,o;a=(0,e.N)(a);let u=b?.requireDefaultIndicator??!0,v=a.split("\n"),w=v.length;for(;w>0&&""===v[w-1].trim();)w--;let x=Math.max(0,w-50),y=!1;for(let a=w-1;a>=x;a--){let b=l.test(v[a]);if(k.test(v[a])||b){w=a,y=b;break}}let z=v.slice(x,w),A=!1,B=!1;for(let a of z){let b=a.trim();if(!A&&m.test(b)){A=!0,n.test(b)&&(B=!0);break}}if(u){let b=!1;for(let a of z){let c=a.trim();if(f.test(c)){b=!0;break}}if(!b&&!A)return r(a)}let C=[],D=-1,E=0;for(let b=w-1;b>=x;b--){let c=v[b].trim();if(i.test(c)||j.test(c)){E++;continue}let d=c.match(f);if(d){let a=parseInt(d[1],10);if(a<=20&&q(a,C)){let b=d[2].trim();C.unshift({number:a,label:b,isDefault:!0}),E=0;continue}}let e=c.match(g);if(e){let a=parseInt(e[1],10);if(a>20);else if(q(a,C)){let b=e[2].trim();C.unshift({number:a,label:b,isDefault:!1}),E=0;continue}}if(0===C.length&&(c.startsWith("❯")||c.startsWith("●")||c.startsWith("›")))return r(a);if(C.length>0&&c&&!h.test(c)){let a=v[b];if(/^\s{4,}/.test(a)&&t(a,c)){if(++E>25){D=b;break}continue}if(s(c)){D=b;break}if(t(a,c)){if(++E>(/^\s{4,}/.test(a)?25:5)){D=b;break}continue}D=b;break}}if(!function(a){if(0===a.length||1!==a[0])return!1;let b=0;for(let c=1;c<a.length;c++){let d=a[c]-a[c-1];if(d<1||d>2||(2===d&&b++,b>1))return!1}return!0}(C.map(a=>a.number)))return r(a);let F=C.some(a=>a.isDefault),G=u&&A;if(C.length<2||u&&!F&&!G||!u&&(-1===D||!s(v[D]?.trim()??"")&&!function(a,b,c,d){let e=Math.max(d,b-3);for(let c=b-1;c>=e;c--){let b=a[c]?.trim()??"";if(!(!b||h.test(b))&&s(b))return!0}return!1}(v,D,0,x)))return r(a);let H=function(a,b){if(b<0)return"Please select an option:";let c=[];for(let d=Math.max(0,b-5);d<=b;d++){let b=a[d].trim();b&&!h.test(b)&&c.push(b)}return c.join(" ")}(v,D),I=function(a,b,c){if(b<0)return;let d=Math.max(0,b-19),e=a.slice(d,c).map(a=>a.trimEnd()).join("\n").trim();return e.length>0?e:void 0}(v,D,w),J=A?B?"answer_only":"answer_then_enter":void 0;return d=a,o=y,{isPrompt:!0,promptData:{type:"multiple_choice",question:H.trim(),options:C.map(a=>{let b=p.some(b=>b.test(a.label));return{number:a.number,label:a.label,isDefault:a.isDefault,requiresTextInput:b}}),status:"pending",instructionText:I,...J?{submitMode:J}:{},...o?{isAskUserQuestion:!0}:{}},cleanContent:H.trim(),rawContent:c(d.trim())}}(c,b,x);if(B.isPrompt)return u||v.info("detectPrompt:multipleChoice",{isPrompt:!0,question:B.promptData?.question,optionsCount:B.promptData?.options?.length}),B;let C=A.trim();for(let a of y){let b=A.match(a.regex);if(b){let c=b[1].trim();return z(c,c,C,a.defaultOption)}}let D=A.match(/^(.*?)Approve\?\s*$/m);if(D){let a=D[1].trim();return z(a?`${a} Approve?`:"Approve?",a||"Approve?",C)}return u||v.debug("detectPrompt:complete",{isPrompt:!1}),{isPrompt:!1,cleanContent:c.trim()}}},25754:(a,b,c)=>{"use strict";c.d(b,{Xn:()=>e,d9:()=>g,gB:()=>f,rv:()=>h});let d=["en","ja"],e="en",f="locale";function g(a){return"string"==typeof a&&d.includes(a)}function h(a,b){return g(a)?a:d.find(a=>(b??"").includes(a))??e}},26838:(a,b,c)=>{"use strict";c.d(b,{Mj:()=>k,Sw:()=>j,lX:()=>l});var d=c(29021),e=c(33873),f=c(90164);let g=/^v?\d+\.\d+\.\d+$/,h=/^[a-zA-Z0-9.\-\s_v]+$/,i=globalThis.__versionCheckCache??(globalThis.__versionCheckCache={result:null,fetchedAt:0,rateLimitResetAt:null});function j(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.14.0"}function k(){return j()}async function l(){try{var a,b,c;if(null!==i.result&&Date.now()-i.fetchedAt<36e5||i.rateLimitResetAt&&(!(Date.now()>=i.rateLimitResetAt)||(i.rateLimitResetAt=null,0)))return i.result;let d=await fetch("https://api.github.com/repos/Kewton/CommandMate/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":`CommandMate/${k()}`},cache:"no-store",signal:AbortSignal.timeout(5e3)});if(403===d.status)return function(a){let b=a.headers.get("X-RateLimit-Reset");b?i.rateLimitResetAt=1e3*parseInt(b,10):i.rateLimitResetAt=Date.now()+36e5}(d),i.result;if(!d.ok)return i.result;let e=await d.json(),j=k(),l=e.tag_name.replace(/^v/,""),m={hasUpdate:function(a,b){if(!g.test(a)||!g.test(b))return!1;let c=a=>a.replace(/^v/,"").split(".").map(Number),[d,e,f]=c(a),[h,i,j]=c(b);return h!==d?h>d:i!==e?i>e:j>f}(j,e.tag_name),currentVersion:j,latestVersion:l,releaseUrl:(a=e.html_url).startsWith(f.Dk)?a:null,releaseName:(b=e.name,c=e.tag_name,h.test(b)&&b.length<=128?b:c),publishedAt:e.published_at};return i.result=m,i.fetchedAt=Date.now(),m}catch{return i.result}}},30618:(a,b,c)=>{"use strict";c.d(b,{xT:()=>w,Ui:()=>x});var d=c(44265),e=c(11665),f=c(40236),g=c(93997),h=c(29021),i=c(33873),j=c(72626);let k=(0,j.h)("cli-tools/opencode-config"),l=/^[a-zA-Z0-9._:/-]{1,100}$/,m=/^[a-zA-Z0-9._:/@-]{1,200}$/;async function n(){let a={};try{let b=new AbortController,c=setTimeout(()=>b.abort(),3e3),d=await fetch("http://localhost:11434/api/tags",{signal:b.signal}).finally(()=>{clearTimeout(c)});if(!d.ok)return k.warn("ollama-api-returned"),{};let e=await d.text();if(e.length>1048576)return k.warn("ollama-api-response"),{};let f=JSON.parse(e);if(!f||!Array.isArray(f.models))return k.warn("invalid-ollama-api"),{};for(let b of f.models.slice(0,100))"string"==typeof b?.name&&l.test(b.name)&&(a[b.name]={name:function(a){let b=String(a.name),c=a.details;if(!c)return b;let d=[b];return"string"==typeof c.parameter_size&&/^[\d.]+[BKMGT]?B?$/i.test(c.parameter_size)&&d.push(c.parameter_size),"string"==typeof c.quantization_level&&/^[A-Z0-9_]{1,20}$/i.test(c.quantization_level)&&d.push(c.quantization_level),d.length>1?`${b} (${d.slice(1).join(", ")})`:b}(b)})}catch(a){a instanceof Error&&"AbortError"===a.name?k.warn("ollama-api-timeout"):k.warn("failed-to-fetch")}return a}async function o(){let a={};try{let b=new AbortController,c=setTimeout(()=>b.abort(),3e3),d=await fetch("http://localhost:1234/v1/models",{signal:b.signal}).finally(()=>{clearTimeout(c)});if(!d.ok)return k.warn("lm-studio-api"),{};let e=await d.text();if(e.length>1048576)return k.warn("lm-studio-api"),{};let f=JSON.parse(e);if(!f||!Array.isArray(f.data))return k.warn("invalid-lm-studio"),{};for(let b of f.data.slice(0,100))"string"==typeof b?.id&&m.test(b.id)&&(a[b.id]={name:b.id})}catch(a){a instanceof Error&&"AbortError"===a.name?k.warn("lm-studio-api"):k.warn("failed-to-fetch")}return a}async function p(a){let b=function(a){let b=i.resolve(a);try{if(!h.lstatSync(b).isDirectory())throw Error(`Path is not a directory: ${b}`)}catch(a){if("ENOENT"===a.code)throw Error(`Path does not exist: ${b}`);throw a}return h.realpathSync(b)}(a),c=i.join(b,"opencode.json");if(h.existsSync(c))return;let[d,e]=await Promise.all([n(),o()]),f={};if(Object.keys(d).length>0&&(f.ollama={npm:"@ai-sdk/openai-compatible",name:"Ollama (local)",options:{baseURL:"http://localhost:11434/v1"},models:d}),Object.keys(e).length>0&&(f.lmstudio={npm:"@ai-sdk/openai-compatible",name:"LM Studio (local)",options:{baseURL:"http://localhost:1234/v1"},models:e}),0!==Object.keys(f).length)try{h.writeFileSync(c,JSON.stringify({$schema:"https://opencode.ai/config.json",provider:f},null,2),{encoding:"utf-8",flag:"wx"})}catch(a){if("EEXIST"===a.code)return;k.warn("failed-to-write-opencodejson:error-insta")}}var q=c(79646),r=c(28354),s=c(20610);let t=(0,j.h)("cli-tools/opencode"),u=(0,r.promisify)(q.execFile);function v(a){return a instanceof Error?a.message:String(a)}let w=200;class x extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,e.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("OpenCode is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,e.N)(d)){await this.reconcileExistingSession(d,{windowWidth:80,windowHeight:w}),t.info("opencode-session-sessionname");return}try{await p(b),await (0,e.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,s.Uc));try{await u("tmux",["resize-window","-t",(0,e.lA)(d),"-x","80","-y",String(w)])}catch{}await (0,e.V1)(d,"opencode",!0),await new Promise(a=>setTimeout(a,15e3)),t.info("started-opencode-session:sessionname")}catch(b){let a=v(b);throw Error(`Failed to start OpenCode session: ${a}`)}}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,e.N)(d))throw Error(`OpenCode session ${d} does not exist. Start the session first.`);try{await (0,f.F)({sessionName:d,message:b,cliToolId:"opencode"}),(0,g.gm)(d),t.info("sent-message-to-opencode-session:session")}catch(b){let a=v(b);throw Error(`Failed to send message to OpenCode: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,e.N)(c)?(await (0,e.V1)(c,"/exit",!0),await new Promise(a=>setTimeout(a,s.KI)),await (0,e.N)(c)&&await (0,e.fY)(c)):await (0,e.fY)(c),(0,g.gm)(c),t.info("stopped-opencode-session:sessionname")}catch(a){throw t.error("session:stop-failed",{error:v(a)}),a}}constructor(...a){super(...a),this.id="opencode",this.name="OpenCode",this.command="opencode"}}},31268:(a,b,c)=>{"use strict";c.d(b,{s:()=>K});var d=c(44265),e=c(57905);class f extends d.M{async isInstalled(){return await (0,e.zw)()}async isRunning(a,b){return await (0,e.Yq)(a,b)}async startSession(a,b,c){await (0,e.R7)({worktreeId:a,worktreePath:b,instanceId:c})}async sendMessage(a,b,c){await (0,e.pU)(a,b,c)}supportsImage(){return!0}async sendMessageWithImage(a,b,c,d){let e=`
2
2
  ![](${c})`,f=b?`${b}${e}`:e;await this.sendMessage(a,f,d)}async killSession(a,b){await (0,e.VU)(a,b)}constructor(...a){super(...a),this.id="claude",this.name="Claude Code",this.command="claude"}}var g=c(11665),h=c(40236),i=c(93997),j=c(26283),k=c(72626),l=c(20610);let m=(0,k.h)("cli-tools/codex");function n(a){return a instanceof Error?a.message:String(a)}class o extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("Codex CLI is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,g.N)(d)){await this.reconcileExistingSession(d),m.info("codex-session-sessionname");return}try{await (0,g.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,l.Uc)),await (0,g.V1)(d,"codex",!0),await new Promise(a=>setTimeout(a,3e3)),await this.waitForReady(d),m.info("started-codex-session:sessionname")}catch(b){let a=n(b);throw Error(`Failed to start Codex session: ${a}`)}}async waitForReady(a){let b=!1,c=!1;for(let d=0;d<30;d++){try{let d=await (0,g.Xg)(a,50),e=(0,j.aJ)(d);if((0,j.zZ)(e))return void m.info("codex-prompt-detected");let f=(0,j.Qh)(e);if("update"===f&&!b){await (0,g.V1)(a,"2",!1),b=!0,m.info("skipped-codex-update"),await new Promise(a=>setTimeout(a,l.CV));continue}if("press-enter"===f){await (0,g.ds)(a,"Enter"),m.info("dismissed-codex-notification"),await new Promise(a=>setTimeout(a,l.CV));continue}if("trust"===f&&!c){await (0,g.V1)(a,"1",!1),c=!0,m.info("auto-trusted-folder-for"),await new Promise(a=>setTimeout(a,l.CV));continue}}catch{}await new Promise(a=>setTimeout(a,1e3))}m.info("codex-prompt-detection")}async waitForPrompt(a){let b=Date.now();for(;Date.now()-b<15e3;){try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if((0,j.zZ)(c))return}catch{}await new Promise(a=>setTimeout(a,500))}throw m.info("codex-prompt-not"),Error("Codex prompt not ready: timed out waiting for the input prompt before sending")}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Codex session ${d} does not exist. Start the session first.`);try{await this.waitForPrompt(d),await (0,h.F)({sessionName:d,message:b,cliToolId:"codex"}),(0,i.gm)(d),m.info("sent-message-to-codex-session:sessionnam")}catch(b){let a=n(b);throw Error(`Failed to send message to Codex: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,g.N)(c)&&(await (0,g.ds)(c,"C-d"),await new Promise(a=>setTimeout(a,l.Zf))),await (0,g.fY)(c)&&m.info("stopped-codex-session:sessionname")}catch(a){throw m.error("session:stop-failed",{error:n(a)}),a}}constructor(...a){super(...a),this.id="codex",this.name="Codex CLI",this.command="codex"}}var p=c(11508),q=c(15194),r=c(88807),s=c(56791);let t=(0,k.h)("cli-tools/vibe-local");function u(a){return a instanceof Error?a.message:String(a)}class v extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("vibe-local is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,g.N)(d)){await this.reconcileExistingSession(d),t.info("vibe-local-session");return}try{await (0,g.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,l.Uc));let c="vibe-local -y";try{let b=(0,r.getDbInstance)(),d=(0,s.Ui)(b,a);d?.vibeLocalModel&&q.QP.test(d.vibeLocalModel)&&(c+=` -m ${d.vibeLocalModel}`);let e=d?.vibeLocalContextWindow;(0,q.FV)(e)&&(c+=` --context-window ${Number(e)}`)}catch{}await (0,g.V1)(d,c,!0),await new Promise(a=>setTimeout(a,5e3)),t.info("started-vibe-local-session:sessionname")}catch(b){let a=u(b);throw Error(`Failed to start Vibe Local session: ${a}`)}}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Vibe Local session ${d} does not exist. Start the session first.`);try{await (0,h.F)({sessionName:d,message:b,cliToolId:"vibe-local",submitEnterCount:2,interEnterWaitMs:l.PY}),(0,i.gm)(d),t.info("sent-message-to-vibe-local-session:sessi")}catch(b){let a=u(b);throw Error(`Failed to send message to Vibe Local: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,g.N)(c)&&(await (0,g.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,l.Is)),await (0,g.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,l.Zf))),await (0,g.fY)(c)&&t.info("stopped-vibe-local-session:sessionname")}catch(a){throw t.error("session:stop-failed",{error:u(a)}),a}}constructor(...a){super(...a),this.id="vibe-local",this.name="Vibe Local",this.command="vibe-local"}}var w=c(30618),x=c(79646),y=c(56263),z=c(77093);let A=(0,k.h)("cli-tools/copilot"),B=new Set(["model","agent","theme"]);class C extends d.M{async isInstalled(){try{return await new Promise((a,b)=>{(0,x.execFile)("gh",["--version"],{timeout:5e3},c=>{c?b(c):a()})}),await new Promise((a,b)=>{(0,x.execFile)("gh",["copilot","--help"],{timeout:5e3},c=>{c?b(c):a()})}),!0}catch{return!1}}async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("GitHub Copilot CLI is not installed. Install with: gh extension install github/gh-copilot");let d=this.getSessionName(a,c);if(await (0,g.N)(d)){await this.reconcileExistingSession(d),A.info("copilot-session-exists");return}try{await (0,g.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,l.Uc)),await (0,g.V1)(d,"gh copilot",!0),await new Promise(a=>setTimeout(a,4e3)),await this.waitForReady(d),A.info("started-copilot-session")}catch(b){let a=(0,z.u1)(b);throw Error(`Failed to start Copilot session: ${a}`)}}async waitForReady(a){for(let b=0;b<30;b++){try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if(j.Du.test(c))return void A.info("copilot-prompt-detected")}catch{}await new Promise(a=>setTimeout(a,1e3))}A.info("copilot-prompt-detection-timeout")}async waitForPrompt(a,b=15e3){let c=Date.now();for(;Date.now()-c<b;){try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if(j.Du.test(c))return}catch{}await new Promise(a=>setTimeout(a,500))}A.info("copilot-prompt-not-detected")}extractSlashCommand(a){let b=a.trim();if(!b.startsWith("/"))return null;let c=b.match(/^\/(\S+)/);return c?c[1]:null}async waitForSelectionList(a){let b=Date.now();for(;Date.now()-b<5e3;){await new Promise(a=>setTimeout(a,300));try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if(j.Mi.test(c))return A.info("copilot-selection-list-detected"),!0}catch{}}return A.info("copilot-selection-list-not-detected-timeout"),!1}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Copilot session ${d} does not exist. Start the session first.`);try{await this.waitForPrompt(d);let a=this.extractSlashCommand(b);if(a&&B.has(a)){await (0,g.V1)(d,b,!0),await this.waitForSelectionList(d),(0,i.gm)(d),A.info("sent-selection-list-command-to-copilot",{command:a});return}await (0,h.F)({sessionName:d,message:b,cliToolId:"copilot",textInputWaitMs:y.L1,verifyDelayMs:y.wp}),(0,i.gm)(d),A.info("sent-message-to-copilot-session")}catch(b){let a=(0,z.u1)(b);throw Error(`Failed to send message to Copilot: ${a}`)}}async sendModelCommand(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Copilot session ${d} does not exist. Start the session first.`);try{await (0,g.V1)(d,`/model ${b}`,!0),await this.waitForSelectionList(d)&&await (0,g.ds)(d,"C-m"),await this.waitForPrompt(d,y.pL),(0,i.gm)(d),A.info("copilot-model-switched",{model:b})}catch(c){let a=(0,z.u1)(c);throw Error(`Failed to switch Copilot model to ${b}: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,g.N)(c)&&(await (0,g.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,l.Is)),await (0,g.V1)(c,"exit",!0),await new Promise(a=>setTimeout(a,l.Zf))),await (0,g.fY)(c)&&A.info("stopped-copilot-session")}catch(a){throw A.error("session:stop-failed",{error:(0,z.u1)(a)}),a}}constructor(...a){super(...a),this.id="copilot",this.name="Copilot",this.command="gh"}}let D=(0,k.h)("cli-tools/antigravity");function E(a){return a instanceof Error?a.message:String(a)}let F=/\?\s+for\s+shortcuts/,G=/Do you trust the contents of this project\?/;function H(a){return F.test(a)&&!G.test(a)}class I extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async startSession(a,b,c,d){if(!await this.isInstalled())throw Error("Antigravity CLI (agy) is not installed or not in PATH");let e=this.getSessionName(a,c);if(await (0,g.N)(e)){await this.reconcileExistingSession(e),D.info("antigravity-session-exists");return}try{await (0,g.jw)({sessionName:e,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,l.Uc));let a=d?`agy --model '${d.replace(/'/g,"'\\''")}'`:"agy";await (0,g.V1)(e,a,!0),await new Promise(a=>setTimeout(a,3e3)),await this.waitForReady(e),D.info("started-antigravity-session")}catch(b){let a=E(b);throw Error(`Failed to start Antigravity session: ${a}`)}}async waitForReady(a){let b=!1;for(let c=0;c<30;c++){try{let c=await (0,g.Xg)(a,50),d=(0,j.aJ)(c);if(H(d))return void D.info("antigravity-prompt-detected");if(!b&&G.test(d)){await (0,g.ds)(a,"Enter"),b=!0,D.info("auto-trusted-folder-for-antigravity"),await new Promise(a=>setTimeout(a,500));continue}}catch{}await new Promise(a=>setTimeout(a,1e3))}D.info("antigravity-prompt-detection-timeout")}async waitForPrompt(a){let b=Date.now();for(;Date.now()-b<15e3;){try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if(H(c))return}catch{}await new Promise(a=>setTimeout(a,500))}throw D.info("antigravity-prompt-not-ready"),Error("Antigravity prompt not ready: timed out waiting for the input prompt before sending")}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Antigravity session ${d} does not exist. Start the session first.`);try{await this.waitForPrompt(d),await (0,h.F)({sessionName:d,message:b,cliToolId:"antigravity"}),(0,i.gm)(d),D.info("sent-message-to-antigravity-session")}catch(b){let a=E(b);throw Error(`Failed to send message to Antigravity: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,g.N)(c)&&(await (0,g.ds)(c,"C-d"),await new Promise(a=>setTimeout(a,l.Zf)));let a=await (0,g.fY)(c);(0,i.gm)(c),a&&D.info("stopped-antigravity-session")}catch(a){throw D.error("session:stop-failed",{error:E(a)}),a}}constructor(...a){super(...a),this.id="antigravity",this.name="Antigravity CLI",this.command="agy"}}var J=c(95220);class K{constructor(){this.tools=new Map,this.tools.set("claude",new f),this.tools.set("codex",new o),this.tools.set("gemini",new p.m),this.tools.set("vibe-local",new v),this.tools.set("opencode",new w.Ui),this.tools.set("copilot",new C),this.tools.set("antigravity",new I)}static getInstance(){return K.instance||(K.instance=new K),K.instance}getTool(a){let b=this.tools.get(a);if(!b)throw Error(`CLI tool '${a}' not found`);return b}getAllTools(){return Array.from(this.tools.values())}async getToolInfo(a){let b=this.getTool(a),c=await b.isInstalled();return{id:b.id,name:b.name,command:b.command,installed:c}}async getAllToolsInfo(){return Promise.all(this.getAllTools().map(async a=>{let b=await a.isInstalled();return{id:a.id,name:a.name,command:a.command,installed:b}}))}async getInstalledTools(){return(await this.getAllToolsInfo()).filter(a=>a.installed)}stopPollers(a,b,c){(0,J.stopPolling)(a,b,c)}}},31766:(a,b,c)=>{"use strict";c.d(b,{Wh:()=>p,WD:()=>q,K1:()=>o});var d=c(31268),e=c(72626),f=c(11665);let g={streamingOutput:!1,explicitResize:!1,snapshotFallback:!0};class h{async unsubscribe(){}}class i{async ensureSession(a,b){await (0,f.N)(a)||await (0,f.jw)(a,b)}async sessionExists(a){return(0,f.N)(a)}async sendInput(a,b){await (0,f.V1)(a,b)}async sendSpecialKey(a,b){if("Escape"!==b&&"C-c"!==b&&"C-d"!==b&&"C-m"!==b&&"Enter"!==b)throw Error(`Unsupported special key for PollingTmuxTransport: ${b}`);await (0,f.ds)(a,b)}async resize(){throw Error("PollingTmuxTransport does not support explicit resize")}async captureSnapshot(a,b){return(0,f.Xg)(a,b)}async subscribe(){return new h}getCapabilities(){return g}async killSession(a){return(0,f.fY)(a)}}let j=null;var k=c(93997);let l=(0,e.h)("cli-session");function m(){return j||(j=new i),j}function n(a,b,c){let e=d.s.getInstance().getTool(b),f=e.getSessionName(a,c);return{cliTool:e,sessionName:f}}async function o(a,b,c){let{sessionName:d}=n(a,b,c);return m().sessionExists(d)}async function p(a,b,c=1e3,d){let e=l.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutput:start",{requestedLines:c});let{cliTool:f,sessionName:g}=n(a,b,d),h=m();try{let a=await (0,k.aq)(g,c,async()=>{if(!await h.sessionExists(g))throw Error(`${f.name} session ${g} does not exist`);return await h.captureSnapshot(g,{startLine:-k.xE})});return e.debug("captureSessionOutput:success",{actualLines:a.split("\n").length,lastFewLines:a.split("\n").slice(-3).join(" | ")}),a}catch(b){let a=b instanceof Error?b.message:String(b);if(a.includes("does not exist"))throw e.debug("captureSessionOutput:sessionNotFound",{sessionName:g}),b;throw e.error("captureSessionOutput:failed",{error:a}),Error(`Failed to capture ${f.name} output: ${a}`)}}async function q(a,b,c=5e3,d){let e=l.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutputFresh:start",{requestedLines:c});let{cliTool:f,sessionName:g}=n(a,b,d),h=m();try{let a=await h.captureSnapshot(g,{startLine:-c});return a.length>0?(0,k.vF)(g,a,c):(0,k.gm)(g),(0,k.wd)(a,c)}catch(b){(0,k.gm)(g);let a=b instanceof Error?b.message:String(b);throw e.error("captureSessionOutputFresh:failed",{error:a}),Error(`Failed to capture ${f.name} output: ${a}`)}}},34405:(a,b,c)=>{"use strict";c.d(b,{G:()=>e,_:()=>d});let d=1e4,e=1e3},34892:(a,b,c)=>{"use strict";c.d(b,{$:()=>j});var d=c(56791),e=c(31268),f=c(31766),g=c(95595),h=c(5344),i=c(34405);async function j(a,b,c,j){let k=j??c,l=e.s.getInstance().getTool(c);if(!await l.isRunning(b,j))return{isRunning:!1,content:"",lineCount:0,cliToolId:c,sessionStatus:"idle",sessionStatusReason:"session_not_running"};let m=(0,d.y1)(a,b,k),n=m?.lastCapturedLine||0,o=await (0,f.Wh)(b,c,i._,j),p=o.split("\n"),q=p.length,r=p.slice(Math.max(0,n)).join("\n"),s=(0,h.v7)(b,c,j),t=(0,h.xU)(s),u=t?new Date(t):void 0,v=(0,g.WC)(o,c,u),w="running"===v.status&&v.reason===g.gv.THINKING_INDICATOR,x=v.hasActivePrompt,y="waiting"===v.status&&g.ug.has(v.reason),z=v.reason===g.gv.CODEX_PAGER,A="running"===v.status&&v.reason===g.gv.DEFAULT,B=p.slice(-100).join("\n"),C=(0,h.aq)(b,c,j);return{isRunning:!0,cliToolId:c,sessionStatus:v.status,sessionStatusReason:v.reason,content:r,fullOutput:o,realtimeSnippet:B,lineCount:q,lastCapturedLine:n,isComplete:x,isGenerating:w,thinking:w,thinkingMessage:w?"Claude is thinking...":null,isPromptWaiting:x,promptData:x?v.promptDetection.promptData??null:null,autoYes:{enabled:C?.enabled??!1,expiresAt:C?.enabled?C.expiresAt:null,stopReason:C?.stopReason},isSelectionListActive:y,isPagerActive:z,isUnclassifiedActive:A,lastServerResponseTimestamp:t,serverPollerActive:(0,h.bZ)(s)}}},39727:()=>{},40236:(a,b,c)=>{"use strict";c.d(b,{F:()=>k});var d=c(11665),e=c(93997),f=c(26283),g=c(20610);let h=(0,c(72626).h)("cli-tools/submit-verified-sender"),i=/\[Pasted text[\s#]/,j=/^\s*(?:ctx:\d+%\s*)?[>❯›]/;async function k(a){let{sessionName:b,message:c,cliToolId:k,textInputWaitMs:l=g.pL,submitEnterCount:m=1,interEnterWaitMs:n=g.pL,verifyAttempts:o=4,verifyDelayMs:p=g.x9}=a;await (0,d.V1)(b,c,!1),await new Promise(a=>setTimeout(a,l));for(let a=0;a<Math.max(1,m);a++)await (0,d.KB)(b,["Enter"]),a<m-1&&await new Promise(a=>setTimeout(a,n));let q=Math.max(1,o);for(let a=0;a<q;a++){if(await new Promise(a=>setTimeout(a,p)),function(a,b,c){let d=(0,f.aJ)(a).split("\n").slice(-12),e=d.join("\n");if((0,f.ut)(b,e))return!0;let g=function(a){for(let b=a.length-1;b>=0;b--)if(j.test(a[b]))return a[b];return null}(d);if(g){if(i.test(g))return!1;let a=function(a){let b=a.split("\n").map(a=>a.trim()).find(a=>a.length>0);return b?b.slice(0,24):""}(c);if(a.length>=3&&g.includes(a))return!1}return!0}(await (0,d.Xg)(b,{startLine:-12}),k,c))return void(0,e.gm)(b);h.warn("submit-not-confirmed:resending-enter",{sessionName:b,cliToolId:k,attempt:a}),await (0,d.KB)(b,["Enter"])}throw(0,e.gm)(b),h.error("submit-verification-failed",{sessionName:b,cliToolId:k,attempts:q}),Error(`Message submit could not be confirmed for session ${b} after ${q} attempts (typed but unsent)`)}},41364:(a,b,c)=>{"use strict";c.d(b,{Gv:()=>o,hM:()=>n});var d=c(79748),e=c.n(d),f=c(33873),g=c.n(f),h=c(1634),i=c(21684),j=c(72626),k=c(15194);function l(a="claude"){return g().join((0,i.U)(),a)}async function m(a="claude"){let b=l(a);try{await e().access(b)}catch{await e().mkdir(b,{recursive:!0})}}async function n(a,b,c,d="claude"){await m(d);let f=function(a,b="claude"){let c=(0,h.GP)(new Date,"yyyy-MM-dd"),d=`${a}-${c}.md`,e=l(b);return g().join(e,d)}(a,d),i=(0,h.GP)(new Date,"yyyy-MM-dd HH:mm:ss"),j="";try{j=await e().readFile(f,"utf-8")}catch{let b=(0,k.hR)(d)?k.ef[d]:d;j=`# ${b} Conversation Log: ${a}
3
3
 
4
4
  Created: ${i}
@@ -1 +1 @@
1
- "use strict";exports.id=6130,exports.ids=[6130],exports.modules={26838:(a,b,c)=>{c.d(b,{Mj:()=>k,Sw:()=>j,lX:()=>l});var d=c(29021),e=c(33873),f=c(90164);let g=/^v?\d+\.\d+\.\d+$/,h=/^[a-zA-Z0-9.\-\s_v]+$/,i=globalThis.__versionCheckCache??(globalThis.__versionCheckCache={result:null,fetchedAt:0,rateLimitResetAt:null});function j(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.12.1"}function k(){return j()}async function l(){try{var a,b,c;if(null!==i.result&&Date.now()-i.fetchedAt<36e5||i.rateLimitResetAt&&(!(Date.now()>=i.rateLimitResetAt)||(i.rateLimitResetAt=null,0)))return i.result;let d=await fetch("https://api.github.com/repos/Kewton/CommandMate/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":`CommandMate/${k()}`},cache:"no-store",signal:AbortSignal.timeout(5e3)});if(403===d.status)return function(a){let b=a.headers.get("X-RateLimit-Reset");b?i.rateLimitResetAt=1e3*parseInt(b,10):i.rateLimitResetAt=Date.now()+36e5}(d),i.result;if(!d.ok)return i.result;let e=await d.json(),j=k(),l=e.tag_name.replace(/^v/,""),m={hasUpdate:function(a,b){if(!g.test(a)||!g.test(b))return!1;let c=a=>a.replace(/^v/,"").split(".").map(Number),[d,e,f]=c(a),[h,i,j]=c(b);return h!==d?h>d:i!==e?i>e:j>f}(j,e.tag_name),currentVersion:j,latestVersion:l,releaseUrl:(a=e.html_url).startsWith(f.Dk)?a:null,releaseName:(b=e.name,c=e.tag_name,h.test(b)&&b.length<=128?b:c),publishedAt:e.published_at};return i.result=m,i.fetchedAt=Date.now(),m}catch{return i.result}}},88573:(a,b,c)=>{c.d(b,{Lw:()=>s});let d="https://raw.githubusercontent.com/Kewton/commandmate-skills/main/catalog/v1/catalog.json",e=[d],f=/^[A-Za-z0-9/+=_."-]{1,128}$/;var g=c(72626),h=c(13075);let i=(0,g.h)("lib/skills/catalog-client"),j={FETCH_FAILED:"SKILL_CATALOG_FETCH_FAILED",RATE_LIMITED:"SKILL_CATALOG_RATE_LIMITED",OVERSIZED:"SKILL_CATALOG_OVERSIZED",MALFORMED:"SKILL_CATALOG_MALFORMED",INVALID_SCHEMA:"SKILL_CATALOG_INVALID_SCHEMA"},k=globalThis.__skillCatalogCache??={catalog:null,validatedAt:0,confirmedAt:0,etag:null,revision:null,rateLimitResetAt:null,inflight:null};class l extends Error{}let m={[j.FETCH_FAILED]:"The Skill Catalog could not be retrieved.",[j.RATE_LIMITED]:"The Skill Catalog origin is rate limiting requests.",[j.OVERSIZED]:"The Skill Catalog response exceeded the allowed size.",[j.MALFORMED]:"The Skill Catalog response was not valid JSON.",[j.INVALID_SCHEMA]:"The Skill Catalog response did not match the supported Catalog schema."};function n(a){return new Date(a).toISOString()}function o(a,b,c){return{catalog:a,fetchedAt:n(k.validatedAt),revalidatedAt:n(k.confirmedAt),state:b,stale:"stale"===b,offline:"stale"===b,staleReason:c,source:{repository:"Kewton/commandmate-skills",ref:"main",revision:k.revision}}}function p(a,b=[]){return k.catalog?{ok:!0,snapshot:o(k.catalog,"stale",a)}:{ok:!1,failure:{code:a,message:m[a],errors:b}}}async function q(a,b){let c=a.headers.get("Content-Length");if(null!==c){let a=Number(c);if(!Number.isFinite(a)||a<0||a>b)throw new l("content-length out of bounds")}let d=a.body;if(!d||"function"!=typeof d.getReader){let c=await a.text();if(new TextEncoder().encode(c).length>b)throw new l("body exceeded size cap");return c}let e=d.getReader(),f=[],g=0;for(;;){let{done:a,value:c}=await e.read();if(a)break;if(c){if((g+=c.byteLength)>b)throw await e.cancel(),new l("body exceeded size cap");f.push(c)}}let h=new Uint8Array(g),i=0;for(let a of f)h.set(a,i),i+=a.byteLength;return new TextDecoder("utf-8").decode(h)}async function r(a){let b,c,g;if(!e.includes(d))return p(j.FETCH_FAILED);let m={Accept:"application/json","User-Agent":`CommandMate/${a}`};null!==k.catalog&&null!==k.etag&&(m["If-None-Match"]=k.etag);try{b=await fetch(d,{headers:m,cache:"no-store",signal:AbortSignal.timeout(5e3)})}catch{return i.warn("catalog-fetch-failed",{reason:j.FETCH_FAILED}),p(j.FETCH_FAILED)}if(304===b.status&&null!==k.catalog)return k.confirmedAt=Date.now(),{ok:!0,snapshot:o(k.catalog,"revalidated",null)};if(403===b.status||429===b.status)return!function(a){let b=Date.now(),c=b+864e5,d=a.headers.get("X-RateLimit-Reset");if(null!==d){let a=Number(d);if(Number.isFinite(a)&&a>0){k.rateLimitResetAt=Math.min(1e3*a,c);return}}let e=a.headers.get("Retry-After");if(null!==e){let a=Number(e);if(Number.isFinite(a)&&a>0){k.rateLimitResetAt=Math.min(b+1e3*a,c);return}}k.rateLimitResetAt=b+36e5}(b),i.warn("catalog-rate-limited",{status:b.status}),p(j.RATE_LIMITED);if(!b.ok)return i.warn("catalog-fetch-failed",{status:b.status}),p(j.FETCH_FAILED);try{c=await q(b,1048576)}catch(b){let a=b instanceof l?j.OVERSIZED:j.FETCH_FAILED;return i.warn("catalog-body-rejected",{reason:a}),p(a)}try{g=JSON.parse(c)}catch{return i.warn("catalog-malformed",{reason:j.MALFORMED}),p(j.MALFORMED)}let n=(0,h.JJ)(g);if(!n.ok)return i.warn("catalog-invalid-schema",{errorCount:n.errors.length}),p(j.INVALID_SCHEMA,n.errors);let r=Date.now();return k.catalog=n.value,k.validatedAt=r,k.confirmedAt=r,k.etag=b.headers.get("ETag"),k.revision=function(a){if(null===a)return null;let b=a.trim();return f.test(b)?b:null}(k.etag),{ok:!0,snapshot:o(n.value,"fresh",null)}}async function s(a={}){let{hostVersion:b="0.0.0",forceRevalidate:c=!1}=a;return!c&&null!==k.catalog&&Date.now()-k.confirmedAt<9e5&&null!==k.catalog?{ok:!0,snapshot:o(k.catalog,"cached",null)}:null!==k.rateLimitResetAt&&(!(Date.now()>=k.rateLimitResetAt)||(k.rateLimitResetAt=null,0))?p(j.RATE_LIMITED):(null===k.inflight&&(k.inflight=r(b).finally(()=>{k.inflight=null})),k.inflight)}},90164:(a,b,c)=>{c.d(b,{Dk:()=>e,kD:()=>f});let d="https://github.com/Kewton/CommandMate",e=`${d}/releases/`,f=`${d}/blob/main/docs/security-guide.md`}};
1
+ "use strict";exports.id=6130,exports.ids=[6130],exports.modules={26838:(a,b,c)=>{c.d(b,{Mj:()=>k,Sw:()=>j,lX:()=>l});var d=c(29021),e=c(33873),f=c(90164);let g=/^v?\d+\.\d+\.\d+$/,h=/^[a-zA-Z0-9.\-\s_v]+$/,i=globalThis.__versionCheckCache??(globalThis.__versionCheckCache={result:null,fetchedAt:0,rateLimitResetAt:null});function j(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.14.0"}function k(){return j()}async function l(){try{var a,b,c;if(null!==i.result&&Date.now()-i.fetchedAt<36e5||i.rateLimitResetAt&&(!(Date.now()>=i.rateLimitResetAt)||(i.rateLimitResetAt=null,0)))return i.result;let d=await fetch("https://api.github.com/repos/Kewton/CommandMate/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":`CommandMate/${k()}`},cache:"no-store",signal:AbortSignal.timeout(5e3)});if(403===d.status)return function(a){let b=a.headers.get("X-RateLimit-Reset");b?i.rateLimitResetAt=1e3*parseInt(b,10):i.rateLimitResetAt=Date.now()+36e5}(d),i.result;if(!d.ok)return i.result;let e=await d.json(),j=k(),l=e.tag_name.replace(/^v/,""),m={hasUpdate:function(a,b){if(!g.test(a)||!g.test(b))return!1;let c=a=>a.replace(/^v/,"").split(".").map(Number),[d,e,f]=c(a),[h,i,j]=c(b);return h!==d?h>d:i!==e?i>e:j>f}(j,e.tag_name),currentVersion:j,latestVersion:l,releaseUrl:(a=e.html_url).startsWith(f.Dk)?a:null,releaseName:(b=e.name,c=e.tag_name,h.test(b)&&b.length<=128?b:c),publishedAt:e.published_at};return i.result=m,i.fetchedAt=Date.now(),m}catch{return i.result}}},88573:(a,b,c)=>{c.d(b,{Lw:()=>s});let d="https://raw.githubusercontent.com/Kewton/commandmate-skills/main/catalog/v1/catalog.json",e=[d],f=/^[A-Za-z0-9/+=_."-]{1,128}$/;var g=c(72626),h=c(13075);let i=(0,g.h)("lib/skills/catalog-client"),j={FETCH_FAILED:"SKILL_CATALOG_FETCH_FAILED",RATE_LIMITED:"SKILL_CATALOG_RATE_LIMITED",OVERSIZED:"SKILL_CATALOG_OVERSIZED",MALFORMED:"SKILL_CATALOG_MALFORMED",INVALID_SCHEMA:"SKILL_CATALOG_INVALID_SCHEMA"},k=globalThis.__skillCatalogCache??={catalog:null,validatedAt:0,confirmedAt:0,etag:null,revision:null,rateLimitResetAt:null,inflight:null};class l extends Error{}let m={[j.FETCH_FAILED]:"The Skill Catalog could not be retrieved.",[j.RATE_LIMITED]:"The Skill Catalog origin is rate limiting requests.",[j.OVERSIZED]:"The Skill Catalog response exceeded the allowed size.",[j.MALFORMED]:"The Skill Catalog response was not valid JSON.",[j.INVALID_SCHEMA]:"The Skill Catalog response did not match the supported Catalog schema."};function n(a){return new Date(a).toISOString()}function o(a,b,c){return{catalog:a,fetchedAt:n(k.validatedAt),revalidatedAt:n(k.confirmedAt),state:b,stale:"stale"===b,offline:"stale"===b,staleReason:c,source:{repository:"Kewton/commandmate-skills",ref:"main",revision:k.revision}}}function p(a,b=[]){return k.catalog?{ok:!0,snapshot:o(k.catalog,"stale",a)}:{ok:!1,failure:{code:a,message:m[a],errors:b}}}async function q(a,b){let c=a.headers.get("Content-Length");if(null!==c){let a=Number(c);if(!Number.isFinite(a)||a<0||a>b)throw new l("content-length out of bounds")}let d=a.body;if(!d||"function"!=typeof d.getReader){let c=await a.text();if(new TextEncoder().encode(c).length>b)throw new l("body exceeded size cap");return c}let e=d.getReader(),f=[],g=0;for(;;){let{done:a,value:c}=await e.read();if(a)break;if(c){if((g+=c.byteLength)>b)throw await e.cancel(),new l("body exceeded size cap");f.push(c)}}let h=new Uint8Array(g),i=0;for(let a of f)h.set(a,i),i+=a.byteLength;return new TextDecoder("utf-8").decode(h)}async function r(a){let b,c,g;if(!e.includes(d))return p(j.FETCH_FAILED);let m={Accept:"application/json","User-Agent":`CommandMate/${a}`};null!==k.catalog&&null!==k.etag&&(m["If-None-Match"]=k.etag);try{b=await fetch(d,{headers:m,cache:"no-store",signal:AbortSignal.timeout(5e3)})}catch{return i.warn("catalog-fetch-failed",{reason:j.FETCH_FAILED}),p(j.FETCH_FAILED)}if(304===b.status&&null!==k.catalog)return k.confirmedAt=Date.now(),{ok:!0,snapshot:o(k.catalog,"revalidated",null)};if(403===b.status||429===b.status)return!function(a){let b=Date.now(),c=b+864e5,d=a.headers.get("X-RateLimit-Reset");if(null!==d){let a=Number(d);if(Number.isFinite(a)&&a>0){k.rateLimitResetAt=Math.min(1e3*a,c);return}}let e=a.headers.get("Retry-After");if(null!==e){let a=Number(e);if(Number.isFinite(a)&&a>0){k.rateLimitResetAt=Math.min(b+1e3*a,c);return}}k.rateLimitResetAt=b+36e5}(b),i.warn("catalog-rate-limited",{status:b.status}),p(j.RATE_LIMITED);if(!b.ok)return i.warn("catalog-fetch-failed",{status:b.status}),p(j.FETCH_FAILED);try{c=await q(b,1048576)}catch(b){let a=b instanceof l?j.OVERSIZED:j.FETCH_FAILED;return i.warn("catalog-body-rejected",{reason:a}),p(a)}try{g=JSON.parse(c)}catch{return i.warn("catalog-malformed",{reason:j.MALFORMED}),p(j.MALFORMED)}let n=(0,h.JJ)(g);if(!n.ok)return i.warn("catalog-invalid-schema",{errorCount:n.errors.length}),p(j.INVALID_SCHEMA,n.errors);let r=Date.now();return k.catalog=n.value,k.validatedAt=r,k.confirmedAt=r,k.etag=b.headers.get("ETag"),k.revision=function(a){if(null===a)return null;let b=a.trim();return f.test(b)?b:null}(k.etag),{ok:!0,snapshot:o(n.value,"fresh",null)}}async function s(a={}){let{hostVersion:b="0.0.0",forceRevalidate:c=!1}=a;return!c&&null!==k.catalog&&Date.now()-k.confirmedAt<9e5&&null!==k.catalog?{ok:!0,snapshot:o(k.catalog,"cached",null)}:null!==k.rateLimitResetAt&&(!(Date.now()>=k.rateLimitResetAt)||(k.rateLimitResetAt=null,0))?p(j.RATE_LIMITED):(null===k.inflight&&(k.inflight=r(b).finally(()=>{k.inflight=null})),k.inflight)}},90164:(a,b,c)=>{c.d(b,{Dk:()=>e,kD:()=>f});let d="https://github.com/Kewton/CommandMate",e=`${d}/releases/`,f=`${d}/blob/main/docs/security-guide.md`}};
@@ -10,4 +10,4 @@ exports.id=9123,exports.ids=[9123],exports.modules={762:(a,b,c)=>{Promise.resolv
10
10
  hover:opacity-70
11
11
  focus:outline-none focus:ring-2 focus:ring-offset-2
12
12
  transition-opacity
13
- `,children:(0,d.jsx)(l.A,{className:"h-4 w-4"})})]})}function s({toasts:a,onClose:b}){let[c,g]=(0,e.useState)(!1),h=(0,d.jsx)("div",{"data-testid":"toast-container","aria-live":"polite",className:"fixed bottom-4 right-4 flex flex-col gap-2",style:{zIndex:m.M.TOAST},children:a.map(a=>(0,d.jsx)(r,{id:a.id,message:a.message,type:a.type,onClose:b,duration:a.duration},a.id))});return c?(0,f.createPortal)(h,document.body):null}function t(){let[a,b]=(0,e.useState)([]),c=(0,e.useRef)(0),d=(0,e.useCallback)((a,d="info",e=p)=>{let f=`toast-${++c.current}-${Date.now()}`,g={id:f,message:a,type:d,duration:e};return b(a=>[...a,g]),f},[]),f=(0,e.useCallback)(a=>{b(b=>b.filter(b=>b.id!==a))},[]),g=(0,e.useCallback)(()=>{b([])},[]);return(0,e.useMemo)(()=>({toasts:a,showToast:d,removeToast:f,clearToasts:g}),[a,d,f,g])}let u=(0,e.createContext)(null);function v({children:a}){let b=t();return(0,d.jsxs)(u.Provider,{value:b,children:[a,(0,d.jsx)(s,{toasts:b.toasts,onClose:b.removeToast})]})}function w(){let a=(0,e.useContext)(u),b=t();return a??b}},64182:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(97954).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/CommandMate/CommandMate/src/app/global-error.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/CommandMate/CommandMate/src/app/global-error.tsx","default")},64632:(a,b,c)=>{"use strict";c.d(b,{C:()=>h,E:()=>g});var d=c(21124),e=c(38301);let f=(0,e.createContext)({open:!1,setOpen:()=>{},toggle:()=>{}});function g({children:a}){let[b,c]=(0,e.useState)(!1),g=(0,e.useCallback)(()=>c(a=>!a),[]),h=(0,e.useMemo)(()=>({open:b,setOpen:c,toggle:g}),[b,g]);return(0,d.jsx)(f.Provider,{value:h,children:a})}function h(){return(0,e.useContext)(f)}},66125:(a,b,c)=>{var d={"./en/error.json":[22980,2980],"./ja/error.json":[10450,450]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=66125,a.exports=e},67619:(a,b,c)=>{"use strict";c.d(b,{tS:()=>i,xM:()=>j,T3:()=>k});var d=c(21124),e=c(38301);c(12055);let f=()=>{},g={status:"disconnected",connected:!1,subscribe:f,unsubscribe:f,addListener:()=>f},h=(0,e.createContext)(null);function i({children:a,enabled:b=!0}){let c=(0,e.useRef)(new Set),f=(0,e.useRef)(new Map),{status:g,subscribe:i,unsubscribe:j}=function(a={}){let{onEvent:b,onStatusChange:c,autoReconnect:d=!0,reconnectBaseDelay:f=1e3,reconnectMaxDelay:g=3e4,enabled:h=!0}=a,[i,j]=(0,e.useState)("disconnected"),k=(0,e.useRef)(null),l=(0,e.useRef)(null);(0,e.useRef)(0);let m=(0,e.useRef)(new Set),n=(0,e.useRef)(!1);(0,e.useRef)(b).current=b;let o=(0,e.useRef)(c);o.current=c;let p=(0,e.useCallback)(a=>{j(a),o.current?.(a)},[]),q=(0,e.useCallback)(()=>{null!==l.current&&(clearTimeout(l.current),l.current=null)},[]);(0,e.useCallback)(()=>{},[h,d,f,g,p,q]),(0,e.useCallback)(()=>{if(q(),n.current=!0,k.current){try{k.current.close(1e3,"Client disconnect")}catch{}k.current=null}},[q]);let r=(0,e.useCallback)(a=>{let b=k.current,c="undefined"!=typeof globalThis&&"function"==typeof globalThis.WebSocket?globalThis.WebSocket:null;if(b&&c&&b.readyState===c.OPEN)try{b.send(JSON.stringify(a))}catch{}},[]);return{status:i,subscribe:(0,e.useCallback)(a=>{m.current.has(a)||(m.current.add(a),r({type:"subscribe",worktreeId:a}))},[r]),unsubscribe:(0,e.useCallback)(a=>{m.current.has(a)&&(m.current.delete(a),r({type:"unsubscribe",worktreeId:a}))},[r]),send:r}}({enabled:b,onEvent:(0,e.useCallback)(a=>{c.current.forEach(b=>{try{b(a)}catch{}})},[])}),k=(0,e.useCallback)(a=>{let b=f.current,c=b.get(a)??0;b.set(a,c+1),0===c&&i(a)},[i]),l=(0,e.useCallback)(a=>{let b=f.current,c=b.get(a)??0;c<=1?(b.delete(a),j(a)):b.set(a,c-1)},[j]),m=(0,e.useCallback)(a=>(c.current.add(a),()=>{c.current.delete(a)}),[]),n=(0,e.useMemo)(()=>({status:g,connected:"connected"===g,subscribe:k,unsubscribe:l,addListener:m}),[g,k,l,m]);return(0,d.jsx)(h.Provider,{value:n,children:a})}function j(){return(0,e.useContext)(h)??g}function k(a){let{addListener:b}=j();(0,e.useRef)(a).current=a}},68132:(a,b,c)=>{Promise.resolve().then(c.bind(c,39800))},70288:(a,b,c)=>{var d={"./en/home.json":[41825,1825],"./ja/home.json":[26159,6159]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=70288,a.exports=e},72637:(a,b,c)=>{var d={"./en/prompt.json":[72816,2816],"./ja/prompt.json":[80066,7685]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=72637,a.exports=e},75567:(a,b,c)=>{var d={"./en/pwa.json":[51262,1262],"./ja/pwa.json":[46072,6072]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=75567,a.exports=e},78162:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(97523);let e=async a=>[{type:"image/png",sizes:"32x32",url:(0,d.fillMetadataSegment)(".",await a.params,"icon.png")+"?eeae29d23f3aae17"}]},78352:(a,b,c)=>{"use strict";c.d(b,{$T:()=>i,GQ:()=>k,Rx:()=>h,hD:()=>d,hS:()=>j,y:()=>g});class d extends Error{constructor(a,b,c){super(a),this.status=b,this.data=c,this.name="ApiError"}}async function e(a,b,c){if(!(a.headers.get("content-type")||"").includes("application/json"))return b;try{return await a.json()}catch{return b}}async function f(a,b){try{let c=new Headers(b?.headers);c.set("Content-Type","application/json");let f=await fetch(a,{...b,headers:c}),g=f.headers.get("content-type")||"";if(f.redirected&&f.url.includes("/login"))throw new d("Authentication required",401);if(!f.ok){let a=await e(f,{},"error-body");throw new d(a.error||`HTTP error ${f.status}`,f.status,a)}if(!g.includes("application/json"))throw new d("Unexpected response format",f.status);return f.json()}catch(a){if(a instanceof d)throw a;throw new d(a instanceof Error?a.message:"Unknown error",0,a)}}let g={getAll:async()=>f("/api/worktrees"),getById:async a=>f(`/api/worktrees/${a}`),updateDescription:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({description:b})}),updateLink:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({link:b})}),toggleFavorite:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({favorite:b})}),updateStatus:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({status:b})}),updateCliTool:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({cliToolId:b})}),markAsViewed:async a=>f(`/api/worktrees/${a}/viewed`,{method:"PATCH"}),async getMessages(a,b,c,d){let e=new URLSearchParams;return b&&e.append("cliTool",b),c&&e.append("includeArchived","true"),"number"==typeof d&&Number.isFinite(d)&&e.append("limit",String(d)),f(`/api/worktrees/${a}/messages${e.toString()?`?${e.toString()}`:""}`)},async sendMessage(a,b,c){let d={content:b};return c?.cliToolId&&(d.cliToolId=c.cliToolId),c?.instanceId&&(d.instanceId=c.instanceId),c?.imagePath&&(d.imagePath=c.imagePath),f(`/api/worktrees/${a}/send`,{method:"POST",body:JSON.stringify(d)})},async uploadImageFile(a,b){let c=Date.now(),d=`${c}-${b.name}`,f=".commandmate/attachments",g=new FormData;g.append("file",new File([b],d,{type:b.type}));let h=await fetch(`/api/worktrees/${a}/upload/${f}`,{method:"POST",body:g});if(!h.ok){let a=await e(h,{},"error-body");throw Error(a?.error?.message||`Upload failed (HTTP ${h.status})`)}return{path:(await e(h,{},"response-body")).path||`${f}/${d}`}},getLogs:async a=>f(`/api/worktrees/${a}/logs`),async getLogFile(a,b,c){let d=c?.sanitize?"?sanitize=true":"";return f(`/api/worktrees/${a}/logs/${b}${d}`)},async killSession(a,b,c){let d=new URLSearchParams;b&&d.set("cliTool",b),c&&d.set("instance",c);let e=d.toString();return f(`/api/worktrees/${a}/kill-session${e?`?${e}`:""}`,{method:"POST"})}},h={scan:async a=>f("/api/repositories/scan",{method:"POST",body:JSON.stringify({repositoryPath:a})}),sync:async()=>f("/api/repositories/sync",{method:"POST"}),delete:async a=>f("/api/repositories",{method:"DELETE",body:JSON.stringify({repositoryPath:a})}),clone:async a=>f("/api/repositories/clone",{method:"POST",body:JSON.stringify({cloneUrl:a})}),getCloneStatus:async a=>f(`/api/repositories/clone/${a}`),getExcluded:async()=>f("/api/repositories/excluded"),restore:async a=>f("/api/repositories/restore",{method:"PUT",body:JSON.stringify({repositoryPath:a})}),list:async()=>f("/api/repositories"),updateDisplayName:async(a,b)=>f(`/api/repositories/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify({displayName:b})}),updateVisibility:async(a,b)=>f(`/api/repositories/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify({visible:b})})},i={getAll:async a=>(await f(`/api/worktrees/${a}/memos`)).memos,create:async(a,b)=>(await f(`/api/worktrees/${a}/memos`,{method:"POST",body:JSON.stringify(b||{})})).memo,update:async(a,b,c)=>(await f(`/api/worktrees/${a}/memos/${b}`,{method:"PUT",body:JSON.stringify(c)})).memo,delete:async(a,b)=>f(`/api/worktrees/${a}/memos/${b}`,{method:"DELETE"}),async reorder(a,b){await f(`/api/worktrees/${a}/memos`,{method:"PATCH",body:JSON.stringify({memoIds:b})})}};function j(a){return a instanceof d||a instanceof Error?a.message:"An unknown error occurred"}let k={checkForUpdate:async()=>f("/api/app/update-check",{method:"GET"}),startUpdate:async()=>f("/api/app/update",{method:"POST"}),async ping(){try{return(await fetch("/api/auth/status",{cache:"no-store"})).ok}catch{return!1}}}},79782:(a,b,c)=>{"use strict";c.d(b,{SC:()=>m,TM:()=>i,aF:()=>k});var d=c(21124),e=c(38301),f=c(20481),g=c(98033),h=c(94260);function i({isOpen:a,title:b,description:c,confirmLabel:e,cancelLabel:i,variant:j="default",onConfirm:k,onCancel:l}){let m=(0,f.c)("common"),n="danger"===j;return(0,d.jsx)(g.a,{isOpen:a,onClose:l,title:b??m("confirmDialog.title"),size:"sm",showCloseButton:!1,children:(0,d.jsxs)("div",{className:"space-y-4","data-testid":"confirm-dialog",children:[(0,d.jsx)("p",{className:"text-sm text-foreground whitespace-pre-line",children:c}),(0,d.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,d.jsx)(h.$,{type:"button",variant:"secondary",size:"sm",autoFocus:n,onClick:l,"data-testid":"confirm-dialog-cancel",children:i??m("cancel")}),(0,d.jsx)(h.$,{type:"button",variant:n?"danger":"primary",size:"sm",autoFocus:!n,onClick:k,"data-testid":"confirm-dialog-confirm",children:e??m("confirmDialog.confirm")})]})]})})}let j=(0,e.createContext)(null);function k({children:a}){let[b,c]=(0,e.useState)(null),f=(0,e.useRef)(null),g=(0,e.useRef)(null),h=b?.options??g.current,k=(0,e.useCallback)(a=>new Promise(b=>{f.current=document.activeElement instanceof HTMLElement?document.activeElement:null,c(c=>(c?.resolve(!1),{options:a,resolve:b}))}),[]),l=(0,e.useCallback)(a=>{c(b=>(b?.resolve(a),null)),f.current?.focus(),f.current=null},[]);return(0,d.jsxs)(j.Provider,{value:k,children:[a,(0,d.jsx)(i,{isOpen:null!==b,title:h?.title,description:h?.description??"",confirmLabel:h?.confirmLabel,cancelLabel:h?.cancelLabel,variant:h?.variant,onConfirm:()=>l(!0),onCancel:()=>l(!1)})]})}let l=async()=>!1;function m(){return(0,e.useContext)(j)??l}},80407:(a,b,c)=>{var d={"./en/commandPalette.json":[28098,8098],"./ja/commandPalette.json":[12560,2560]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=80407,a.exports=e},80776:(a,b,c)=>{"use strict";c.d(b,{AppProviders:()=>v});var d=c(21124),e=c(37397),f=c(45523),g=c(81092),h=c(84342),i=c(5772),j=c(64632),k=c(89184),l=c(63157),m=c(52761),n=c(67619),o=c(79782),p=c(63474),q=c(38301),r=c(20481),s=c(25345),t=c(11010);function u(){let a=(0,r.c)("pwa"),[b,c]=(0,q.useState)(null);return((0,q.useRef)(!1),b)?(0,d.jsx)("div",{role:"status","aria-live":"polite",className:"fixed inset-x-0 bottom-0 flex justify-center px-4 pb-safe",style:{zIndex:t.M.TOAST},children:(0,d.jsxs)("div",{className:"mb-4 flex items-center gap-3 rounded-lg border border-border bg-surface px-4 py-3 shadow-lg",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:a("update.available")}),(0,d.jsxs)("button",{type:"button",onClick:()=>{b.postMessage({type:"SKIP_WAITING"})},className:"inline-flex items-center gap-1.5 rounded-md bg-accent-600 px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-accent-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background dark:bg-accent-500 dark:hover:bg-accent-600",children:[(0,d.jsx)(s.A,{className:"h-4 w-4"}),a("update.reload")]})]})}):null}function v({children:a,locale:b,messages:c,timeZone:q,authEnabled:r=!1}){return(0,d.jsx)(e.default,{locale:b,messages:c,timeZone:q,children:(0,d.jsx)(p.tE,{children:(0,d.jsx)(f.N,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:(0,d.jsx)(h.O,{authEnabled:r,children:(0,d.jsx)(i.W5,{children:(0,d.jsx)(g.GB,{children:(0,d.jsx)(n.tS,{children:(0,d.jsx)(l.g7,{children:(0,d.jsx)(j.E,{children:(0,d.jsx)(k.S,{children:(0,d.jsxs)(o.aF,{children:[(0,d.jsx)(m.Bo,{children:a}),(0,d.jsx)(u,{})]})})})})})})})})})})})}},80812:(a,b,c)=>{var d={"./en/externalApps.json":[37941,7941],"./ja/externalApps.json":[99211,9211]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=80812,a.exports=e},81092:(a,b,c)=>{"use strict";c.d(b,{GB:()=>j,VF:()=>k});var d=c(21124),e=c(38301),f=c(32482);let g="updatedAt",h=(0,e.createContext)(null);function i(a,b){switch(b.type){case"TOGGLE":return{...a,isOpen:!a.isOpen};case"SET_WIDTH":return{...a,width:b.width};case"OPEN_MOBILE_DRAWER":return{...a,isMobileDrawerOpen:!0};case"CLOSE_MOBILE_DRAWER":return{...a,isMobileDrawerOpen:!1};case"SET_SORT_KEY":return{...a,sortKey:b.sortKey};case"SET_SORT_DIRECTION":return{...a,sortDirection:b.sortDirection};case"LOAD_SORT_SETTINGS":return{...a,sortKey:b.sortKey,sortDirection:b.sortDirection};case"SET_VIEW_MODE":return{...a,viewMode:b.viewMode};default:return a}}function j({children:a,initialOpen:b=!0,initialWidth:c=224}){let[j,k]=(0,e.useReducer)(i,{isOpen:b,width:c,isMobileDrawerOpen:!1,sortKey:g,sortDirection:"desc",viewMode:"grouped"});j.sortKey,j.sortDirection,(0,e.useRef)(!0),j.viewMode,(0,e.useRef)(!0),j.width,(0,e.useRef)(!0);let l=(0,e.useCallback)(()=>{k({type:"TOGGLE"})},[]),m=(0,e.useCallback)(a=>{k({type:"SET_WIDTH",width:a})},[]),n=(0,e.useCallback)(()=>{k({type:"OPEN_MOBILE_DRAWER"})},[]),o=(0,e.useCallback)(()=>{k({type:"CLOSE_MOBILE_DRAWER"})},[]),p=(0,e.useCallback)(a=>{k({type:"SET_SORT_KEY",sortKey:a})},[]),q=(0,e.useCallback)(a=>{k({type:"SET_SORT_DIRECTION",sortDirection:a})},[]),r=(0,e.useCallback)(a=>{k({type:"SET_VIEW_MODE",viewMode:a})},[]),s=(0,e.useMemo)(()=>({isOpen:j.isOpen,width:j.width,isMobileDrawerOpen:j.isMobileDrawerOpen,sortKey:j.sortKey,sortDirection:j.sortDirection,toggle:l,setWidth:m,openMobileDrawer:n,closeMobileDrawer:o,setSortKey:p,setSortDirection:q,viewMode:j.viewMode,setViewMode:r}),[j.isOpen,j.width,j.isMobileDrawerOpen,j.sortKey,j.sortDirection,j.viewMode,l,m,n,o,p,q,r]);return(0,d.jsx)(h.Provider,{value:s,children:a})}function k(){let a=(0,e.useContext)(h);if(!a)throw Error("useSidebarContext must be used within a SidebarProvider");return a}},84342:(a,b,c)=>{"use strict";c.d(b,{H:()=>h,O:()=>g});var d=c(21124),e=c(38301);let f=(0,e.createContext)(!1);function g({children:a,authEnabled:b}){return(0,d.jsx)(f.Provider,{value:b,children:a})}function h(){return(0,e.useContext)(f)}},86634:(a,b,c)=>{Promise.resolve().then(c.bind(c,37397))},89184:(a,b,c)=>{"use strict";c.d(b,{K:()=>h,S:()=>g});var d=c(21124),e=c(38301);let f=(0,e.createContext)({open:!1,setOpen:()=>{},toggle:()=>{}});function g({children:a}){let[b,c]=(0,e.useState)(!1),g=(0,e.useCallback)(()=>c(a=>!a),[]),h=(0,e.useMemo)(()=>({open:b,setOpen:c,toggle:g}),[b,g]);return(0,d.jsx)(f.Provider,{value:h,children:a})}function h(){return(0,e.useContext)(f)}},90076:(a,b,c)=>{"use strict";c.d(b,{D:()=>f,a:()=>g});var d=c(38301);let e=d.useEffect,f=768;function g(a={}){let{breakpoint:b=f}=a,[c,h]=(0,d.useState)(!1);return e(()=>{let a=window.matchMedia(`(max-width: ${b-1}px)`);h(a.matches);let c=a=>{h(a.matches)};return a.addEventListener("change",c),()=>{a.removeEventListener("change",c)}},[b]),c}},90338:(a,b,c)=>{var d={"./en/worktree.json":[72119,2119],"./ja/worktree.json":[52445,2445]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=90338,a.exports=e},91786:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,23597,23)),Promise.resolve().then(c.t.bind(c,36893,23)),Promise.resolve().then(c.t.bind(c,89748,23)),Promise.resolve().then(c.t.bind(c,6060,23)),Promise.resolve().then(c.t.bind(c,7184,23)),Promise.resolve().then(c.t.bind(c,69576,23)),Promise.resolve().then(c.t.bind(c,73041,23)),Promise.resolve().then(c.t.bind(c,51384,23))},94260:(a,b,c)=>{"use strict";c.d(b,{$:()=>i});var d=c(21124);c(38301);var e=c(26691),f=c(35595),g=c(17793);let h=(0,e.F)("inline-flex items-center justify-center px-4 py-2 rounded-md font-medium transition-all duration-200 touch-manipulation focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background",{variants:{variant:{primary:"bg-accent-600 dark:bg-accent-500 text-white hover:bg-accent-700 dark:hover:bg-accent-600",secondary:"bg-muted text-foreground hover:bg-muted/80",danger:"bg-danger text-white hover:bg-danger/90",ghost:"bg-transparent text-foreground hover:bg-muted"},size:{sm:"px-3 py-1.5 text-sm",md:"",lg:"px-6 py-3 text-lg"},fullWidth:{true:"w-full",false:""}},defaultVariants:{variant:"primary",size:"md",fullWidth:!1}});function i({variant:a="primary",size:b="md",fullWidth:c=!1,loading:e=!1,disabled:i,className:j="",children:k,...l}){let m=i||e,n=(0,f.cn)(h({variant:a,size:b,fullWidth:c}),!m&&"motion-safe:hover:-translate-y-0.5 motion-safe:active:translate-y-0",m&&"opacity-50 cursor-not-allowed",j);return(0,d.jsxs)("button",{className:n,disabled:m,...l,children:[e&&(0,d.jsx)(g.y,{size:"sm",className:"-ml-1 mr-2"}),k]})}},94650:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(97523);let e=async a=>[{type:"image/png",sizes:"180x180",url:(0,d.fillMetadataSegment)(".",await a.params,"apple-icon.png")+"?31a89e65aa4ac65b"}]},95427:(a,b,c)=>{"use strict";c.d(b,{r:()=>e});var d=c(38301);function e(a={}){let{active:b=!0,initialFocus:c=!0,restoreFocus:f=!0}=a;return(0,d.useRef)(null)}},96908:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>g});var d=c(21124);c(38301);var e=c(20481),f=c(35914);function g({error:a,reset:b}){let c=(0,e.c)("error"),g=(0,e.c)("common"),h=(0,f.oz)(a);return(0,d.jsxs)("main",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-background px-6 pt-safe pb-safe text-center",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:c(h?"chunkReload.title":"unexpected.title")}),(0,d.jsx)("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:c(h?"chunkReload.description":"unexpected.description")})]}),(0,d.jsx)("button",{type:"button",onClick:h?()=>window.location.reload():b,className:"rounded-lg bg-accent-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-accent-700",children:g(h?"reload":"retry")})]})}},98033:(a,b,c)=>{"use strict";c.d(b,{a:()=>o});var d=c(21124),e=c(38301),f=c(23312),g=c(20481),h=c(26691),i=c(11010),j=c(58970),k=c(6074),l=c(95427),m=c(35595);let n=(0,h.F)("",{variants:{size:{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]"}},defaultVariants:{size:"lg"}});function o({isOpen:a,onClose:b,title:c,children:h,size:o="lg",showCloseButton:p=!0,disableClose:q=!1}){let r=(0,g.c)("common"),s=(0,e.useId)(),t=(0,l.r)({active:a}),{shouldRender:u,isExiting:v}=(0,k.O)(a,j.Ys),w=v?"closed":"open";return u?(0,f.createPortal)((0,d.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:i.M.MODAL},children:[(0,d.jsx)("div",{"data-state":w,className:"fixed inset-0 bg-black/50 transition-opacity data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-200 data-[state=closed]:fill-mode-forwards",onClick:q||v?void 0:b}),(0,d.jsx)("div",{className:"relative flex min-h-full items-center justify-center p-2 sm:p-4",children:(0,d.jsxs)("div",{ref:t,"data-state":w,"data-testid":"modal-panel",role:"dialog","aria-modal":"true","aria-labelledby":c?s:void 0,tabIndex:-1,className:(0,m.cn)("relative w-full",n({size:o}),"max-h-[calc(100vh-1rem)] sm:max-h-[calc(100vh-2rem)] flex flex-col bg-surface rounded-lg shadow-xl transform transition-all","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:duration-200","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:duration-200 data-[state=closed]:fill-mode-forwards"),children:[(c||p)&&(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-border flex-shrink-0",children:[(0,d.jsx)("h3",{id:s,className:"text-base sm:text-lg font-semibold text-foreground truncate pr-2",children:c}),p&&(0,d.jsx)("button",{onClick:b,"aria-label":r("close"),className:"text-muted-foreground hover:text-foreground transition-colors flex-shrink-0 touch-manipulation",children:(0,d.jsx)("svg",{className:"w-5 h-5 sm:w-6 sm:h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,d.jsx)("div",{className:"px-4 sm:px-6 py-3 sm:py-4 overflow-y-auto flex-1 min-h-0",children:h})]})})]}),document.body):null}},99127:(a,b,c)=>{var d={"./en/notifications.json":[49358,9358],"./ja/notifications.json":[61296,1296]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=99127,a.exports=e}};
13
+ `,children:(0,d.jsx)(l.A,{className:"h-4 w-4"})})]})}function s({toasts:a,onClose:b}){let[c,g]=(0,e.useState)(!1),h=(0,d.jsx)("div",{"data-testid":"toast-container","aria-live":"polite",className:"fixed bottom-4 right-4 flex flex-col gap-2",style:{zIndex:m.M.TOAST},children:a.map(a=>(0,d.jsx)(r,{id:a.id,message:a.message,type:a.type,onClose:b,duration:a.duration},a.id))});return c?(0,f.createPortal)(h,document.body):null}function t(){let[a,b]=(0,e.useState)([]),c=(0,e.useRef)(0),d=(0,e.useCallback)((a,d="info",e=p)=>{let f=`toast-${++c.current}-${Date.now()}`,g={id:f,message:a,type:d,duration:e};return b(a=>[...a,g]),f},[]),f=(0,e.useCallback)(a=>{b(b=>b.filter(b=>b.id!==a))},[]),g=(0,e.useCallback)(()=>{b([])},[]);return(0,e.useMemo)(()=>({toasts:a,showToast:d,removeToast:f,clearToasts:g}),[a,d,f,g])}let u=(0,e.createContext)(null);function v({children:a}){let b=t();return(0,d.jsxs)(u.Provider,{value:b,children:[a,(0,d.jsx)(s,{toasts:b.toasts,onClose:b.removeToast})]})}function w(){let a=(0,e.useContext)(u),b=t();return a??b}},64182:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(97954).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/CommandMate/CommandMate/src/app/global-error.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/CommandMate/CommandMate/src/app/global-error.tsx","default")},64632:(a,b,c)=>{"use strict";c.d(b,{C:()=>h,E:()=>g});var d=c(21124),e=c(38301);let f=(0,e.createContext)({open:!1,setOpen:()=>{},toggle:()=>{}});function g({children:a}){let[b,c]=(0,e.useState)(!1),g=(0,e.useCallback)(()=>c(a=>!a),[]),h=(0,e.useMemo)(()=>({open:b,setOpen:c,toggle:g}),[b,g]);return(0,d.jsx)(f.Provider,{value:h,children:a})}function h(){return(0,e.useContext)(f)}},66125:(a,b,c)=>{var d={"./en/error.json":[22980,2980],"./ja/error.json":[10450,450]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=66125,a.exports=e},67619:(a,b,c)=>{"use strict";c.d(b,{tS:()=>i,xM:()=>j,T3:()=>k});var d=c(21124),e=c(38301);c(12055);let f=()=>{},g={status:"disconnected",connected:!1,subscribe:f,unsubscribe:f,addListener:()=>f},h=(0,e.createContext)(null);function i({children:a,enabled:b=!0}){let c=(0,e.useRef)(new Set),f=(0,e.useRef)(new Map),{status:g,subscribe:i,unsubscribe:j}=function(a={}){let{onEvent:b,onStatusChange:c,autoReconnect:d=!0,reconnectBaseDelay:f=1e3,reconnectMaxDelay:g=3e4,enabled:h=!0}=a,[i,j]=(0,e.useState)("disconnected"),k=(0,e.useRef)(null),l=(0,e.useRef)(null);(0,e.useRef)(0);let m=(0,e.useRef)(new Set),n=(0,e.useRef)(!1);(0,e.useRef)(b).current=b;let o=(0,e.useRef)(c);o.current=c;let p=(0,e.useCallback)(a=>{j(a),o.current?.(a)},[]),q=(0,e.useCallback)(()=>{null!==l.current&&(clearTimeout(l.current),l.current=null)},[]);(0,e.useCallback)(()=>{},[h,d,f,g,p,q]),(0,e.useCallback)(()=>{if(q(),n.current=!0,k.current){try{k.current.close(1e3,"Client disconnect")}catch{}k.current=null}},[q]);let r=(0,e.useCallback)(a=>{let b=k.current,c="undefined"!=typeof globalThis&&"function"==typeof globalThis.WebSocket?globalThis.WebSocket:null;if(b&&c&&b.readyState===c.OPEN)try{b.send(JSON.stringify(a))}catch{}},[]);return{status:i,subscribe:(0,e.useCallback)(a=>{m.current.has(a)||(m.current.add(a),r({type:"subscribe",worktreeId:a}))},[r]),unsubscribe:(0,e.useCallback)(a=>{m.current.has(a)&&(m.current.delete(a),r({type:"unsubscribe",worktreeId:a}))},[r]),send:r}}({enabled:b,onEvent:(0,e.useCallback)(a=>{c.current.forEach(b=>{try{b(a)}catch{}})},[])}),k=(0,e.useCallback)(a=>{let b=f.current,c=b.get(a)??0;b.set(a,c+1),0===c&&i(a)},[i]),l=(0,e.useCallback)(a=>{let b=f.current,c=b.get(a)??0;c<=1?(b.delete(a),j(a)):b.set(a,c-1)},[j]),m=(0,e.useCallback)(a=>(c.current.add(a),()=>{c.current.delete(a)}),[]),n=(0,e.useMemo)(()=>({status:g,connected:"connected"===g,subscribe:k,unsubscribe:l,addListener:m}),[g,k,l,m]);return(0,d.jsx)(h.Provider,{value:n,children:a})}function j(){return(0,e.useContext)(h)??g}function k(a){let{addListener:b}=j();(0,e.useRef)(a).current=a}},68132:(a,b,c)=>{Promise.resolve().then(c.bind(c,39800))},70288:(a,b,c)=>{var d={"./en/home.json":[41825,1825],"./ja/home.json":[26159,6159]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=70288,a.exports=e},72637:(a,b,c)=>{var d={"./en/prompt.json":[72816,2816],"./ja/prompt.json":[80066,7685]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=72637,a.exports=e},75567:(a,b,c)=>{var d={"./en/pwa.json":[51262,1262],"./ja/pwa.json":[46072,6072]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=75567,a.exports=e},78162:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(97523);let e=async a=>[{type:"image/png",sizes:"32x32",url:(0,d.fillMetadataSegment)(".",await a.params,"icon.png")+"?eeae29d23f3aae17"}]},78352:(a,b,c)=>{"use strict";c.d(b,{$T:()=>i,GQ:()=>k,Rx:()=>h,hD:()=>d,hS:()=>j,y:()=>g});class d extends Error{constructor(a,b,c){super(a),this.status=b,this.data=c,this.name="ApiError"}}async function e(a,b,c){if(!(a.headers.get("content-type")||"").includes("application/json"))return b;try{return await a.json()}catch{return b}}async function f(a,b){try{let c=new Headers(b?.headers);c.set("Content-Type","application/json");let f=await fetch(a,{...b,headers:c}),g=f.headers.get("content-type")||"";if(f.redirected&&f.url.includes("/login"))throw new d("Authentication required",401);if(!f.ok){let a=await e(f,{},"error-body");throw new d(a.error||`HTTP error ${f.status}`,f.status,a)}if(!g.includes("application/json"))throw new d("Unexpected response format",f.status);return f.json()}catch(a){if(a instanceof d)throw a;throw new d(a instanceof Error?a.message:"Unknown error",0,a)}}let g={getAll:async()=>f("/api/worktrees"),getById:async a=>f(`/api/worktrees/${a}`),updateDescription:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({description:b})}),updateLink:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({link:b})}),toggleFavorite:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({favorite:b})}),updateStatus:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({status:b})}),updateCliTool:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({cliToolId:b})}),markAsViewed:async a=>f(`/api/worktrees/${a}/viewed`,{method:"PATCH"}),async getMessages(a,b,c,d){let e=new URLSearchParams;return b&&e.append("cliTool",b),c&&e.append("includeArchived","true"),"number"==typeof d&&Number.isFinite(d)&&e.append("limit",String(d)),f(`/api/worktrees/${a}/messages${e.toString()?`?${e.toString()}`:""}`)},async sendMessage(a,b,c){let d={content:b};return c?.cliToolId&&(d.cliToolId=c.cliToolId),c?.instanceId&&(d.instanceId=c.instanceId),c?.imagePath&&(d.imagePath=c.imagePath),f(`/api/worktrees/${a}/send`,{method:"POST",body:JSON.stringify(d)})},async uploadImageFile(a,b){let c=Date.now(),d=`${c}-${b.name}`,f=".commandmate/attachments",g=new FormData;g.append("file",new File([b],d,{type:b.type}));let h=await fetch(`/api/worktrees/${a}/upload/${f}`,{method:"POST",body:g});if(!h.ok){let a=await e(h,{},"error-body");throw Error(a?.error?.message||`Upload failed (HTTP ${h.status})`)}return{path:(await e(h,{},"response-body")).path||`${f}/${d}`}},getLogs:async a=>f(`/api/worktrees/${a}/logs`),async getLogFile(a,b,c){let d=c?.sanitize?"?sanitize=true":"";return f(`/api/worktrees/${a}/logs/${b}${d}`)},async killSession(a,b,c){let d=new URLSearchParams;b&&d.set("cliTool",b),c&&d.set("instance",c);let e=d.toString();return f(`/api/worktrees/${a}/kill-session${e?`?${e}`:""}`,{method:"POST"})}},h={scan:async a=>f("/api/repositories/scan",{method:"POST",body:JSON.stringify({repositoryPath:a})}),sync:async()=>f("/api/repositories/sync",{method:"POST"}),delete:async a=>f("/api/repositories",{method:"DELETE",body:JSON.stringify({repositoryPath:a})}),clone:async(a,b)=>f("/api/repositories/clone",{method:"POST",body:JSON.stringify({cloneUrl:a,fork:b?.fork??!1})}),getCloneStatus:async a=>f(`/api/repositories/clone/${a}`),getExcluded:async()=>f("/api/repositories/excluded"),restore:async a=>f("/api/repositories/restore",{method:"PUT",body:JSON.stringify({repositoryPath:a})}),list:async()=>f("/api/repositories"),updateDisplayName:async(a,b)=>f(`/api/repositories/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify({displayName:b})}),updateVisibility:async(a,b)=>f(`/api/repositories/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify({visible:b})})},i={getAll:async a=>(await f(`/api/worktrees/${a}/memos`)).memos,create:async(a,b)=>(await f(`/api/worktrees/${a}/memos`,{method:"POST",body:JSON.stringify(b||{})})).memo,update:async(a,b,c)=>(await f(`/api/worktrees/${a}/memos/${b}`,{method:"PUT",body:JSON.stringify(c)})).memo,delete:async(a,b)=>f(`/api/worktrees/${a}/memos/${b}`,{method:"DELETE"}),async reorder(a,b){await f(`/api/worktrees/${a}/memos`,{method:"PATCH",body:JSON.stringify({memoIds:b})})}};function j(a){return a instanceof d||a instanceof Error?a.message:"An unknown error occurred"}let k={checkForUpdate:async()=>f("/api/app/update-check",{method:"GET"}),startUpdate:async()=>f("/api/app/update",{method:"POST"}),async ping(){try{return(await fetch("/api/auth/status",{cache:"no-store"})).ok}catch{return!1}}}},79782:(a,b,c)=>{"use strict";c.d(b,{SC:()=>m,TM:()=>i,aF:()=>k});var d=c(21124),e=c(38301),f=c(20481),g=c(98033),h=c(94260);function i({isOpen:a,title:b,description:c,confirmLabel:e,cancelLabel:i,variant:j="default",onConfirm:k,onCancel:l}){let m=(0,f.c)("common"),n="danger"===j;return(0,d.jsx)(g.a,{isOpen:a,onClose:l,title:b??m("confirmDialog.title"),size:"sm",showCloseButton:!1,children:(0,d.jsxs)("div",{className:"space-y-4","data-testid":"confirm-dialog",children:[(0,d.jsx)("p",{className:"text-sm text-foreground whitespace-pre-line",children:c}),(0,d.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,d.jsx)(h.$,{type:"button",variant:"secondary",size:"sm",autoFocus:n,onClick:l,"data-testid":"confirm-dialog-cancel",children:i??m("cancel")}),(0,d.jsx)(h.$,{type:"button",variant:n?"danger":"primary",size:"sm",autoFocus:!n,onClick:k,"data-testid":"confirm-dialog-confirm",children:e??m("confirmDialog.confirm")})]})]})})}let j=(0,e.createContext)(null);function k({children:a}){let[b,c]=(0,e.useState)(null),f=(0,e.useRef)(null),g=(0,e.useRef)(null),h=b?.options??g.current,k=(0,e.useCallback)(a=>new Promise(b=>{f.current=document.activeElement instanceof HTMLElement?document.activeElement:null,c(c=>(c?.resolve(!1),{options:a,resolve:b}))}),[]),l=(0,e.useCallback)(a=>{c(b=>(b?.resolve(a),null)),f.current?.focus(),f.current=null},[]);return(0,d.jsxs)(j.Provider,{value:k,children:[a,(0,d.jsx)(i,{isOpen:null!==b,title:h?.title,description:h?.description??"",confirmLabel:h?.confirmLabel,cancelLabel:h?.cancelLabel,variant:h?.variant,onConfirm:()=>l(!0),onCancel:()=>l(!1)})]})}let l=async()=>!1;function m(){return(0,e.useContext)(j)??l}},80407:(a,b,c)=>{var d={"./en/commandPalette.json":[28098,8098],"./ja/commandPalette.json":[12560,2560]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=80407,a.exports=e},80776:(a,b,c)=>{"use strict";c.d(b,{AppProviders:()=>v});var d=c(21124),e=c(37397),f=c(45523),g=c(81092),h=c(84342),i=c(5772),j=c(64632),k=c(89184),l=c(63157),m=c(52761),n=c(67619),o=c(79782),p=c(63474),q=c(38301),r=c(20481),s=c(25345),t=c(11010);function u(){let a=(0,r.c)("pwa"),[b,c]=(0,q.useState)(null);return((0,q.useRef)(!1),b)?(0,d.jsx)("div",{role:"status","aria-live":"polite",className:"fixed inset-x-0 bottom-0 flex justify-center px-4 pb-safe",style:{zIndex:t.M.TOAST},children:(0,d.jsxs)("div",{className:"mb-4 flex items-center gap-3 rounded-lg border border-border bg-surface px-4 py-3 shadow-lg",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:a("update.available")}),(0,d.jsxs)("button",{type:"button",onClick:()=>{b.postMessage({type:"SKIP_WAITING"})},className:"inline-flex items-center gap-1.5 rounded-md bg-accent-600 px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-accent-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background dark:bg-accent-500 dark:hover:bg-accent-600",children:[(0,d.jsx)(s.A,{className:"h-4 w-4"}),a("update.reload")]})]})}):null}function v({children:a,locale:b,messages:c,timeZone:q,authEnabled:r=!1}){return(0,d.jsx)(e.default,{locale:b,messages:c,timeZone:q,children:(0,d.jsx)(p.tE,{children:(0,d.jsx)(f.N,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:(0,d.jsx)(h.O,{authEnabled:r,children:(0,d.jsx)(i.W5,{children:(0,d.jsx)(g.GB,{children:(0,d.jsx)(n.tS,{children:(0,d.jsx)(l.g7,{children:(0,d.jsx)(j.E,{children:(0,d.jsx)(k.S,{children:(0,d.jsxs)(o.aF,{children:[(0,d.jsx)(m.Bo,{children:a}),(0,d.jsx)(u,{})]})})})})})})})})})})})}},80812:(a,b,c)=>{var d={"./en/externalApps.json":[37941,7941],"./ja/externalApps.json":[99211,9211]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=80812,a.exports=e},81092:(a,b,c)=>{"use strict";c.d(b,{GB:()=>j,VF:()=>k});var d=c(21124),e=c(38301),f=c(32482);let g="updatedAt",h=(0,e.createContext)(null);function i(a,b){switch(b.type){case"TOGGLE":return{...a,isOpen:!a.isOpen};case"SET_WIDTH":return{...a,width:b.width};case"OPEN_MOBILE_DRAWER":return{...a,isMobileDrawerOpen:!0};case"CLOSE_MOBILE_DRAWER":return{...a,isMobileDrawerOpen:!1};case"SET_SORT_KEY":return{...a,sortKey:b.sortKey};case"SET_SORT_DIRECTION":return{...a,sortDirection:b.sortDirection};case"LOAD_SORT_SETTINGS":return{...a,sortKey:b.sortKey,sortDirection:b.sortDirection};case"SET_VIEW_MODE":return{...a,viewMode:b.viewMode};default:return a}}function j({children:a,initialOpen:b=!0,initialWidth:c=224}){let[j,k]=(0,e.useReducer)(i,{isOpen:b,width:c,isMobileDrawerOpen:!1,sortKey:g,sortDirection:"desc",viewMode:"grouped"});j.sortKey,j.sortDirection,(0,e.useRef)(!0),j.viewMode,(0,e.useRef)(!0),j.width,(0,e.useRef)(!0);let l=(0,e.useCallback)(()=>{k({type:"TOGGLE"})},[]),m=(0,e.useCallback)(a=>{k({type:"SET_WIDTH",width:a})},[]),n=(0,e.useCallback)(()=>{k({type:"OPEN_MOBILE_DRAWER"})},[]),o=(0,e.useCallback)(()=>{k({type:"CLOSE_MOBILE_DRAWER"})},[]),p=(0,e.useCallback)(a=>{k({type:"SET_SORT_KEY",sortKey:a})},[]),q=(0,e.useCallback)(a=>{k({type:"SET_SORT_DIRECTION",sortDirection:a})},[]),r=(0,e.useCallback)(a=>{k({type:"SET_VIEW_MODE",viewMode:a})},[]),s=(0,e.useMemo)(()=>({isOpen:j.isOpen,width:j.width,isMobileDrawerOpen:j.isMobileDrawerOpen,sortKey:j.sortKey,sortDirection:j.sortDirection,toggle:l,setWidth:m,openMobileDrawer:n,closeMobileDrawer:o,setSortKey:p,setSortDirection:q,viewMode:j.viewMode,setViewMode:r}),[j.isOpen,j.width,j.isMobileDrawerOpen,j.sortKey,j.sortDirection,j.viewMode,l,m,n,o,p,q,r]);return(0,d.jsx)(h.Provider,{value:s,children:a})}function k(){let a=(0,e.useContext)(h);if(!a)throw Error("useSidebarContext must be used within a SidebarProvider");return a}},84342:(a,b,c)=>{"use strict";c.d(b,{H:()=>h,O:()=>g});var d=c(21124),e=c(38301);let f=(0,e.createContext)(!1);function g({children:a,authEnabled:b}){return(0,d.jsx)(f.Provider,{value:b,children:a})}function h(){return(0,e.useContext)(f)}},86634:(a,b,c)=>{Promise.resolve().then(c.bind(c,37397))},89184:(a,b,c)=>{"use strict";c.d(b,{K:()=>h,S:()=>g});var d=c(21124),e=c(38301);let f=(0,e.createContext)({open:!1,setOpen:()=>{},toggle:()=>{}});function g({children:a}){let[b,c]=(0,e.useState)(!1),g=(0,e.useCallback)(()=>c(a=>!a),[]),h=(0,e.useMemo)(()=>({open:b,setOpen:c,toggle:g}),[b,g]);return(0,d.jsx)(f.Provider,{value:h,children:a})}function h(){return(0,e.useContext)(f)}},90076:(a,b,c)=>{"use strict";c.d(b,{D:()=>f,a:()=>g});var d=c(38301);let e=d.useEffect,f=768;function g(a={}){let{breakpoint:b=f}=a,[c,h]=(0,d.useState)(!1);return e(()=>{let a=window.matchMedia(`(max-width: ${b-1}px)`);h(a.matches);let c=a=>{h(a.matches)};return a.addEventListener("change",c),()=>{a.removeEventListener("change",c)}},[b]),c}},90338:(a,b,c)=>{var d={"./en/worktree.json":[72119,2119],"./ja/worktree.json":[52445,2445]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=90338,a.exports=e},91786:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,23597,23)),Promise.resolve().then(c.t.bind(c,36893,23)),Promise.resolve().then(c.t.bind(c,89748,23)),Promise.resolve().then(c.t.bind(c,6060,23)),Promise.resolve().then(c.t.bind(c,7184,23)),Promise.resolve().then(c.t.bind(c,69576,23)),Promise.resolve().then(c.t.bind(c,73041,23)),Promise.resolve().then(c.t.bind(c,51384,23))},94260:(a,b,c)=>{"use strict";c.d(b,{$:()=>i});var d=c(21124);c(38301);var e=c(26691),f=c(35595),g=c(17793);let h=(0,e.F)("inline-flex items-center justify-center px-4 py-2 rounded-md font-medium transition-all duration-200 touch-manipulation focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background",{variants:{variant:{primary:"bg-accent-600 dark:bg-accent-500 text-white hover:bg-accent-700 dark:hover:bg-accent-600",secondary:"bg-muted text-foreground hover:bg-muted/80",danger:"bg-danger text-white hover:bg-danger/90",ghost:"bg-transparent text-foreground hover:bg-muted"},size:{sm:"px-3 py-1.5 text-sm",md:"",lg:"px-6 py-3 text-lg"},fullWidth:{true:"w-full",false:""}},defaultVariants:{variant:"primary",size:"md",fullWidth:!1}});function i({variant:a="primary",size:b="md",fullWidth:c=!1,loading:e=!1,disabled:i,className:j="",children:k,...l}){let m=i||e,n=(0,f.cn)(h({variant:a,size:b,fullWidth:c}),!m&&"motion-safe:hover:-translate-y-0.5 motion-safe:active:translate-y-0",m&&"opacity-50 cursor-not-allowed",j);return(0,d.jsxs)("button",{className:n,disabled:m,...l,children:[e&&(0,d.jsx)(g.y,{size:"sm",className:"-ml-1 mr-2"}),k]})}},94650:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(97523);let e=async a=>[{type:"image/png",sizes:"180x180",url:(0,d.fillMetadataSegment)(".",await a.params,"apple-icon.png")+"?31a89e65aa4ac65b"}]},95427:(a,b,c)=>{"use strict";c.d(b,{r:()=>e});var d=c(38301);function e(a={}){let{active:b=!0,initialFocus:c=!0,restoreFocus:f=!0}=a;return(0,d.useRef)(null)}},96908:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>g});var d=c(21124);c(38301);var e=c(20481),f=c(35914);function g({error:a,reset:b}){let c=(0,e.c)("error"),g=(0,e.c)("common"),h=(0,f.oz)(a);return(0,d.jsxs)("main",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-background px-6 pt-safe pb-safe text-center",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:c(h?"chunkReload.title":"unexpected.title")}),(0,d.jsx)("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:c(h?"chunkReload.description":"unexpected.description")})]}),(0,d.jsx)("button",{type:"button",onClick:h?()=>window.location.reload():b,className:"rounded-lg bg-accent-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-accent-700",children:g(h?"reload":"retry")})]})}},98033:(a,b,c)=>{"use strict";c.d(b,{a:()=>o});var d=c(21124),e=c(38301),f=c(23312),g=c(20481),h=c(26691),i=c(11010),j=c(58970),k=c(6074),l=c(95427),m=c(35595);let n=(0,h.F)("",{variants:{size:{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]"}},defaultVariants:{size:"lg"}});function o({isOpen:a,onClose:b,title:c,children:h,size:o="lg",showCloseButton:p=!0,disableClose:q=!1}){let r=(0,g.c)("common"),s=(0,e.useId)(),t=(0,l.r)({active:a}),{shouldRender:u,isExiting:v}=(0,k.O)(a,j.Ys),w=v?"closed":"open";return u?(0,f.createPortal)((0,d.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:i.M.MODAL},children:[(0,d.jsx)("div",{"data-state":w,className:"fixed inset-0 bg-black/50 transition-opacity data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-200 data-[state=closed]:fill-mode-forwards",onClick:q||v?void 0:b}),(0,d.jsx)("div",{className:"relative flex min-h-full items-center justify-center p-2 sm:p-4",children:(0,d.jsxs)("div",{ref:t,"data-state":w,"data-testid":"modal-panel",role:"dialog","aria-modal":"true","aria-labelledby":c?s:void 0,tabIndex:-1,className:(0,m.cn)("relative w-full",n({size:o}),"max-h-[calc(100vh-1rem)] sm:max-h-[calc(100vh-2rem)] flex flex-col bg-surface rounded-lg shadow-xl transform transition-all","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:duration-200","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:duration-200 data-[state=closed]:fill-mode-forwards"),children:[(c||p)&&(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-border flex-shrink-0",children:[(0,d.jsx)("h3",{id:s,className:"text-base sm:text-lg font-semibold text-foreground truncate pr-2",children:c}),p&&(0,d.jsx)("button",{onClick:b,"aria-label":r("close"),className:"text-muted-foreground hover:text-foreground transition-colors flex-shrink-0 touch-manipulation",children:(0,d.jsx)("svg",{className:"w-5 h-5 sm:w-6 sm:h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,d.jsx)("div",{className:"px-4 sm:px-6 py-3 sm:py-4 overflow-y-auto flex-1 min-h-0",children:h})]})})]}),document.body):null}},99127:(a,b,c)=>{var d={"./en/notifications.json":[49358,9358],"./ja/notifications.json":[61296,1296]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=99127,a.exports=e}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=9192,exports.ids=[9192],exports.modules={2412:(a,b,c)=>{c.d(b,{Qb:()=>f,tR:()=>g});var d=c(46065);let e=Symbol("default-branch-unresolved");async function f(a){let b=await (0,d.Bc)(["symbolic-ref","refs/remotes/origin/HEAD","--short"],a);if(null===b)return e;let c=b.trim();return c.startsWith("origin/")?c.slice(7):null}async function g(a){let b=await f(a);return"string"==typeof b?b:null}},59082:(a,b,c)=>{c.d(b,{C4:()=>l,FW:()=>j,Iz:()=>k,Z3:()=>m});var d=c(65417),e=c(72626),f=c(46065),g=c(2412),h=c(63271);let i=(0,e.h)("git-remote");async function j(a,b){let{remote:c="origin",prune:e}=b,g=["fetch"];e&&g.push("--prune"),g.push(c,"--"),await (0,f.sl)(g,a,d.dw)}async function k(a,b,c){await (0,f.rS)(["remote","add",b,c],a,5e3)}async function l(a,b){let{remote:c="origin",branch:e,rebase:g,ffOnly:h}=b;return(0,f.dX)(a,async()=>{let b=["pull"];return g&&b.push("--rebase"),h&&b.push("--ff-only"),b.push(c),e&&b.push(e),b.push("--"),(0,f.mY)(b,a,d.A$,!0)})}async function m(a,b){let{remote:c="origin",branch:e,force:j,forceWithLease:k,setUpstream:l}=b;if(j||k){let b=await (0,g.tR)(a);if(null!==b&&b===e)throw new h.rm;i.warn("git:danger:force-push",{operation:"push",worktreePath:a,branch:e,forceWithLease:!0===k,timestamp:new Date().toISOString()})}await (0,f.dX)(a,async()=>{let b=["push"];k?b.push("--force-with-lease"):j&&b.push("--force"),l&&b.push("-u"),b.push(c,`${e}:refs/heads/${e}`,"--"),await (0,f.sl)(b,a,d.fL)})}},99192:(a,b,c)=>{c.d(b,{nX:()=>H,z0:()=>u,lY:()=>I,SN:()=>J,Pt:()=>w,ID:()=>i,Wz:()=>y,NM:()=>r,ac:()=>s,$G:()=>h,t$:()=>m,mk:()=>M,Lz:()=>z,om:()=>C,FW:()=>V.FW,C4:()=>V.C4,Z3:()=>V.Z3,S7:()=>T,lw:()=>U,x7:()=>d.x7,jr:()=>E,pc:()=>A,Ey:()=>P,X_:()=>Q,VM:()=>O,oC:()=>N,X0:()=>B});var d=c(63271),e=c(46065),f=c(2412),g=c(65417);async function h(a,b){let c,[d,f,g]=await Promise.all([(0,e.Bc)(["rev-parse","--abbrev-ref","HEAD"],a),(0,e.Bc)(["rev-parse","--short","HEAD"],a),(0,e.Bc)(["status","--porcelain"],a)]);return c=null===d?"(unknown)":"HEAD"===d?"(detached HEAD)":d,{currentBranch:c,initialBranch:b,isBranchMismatch:null!==b&&"(unknown)"!==c&&"(detached HEAD)"!==c&&c!==b,commitHash:f??"(unknown)",isDirty:null!==g&&g.length>0}}async function i(a){let b=await (0,e.Bc)(["rev-list","--left-right","--count","@{upstream}...HEAD"],a);if(null===b)return null;let c=b.split(" ");if(2!==c.length)return null;let d=parseInt(c[0],10),f=parseInt(c[1],10);return Number.isInteger(d)&&Number.isInteger(f)?{ahead:f,behind:d}:null}function j(a){switch(a){case"A":return"added";case"D":return"deleted";case"R":case"C":return"renamed";default:return"modified"}}let k=new Set(["DD","AU","UD","UA","DU","AA","UU"]);function l(a){let b=a.indexOf(" -> ");return -1!==b?a.slice(b+4):a}async function m(a){return function(a){let b=[],c=[],d=[];if(!a)return{staged:b,unstaged:c,untracked:d};for(let e of a.split("\n")){if(e.length<4)continue;let a=e[0],f=e[1],g=e.slice(3);if(!g)continue;if("?"===a&&"?"===f){d.push({path:l(g),status:"untracked"});continue}let h=l(g);if("U"===a||"U"===f||k.has(`${a}${f}`)){c.push({path:h,status:"unmerged"});continue}" "!==a&&"?"!==a&&b.push({path:h,status:j(a)})," "!==f&&"?"!==f&&c.push({path:h,status:j(f)})}return{staged:b,unstaged:c,untracked:d}}(await (0,e.rS)(["status","--porcelain"],a,g.Ev))}var n=c(29021),o=c.n(n),p=c(72626);let q=(0,p.h)("git-log");async function r(a,b=50,c=0){let d=(await (0,e.rS)(["log",`--max-count=${b}`,`--skip=${c}`,"--format=%H%n%h%n%s%n%an%n%aI","--"],a,e.t1)).trim();if(!d)return[];let f=d.split("\n"),g=[];for(let a=0;a+4<f.length;a+=5)g.push({hash:f[a],shortHash:f[a+1],message:f[a+2],author:f[a+3],date:f[a+4]});return g}async function s(a,b){try{let c=(await (0,e.rS)(["log","-1","--format=%H%n%h%n%s%n%an%n%aI",b,"--"],a,e.t1)).trim().split("\n");if(c.length<5)return null;let d={hash:c[0],shortHash:c[1],message:c[2],author:c[3],date:c[4]},f=await (0,e.rS)(["diff-tree","--no-commit-id","-r","--name-status",b,"--"],a,e.t1),g=function(a){let b=[];for(let c of a.trim().split("\n")){if(!c.trim())continue;let a=c.split(" ");if(a.length<2)continue;let d=a[0].trim(),e=a[a.length-1].trim();d.startsWith("R")?b.push({path:e,status:"renamed"}):"A"===d?b.push({path:e,status:"added"}):"D"===d?b.push({path:e,status:"deleted"}):b.push({path:e,status:"modified"})}return b}(f);return{commit:d,files:g}}catch(b){if(b instanceof d.y0||b instanceof d.wo)throw b;let a=b instanceof Error?b.message:"";if(a.includes("unknown revision")||a.includes("bad object"))return null;throw b}}async function t(a,b,c){if(!o().existsSync(a))return[];try{let{stdout:d}=await (0,e.mf)("git",["log","--all",`--since=${b}`,`--until=${c}`,`--format=%h\x1f%s\x1f%an`,"--"],{cwd:a,timeout:5e3}),f=d.trim();if(!f)return[];let g=[];for(let a of f.split("\n")){let b=a.split("\x1f");3===b.length&&g.push({shortHash:b[0],message:b[1],author:b[2]})}return g}catch(b){return q.error("git:commit-log-failed",{repoPath:a,error:b instanceof Error?b.message:"Unknown error"}),[]}}async function u(a,b,c){let d=await Promise.allSettled(a.map(async a=>({id:a.id,name:a.name,commits:await t(a.path,b,c)}))),e=new Map;for(let a of d)"fulfilled"===a.status&&a.value.commits.length>0&&e.set(a.value.id,{name:a.value.name,commits:a.value.commits});return e}let v=/(?:(?:closes|fixes|resolves)\s+)?#(\d+)/gi;function w(a){let b=new Set;for(let c of a){let a;for(v.lastIndex=0;null!==(a=v.exec(c));)b.add(parseInt(a[1],10))}return Array.from(b).sort((a,b)=>a-b)}let x=(0,p.h)("git-diff");async function y(a,b,c){try{return(await (0,e.rS)(["show",b,"--",c],a,e.t1)).trim()||null}catch(a){if(a instanceof d.y0||a instanceof d.wo)throw a;return null}}async function z(a,b,c){let f=function(a,b){switch(b){case"staged":return["diff","--cached","--",a];case"untracked":return["diff","--no-index","--","/dev/null",a];default:return["diff","--",a]}}(b,c);try{let{stdout:b}=await (0,e.mf)("git",f,{cwd:a,timeout:e.t1});return b.trim()||null}catch(a){if(a.killed||"ERR_CHILD_PROCESS_EXEC_TIMEOUT"===a.code||"ETIMEDOUT"===a.code)throw new d.y0(`Git command timed out after ${e.t1}ms`);if((a.stderr||a.message||"").includes("not a git repository"))throw new d.wo("Not a git repository");if("string"==typeof a.stdout)return a.stdout.trim()||null;throw x.error("git:working-diff-failed",{args:f.join(" "),error:a.message}),Error("Failed to execute git command")}}async function A(a,b){await (0,e.dX)(a,async()=>{await (0,e.rS)(["add","--",...b],a,g.Ev)})}async function B(a,b){await (0,e.dX)(a,async()=>{await (0,e.rS)(["restore","--staged","--",...b],a,g.Ev)})}async function C(a,b,c){await (0,e.dX)(a,async()=>{let f=["commit","-m",b];c&&f.push("--amend"),f.push("--");try{await (0,e.rS)(f,a,g.Ev)}catch(b){let a=b instanceof Error?b.message:"";if(/nothing to commit|no changes added to commit|nothing added to commit/i.test(a))throw new d.mZ("Nothing to commit");throw b}})}function D(a){let b=new Map;if(!a)return b;let c=null;for(let d of a.split("\n")){let a=d.trimEnd();if(a.startsWith("worktree "))c=a.slice(9).trim();else if(a.startsWith("branch ")&&c){let d=a.slice(7).trim(),e=d.startsWith("refs/heads/")?d.slice(11):d;e&&b.set(e,c)}else""===a&&(c=null)}return b}async function E(a,b="local"){let c="local"===b||"all"===b,d="remote"===b||"all"===b,[f,g,h,i,j]=await Promise.all([c?(0,e.Bc)(["branch","--list"],a):Promise.resolve(""),d?(0,e.Bc)(["branch","-r"],a):Promise.resolve(""),(0,e.Bc)(["symbolic-ref","refs/remotes/origin/HEAD","--short"],a),(0,e.Bc)(["worktree","list","--porcelain"],a),(0,e.Bc)(["for-each-ref","--format=%(refname:short)%09%(upstream:short)%09%(upstream:track)","refs/heads"],a)]),k=h?h.trim():null,l=D(i??""),m=function(a){let b=new Map;if(!a)return b;for(let c of a.split("\n")){if(!c.trim())continue;let[a,d="",e=""]=c.split(" ");if(!a)continue;let f=d.trim()||null,g=null;if(f){let a=e.match(/ahead (\d+)/),b=e.match(/behind (\d+)/);a||b?g={ahead:a?parseInt(a[1],10):0,behind:b?parseInt(b[1],10):0}:/gone/.test(e)||(g={ahead:0,behind:0})}b.set(a,{upstream:f,aheadBehind:g})}return b}(j??""),n=[];if(c)for(let{name:a,isCurrent:b}of function(a){let b=[];if(!a)return b;for(let c of a.split("\n")){let a=c.trimEnd();if(!a.trim())continue;let d=a.startsWith("* "),e=a.replace(/^[*+]?\s+/,"").trim();!e||e.startsWith("(")||b.push({name:e,isCurrent:d})}return b}(f??"")){let c=m.get(a);n.push({name:a,isCurrent:b,isRemote:!1,isDefault:null!==k&&k===`origin/${a}`,upstream:c?.upstream??null,aheadBehind:c?.aheadBehind??null,checkedOutWorktreePath:l.get(a)??null})}if(d)for(let a of function(a){let b=[];if(!a)return b;for(let c of a.split("\n")){let a=c.trim();a&&(a.includes("->")||b.push(a))}return b}(g??""))n.push({name:a,isCurrent:!1,isRemote:!0,isDefault:null!==k&&k===a,upstream:null,aheadBehind:null,checkedOutWorktreePath:null});return n}async function F(a,b){let c=await (0,e.Bc)(["worktree","list","--porcelain"],a);if(null===c)return null;let d=D(c).get(b);return d&&d!==a?d:null}function G(a){if(a instanceof d.y0||a instanceof d.wo||a instanceof d.rI)throw a;let b=a instanceof Error?a.message:String(a),c=a?.stderr??"",e=`${c} ${b}`;if(/did not match|not a valid ref|not found|unknown revision|invalid reference|couldn't find remote ref/i.test(e))throw new d.ur("Branch not found");throw a}async function H(a,b){let{branch:c,createIfMissing:f=!1,from:h,force:i=!1}=b,j=await F(a,c);if(j)throw new d.oK("Branch is checked out in another worktree",j);if(!i){let b=await (0,e.Bc)(["status","--porcelain"],a);if(null!==b&&b.length>0)throw new d.d_("Working tree has uncommitted changes")}await (0,e.dX)(a,async()=>{let b;f?(b=["switch","-c",c],h&&b.push(h),b.push("--")):b=c.startsWith("origin/")?["switch","-c",c.slice(7),"--track",c,"--"]:i?["checkout","-f",c,"--"]:["switch",c,"--"];try{await (0,e.rS)(b,a,g.Ev)}catch(a){G(a)}})}async function I(a,b){let{name:c,from:d}=b;await (0,e.dX)(a,async()=>{let b=["branch",c];d&&b.push(d),b.push("--");try{await (0,e.rS)(b,a,g.Ev)}catch(a){G(a)}})}async function J(a,b){let{name:c,force:h=!1}=b,i=await (0,e.Bc)(["rev-parse","--abbrev-ref","HEAD"],a);if(null!==i&&i.trim()===c)throw new d.MC("Cannot delete the current branch");let j=await (0,f.tR)(a);if(null!==j&&j===c)throw new d.qb("Cannot delete the default branch");await (0,e.dX)(a,async()=>{try{await (0,e.rS)(["branch",h?"-D":"-d",c,"--"],a,g.Ev)}catch(e){let a=e instanceof Error?e.message:String(e),b=e?.stderr??"",c=`${b} ${a}`;if(/not fully merged/i.test(c))throw new d.A6("Branch is not fully merged");G(e)}})}let K=(0,p.h)("git-stash"),L=/^stash@\{(\d+)\}$/;async function M(a){let b=await (0,e.Bc)(["stash","list","--format=%gd%x09%s%x09%cI%x09%H"],a);if(null===b)return[];let c=[];if(!b||!b.trim())return c;for(let a of b.split("\n")){if(!a.trim())continue;let[b="",d="",e="",f=""]=a.split(" "),g=b.match(L);g&&c.push({index:parseInt(g[1],10),message:d,branch:function(a){let b=a.match(/^WIP on ([^:]+):/);if(b)return b[1].trim()||null;let c=a.match(/^On ([^:]+):/);return c&&c[1].trim()||null}(d),date:e,sha:f})}return c}async function N(a,b){let{message:c,includeUntracked:f}=b;await (0,e.dX)(a,async()=>{let b=["stash","push"];f&&b.push("--include-untracked"),c&&b.push("-m",c),b.push("--");try{await (0,e.rS)(b,a,g.Ev)}catch(c){let a=c instanceof Error?c.message:"",b=c?.stderr??"";if(/No local changes to save|No stash entries|No local changes/i.test(`${b} ${a}`))throw new d.s$("No local changes to stash");throw c}})}async function O(a,b){return(0,e.dX)(a,async()=>{let c=await (0,e.mY)(["stash","pop","--",`stash@{${b}}`],a);return c.conflict?{...c,stashRetained:!0}:c})}async function P(a,b){return(0,e.dX)(a,async()=>(0,e.mY)(["stash","apply","--",`stash@{${b}}`],a))}async function Q(a,b){K.warn("git:danger:stash-drop",{operation:"stash-drop",worktreePath:a,index:b,timestamp:new Date().toISOString()}),await (0,e.dX)(a,async()=>{await (0,e.rS)(["stash","drop","--",`stash@{${b}}`],a,g.Ev)})}let R=(0,p.h)("git-reset");async function S(a){let b=await (0,e.Bc)(["rev-parse","--abbrev-ref","HEAD"],a);if(null===b)return!1;let c=b.trim(),d=await (0,f.Qb)(a);return"string"==typeof d?d===c:null!==d&&("main"===c||"master"===c)}async function T(a,b){let{target:c,mode:f}=b;if("hard"===f){if(await S(a))throw R.warn("git:danger:hard-reset-blocked",{operation:"reset",worktreePath:a,target:c,mode:f,timestamp:new Date().toISOString()}),new d.BN("Cannot hard-reset the default branch");R.warn("git:danger:hard-reset",{operation:"reset",worktreePath:a,target:c,mode:f,timestamp:new Date().toISOString()})}await (0,e.dX)(a,async()=>{await (0,e.rS)(["reset",`--${f}`,c,"--"],a,g.Ev)})}async function U(a,b){let{commitHash:c,noCommit:d}=b;return R.warn("git:danger:revert",{operation:"revert",worktreePath:a,commitHash:c,noCommit:!0===d,timestamp:new Date().toISOString()}),(0,e.dX)(a,async()=>{let b=["revert"];return d&&b.push("--no-commit"),b.push(c,"--"),(0,e.mY)(b,a)})}var V=c(59082)}};
@@ -17,11 +17,11 @@
17
17
  "wasm": [],
18
18
  "assets": [],
19
19
  "env": {
20
- "__NEXT_BUILD_ID": "ZYti9g9gICKnjtmkfvvB2",
21
- "NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "AF1OyZIHY/3/3gdci52SfSsa4FFM45Isy8OaxXlZF0o=",
22
- "__NEXT_PREVIEW_MODE_ID": "40d17fe3ed9cd73c2fd240ea11af892c",
23
- "__NEXT_PREVIEW_MODE_SIGNING_KEY": "6839fb34ff2ce4471403f570aa6f1fc8d3ff95f8afc6e34a2eeb0f82202baf13",
24
- "__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "8c865ca4cdb68764eb6da956efbb7a3269572f6bf80465348490185945ce749d"
20
+ "__NEXT_BUILD_ID": "Etea8LidpB8eWOTac-R8b",
21
+ "NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "v+gvyeW7fkAD+4YJm89unalgDc0mop2Pd4ByQgnfUyk=",
22
+ "__NEXT_PREVIEW_MODE_ID": "d505c90bbe94e6dc8314f2b7aabb78dd",
23
+ "__NEXT_PREVIEW_MODE_SIGNING_KEY": "2c4883c0794bcfcd2003ffd5c1ce9c80e6001fe57703f0f0188d523f50bc2b1d",
24
+ "__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "bdda7895d35f9dc2746c1b2403a473bfb6795d43089b51e9a43edb7c53f51ee4"
25
25
  }
26
26
  }
27
27
  },
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-0f9275e279c058eb.js" defer=""></script><script src="/_next/static/chunks/framework-eaf13c96191cb608.js" defer=""></script><script src="/_next/static/chunks/main-6092074a0dc78280.js" defer=""></script><script src="/_next/static/chunks/pages/_app-4b3fb5e477a0267f.js" defer=""></script><script src="/_next/static/chunks/pages/_error-c970d8b55ace1b48.js" defer=""></script><script src="/_next/static/ZYti9g9gICKnjtmkfvvB2/_buildManifest.js" defer=""></script><script src="/_next/static/ZYti9g9gICKnjtmkfvvB2/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"ZYti9g9gICKnjtmkfvvB2","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-0f9275e279c058eb.js" defer=""></script><script src="/_next/static/chunks/framework-eaf13c96191cb608.js" defer=""></script><script src="/_next/static/chunks/main-6092074a0dc78280.js" defer=""></script><script src="/_next/static/chunks/pages/_app-4b3fb5e477a0267f.js" defer=""></script><script src="/_next/static/chunks/pages/_error-c970d8b55ace1b48.js" defer=""></script><script src="/_next/static/Etea8LidpB8eWOTac-R8b/_buildManifest.js" defer=""></script><script src="/_next/static/Etea8LidpB8eWOTac-R8b/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"Etea8LidpB8eWOTac-R8b","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -1 +1 @@
1
- {"node":{},"edge":{},"encryptionKey":"AF1OyZIHY/3/3gdci52SfSsa4FFM45Isy8OaxXlZF0o="}
1
+ {"node":{},"edge":{},"encryptionKey":"v+gvyeW7fkAD+4YJm89unalgDc0mop2Pd4ByQgnfUyk="}