commandmate 0.26.1 → 0.27.1
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.
- package/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +430 -402
- package/.next/app-path-routes-manifest.json +32 -28
- package/.next/build-manifest.json +5 -5
- package/.next/prerender-manifest.json +12 -12
- package/.next/react-loadable-manifest.json +6 -6
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +24 -0
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update-check/route.js +1 -1
- package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/conversation/route.js +1 -1
- package/.next/server/app/api/assistant/conversation/route.js.nft.json +1 -1
- package/.next/server/app/api/assistant/conversation/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/current-output/route.js +1 -1
- package/.next/server/app/api/assistant/current-output/route.js.nft.json +1 -1
- package/.next/server/app/api/assistant/current-output/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/messages/route.js +1 -1
- package/.next/server/app/api/assistant/messages/route.js.nft.json +1 -1
- package/.next/server/app/api/assistant/messages/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/session/route.js +1 -1
- package/.next/server/app/api/assistant/session/route.js.nft.json +1 -1
- package/.next/server/app/api/assistant/session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/start/route.js +1 -1
- package/.next/server/app/api/assistant/start/route.js.nft.json +1 -1
- package/.next/server/app/api/assistant/start/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/terminal/route.js +2 -2
- package/.next/server/app/api/assistant/terminal/route.js.nft.json +1 -1
- package/.next/server/app/api/assistant/terminal/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/tools/route.js +1 -1
- package/.next/server/app/api/assistant/tools/route.js.nft.json +1 -1
- package/.next/server/app/api/assistant/tools/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/capabilities/route.js +1 -0
- package/.next/server/app/api/capabilities/route.js.nft.json +1 -0
- package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/browse/route.js +2 -2
- package/.next/server/app/api/fs/browse/route.js.nft.json +1 -1
- package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/recent-paths/route.js +2 -2
- package/.next/server/app/api/fs/recent-paths/route.js.nft.json +1 -1
- package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/agent-event/route.js +1 -1
- package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/claude-done/route.js +19 -1
- package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/escalation/route.js +1 -1
- package/.next/server/app/api/push/escalation/route.js.nft.json +1 -1
- package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/subscriptions/route.js +1 -1
- package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/vapid/route.js +1 -1
- package/.next/server/app/api/push/vapid/route.js.nft.json +1 -1
- package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/[id]/todos/[todoId]/route.js +1 -1
- package/.next/server/app/api/repositories/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/[id]/todos/route.js +1 -1
- package/.next/server/app/api/repositories/[id]/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/route.js +1 -1
- package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/restore/route.js +1 -1
- package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/route.js +1 -1
- package/.next/server/app/api/repositories/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/scan/route.js +1 -1
- package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/sync/route.js +1 -1
- package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/validate-path/route.js +1 -1
- package/.next/server/app/api/repositories/validate-path/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/slash-commands/route.js.nft.json +1 -1
- package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/route.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/todos/route.js +1 -1
- package/.next/server/app/api/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/[runId]/route.js +1 -1
- package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/route.js +1 -1
- package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/worktrees/[id]/cli-tool/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route.js +2 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/env/route.js +2 -0
- package/.next/server/app/api/worktrees/[id]/env/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branches/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/commit/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/log/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/staged/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/status/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/marp-render/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/messages/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/resolve-target/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/resolve-target/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +1 -5
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/route.js +2 -6
- package/.next/server/app/api/worktrees/[id]/schedules/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/search/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/search/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route.js +3 -1
- package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/start-polling/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/start-polling/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/start-polling/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tasks/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/history/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route.js +3 -1
- package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/viewed/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/route.js +1 -1
- package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
- package/.next/server/app/chat/page.js +2 -2
- package/.next/server/app/chat/page.js.nft.json +1 -1
- package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login/page.js +2 -2
- package/.next/server/app/login/page.js.nft.json +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/.next/server/app/more/page.js +2 -2
- package/.next/server/app/more/page.js.nft.json +1 -1
- package/.next/server/app/more/page_client-reference-manifest.js +1 -1
- package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/repositories/page.js +2 -2
- package/.next/server/app/repositories/page.js.nft.json +1 -1
- package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
- package/.next/server/app/review/page.js +1 -1
- package/.next/server/app/review/page.js.nft.json +1 -1
- package/.next/server/app/review/page_client-reference-manifest.js +1 -1
- package/.next/server/app/sessions/page.js +1 -1
- package/.next/server/app/sessions/page.js.nft.json +1 -1
- package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/[skillId]/page.js +2 -2
- package/.next/server/app/skills/[skillId]/page.js.nft.json +1 -1
- package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/installed/page.js +2 -2
- package/.next/server/app/skills/installed/page.js.nft.json +1 -1
- package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/page.js +2 -2
- package/.next/server/app/skills/page.js.nft.json +1 -1
- package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/files/[...path]/page.js +2 -2
- package/.next/server/app/worktrees/[id]/files/[...path]/page.js.nft.json +1 -1
- package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/page.js +9 -7
- package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
- package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +32 -28
- package/.next/server/chunks/1029.js +1 -1
- package/.next/server/chunks/1068.js +3 -1
- package/.next/server/chunks/1296.js +1 -1
- package/.next/server/chunks/1538.js +7 -0
- package/.next/server/chunks/1601.js +2 -2
- package/.next/server/chunks/2119.js +1 -1
- package/.next/server/chunks/2404.js +3 -2
- package/.next/server/chunks/2445.js +1 -1
- package/.next/server/chunks/2546.js +1 -1
- package/.next/server/chunks/2689.js +13 -0
- package/.next/server/chunks/2759.js +8 -0
- package/.next/server/chunks/2839.js +1 -0
- package/.next/server/chunks/3241.js +1 -1
- package/.next/server/chunks/3292.js +1 -0
- package/.next/server/chunks/3417.js +1 -1
- package/.next/server/chunks/3480.js +1 -17
- package/.next/server/chunks/4393.js +1 -1
- package/.next/server/chunks/4423.js +1 -0
- package/.next/server/chunks/4444.js +22 -8
- package/.next/server/chunks/4565.js +3 -0
- package/.next/server/chunks/467.js +1 -0
- package/.next/server/chunks/4905.js +5 -0
- package/.next/server/chunks/5017.js +1 -0
- package/.next/server/chunks/5089.js +1 -0
- package/.next/server/chunks/5164.js +1 -1
- package/.next/server/chunks/5220.js +1 -0
- package/.next/server/chunks/5354.js +1 -0
- package/.next/server/chunks/552.js +19 -0
- package/.next/server/chunks/5571.js +1 -1
- package/.next/server/chunks/5998.js +3 -3
- package/.next/server/chunks/6130.js +1 -1
- package/.next/server/chunks/6274.js +11 -11
- package/.next/server/chunks/6285.js +1 -1
- package/.next/server/chunks/6401.js +1 -1
- package/.next/server/chunks/6781.js +1 -1
- package/.next/server/chunks/7472.js +1 -0
- package/.next/server/chunks/7506.js +1 -0
- package/.next/server/chunks/848.js +1 -1
- package/.next/server/chunks/8536.js +1 -1
- package/.next/server/chunks/880.js +1 -1
- package/.next/server/chunks/8807.js +5 -5
- package/.next/server/chunks/9067.js +1 -1
- package/.next/server/chunks/9284.js +1 -0
- package/.next/server/chunks/9358.js +1 -1
- package/.next/server/chunks/9508.js +1 -0
- package/.next/server/chunks/9938.js +1 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/9IXgWfBUtnEnRqnbmErTp/_buildManifest.js +1 -0
- package/.next/static/chunks/{2053-dfac2d49227cc942.js → 2053-c0e931eb4391baa1.js} +1 -1
- package/.next/static/chunks/3361-5d6e93fba8a92bc1.js +1 -0
- package/.next/static/chunks/3922.0d2e64daf9f187da.js +1 -0
- package/.next/static/chunks/{5229-35f9acab97a553c5.js → 5229-1f5f19740a8d6c11.js} +1 -1
- package/.next/static/chunks/{6381-0e097c0286155883.js → 6381-8cfe50a5ca5425b1.js} +1 -1
- package/.next/static/chunks/{8649-f551b0010dba4986.js → 8521-c43994fb58501d13.js} +1 -1
- package/.next/static/chunks/app/api/app/update/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/app/update-check/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/assistant/conversation/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/assistant/current-output/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/assistant/messages/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/assistant/session/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/assistant/start/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/assistant/terminal/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/assistant/tools/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/auth/login/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/auth/status/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/capabilities/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/daily-summary/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/daily-summary/status/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/external-apps/[id]/health/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/external-apps/[id]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/external-apps/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/fs/browse/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/fs/recent-paths/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/hooks/agent-event/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/hooks/claude-done/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/hooks/permission-request/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/metrics/vibe/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/ollama/models/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/push/escalation/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/push/subscriptions/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/push/vapid/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/repositories/[id]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/repositories/[id]/todos/[todoId]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/repositories/[id]/todos/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/repositories/clone/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/repositories/excluded/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/repositories/restore/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/repositories/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/repositories/scan/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/repositories/sync/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/repositories/validate-path/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/sidebar/group-order/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/skills/[id]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/skills/installations/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/skills/operations/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/skills/reindex/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/skills/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/slash-commands/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/tasks/[taskId]/cancel/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/tasks/[taskId]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/templates/[id]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/templates/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/todos/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/verification/runs/[runId]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/verification/runs/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/capture/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/clear-composer/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/env/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/logs/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/memos/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/messages/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/resolve-target/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/respond/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/search/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/send/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update-plan/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/start-polling/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/tasks/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/timers/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/todos/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/tree/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/verify/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/api/worktrees/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/chat/{page-439b35c9cb90dbe0.js → page-231df45127e876c2.js} +1 -1
- package/.next/static/chunks/app/login/{page-eefd515d8c37e5ee.js → page-adc51f0f7cbb7ac6.js} +1 -1
- package/.next/static/chunks/app/manifest.webmanifest/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/more/{page-889b7546a8a553dc.js → page-3266dfa945972649.js} +1 -1
- package/.next/static/chunks/app/{page-a8d04ac0e3e4c9fc.js → page-0305431f43195431.js} +1 -1
- package/.next/static/chunks/app/proxy/[...path]/route-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/repositories/{page-f3c4d8839b1ca203.js → page-ae8fa55749976f79.js} +1 -1
- package/.next/static/chunks/app/review/{page-6dc88649fe88ac16.js → page-8f63aff862fee421.js} +1 -1
- package/.next/static/chunks/app/sessions/{page-2c9ed9e969097688.js → page-4d5382b257077c14.js} +1 -1
- package/.next/static/chunks/app/skills/[skillId]/{page-19beef6121c4c982.js → page-aaf0bcb1dfb558b9.js} +1 -1
- package/.next/static/chunks/app/skills/installed/{page-d5b9cef6d21fabda.js → page-dafc486410e839b7.js} +1 -1
- package/.next/static/chunks/app/skills/{page-06ef637e07dd9377.js → page-9e3c91da31514893.js} +1 -1
- package/.next/static/chunks/app/worktrees/[id]/files/[...path]/{page-5fed3984fafcd910.js → page-90f96977c741bbf8.js} +1 -1
- package/.next/static/chunks/app/worktrees/[id]/layout-6add0d88e2828c23.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/page-f7b3dfbe757dc6b8.js +1 -0
- package/.next/static/chunks/{webpack-9d892a9ff07c289d.js → webpack-6a9668cf54a26eba.js} +1 -1
- package/.next/static/css/928e5a8830fbf997.css +1 -0
- package/.next/trace +13 -12
- package/.next/types/app/api/capabilities/route.ts +347 -0
- package/.next/types/app/api/worktrees/[id]/clear-composer/route.ts +347 -0
- package/.next/types/app/api/worktrees/[id]/env/route.ts +347 -0
- package/.next/types/app/api/worktrees/[id]/resolve-target/route.ts +347 -0
- package/.next/types/routes.d.ts +5 -1
- package/.next/types/validator.ts +36 -0
- package/dist/cli/commands/auto-yes.d.ts.map +1 -1
- package/dist/cli/commands/auto-yes.js +40 -2
- package/dist/cli/commands/capture.d.ts.map +1 -1
- package/dist/cli/commands/capture.js +28 -13
- package/dist/cli/commands/instances.d.ts +30 -18
- package/dist/cli/commands/instances.d.ts.map +1 -1
- package/dist/cli/commands/instances.js +32 -36
- package/dist/cli/commands/ls.d.ts.map +1 -1
- package/dist/cli/commands/ls.js +73 -1
- package/dist/cli/commands/respond.d.ts.map +1 -1
- package/dist/cli/commands/respond.js +18 -1
- package/dist/cli/commands/send.d.ts.map +1 -1
- package/dist/cli/commands/send.js +21 -15
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +38 -0
- package/dist/cli/commands/wait.d.ts +26 -0
- package/dist/cli/commands/wait.d.ts.map +1 -1
- package/dist/cli/commands/wait.js +390 -43
- package/dist/cli/config/cli-dependencies.d.ts.map +1 -1
- package/dist/cli/config/cli-dependencies.js +16 -0
- package/dist/cli/config/cli-tool-ids.d.ts +11 -0
- package/dist/cli/config/cli-tool-ids.d.ts.map +1 -1
- package/dist/cli/config/cli-tool-ids.js +12 -1
- package/dist/cli/types/api-responses.d.ts +443 -2
- package/dist/cli/types/api-responses.d.ts.map +1 -1
- package/dist/cli/utils/api-client.d.ts +18 -0
- package/dist/cli/utils/api-client.d.ts.map +1 -1
- package/dist/cli/utils/api-client.js +22 -0
- package/dist/cli/utils/server-capabilities.d.ts +56 -0
- package/dist/cli/utils/server-capabilities.d.ts.map +1 -0
- package/dist/cli/utils/server-capabilities.js +166 -0
- package/dist/cli/utils/session-target.d.ts +70 -0
- package/dist/cli/utils/session-target.d.ts.map +1 -0
- package/dist/cli/utils/session-target.js +118 -0
- package/dist/lib/cli-tools/copilot-executable.d.ts +79 -0
- package/dist/lib/cli-tools/copilot-executable.d.ts.map +1 -0
- package/dist/lib/cli-tools/copilot-executable.js +155 -0
- package/dist/lib/cli-tools/types.d.ts +61 -0
- package/dist/lib/cli-tools/types.d.ts.map +1 -1
- package/dist/lib/cli-tools/types.js +41 -0
- package/dist/lib/detection/ansi.d.ts +2 -1
- package/dist/lib/detection/ansi.d.ts.map +1 -1
- package/dist/lib/detection/ansi.js +3 -2
- package/dist/lib/detection/tools/verified-against.d.ts +84 -0
- package/dist/lib/detection/tools/verified-against.d.ts.map +1 -0
- package/dist/lib/detection/tools/verified-against.js +88 -0
- package/dist/lib/detection/version-probes.d.ts +207 -0
- package/dist/lib/detection/version-probes.d.ts.map +1 -0
- package/dist/lib/detection/version-probes.js +290 -0
- package/dist/lib/security/env-sanitizer.d.ts +198 -0
- package/dist/lib/security/env-sanitizer.d.ts.map +1 -0
- package/dist/lib/security/env-sanitizer.js +232 -0
- package/dist/server/locales/en/notifications.json +17 -6
- package/dist/server/locales/ja/notifications.json +17 -6
- package/dist/server/src/config/activity-bar-config.js +4 -0
- package/dist/server/src/config/cli-tool-timing-config.js +59 -2
- package/dist/server/src/config/copilot-constants.js +11 -1
- package/dist/server/src/config/detection-evidence-config.js +129 -0
- package/dist/server/src/config/schedule-config.js +56 -7
- package/dist/server/src/config/tmux-pane-config.js +18 -1
- package/dist/server/src/lib/auto-yes-poller.js +36 -0
- package/dist/server/src/lib/cli-tools/antigravity.js +4 -2
- package/dist/server/src/lib/cli-tools/base.js +131 -10
- package/dist/server/src/lib/cli-tools/capture-spec.js +56 -0
- package/dist/server/src/lib/cli-tools/claude.js +1 -1
- package/dist/server/src/lib/cli-tools/codex.js +6 -2
- package/dist/server/src/lib/cli-tools/composer-spec.js +96 -0
- package/dist/server/src/lib/cli-tools/copilot-executable.js +155 -0
- package/dist/server/src/lib/cli-tools/copilot.js +307 -81
- package/dist/server/src/lib/cli-tools/gemini.js +8 -6
- package/dist/server/src/lib/cli-tools/graceful-exit.js +181 -0
- package/dist/server/src/lib/cli-tools/index.js +11 -1
- package/dist/server/src/lib/cli-tools/manager.js +56 -4
- package/dist/server/src/lib/cli-tools/opencode-config.js +195 -24
- package/dist/server/src/lib/cli-tools/opencode.js +233 -30
- package/dist/server/src/lib/cli-tools/session-name.js +57 -0
- package/dist/server/src/lib/cli-tools/submit-verified-sender.js +213 -30
- package/dist/server/src/lib/cli-tools/types.js +41 -0
- package/dist/server/src/lib/cli-tools/vibe-local.js +7 -3
- package/dist/server/src/lib/cmate-cli-tool-parser.js +29 -1
- package/dist/server/src/lib/cmate-parser.js +12 -4
- package/dist/server/src/lib/db/db.js +5 -1
- package/dist/server/src/lib/db/migrations/v41-push-subscriptions.js +11 -0
- package/dist/server/src/lib/db/push-subscriptions-db.js +60 -3
- package/dist/server/src/lib/detection/ansi.js +3 -2
- package/dist/server/src/lib/detection/cli-patterns.js +901 -67
- package/dist/server/src/lib/detection/composer-text.js +455 -0
- package/dist/server/src/lib/detection/idle-evidence-observation.js +51 -0
- package/dist/server/src/lib/detection/model-info-extractor.js +195 -4
- package/dist/server/src/lib/detection/prompt-detect-multiple-choice.js +19 -0
- package/dist/server/src/lib/detection/status-detector.js +76 -675
- package/dist/server/src/lib/detection/status-reason.js +57 -0
- package/dist/server/src/lib/detection/tools/antigravity/detect.js +75 -0
- package/dist/server/src/lib/detection/tools/claude/detect.js +144 -0
- package/dist/server/src/lib/detection/tools/claude/patterns.js +98 -0
- package/dist/server/src/lib/detection/tools/claude/prompt.js +124 -0
- package/dist/server/src/lib/detection/tools/codex/detect.js +343 -0
- package/dist/server/src/lib/detection/tools/codex/prompt.js +104 -0
- package/dist/server/src/lib/detection/tools/copilot/detect.js +185 -0
- package/dist/server/src/lib/detection/tools/copilot/prompt.js +89 -0
- package/dist/server/src/lib/detection/tools/dialog-block.js +159 -0
- package/dist/server/src/lib/detection/tools/frame.js +47 -0
- package/dist/server/src/lib/detection/tools/opencode/detect.js +242 -0
- package/dist/server/src/lib/detection/tools/opencode/prompt.js +85 -0
- package/dist/server/src/lib/detection/tools/registry.js +58 -0
- package/dist/server/src/lib/detection/tools/run-detection.js +202 -0
- package/dist/server/src/lib/detection/tools/types.js +34 -0
- package/dist/server/src/lib/detection/tools/verified-against.js +88 -0
- package/dist/server/src/lib/hooks/agent-event-types.js +19 -1
- package/dist/server/src/lib/hooks/permission-adjudication.js +160 -0
- package/dist/server/src/lib/hooks/permission-decision-service.js +81 -14
- package/dist/server/src/lib/hooks/permission-decision-state.js +62 -0
- package/dist/server/src/lib/hooks/permission-request-payload.js +18 -1
- package/dist/server/src/lib/hooks/sources/antigravity/source.js +10 -0
- package/dist/server/src/lib/hooks/sources/claude/source.js +20 -0
- package/dist/server/src/lib/hooks/sources/codex/source.js +10 -0
- package/dist/server/src/lib/hooks/sources/copilot/hook-settings.js +403 -50
- package/dist/server/src/lib/hooks/sources/copilot/source.js +40 -4
- package/dist/server/src/lib/hooks/sources/define-source.js +23 -1
- package/dist/server/src/lib/hooks/sources/event-mapper.js +29 -1
- package/dist/server/src/lib/hooks/sources/gemini/source.js +10 -0
- package/dist/server/src/lib/hooks/sources/index.js +3 -1
- package/dist/server/src/lib/hooks/sources/launch-command.js +96 -1
- package/dist/server/src/lib/hooks/sources/legacy-relay.js +12 -0
- package/dist/server/src/lib/hooks/sources/opencode/client.js +295 -32
- package/dist/server/src/lib/hooks/sources/opencode/ingest.js +120 -42
- package/dist/server/src/lib/hooks/sources/opencode/mappers.js +95 -3
- package/dist/server/src/lib/hooks/sources/opencode/ports.js +70 -9
- package/dist/server/src/lib/hooks/sources/opencode/runtime.js +62 -4
- package/dist/server/src/lib/hooks/sources/opencode/source.js +54 -3
- package/dist/server/src/lib/hooks/sources/opencode/subscription.js +254 -26
- package/dist/server/src/lib/hooks/sources/opencode/turn-gate.js +119 -4
- package/dist/server/src/lib/hooks/sources/pending-decisions.js +40 -2
- package/dist/server/src/lib/hooks/tool-input-normalization-state.js +67 -0
- package/dist/server/src/lib/hooks/tool-input-normalization.js +157 -0
- package/dist/server/src/lib/job-executor.js +16 -4
- package/dist/server/src/lib/polling/auto-yes-dialog-gate.js +184 -0
- package/dist/server/src/lib/polling/response-checker.js +243 -26
- package/dist/server/src/lib/push/failure-episode-state.js +127 -0
- package/dist/server/src/lib/push/failure-push-notifier.js +344 -0
- package/dist/server/src/lib/push/index.js +35 -1
- package/dist/server/src/lib/push/prompt-card-state.js +93 -0
- package/dist/server/src/lib/push/prompt-push-gate.js +130 -0
- package/dist/server/src/lib/push/push-sender.js +82 -7
- package/dist/server/src/lib/push/resolution-push-notifier.js +193 -0
- package/dist/server/src/lib/push/waiting-push-notifier.js +42 -0
- package/dist/server/src/lib/response-cleaner.js +93 -20
- package/dist/server/src/lib/response-extractor.js +98 -5
- package/dist/server/src/lib/security/env-sanitizer.js +179 -5
- package/dist/server/src/lib/session/agent-event-state.js +1038 -189
- package/dist/server/src/lib/session/agent-session-lifecycle.js +8 -0
- package/dist/server/src/lib/session/claude-executor.js +23 -3
- package/dist/server/src/lib/session/claude-session.js +11 -1
- package/dist/server/src/lib/session/composer-clear.js +95 -0
- package/dist/server/src/lib/session/current-output-builder.js +267 -25
- package/dist/server/src/lib/session/provisional-turn.js +310 -0
- package/dist/server/src/lib/session/resolve-session-target.js +156 -0
- package/dist/server/src/lib/session/send-user-message.js +14 -18
- package/dist/server/src/lib/session/session-start-error.js +53 -1
- package/dist/server/src/lib/session/status-evidence.js +217 -0
- package/dist/server/src/lib/session/structured-prompt.js +46 -4
- package/dist/server/src/lib/session/waiting-episode-state.js +24 -0
- package/dist/server/src/lib/tmux/key-sequence.js +120 -0
- package/dist/server/src/lib/tmux/tmux.js +91 -19
- package/dist/server/src/lib/tui-accumulator.js +68 -1
- package/dist/server/src/lib/verification/gate-runner.js +84 -1
- package/dist/server/src/lib/ws-server.js +8 -5
- package/dist/server/src/types/cli-tool-contracts.js +75 -0
- package/dist/server/src/types/terminal-keys.js +37 -0
- package/dist/types/cli-tool-contracts.d.ts +235 -0
- package/dist/types/cli-tool-contracts.d.ts.map +1 -0
- package/dist/types/cli-tool-contracts.js +75 -0
- package/package.json +3 -2
- package/public/sw.js +65 -2
- package/.next/server/chunks/1841.js +0 -1
- package/.next/server/chunks/233.js +0 -1
- package/.next/server/chunks/3022.js +0 -1
- package/.next/server/chunks/3270.js +0 -1
- package/.next/server/chunks/4455.js +0 -1
- package/.next/server/chunks/5959.js +0 -27
- package/.next/server/chunks/7458.js +0 -6
- package/.next/server/chunks/8730.js +0 -1
- package/.next/server/chunks/9058.js +0 -1
- package/.next/server/chunks/9687.js +0 -3
- package/.next/static/chunks/3898-ef488bfa804507d9.js +0 -1
- package/.next/static/chunks/9263.f2034ec525abcf72.js +0 -1
- package/.next/static/chunks/app/api/app/update/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/app/update-check/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/assistant/conversation/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/assistant/current-output/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/assistant/messages/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/assistant/session/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/assistant/start/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/assistant/terminal/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/assistant/tools/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/auth/login/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/auth/status/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/daily-summary/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/daily-summary/status/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/external-apps/[id]/health/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/external-apps/[id]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/external-apps/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/fs/browse/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/fs/recent-paths/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/hooks/agent-event/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/hooks/claude-done/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/hooks/permission-request/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/metrics/vibe/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/ollama/models/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/push/escalation/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/push/subscriptions/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/push/vapid/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/repositories/[id]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/repositories/[id]/todos/[todoId]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/repositories/[id]/todos/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/repositories/clone/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/repositories/excluded/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/repositories/restore/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/repositories/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/repositories/scan/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/repositories/sync/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/repositories/validate-path/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/sidebar/group-order/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/skills/[id]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/skills/installations/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/skills/operations/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/skills/reindex/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/skills/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/slash-commands/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/tasks/[taskId]/cancel/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/tasks/[taskId]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/templates/[id]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/templates/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/todos/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/verification/runs/[runId]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/verification/runs/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/capture/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/logs/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/memos/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/messages/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/respond/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/search/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/send/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update-plan/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/start-polling/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/tasks/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/timers/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/todos/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/tree/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/verify/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/api/worktrees/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/manifest.webmanifest/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/proxy/[...path]/route-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/layout-fae89f8d4cc3ff97.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/page-fdfca039b7f5837e.js +0 -1
- package/.next/static/css/e865c4979a41aa03.css +0 -1
- package/.next/static/wyFLOpmKpr45BHZ4svYpE/_buildManifest.js +0 -1
- /package/.next/static/{wyFLOpmKpr45BHZ4svYpE → 9IXgWfBUtnEnRqnbmErTp}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5229],{15229:(e,t,r)=>{r.d(t,{GV:()=>ti});var n=r(95155),s=r(12115),a=r(20063),i=r(52619),o=r.n(i),l=r(89275);let c=(0,s.forwardRef)(function(e,t){let{href:r,onClick:s,target:i,...c}=e,d=(0,a.usePathname)(),u=(0,l.Hq)();return(0,n.jsx)(o(),{ref:t,href:r,target:i,onClick:e=>{var t;null==s||s(e),e.defaultPrevented||0!==(t=e).button||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||void 0!==i&&"_self"!==i||/^([a-z][a-z0-9+.-]*:)?\/\//i.test(r)||/^(mailto:|tel:)/i.test(r)||(e.preventDefault(),r!==d&&u.push(r))},...c})});var d=r(18955),u=r(59847),m=r(86651),h=r(94684),f=r(34681),x=r(5379),p=r(59427),b=r(37494);function g(){let{theme:e,setTheme:t}=(0,x.D)(),[r,a]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{a(!0)},[]),!r)return(0,n.jsx)("div",{"data-testid":"theme-toggle-placeholder",className:"w-8 h-8","aria-hidden":"true"});let i="dark"===e;return(0,n.jsx)("button",{"data-testid":"theme-toggle",onClick:()=>t(i?"light":"dark"),className:"p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors focus:outline-none focus:ring-2 focus:ring-ring","aria-label":i?"Switch to light mode":"Switch to dark mode",title:i?"Switch to light mode":"Switch to dark mode",children:i?(0,n.jsx)(p.A,{className:"w-5 h-5","data-testid":"theme-icon-sun"}):(0,n.jsx)(b.A,{className:"w-5 h-5","data-testid":"theme-icon-moon"})})}var v=r(63365);function y(){let{status:e}=(0,v.xM)(),t=(0,d.c)("common");if("connected"===e)return null;let r="connecting"===e,s=t(r?"connection.reconnecting":"connection.offline");return(0,n.jsxs)("span",{"data-testid":"connection-status-indicator",role:"status","aria-live":"polite",title:t(r?"connection.reconnectingTooltip":"connection.offlineTooltip"),className:"hidden sm:inline-flex items-center gap-1.5 rounded-full border border-border bg-surface px-2 py-0.5 text-xs text-muted-foreground",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:["w-1.5 h-1.5 rounded-full",r?"bg-warning motion-safe:animate-pulse":"bg-muted-foreground"].join(" ")}),s]})}var j=r(79651),w=r(92614);let k=[{labelKey:"nav.home",href:"/",isActive:e=>"/"===e},{labelKey:"nav.chat",href:"/chat",isActive:e=>e.startsWith("/chat")},{labelKey:"nav.sessions",href:"/sessions",isActive:e=>e.startsWith("/sessions")},{labelKey:"nav.repositoriesShort",href:"/repositories",isActive:e=>e.startsWith("/repositories")},{labelKey:"nav.reviewReport",href:"/review",isActive:e=>e.startsWith("/review")},{labelKey:"nav.more",href:"/more",isActive:e=>e.startsWith("/more")}];function N(e){let{title:t="CommandMate"}=e,r=(0,a.usePathname)(),i=(0,d.c)("commandPalette"),o=(0,d.c)("common"),{setOpen:l}=(0,w.C)(),[x,p]=s.useState(null);return s.useEffect(()=>{p("undefined"!=typeof navigator&&/Mac|iPhone|iPad|iPod/i.test(navigator.platform||"")?"⌘":"Ctrl")},[]),(0,n.jsx)("header",{className:"sticky top-0 z-50 border-b border-border bg-background supports-[backdrop-filter]:bg-background/80 backdrop-blur-md",children:(0,n.jsx)("div",{className:"container-custom",children:(0,n.jsxs)("div",{className:"flex items-center justify-between h-16",children:[(0,n.jsx)("div",{className:"flex items-center space-x-4",children:(0,n.jsxs)(c,{href:"/",className:"flex items-center space-x-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)("div",{className:"w-8 h-8 bg-accent-600 rounded-lg flex items-center justify-center",children:(0,n.jsx)(u.A,{size:20,strokeWidth:2,className:"text-white","aria-hidden":"true"})}),(0,n.jsx)("h1",{className:"text-xl font-bold text-foreground",children:t})]})}),(0,n.jsxs)("nav",{className:"flex items-center space-x-6",role:"navigation",children:[k.map(e=>{let t=e.isActive(r);return(0,n.jsx)(c,{href:e.href,"aria-current":t?"page":void 0,className:"relative py-1 text-sm font-medium transition-colors after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:rounded-full after:bg-accent-600 dark:after:bg-accent-400 after:origin-center motion-safe:after:transition-transform after:duration-200 after:ease-[var(--motion-ease-out)] ".concat(t?"text-accent-600 dark:text-accent-400 after:scale-x-100":"text-muted-foreground hover:text-foreground after:scale-x-0"),children:o(e.labelKey)},e.href)}),(0,n.jsxs)("button",{type:"button","data-testid":"header-command-palette-trigger",onClick:()=>l(!0),"aria-label":i("mobileTrigger"),className:"hidden md:inline-flex items-center gap-2 rounded-md border border-border bg-surface px-2.5 py-1.5 text-sm text-muted-foreground hover:bg-surface-2 transition-colors",children:[(0,n.jsx)(m.A,{size:16,strokeWidth:2,"aria-hidden":"true",className:"shrink-0"}),(0,n.jsx)("span",{children:i("searchAction")}),x&&(0,n.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,n.jsx)(j.u,{children:x}),(0,n.jsx)(j.u,{children:"K"})]})]}),(0,n.jsx)(y,{}),(0,n.jsx)(f.g,{}),(0,n.jsx)(g,{}),(0,n.jsxs)("a",{href:"https://github.com/kewton/MyCodeBranchDesk",target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-muted-foreground hover:text-foreground transition-colors flex items-center space-x-1",children:[(0,n.jsx)(h.A,{size:20,strokeWidth:2,"aria-hidden":"true"}),(0,n.jsx)("span",{children:"GitHub"})]})]})]})})})}var S=r(32916),C=r(38218);let A={showSidebar:!0,showGlobalNav:!0,showLocalNav:!1,autoCollapseSidebar:!1},M=[{prefix:"/worktrees/",config:{showGlobalNav:!1,showLocalNav:!0}},{prefix:"/sessions",config:{autoCollapseSidebar:!0}}];var E=r(22592),L=r(85710),R=r(17787),z=r(49027),B=r(27587),T=r(39649),D=r(47650),K=r(38606),W=r(48481);let P=(0,s.memo)(function(e){let{status:t,label:r,waitingKind:s}=e;return(0,n.jsx)(W.m,{"data-testid":"status-indicator",status:t,label:r,waitingKind:s,size:"lg"})});function I(e,t,r){let n=r-8-t;return n<=8?8:Math.min(Math.max(e,8),n)}function O(e){let{id:t,branch:r,isVisible:a,anchorRef:i,nextActionLabel:o}=e,[l,c]=(0,s.useState)({top:-9999,left:-9999}),d=(0,s.useRef)(null);if((0,s.useEffect)(()=>{var e,t,r;if(!a||!i.current)return;let n=i.current.getBoundingClientRect(),s=null==(e=d.current)?void 0:e.getBoundingClientRect(),o=null!=(t=null==s?void 0:s.width)?t:0,l=null!=(r=null==s?void 0:s.height)?r:0,u=window.innerWidth,m=window.innerHeight,h=n.right+8;if(h+o>u-8){let e=n.left-8-o;e>=8&&(h=e)}c({top:I(n.top,l,m),left:I(h,o,u)})},[a,i]),"undefined"==typeof document||!a)return null;let u=Math.min(384,Math.max(0,window.innerWidth-16));return D.createPortal((0,n.jsxs)("div",{ref:d,id:t,role:"tooltip",className:" fixed z-[9999] px-3 py-2 rounded-md shadow-lg bg-sidebar text-xs text-sidebar-foreground border border-sidebar-border pointer-events-none max-w-sm transition-opacity duration-150 ",style:{top:l.top,left:l.left,maxWidth:u},children:[(0,n.jsx)("p",{className:"font-medium text-sidebar-foreground whitespace-nowrap",children:r.name}),(0,n.jsx)("p",{className:"text-sidebar-muted whitespace-nowrap",children:r.repositoryName}),(0,n.jsxs)("p",{className:"text-sidebar-muted whitespace-nowrap",children:["Status: ",r.status]}),r.worktreePath&&(0,n.jsx)("p",{className:"text-sidebar-muted truncate",children:r.worktreePath}),o&&(0,n.jsxs)("p",{className:"text-sidebar-muted whitespace-nowrap",children:["Next: ",o]}),r.description&&(0,n.jsx)("p",{className:"text-sidebar-muted mt-1 border-t border-sidebar-border pt-1 whitespace-pre-wrap break-words",children:r.description})]}),document.body)}let _=0,F=(0,s.memo)(function(e){let{branch:t,isSelected:r,onClick:a,showRepositoryName:i=!0}=e,o=(0,d.c)("common"),l=(0,d.c)("worktree"),c="tooltip-".concat(t.id),u=(0,s.useRef)(null),[m,h]=(0,s.useState)(!1),f=(0,s.useRef)(null),x=(0,s.useCallback)(()=>{null!==f.current&&(clearTimeout(f.current),f.current=null)},[]);(0,s.useEffect)(()=>()=>x(),[x]);let p=(0,K.A7)(t.cliStatus),b="waiting"===p,g=!0===t.awaitingInstruction,v=t.nextActionKey?l(t.nextActionKey):null,y=(b||g)&&null!==v,j=m&&!r;return(0,s.useEffect)(()=>{r&&h(!1)},[r]),(0,s.useEffect)(()=>{if(!m)return;let e=()=>h(!1);return document.addEventListener("click",e),()=>document.removeEventListener("click",e)},[m]),(0,n.jsxs)("button",{ref:u,"data-testid":"branch-list-item",onClick:()=>{x(),_=Date.now()+400,h(!1),a()},onMouseEnter:()=>{x(),Date.now()>=_&&(f.current=setTimeout(()=>{h(!0)},150))},onMouseLeave:()=>{x(),h(!1)},onFocus:e=>{x(),e.target.matches(":focus-visible")&&(f.current=setTimeout(()=>{h(!0)},150))},onBlur:()=>{x(),h(!1)},"aria-current":r?"true":void 0,"aria-describedby":j?c:void 0,"aria-label":i?void 0:"".concat(t.name," - ").concat(t.repositoryName),className:"\n group relative w-full px-4 py-3 flex flex-col gap-1\n hover:bg-sidebar-hover transition-colors\n focus:outline-none focus:ring-2 focus:ring-inset focus:ring-ring\n ".concat(r?"bg-sidebar-hover border-l-2 border-accent-500":"border-l-2 border-transparent","\n "),children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[t.cliStatus&&Object.keys(t.cliStatus).length>0&&(0,n.jsx)("div",{className:"flex items-center justify-center flex-shrink-0 w-4","aria-label":o("branchItem.cliToolStatus"),children:(0,n.jsx)(P,{status:p,label:(0,K.dw)(t.cliStatus,t.cliStatusLabels),waitingKind:t.waitingKind})}),(0,n.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-sidebar-foreground truncate",children:t.name}),i&&(0,n.jsx)("p",{className:"text-xs text-sidebar-muted truncate",children:t.repositoryName}),y&&(0,n.jsx)("p",{"data-testid":"branch-next-action",className:"text-xs font-medium truncate ".concat(b?"text-warning-foreground":"text-success-foreground"),children:v})]}),g&&(0,n.jsx)("span",{"data-testid":"awaiting-instruction-badge",className:"flex-shrink-0 rounded-full bg-success-subtle px-1.5 py-0.5 text-[10px] font-medium leading-4 text-success-foreground",title:l("awaitingInstruction.label"),children:l("awaitingInstruction.badge")}),t.hasUnread&&(0,n.jsx)("span",{"data-testid":"unread-indicator",className:"w-2 h-2 rounded-full bg-accent-500 flex-shrink-0","aria-label":o("branchItem.hasUnread")})]}),t.description&&(0,n.jsx)("div",{"data-testid":"branch-description",className:"pl-6 pr-2 mt-1 text-left",children:(0,n.jsx)("p",{className:"text-xs text-sidebar-muted line-clamp-2",children:t.description})}),(0,n.jsx)(O,{id:c,branch:t,isVisible:j,anchorRef:u,nextActionLabel:v})]})});var V=r(41898);function H(e,t,r){if(t<=0||r<=0)return 0;let n=e+t+8-r;return n>0?-Math.min(n,Math.max(0,e-8)):e<8?8-e:0}let G=(0,s.memo)(function(e){var t;let{sortKey:r,sortDirection:a,onSortKeyChange:i,onSortDirectionChange:o,options:l,defaultDirections:c,compact:u,tooltip:m,iconClassName:h="w-3 h-3"}=e,f=(0,d.c)("common"),[x,p]=(0,s.useState)(!1),b=(0,s.useRef)(null),g=(0,s.useRef)(null),v=(0,s.useRef)({x:0,y:0}),[y,j]=(0,s.useState)({x:0,y:0});(0,s.useEffect)(()=>{function e(e){b.current&&!b.current.contains(e.target)&&p(!1)}if(x)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[x]),(0,s.useEffect)(()=>{function e(e){"Escape"===e.key&&p(!1)}if(x)return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[x]),(0,s.useLayoutEffect)(()=>{let e=e=>{v.current=e,j(t=>t.x===e.x&&t.y===e.y?t:e)};if(!x)return void e({x:0,y:0});let t=g.current;if(!t)return;let r=t.getBoundingClientRect();e({x:H(r.left-v.current.x,r.width,window.innerWidth),y:H(r.top-v.current.y,r.height,window.innerHeight)})},[x]);let w=(0,s.useCallback)(()=>{p(e=>!e)},[]),k=(0,s.useCallback)(e=>{if(e===r)o("asc"===a?"desc":"asc");else{var t;i(e),o(null!=(t=null==c?void 0:c[e])?t:"asc")}p(!1)},[r,a,i,o,c]),N=(0,s.useCallback)(()=>{o("asc"===a?"desc":"asc")},[a,o]),S=(null==(t=l.find(e=>e.key===r))?void 0:t.label)||"Sort",C=(0,n.jsxs)("button",{type:"button",onClick:w,"aria-expanded":x,"aria-haspopup":"listbox","aria-label":"Sort by ".concat(S),className:" flex items-center gap-1 px-2 py-1 rounded text-xs text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors ",children:[(0,n.jsx)(J,{className:h}),(0,n.jsx)("span",{className:u?"hidden":"hidden sm:inline",children:S})]});return(0,n.jsxs)("div",{ref:b,className:"relative","data-testid":"sort-selector-base",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[m?(0,n.jsx)(V.m_,{content:m,placement:"bottom",children:C}):C,(0,n.jsx)("button",{type:"button",onClick:N,"aria-label":"asc"===a?"Sort ascending":"Sort descending",className:" p-1 rounded text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors ",children:"asc"===a?(0,n.jsx)(U,{className:h}):(0,n.jsx)(X,{className:h})})]}),x&&(0,n.jsx)("div",{ref:g,role:"listbox","aria-label":f("sort.options"),className:" absolute right-0 top-full mt-1 z-50 min-w-[140px] py-1 rounded-md shadow-lg bg-sidebar border border-sidebar-border ",style:0!==y.x||0!==y.y?{transform:"translate(".concat(y.x,"px, ").concat(y.y,"px)")}:void 0,children:l.map(e=>(0,n.jsxs)("button",{type:"button",role:"option","aria-selected":r===e.key,onClick:()=>k(e.key),className:"\n w-full px-3 py-2 text-left text-sm\n flex items-center justify-between\n hover:bg-sidebar-hover transition-colors\n ".concat(r===e.key?"text-accent-700 dark:text-accent-400":"text-sidebar-muted","\n "),children:[(0,n.jsx)("span",{children:e.label}),r===e.key&&(0,n.jsx)("span",{className:"text-xs",children:"asc"===a?"ASC":"DESC"})]},e.key))})]})});function J(e){let{className:t}=e;return(0,n.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12"})})}function U(e){let{className:t}=e;return(0,n.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}function X(e){let{className:t}=e;return(0,n.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}let q=[{key:"updatedAt",labelKey:"sort.updatedAt"},{key:"repositoryName",labelKey:"sort.repositoryName"},{key:"branchName",labelKey:"sort.branchName"},{key:"status",labelKey:"sort.status"}],Y={updatedAt:"desc"},Z=(0,s.memo)(function(){let{sortKey:e,sortDirection:t,setSortKey:r,setSortDirection:a}=(0,S.VF)(),i=(0,d.c)("common"),o=(0,s.useMemo)(()=>q.map(e=>{let{key:t,labelKey:r}=e;return{key:t,label:i(r)}}),[i]);return(0,n.jsx)(G,{sortKey:e,sortDirection:t,onSortKeyChange:r,onSortDirectionChange:a,options:o,defaultDirections:Y,compact:!0,tooltip:i("tooltips.sort"),iconClassName:"w-4 h-4"})});var $=r(13898),Q=r(30061),ee=r(36809);let et=["en","ja"],er={en:"English",ja:"日本語"};function en(){return{currentLocale:(0,ee.Ym)(),switchLocale:e=>{if(et.includes(e)){let t="https:"===window.location.protocol;document.cookie="".concat("locale","=").concat(e,";path=/;max-age=").concat(31536e3,";SameSite=Lax").concat(t?";Secure":""),localStorage.setItem("locale",e),window.location.reload()}}}}function es(){let{currentLocale:e,switchLocale:t}=en(),r=(0,d.c)("common");return(0,n.jsx)("select",{value:e,onChange:e=>t(e.target.value),"data-testid":"locale-switcher","aria-label":r("language"),className:" w-full px-3 py-2 rounded-md bg-sidebar text-sidebar-foreground border border-sidebar-border focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent text-sm ",children:et.map(e=>(0,n.jsx)("option",{value:e,children:er[e]},e))})}var ea=r(65380);function ei(){let e=(0,d.c)("auth"),t=(0,ea.H)(),[r,a]=(0,s.useState)(!1);if(!t)return null;async function i(){a(!0);try{await fetch("/api/auth/logout",{method:"POST"}),window.location.href="/login"}catch(e){window.location.href="/login"}}return(0,n.jsx)("button",{type:"button",onClick:i,disabled:r,"data-testid":"logout-button",className:" w-full px-3 py-2 text-sm text-left rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50 transition-colors ",children:r?"...":e("logout.button")})}var eo=r(94442),el=r(44308),ec=r(24373);function ed(){let e=(0,d.c)("common"),{count:t}=(0,ec.Lv)();return 0===t?null:(0,n.jsxs)(o(),{href:el.ks,"data-testid":"attention-badge","aria-label":e("attention.badgeLabel",{count:t}),className:"mt-2 inline-flex w-full items-center justify-between gap-2 rounded-md border border-warning-border bg-warning-subtle px-2 py-1 text-xs font-medium text-warning-foreground transition-colors hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,n.jsx)("span",{className:"min-w-0 truncate",children:e("attention.label")}),(0,n.jsx)("span",{"data-testid":"attention-badge-count",className:"tabular-nums font-semibold",children:t})]})}function eu(e){let{count:t}=e,r=(0,d.c)("common");return 0===t?null:(0,n.jsx)("span",{"data-testid":"attention-badge-bubble",role:"status","aria-label":r("attention.badgeLabel",{count:t}),className:"absolute -top-1.5 -right-2.5 min-w-[1.05rem] rounded-full bg-warning-foreground px-1 text-[0.625rem] font-bold leading-[1.05rem] text-warning-subtle tabular-nums text-center",children:t>99?"99+":t})}var em=r(80344),eh=r(7636);let ef="mcbd-sidebar-group-collapsed",ex="mcbd-sidebar-scroll-top",ep="mcbd-sidebar-group-order-cache",eb="w-4 h-4",eg=0;function ev(){try{let e=localStorage.getItem(ep);if(!e)return[];let t=function(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return[];return t.filter(e=>"string"==typeof e).slice(0,500)}catch(e){return[]}}(e);return t.length,t}catch(e){return[]}}function ey(e){try{localStorage.setItem(ep,JSON.stringify(e))}catch(e){}}let ej=(0,s.memo)(function(){var e,t;let r=(0,l.Hq)(),{worktrees:a,repositories:i,selectedWorktreeId:c,selectWorktree:u,refreshWorktrees:m}=(0,T.$f)(),{closeMobileDrawer:h,sortKey:f,sortDirection:x,viewMode:p,setViewMode:b}=(0,S.VF)(),v=(0,d.c)("common"),[y,j]=(0,s.useState)(""),w=(0,s.useRef)(null),[k,N]=(0,s.useState)(()=>{try{let e=localStorage.getItem(ef);return e?function(e){try{let t=JSON.parse(e);if("object"!=typeof t||null===t||Array.isArray(t))return{};let r={},n=0;for(let[e,s]of Object.entries(t))if(!ek.has(e)&&"boolean"==typeof s){if(++n>100)break;r[e]=s}return r}catch(e){return{}}}(e):{}}catch(e){return{}}}),[C,A]=(0,s.useState)(ev),M=(0,s.useRef)(!1);(0,s.useEffect)(()=>{M.current||(M.current=!0,fetch("/api/sidebar/group-order").then(e=>e.json()).then(e=>{e.success&&Array.isArray(e.order)&&(A(e.order),ey(e.order))}).catch(()=>{}))},[]);let E=(0,s.useMemo)(()=>(0,eh.UZ)(i),[i]),B=(0,s.useMemo)(()=>(0,eh.s6)(a,E),[a,E]),D=(0,s.useMemo)(()=>B.map(K.XK),[B]),W=(0,s.useDeferredValue)(D),P=(0,s.useRef)(null),I=(0,s.useRef)(null);(0,s.useEffect)(()=>()=>{null!==I.current&&clearTimeout(I.current)},[]);let O=(0,s.useMemo)(()=>{let e=P.current;return!e||Date.now()>=e.expiresAt?W:e.items},[W]),_=(0,s.useRef)(O);(0,s.useLayoutEffect)(()=>{_.current=O});let H=(0,s.useCallback)(()=>{null!==I.current&&(clearTimeout(I.current),I.current=null);let e=P.current;if(e&&Date.now()<e.expiresAt){P.current={...e,expiresAt:1/0};return}P.current={items:_.current,expiresAt:1/0}},[]),G=(0,s.useCallback)(()=>{P.current&&(P.current={...P.current,expiresAt:Date.now()+1e3},null!==I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{P.current=null},1e3))},[]),{sortedItems:J,groupedItems:U}=function(e){let{items:t,sortKey:r,sortDirection:n,viewMode:a,filterText:i}=e,o=(0,s.useMemo)(()=>{if(!i)return t;let e=i.toLowerCase();return t.filter(t=>t.name.toLowerCase().includes(e)||t.repositoryName.toLowerCase().includes(e))},[t,i]);return{sortedItems:(0,s.useMemo)(()=>(0,eh.Xn)(o,r,n),[o,r,n]),groupedItems:(0,s.useMemo)(()=>"grouped"===a?(0,eh._s)(o,r,n):[],[o,r,n,a])}}({items:O,sortKey:f,sortDirection:x,viewMode:p,filterText:y}),X=(0,s.useMemo)(()=>{if("grouped"!==p||!U)return null;if(y.trim()||0===C.length)return U;let e=new Map(C.map((e,t)=>[e,t]));return[...U].sort((t,r)=>{let n=e.has(t.repositoryName)?e.get(t.repositoryName):1/0,s=e.has(r.repositoryName)?e.get(r.repositoryName):1/0;return n===s?t.repositoryName.localeCompare(r.repositoryName):n-s})},[p,U,C,y]),q="grouped"===p?X:null;(0,s.useEffect)(()=>{try{localStorage.setItem(ef,JSON.stringify(k))}catch(e){}},[k]);let Y=(0,s.useCallback)(e=>{N(t=>({...t,[e]:!t[e]}))},[]),Q=(0,s.useCallback)(()=>{var e,t,r=null!=(t=null==(e=w.current)?void 0:e.scrollTop)?t:0;let n=Number.isFinite(r)&&r>0?r:0;eg=n;try{localStorage.setItem(ex,String(n))}catch(e){}},[]),ee=J.length>0||(null!=(e=null==q?void 0:q.length)?e:0)>0;(0,s.useEffect)(()=>{let e=w.current;if(!e)return;let t=window.requestAnimationFrame(()=>{e.scrollTop=function(){try{let e=localStorage.getItem(ex);if(!e)return eg=0,0;let t=Number(e);Number.isFinite(t)&&t>=0&&(eg=t)}catch(e){}return eg}()});return()=>{window.cancelAnimationFrame(t)}},[ee,p]);let et=(0,s.useCallback)(e=>{Q(),u(e),r.push("/worktrees/".concat(e)),h()},[Q,u,r,h]),er=(0,R.FR)((0,R.MS)(R.AN,{activationConstraint:{distance:8}})),en=(0,s.useCallback)(e=>{let{active:t,over:r}=e;if(!r||t.id===r.id||!q)return;let n=q.map(e=>e.repositoryName),s=n.indexOf(String(t.id)),a=n.indexOf(String(r.id));if(-1===s||-1===a)return;let i=(0,z.be)(n,s,a);A(i),ey(i),fetch("/api/sidebar/group-order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({order:i})}).catch(()=>{A(n),ey(n)})},[q]),ea="flat"===p?0===J.length:(null!=(t=null==q?void 0:q.length)?t:0)===0;return(0,n.jsxs)("nav",{"data-testid":"sidebar","aria-label":v("sidebar.branchNavigation"),className:"h-full flex flex-col bg-sidebar text-sidebar-foreground",role:"navigation",children:[(0,n.jsxs)("div",{"data-testid":"sidebar-header",className:"flex-shrink-0 px-4 py-4 border-b border-sidebar-border",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[(0,n.jsx)("h2",{className:"min-w-0 truncate text-lg font-semibold text-sidebar-foreground",children:v("sidebar.branches")}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,n.jsx)(eS,{viewMode:p,onToggle:b}),(0,n.jsx)(Z,{}),(0,n.jsx)(eR,{refreshWorktrees:m}),(0,n.jsx)(V.m_,{content:v("tooltips.repositories"),placement:"bottom",children:(0,n.jsx)(o(),{href:"/repositories","aria-label":v("nav.repositories"),className:"p-1 rounded-md text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors inline-flex items-center",children:(0,n.jsx)(L.A,{className:eb,"aria-hidden":"true"})})})]})]}),(0,n.jsx)(ed,{})]}),(0,n.jsx)("div",{className:"flex-shrink-0 px-4 py-3 border-b border-sidebar-border",children:(0,n.jsx)($.pd,{type:"text",placeholder:v("sidebar.searchBranches"),value:y,onChange:e=>j(e.target.value),className:"bg-background shadow-none"})}),(0,n.jsx)("div",{ref:w,"data-testid":"branch-list",onScroll:Q,onMouseEnter:H,onMouseLeave:G,className:"flex-1 overflow-y-auto overflow-x-hidden",children:ea?(0,n.jsx)("div",{className:"px-4 py-8 text-center text-sidebar-muted",children:v(y?"sidebar.noBranchesFound":"sidebar.noBranchesAvailable")}):"grouped"===p&&q?(0,n.jsx)(R.Mp,{sensors:er,collisionDetection:R.fp,onDragEnd:en,children:(0,n.jsx)(z.gB,{items:q.map(e=>e.repositoryName),strategy:z._G,children:q.map(e=>{let t=!k[e.repositoryName]||!!y.trim();return(0,n.jsx)(ew,{group:e,isExpanded:t,selectedWorktreeId:c,onToggle:()=>Y(e.repositoryName),onBranchClick:et,isDragDisabled:!!y.trim()},e.repositoryName)})})}):J.map(e=>(0,n.jsx)(F,{branch:e,isSelected:e.id===c,onClick:()=>et(e.id)},e.id))}),(0,n.jsxs)("div",{className:"flex-shrink-0 px-4 py-3 border-t border-sidebar-border space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("div",{className:"flex-1",children:(0,n.jsx)(es,{})}),(0,n.jsx)(g,{})]}),(0,n.jsx)(ei,{})]})]})});function ew(e){let{group:t,isExpanded:r,selectedWorktreeId:s,onToggle:a,onBranchClick:i,isDragDisabled:o}=e,{attributes:l,listeners:c,setNodeRef:d,setActivatorNodeRef:u,transform:m,transition:h,isDragging:f}=(0,z.gl)({id:t.repositoryName,disabled:o}),x={transform:B.Ks.Transform.toString(m),transition:h,opacity:f?.5:1};return(0,n.jsxs)("div",{ref:d,style:x,className:"w-full min-w-0",children:[(0,n.jsx)(eN,{repositoryName:t.repositoryName,branchCount:t.branches.length,isExpanded:r,onClick:a,dragHandleRef:u,dragHandleListeners:o?void 0:c,dragHandleAttributes:o?void 0:l}),r&&t.branches.map(e=>(0,n.jsx)(F,{branch:e,isSelected:e.id===s,onClick:()=>i(e.id),showRepositoryName:!1},e.id))]})}let ek=new Set(["__proto__","constructor","prototype"]);function eN(e){let{repositoryName:t,branchCount:r,isExpanded:s,onClick:a,dragHandleRef:i,dragHandleListeners:o,dragHandleAttributes:l}=e,c=(0,d.c)("common");return(0,n.jsxs)("div",{className:"flex items-center w-full",children:[o&&(0,n.jsx)("div",{ref:i,...o,...l,"aria-label":c("sidebar.dragToReorderGroup"),className:" flex-shrink-0 flex items-center justify-center w-6 h-full pl-2 cursor-grab active:cursor-grabbing text-sidebar-muted hover:text-sidebar-foreground transition-colors ",children:(0,n.jsx)(eE,{})}),(0,n.jsxs)("button",{"data-testid":"group-header",type:"button",onClick:a,"aria-expanded":s,className:" flex-1 min-w-0 flex items-center gap-2 px-2 py-2 text-xs font-semibold text-sidebar-muted uppercase tracking-wider focus:outline-none focus:ring-2 focus:ring-inset focus:ring-ring transition-colors ",children:[(0,n.jsx)(eC,{isExpanded:s}),(0,n.jsx)(eA,{color:(0,eh.LV)(t)}),(0,n.jsx)(Q.nR,{content:t,className:"flex-1 min-w-0 text-left truncate",children:t}),(0,n.jsx)("span",{className:"text-sidebar-muted font-normal tabular-nums pr-2",children:r})]})]})}function eS(e){let{viewMode:t,onToggle:r}=e,s=(0,d.c)("common");return(0,n.jsx)(V.m_,{content:s("tooltips.viewMode"),placement:"bottom",children:(0,n.jsx)("button",{"data-testid":"view-mode-toggle",type:"button",onClick:()=>{r("grouped"===t?"flat":"grouped")},"aria-label":s("grouped"===t?"sidebar.switchToFlatView":"sidebar.switchToGroupedView"),className:" p-1 rounded-md text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors ",children:"grouped"===t?(0,n.jsx)(eM,{className:eb}):(0,n.jsx)(eA,{className:eb})})})}function eC(e){let{isExpanded:t}=e;return(0,n.jsx)("svg",{className:"w-3 h-3 flex-shrink-0 transition-transform ".concat(t?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})}function eA(e){let{className:t="w-3.5 h-3.5",color:r}=e;return(0,n.jsx)("svg",{className:"".concat(t," flex-shrink-0"),viewBox:"0 0 24 24",fill:null!=r?r:"none",stroke:r?"none":"currentColor",strokeWidth:2*!r,"aria-hidden":"true",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}function eM(e){let{className:t="w-3 h-3"}=e;return(0,n.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}function eE(){return(0,n.jsxs)("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,n.jsx)("circle",{cx:"9",cy:"5",r:"1.5"}),(0,n.jsx)("circle",{cx:"15",cy:"5",r:"1.5"}),(0,n.jsx)("circle",{cx:"9",cy:"12",r:"1.5"}),(0,n.jsx)("circle",{cx:"15",cy:"12",r:"1.5"}),(0,n.jsx)("circle",{cx:"9",cy:"19",r:"1.5"}),(0,n.jsx)("circle",{cx:"15",cy:"19",r:"1.5"})]})}function eL(e){let{className:t=""}=e;return(0,n.jsx)("svg",{className:"".concat(eb," ").concat(t),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h5M20 20v-5h-5M20.49 9A9 9 0 005.64 5.64L4 4m16 16l-1.64-1.64A9 9 0 014.51 15"})})}let eR=(0,s.memo)(function(e){let{refreshWorktrees:t}=e,[r,a]=(0,s.useState)(!1),i=(0,s.useRef)(!1),{showToast:o}=(0,eo.dj)(),l=(0,d.c)("common"),c=(0,s.useCallback)(async()=>{if(!i.current){i.current=!0,a(!0);try{let e=await em.Rx.sync();await t(),o(l("syncSuccess",{count:e.worktreeCount}),"success",3e3)}catch(e){e instanceof em.hD&&401===e.status?o(l("syncAuthError"),"error",5e3):o(l("syncError"),"error",5e3)}finally{i.current=!1,a(!1)}}},[t,o,l]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(V.m_,{content:l("tooltips.sync"),placement:"bottom",children:(0,n.jsx)("button",{type:"button",onClick:c,disabled:r,"aria-label":l("syncButtonLabel"),className:"p-1 rounded-md text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:(0,n.jsx)(eL,{className:r?"animate-spin":""})})})})});var ez=r(65993),eB=r(37586),eT=r(66685),eD=r(61362),eK=r(37772);let eW=[{labelKey:"nav.home",href:"/",isActive:e=>"/"===e,icon:(0,n.jsx)(ez.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.chat",href:"/chat",isActive:e=>e.startsWith("/chat"),icon:(0,n.jsx)(eB.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.sessions",href:"/sessions",isActive:e=>e.startsWith("/sessions"),icon:(0,n.jsx)(eT.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.review",href:"/review",isActive:e=>e.startsWith("/review"),icon:(0,n.jsx)(eD.A,{size:20,"aria-hidden":"true"}),showsAttentionBadge:!0},{labelKey:"nav.more",href:"/more",isActive:e=>e.startsWith("/more"),icon:(0,n.jsx)(eK.A,{size:20,"aria-hidden":"true"})}];function eP(){let e=(0,a.usePathname)(),{setOpen:t}=(0,w.C)(),r=(0,d.c)("commandPalette"),s=(0,d.c)("common"),{count:i}=(0,ec.Lv)();return(0,n.jsx)("nav",{"data-testid":"global-mobile-nav",className:"fixed bottom-0 left-0 right-0 z-50 border-t border-border bg-background supports-[backdrop-filter]:bg-background/80 backdrop-blur-md pb-safe",children:(0,n.jsxs)("div",{className:"flex items-center justify-around h-14",children:[eW.map(t=>{let r=t.isActive(e),a=!0===t.showsAttentionBadge&&i>0;return(0,n.jsxs)(c,{href:a?el.ks:t.href,className:"flex flex-col items-center justify-center flex-1 h-full text-xs transition-colors ".concat(r?"text-accent-600 dark:text-accent-400":"text-muted-foreground hover:text-foreground"),children:[(0,n.jsxs)("span",{className:"relative inline-flex",children:[t.icon,!0===t.showsAttentionBadge&&(0,n.jsx)(eu,{count:i})]}),(0,n.jsx)("span",{className:"mt-1 whitespace-nowrap",children:s(t.labelKey)})]},t.href)}),(0,n.jsxs)("button",{type:"button","data-testid":"mobile-command-palette-trigger",onClick:()=>t(!0),"aria-label":r("mobileTrigger"),className:"flex flex-col items-center justify-center flex-1 h-full text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,n.jsx)(m.A,{size:20,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"mt-1 whitespace-nowrap",children:r("mobileLabel")})]})]})})}var eI=r(79698),eO=r(24533),e_=r(95740),eF=r(79451),eV=r(89559),eH=r(97470),eG=r(76482),eJ=r(39332),eU=r(87531),eX=r(59854),eq=r(70628),eY=r(66966),eZ=r(68704);let e$=[{key:"home",href:"/"},{key:"chat",href:"/chat"},{key:"sessions",href:"/sessions"},{key:"repositories",href:"/repositories"},{key:"review",href:"/review"},{key:"skills",href:"/skills"},{key:"more",href:"/more"}],eQ={home:ez.A,chat:eB.A,sessions:eT.A,repositories:eO.A,review:eD.A,skills:e_.A,more:eK.A},e0="cm.palette.recents";function e1(e){if(!e||"object"!=typeof e)return!1;let{kind:t,id:r}=e;return("nav"===t||"worktree"===t||"action"===t)&&"string"==typeof r}function e2(e){return e.isWaitingForResponse?"waiting":e.isProcessing?"running":e.isSessionRunning?"ready":"idle"}function e5(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return!!("INPUT"===t||"TEXTAREA"===t||"SELECT"===t||e.isContentEditable||e.closest('[role="log"]'))}let e4=(0,eU.cn)("flex cursor-pointer items-center gap-2 rounded-md px-2 py-2 text-sm","text-foreground","data-[selected=true]:bg-accent-500/15 data-[selected=true]:text-accent-700","dark:data-[selected=true]:text-accent-300"),e9="shrink-0 text-muted-foreground";function e6(){var e,t,r;let{open:i,setOpen:o}=(0,w.C)(),{setOpen:l}=(0,eq.K)(),c=(0,a.useRouter)(),u=(0,d.c)("commandPalette"),f=(0,d.c)("common"),{theme:g,setTheme:v}=(0,x.D)(),{setSize:y,isMobile:k}=(0,E.Ps)(),{currentLocale:N,switchLocale:S}=en(),C=(0,eY.rC)(),{showToast:A}=(0,eo.dj)(),[M,L]=(0,s.useState)(!1),[R,z]=(0,s.useState)(""),[B,T]=(0,s.useState)([]),K=(0,s.useRef)(null),P=(0,s.useRef)(null),I=(0,s.useRef)(i);(0,s.useEffect)(()=>{I.current=i},[i]),(0,s.useEffect)(()=>{L(!0)},[]),(0,s.useEffect)(()=>{function e(e){if(("k"===e.key||"K"===e.key)&&(e.metaKey||e.ctrlKey)){if(I.current){e.preventDefault(),e.stopPropagation(),o(!1);return}if(e5(e.target))return;e.preventDefault(),o(!0);return}"Escape"===e.key&&I.current&&(e.preventDefault(),e.stopPropagation(),o(!1))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[o]),(0,s.useEffect)(()=>{var e,t,r,n;i?(P.current=null!=(t=document.activeElement)?t:null,null==(e=K.current)||e.focus(),z(""),T(function(){try{let e=localStorage.getItem(e0);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return t.filter(e1).slice(0,8)}catch(e){return[]}}())):P.current&&(null==(r=(n=P.current).focus)||r.call(n),P.current=null)},[i]);let O=(0,s.useCallback)((e,t)=>{t&&T(e=>(function(e,t){let r=e.filter(e=>e.kind!==t.kind||e.id!==t.id),n=[t,...r].slice(0,8);try{localStorage.setItem(e0,JSON.stringify(n))}catch(e){}return n})(e,t)),o(!1),e()},[o]),_=(0,s.useCallback)(async()=>{try{var e;await em.Rx.sync(),await (null==C||null==(e=C.refresh)?void 0:e.call(C)),A(u("actions.syncSuccess"),"success")}catch(e){A(u("actions.syncError"),"error")}},[C,A,u]),F="dark"===g,V=""===R.trim(),H=null!=(e=null==C?void 0:C.error)?e:null,G=null!=(t=null==C?void 0:C.isLoading)&&t,J=H?[]:null!=(r=null==C?void 0:C.worktrees)?r:[],U=J.length>0,X=!H&&G&&0===J.length,q=[...J].sort((e,t)=>{let r=+!!e.isSessionRunning,n=+!!t.isSessionRunning;if(r!==n)return n-r;let s=e.updatedAt?new Date(e.updatedAt).getTime():0;return(t.updatedAt?new Date(t.updatedAt).getTime():0)-s}),Y=V?q.slice(0,8):q,Z=[{id:"theme",label:F?u("actions.toLight"):u("actions.toDark"),icon:F?p.A:b.A,run:()=>v(F?"light":"dark")},...k?[]:eZ.Uf.map(e=>({id:"displaysize:".concat(e),label:"".concat(u("actions.displaySizePrefix"),": ").concat(f("displaySize.".concat(e))),icon:eF.A,run:()=>y(e)})),{id:"sync",label:u("actions.syncRepositories"),icon:eV.A,run:()=>{_()}},{id:"locale",label:u("actions.switchLanguage"),icon:eH.A,run:()=>S("ja"===N?"en":"ja")},{id:"github",label:u("actions.openGitHub"),icon:h.A,run:()=>window.open("https://github.com/kewton/MyCodeBranchDesk","_blank","noopener,noreferrer")},{id:"keyboardShortcuts",label:u("actions.keyboardShortcuts"),icon:eG.A,run:()=>l(!0)}],$=V?B.map(e=>{if("nav"===e.kind){let t=e$.find(t=>t.key===e.id);if(!t)return null;let r=eQ[t.key],s=f("nav.".concat(t.key));return{id:"nav-".concat(t.key),value:"recent nav ".concat(t.key),node:(0,n.jsxs)(n.Fragment,{children:[r&&(0,n.jsx)(r,{size:16,className:e9,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:s})]}),onSelect:()=>O(()=>c.push(t.href),{kind:"nav",id:t.key})}}if("worktree"===e.kind){let t=J.find(t=>t.id===e.id);if(!t)return null;let r=t.repositoryDisplayName||t.repositoryName||"",s=t.branch||t.name;return{id:"worktree-".concat(t.id),value:"recent worktree ".concat(t.id),node:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eJ.A,{size:16,className:e9,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:s}),r&&(0,n.jsx)("span",{className:"ml-auto truncate pl-2 text-xs text-muted-foreground",children:r}),(0,n.jsx)(W.m,{status:e2(t),size:"sm",className:r?"ml-2":"ml-auto"})]}),onSelect:()=>O(()=>c.push("/worktrees/".concat(t.id)),{kind:"worktree",id:t.id})}}let t=Z.find(t=>t.id===e.id);if(!t)return null;let r=t.icon;return{id:"action-".concat(t.id),value:"recent action ".concat(t.id),node:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r,{size:16,className:e9,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:t.label})]}),onSelect:()=>O(t.run,{kind:"action",id:t.id})}}).filter(e=>null!==e):[];return M?(0,D.createPortal)((0,n.jsx)(n.Fragment,{children:i&&(0,n.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:eX.M.MODAL},"data-testid":"command-palette",children:[(0,n.jsx)("div",{"data-state":"open","aria-hidden":"true",className:"fixed inset-0 bg-black/40 backdrop-blur-sm transition-opacity data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-200",onClick:()=>o(!1)}),(0,n.jsx)("div",{className:"relative flex min-h-full items-start justify-center p-4 pt-[15vh]",children:(0,n.jsx)("div",{"data-state":"open","data-testid":"command-palette-panel",className:(0,eU.cn)("relative w-full max-w-lg overflow-hidden rounded-xl bg-surface/95 shadow-2xl ring-1 ring-border backdrop-blur-xl","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:duration-200"),children:(0,n.jsxs)(eI.uB,{label:u("title"),className:(0,eU.cn)("flex flex-col","[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-2","[&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground"),children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[(0,n.jsx)(m.A,{size:16,strokeWidth:2,"aria-hidden":"true",className:"shrink-0 text-muted-foreground"}),(0,n.jsx)(eI.uB.Input,{ref:K,value:R,onValueChange:z,placeholder:u("placeholder"),"data-testid":"command-palette-input",className:"flex-1 bg-transparent py-3 text-sm text-foreground outline-none placeholder:text-muted-foreground"})]}),(0,n.jsxs)(eI.uB.List,{className:"max-h-[min(60vh,360px)] overflow-y-auto p-2",children:[(0,n.jsx)(eI.uB.Empty,{"data-testid":"command-palette-empty",className:"py-6 text-center text-sm text-muted-foreground",children:u("empty")}),X&&(0,n.jsx)(eI.uB.Loading,{"data-testid":"command-palette-loading",className:"py-6 text-center text-sm text-muted-foreground",children:u("loading")}),$.length>0&&(0,n.jsx)(eI.uB.Group,{heading:u("groups.recent"),children:$.map(e=>(0,n.jsx)(eI.uB.Item,{value:e.value,onSelect:e.onSelect,className:e4,children:e.node},e.id))}),(0,n.jsx)(eI.uB.Group,{heading:u("groups.navigation"),children:e$.map(e=>{let t=f("nav.".concat(e.key)),r=eQ[e.key];return(0,n.jsxs)(eI.uB.Item,{value:"nav ".concat(t," ").concat(e.href),onSelect:()=>O(()=>c.push(e.href),{kind:"nav",id:e.key}),className:e4,children:[r&&(0,n.jsx)(r,{size:16,className:e9,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:t})]},e.key)})}),U&&(0,n.jsx)(eI.uB.Group,{heading:u("groups.worktrees"),children:Y.map(e=>{let t=e.repositoryDisplayName||e.repositoryName||"",r=e.branch||e.name;return(0,n.jsxs)(eI.uB.Item,{value:"worktree ".concat(t," ").concat(r," ").concat(e.name," ").concat(e.id),onSelect:()=>O(()=>c.push("/worktrees/".concat(e.id)),{kind:"worktree",id:e.id}),className:e4,children:[(0,n.jsx)(eJ.A,{size:16,className:e9,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:r}),t&&(0,n.jsx)("span",{className:"ml-auto truncate pl-2 text-xs text-muted-foreground",children:t}),(0,n.jsx)(W.m,{status:e2(e),size:"sm",className:t?"ml-2":"ml-auto"})]},e.id)})}),(0,n.jsx)(eI.uB.Group,{heading:u("groups.actions"),children:Z.map(e=>{let t=e.icon;return(0,n.jsxs)(eI.uB.Item,{value:"action ".concat(e.id," ").concat(e.label),onSelect:()=>O(e.run,{kind:"action",id:e.id}),className:e4,children:[(0,n.jsx)(t,{size:16,className:e9,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:e.label})]},e.id)})})]}),(0,n.jsxs)("div",{className:"flex items-center gap-3 border-t border-border bg-surface-2 px-3 py-2 text-[11px] text-muted-foreground",children:[(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)(j.u,{children:"↑"}),(0,n.jsx)(j.u,{children:"↓"}),u("footer.navigate")]}),(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)(j.u,{children:"↵"}),u("footer.select")]}),(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)(j.u,{children:"esc"}),u("footer.close")]})]})]})})})]})}),document.body):null}var e3=r(94465);let e8=["global","terminal","composer","editor"],e7=[{id:"commandPalette",keys:["MOD","K"],scope:"global"},{id:"keyboardHelp",keys:["?"],scope:"global"},{id:"closeOverlay",keys:["Esc"],scope:"global"},{id:"navigateList",keys:["↑","↓"],scope:"global"},{id:"terminalSearch",keys:["MOD","F"],scope:"terminal"},{id:"sendMessage",keys:["↵"],scope:"composer"},{id:"composerNewline",keys:["Shift","↵"],scope:"composer"},{id:"editorIndent",keys:["Tab"],scope:"editor"},{id:"editorOutdent",keys:["Shift","Tab"],scope:"editor"},{id:"editorTabFocus",keys:["Ctrl","M"],scope:"editor"},{id:"editorSave",keys:["MOD","S"],scope:"editor"},{id:"editorFullscreen",keys:["MOD","Shift","F"],scope:"editor"}];function te(){let{open:e,setOpen:t}=(0,eq.K)(),{open:r}=(0,w.C)(),a=(0,d.c)("keyboardShortcuts"),[i,o]=(0,s.useState)(!1);(0,s.useEffect)(()=>o(function(){if("undefined"==typeof navigator)return!1;let e=navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/.test(e)}()),[]);let l=(0,s.useRef)(e);(0,s.useEffect)(()=>{l.current=e},[e]);let c=(0,s.useRef)(r);(0,s.useEffect)(()=>{c.current=r},[r]),(0,s.useEffect)(()=>{function e(e){"?"!==e.key||e.isComposing||229===e.keyCode||e5(e.target)||c.current||l.current||(e.preventDefault(),t(!0))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t]);let u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e7;return e8.map(t=>({scope:t,shortcuts:e.filter(e=>e.scope===t)})).filter(e=>e.shortcuts.length>0)}();return(0,n.jsx)(e3.a,{isOpen:e,onClose:()=>t(!1),title:a("title"),size:"md",children:(0,n.jsx)("div",{"data-testid":"keyboard-shortcuts-overlay",className:"space-y-6",children:u.map(e=>{let{scope:t,shortcuts:r}=e;return(0,n.jsxs)("section",{"data-testid":"keyboard-shortcuts-scope-".concat(t),children:[(0,n.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:a("scopes.".concat(t))}),(0,n.jsx)("ul",{className:"divide-y divide-border",children:r.map(e=>(0,n.jsxs)("li",{"data-testid":"keyboard-shortcut-".concat(e.id),className:"flex items-center justify-between gap-4 py-2",children:[(0,n.jsx)("span",{className:"text-sm text-foreground",children:a("shortcuts.".concat(e.id))}),(0,n.jsx)("span",{className:"flex flex-shrink-0 items-center gap-1",children:e.keys.map((e,t)=>(0,n.jsx)(j.u,{children:"MOD"===e?i?"⌘":"Ctrl":e},t))})]},e.id))})]},t)})})})}var tt=r(52056),tr=r(65229),tn=r(52703);function ts(){let e=(0,d.c)("common"),[t,r]=(0,s.useState)(null),[a,i]=(0,s.useState)(null),o=(0,s.useCallback)(e=>{if(e.type!==tn.Oo)return;let{serverVersion:t,clientVersion:n}=e;"string"==typeof t&&"string"==typeof n&&t&&n&&t!==a&&r({serverVersion:t,clientVersion:n})},[a]);(0,v.T3)(o);let l=(0,s.useCallback)(()=>{window.location.reload()},[]),c=(0,s.useCallback)(()=>{r(e=>(e&&i(e.serverVersion),null))},[]);return t?(0,n.jsxs)("div",{"data-testid":"version-mismatch-banner",role:"alert","aria-live":"assertive",className:"fixed top-3 left-1/2 -translate-x-1/2 flex items-start gap-3 max-w-[92vw] rounded-lg border border-warning-border bg-warning-subtle px-4 py-3 text-warning-foreground shadow-lg",style:{zIndex:eX.M.TOAST},children:[(0,n.jsx)(tt.A,{className:"h-5 w-5 shrink-0 mt-0.5","aria-hidden":"true"}),(0,n.jsxs)("div",{className:"flex flex-col gap-0.5 text-sm",children:[(0,n.jsx)("span",{className:"font-semibold",children:e("versionMismatch.title")}),(0,n.jsx)("span",{children:e("versionMismatch.description",{serverVersion:t.serverVersion,clientVersion:t.clientVersion})})]}),(0,n.jsxs)("button",{type:"button","data-testid":"version-mismatch-reload",onClick:l,className:"shrink-0 inline-flex items-center gap-1.5 rounded-md border border-warning-border px-3 py-1.5 text-sm font-medium hover:opacity-80 focus:outline-none focus:ring-2 focus:ring-offset-2",children:[(0,n.jsx)(eV.A,{className:"h-4 w-4","aria-hidden":"true"}),e("versionMismatch.reload")]}),(0,n.jsx)("button",{type:"button","data-testid":"version-mismatch-dismiss",onClick:c,"aria-label":e("versionMismatch.dismiss"),className:"shrink-0 hover:opacity-70 focus:outline-none focus:ring-2 focus:ring-offset-2",children:(0,n.jsx)(tr.A,{className:"h-4 w-4","aria-hidden":"true"})})]}):null}let ta="transform transition-transform duration-300 ease-out",ti=(0,s.memo)(function(e){let{children:t}=e,{isOpen:r,isMobileDrawerOpen:i,closeMobileDrawer:o,width:l,setWidth:c}=(0,S.VF)(),d=(0,C.a)(),{showSidebar:u,showGlobalNav:m}=function(){var e=(0,a.usePathname)();for(let t of M)if(e.startsWith(t.prefix))return{...A,...t.config};return{...A}}(),{factor:h}=(0,E.Ps)(),f=Math.round(160*h),x=Math.round(480*h),p=Math.round(Math.min(x,Math.max(f,l*h))),b=(0,s.useRef)(null),g=(0,s.useRef)(null),v=(0,s.useCallback)(e=>{c(Math.round(e/h))},[c,h]);return d?(0,n.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[i&&(0,n.jsx)("div",{"data-testid":"drawer-overlay",className:"fixed inset-0 bg-black/50 z-40",onClick:o,"aria-hidden":"true"}),u&&(0,n.jsx)("aside",{"data-testid":"sidebar-container",className:"\n fixed left-0 top-0 h-full w-72 z-50\n ".concat(ta,"\n ").concat(i?"translate-x-0":"-translate-x-full","\n "),role:"complementary",children:(0,n.jsx)(ej,{})}),(0,n.jsx)("main",{className:"flex-1 min-h-0 overflow-hidden ".concat(m?"pb-14":""),role:"main","data-view-transition":"content",children:t}),m&&(0,n.jsx)(eP,{}),(0,n.jsx)(e6,{}),(0,n.jsx)(te,{}),(0,n.jsx)(ts,{})]}):(0,n.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[m&&(0,n.jsx)(N,{}),(0,n.jsxs)("div",{className:"flex flex-1 min-h-0",children:[u&&(0,n.jsxs)("aside",{ref:b,"data-testid":"sidebar-container",className:"\n fixed left-0\n ".concat(m?"top-16 h-[calc(100vh-4rem)]":"top-0 h-full","\n border-r border-border\n ").concat(ta,"\n ").concat(r?"translate-x-0":"-translate-x-full","\n "),style:{width:"".concat(p,"px"),zIndex:eX.M.SIDEBAR},role:"complementary","aria-hidden":!r,children:[(0,n.jsx)(ej,{}),(0,n.jsx)(to,{currentWidth:p,minWidth:f,maxWidth:x,sidebarRef:b,mainRef:g,onWidthChange:v})]}),(0,n.jsx)("main",{ref:g,className:"flex-1 min-w-0 h-full overflow-hidden transition-[padding] duration-300 ease-out",style:{paddingLeft:u&&r?"".concat(p,"px"):0},role:"main","data-view-transition":"content",children:t})]}),(0,n.jsx)(e6,{}),(0,n.jsx)(te,{}),(0,n.jsx)(ts,{})]})});function to(e){let{currentWidth:t,minWidth:r,maxWidth:s,sidebarRef:a,mainRef:i,onWidthChange:o}=e;return(0,n.jsx)("div",{"data-testid":"sidebar-resize-handle","aria-hidden":"true",onMouseDown:e=>{e.preventDefault();let n=e.clientX,l=t;i.current&&(i.current.style.transition="none");let c=e=>{l=Math.max(r,Math.min(s,t+(e.clientX-n))),a.current&&(a.current.style.width="".concat(l,"px")),i.current&&(i.current.style.paddingLeft="".concat(l,"px"))},d=()=>{document.body.style.cursor="",document.body.style.userSelect="",i.current&&(i.current.style.transition=""),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",d),o(l)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",c),document.addEventListener("mouseup",d)},className:"absolute top-0 right-0 w-1 h-full cursor-col-resize hover:bg-accent-500/40 transition-colors"})}},30061:(e,t,r)=>{r.d(t,{nR:()=>i});var n=r(95155),s=r(12115),a=r(47650);function i(e){let{content:t,delay:r=200,className:i,children:o,metadata:l}=e,c=(0,s.useRef)(null),d=(0,s.useRef)(null),u=(0,s.useRef)(null),m=(0,s.useRef)(null),[h,f]=(0,s.useState)(!1),[x,p]=(0,s.useState)({top:-9999,left:-9999}),b=(0,s.useCallback)(()=>{null!==u.current&&(clearTimeout(u.current),u.current=null)},[]),g=(0,s.useCallback)(()=>{let e=c.current;e&&(e.scrollWidth>e.clientWidth||l)&&(b(),u.current=setTimeout(()=>{let t=e.getBoundingClientRect(),r=Math.max(4,window.innerWidth-384-4);m.current={top:t.top,bottom:t.bottom},p({top:t.bottom+4,left:Math.min(t.left,r)}),f(!0),u.current=null},r))},[b,r,l]);(0,s.useLayoutEffect)(()=>{if(!h)return;let e=d.current,t=m.current;if(!e||!t)return;let{height:r}=e.getBoundingClientRect();if(r<=0)return;let n=window.innerHeight;if(t.bottom+4+r+4<=n)return;let s=t.top-4-r,a=s>=4?s:Math.max(4,n-r-4);p(e=>e.top===a?e:{...e,top:a})},[h]);let v=(0,s.useCallback)(()=>{b(),f(!1)},[b]);return(0,s.useEffect)(()=>()=>b(),[b]),(0,n.jsxs)("span",{ref:c,className:i,onMouseEnter:g,onMouseLeave:v,children:[null!=o?o:t,h&&"undefined"!=typeof document&&(0,a.createPortal)((0,n.jsxs)("span",{ref:d,role:"tooltip","aria-hidden":"true",className:"fixed z-[9999] max-w-md px-2 py-1 text-xs font-medium rounded bg-foreground text-background shadow-lg pointer-events-none",style:{top:x.top,left:x.left},children:[(0,n.jsx)("span",{className:"block break-all",children:t}),l&&(0,n.jsx)("span",{className:"mt-0.5 block whitespace-pre-line font-normal text-background/70",children:l})]}),document.body)]})}},34681:(e,t,r)=>{r.d(t,{g:()=>o});var n=r(95155);r(12115);var s=r(18955),a=r(22592),i=r(68704);function o(){let{size:e,setSize:t,isMobile:r}=(0,a.Ps)(),o=(0,s.c)("common");if(r)return null;let l=o("displaySize.ariaLabel");return(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)("label",{htmlFor:"pc-display-size",className:"sr-only",children:l}),(0,n.jsx)("select",{id:"pc-display-size","data-testid":"pc-display-size-select","aria-label":l,value:e,onChange:e=>{let r=e.target.value;(0,i.fM)(r)&&t(r)},className:"text-sm bg-transparent text-foreground border border-input rounded-md px-2 py-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:i.Uf.map(e=>(0,n.jsx)("option",{value:e,children:o("displaySize.".concat(e))},e))})]})}},41898:(e,t,r)=>{r.d(t,{m_:()=>l});var n=r(95155),s=r(12115),a=r(47650);function i(e,t,r){return Math.min(Math.max(e,4),Math.max(4,r-t-4))}let o={top:-9999,left:-9999};function l(e){let{content:t,placement:r="right",delay:l=100,children:c}=e,[d,u]=(0,s.useState)(!1),[m,h]=(0,s.useState)(null),f=(0,s.useRef)(null),x=(0,s.useRef)(null),p=(0,s.useRef)(null),b=(0,s.useCallback)(()=>{null!==p.current&&(clearTimeout(p.current),p.current=null)},[]),g=(0,s.useCallback)(()=>{b(),p.current=setTimeout(()=>{u(!0),p.current=null},l)},[l,b]),v=(0,s.useCallback)(()=>{b(),u(!1),h(null)},[b]),y=(0,s.useCallback)(()=>{let e=f.current,t=x.current;if(!e||!t)return;let n=e.getBoundingClientRect(),s=t.getBoundingClientRect();h(function(e,t,r,n){let s,a,o=t.left+t.width/2-r.width/2,l=t.top+t.height/2-r.height/2;switch(e){case"top":s=t.top-r.height-8,a=o;break;case"bottom":s=t.top+t.height+8,a=o;break;case"left":s=l,a=t.left-r.width-8;break;default:s=l,a=t.left+t.width+8}return{top:i(s,r.height,n.height),left:i(a,r.width,n.width)}}(r,{top:n.top,left:n.left,width:n.width,height:n.height},{width:s.width,height:s.height},{width:window.innerWidth,height:window.innerHeight}))},[r]);return(0,s.useLayoutEffect)(()=>{if(d)return y(),window.addEventListener("resize",y),window.addEventListener("scroll",y,!0),()=>{window.removeEventListener("resize",y),window.removeEventListener("scroll",y,!0)}},[d,y]),(0,s.useEffect)(()=>()=>{b()},[b]),(0,n.jsxs)("span",{ref:f,"data-testid":"tooltip-wrapper",className:"relative inline-flex",tabIndex:-1,onMouseEnter:g,onMouseLeave:v,children:[c,d&&"undefined"!=typeof document&&(0,a.createPortal)((0,n.jsx)("span",{ref:x,role:"tooltip","aria-hidden":"true","data-placement":r,className:"fixed z-40 whitespace-nowrap px-2 py-1 text-xs font-medium rounded bg-foreground text-background shadow-lg pointer-events-none",style:null!=m?m:o,children:t}),document.body)]})}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5229],{15229:(e,t,r)=>{r.d(t,{GV:()=>ti});var n=r(95155),s=r(12115),a=r(20063),i=r(52619),o=r.n(i),l=r(89275);let c=(0,s.forwardRef)(function(e,t){let{href:r,onClick:s,target:i,...c}=e,d=(0,a.usePathname)(),u=(0,l.Hq)();return(0,n.jsx)(o(),{ref:t,href:r,target:i,onClick:e=>{var t;null==s||s(e),e.defaultPrevented||0!==(t=e).button||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||void 0!==i&&"_self"!==i||/^([a-z][a-z0-9+.-]*:)?\/\//i.test(r)||/^(mailto:|tel:)/i.test(r)||(e.preventDefault(),r!==d&&u.push(r))},...c})});var d=r(18955),u=r(59847),m=r(86651),h=r(94684),f=r(34681),x=r(5379),p=r(59427),b=r(37494);function g(){let{theme:e,setTheme:t}=(0,x.D)(),[r,a]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{a(!0)},[]),!r)return(0,n.jsx)("div",{"data-testid":"theme-toggle-placeholder",className:"w-8 h-8","aria-hidden":"true"});let i="dark"===e;return(0,n.jsx)("button",{"data-testid":"theme-toggle",onClick:()=>t(i?"light":"dark"),className:"p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors focus:outline-none focus:ring-2 focus:ring-ring","aria-label":i?"Switch to light mode":"Switch to dark mode",title:i?"Switch to light mode":"Switch to dark mode",children:i?(0,n.jsx)(p.A,{className:"w-5 h-5","data-testid":"theme-icon-sun"}):(0,n.jsx)(b.A,{className:"w-5 h-5","data-testid":"theme-icon-moon"})})}var v=r(63365);function y(){let{status:e}=(0,v.xM)(),t=(0,d.c)("common");if("connected"===e)return null;let r="connecting"===e,s=t(r?"connection.reconnecting":"connection.offline");return(0,n.jsxs)("span",{"data-testid":"connection-status-indicator",role:"status","aria-live":"polite",title:t(r?"connection.reconnectingTooltip":"connection.offlineTooltip"),className:"hidden sm:inline-flex items-center gap-1.5 rounded-full border border-border bg-surface px-2 py-0.5 text-xs text-muted-foreground",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:["w-1.5 h-1.5 rounded-full",r?"bg-warning motion-safe:animate-pulse":"bg-muted-foreground"].join(" ")}),s]})}var j=r(79651),w=r(92614);let k=[{labelKey:"nav.home",href:"/",isActive:e=>"/"===e},{labelKey:"nav.chat",href:"/chat",isActive:e=>e.startsWith("/chat")},{labelKey:"nav.sessions",href:"/sessions",isActive:e=>e.startsWith("/sessions")},{labelKey:"nav.repositoriesShort",href:"/repositories",isActive:e=>e.startsWith("/repositories")},{labelKey:"nav.reviewReport",href:"/review",isActive:e=>e.startsWith("/review")},{labelKey:"nav.more",href:"/more",isActive:e=>e.startsWith("/more")}];function N(e){let{title:t="CommandMate"}=e,r=(0,a.usePathname)(),i=(0,d.c)("commandPalette"),o=(0,d.c)("common"),{setOpen:l}=(0,w.C)(),[x,p]=s.useState(null);return s.useEffect(()=>{p("undefined"!=typeof navigator&&/Mac|iPhone|iPad|iPod/i.test(navigator.platform||"")?"⌘":"Ctrl")},[]),(0,n.jsx)("header",{className:"sticky top-0 z-50 border-b border-border bg-background supports-[backdrop-filter]:bg-background/80 backdrop-blur-md",children:(0,n.jsx)("div",{className:"container-custom",children:(0,n.jsxs)("div",{className:"flex items-center justify-between h-16",children:[(0,n.jsx)("div",{className:"flex items-center space-x-4",children:(0,n.jsxs)(c,{href:"/",className:"flex items-center space-x-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)("div",{className:"w-8 h-8 bg-accent-600 rounded-lg flex items-center justify-center",children:(0,n.jsx)(u.A,{size:20,strokeWidth:2,className:"text-white","aria-hidden":"true"})}),(0,n.jsx)("h1",{className:"text-xl font-bold text-foreground",children:t})]})}),(0,n.jsxs)("nav",{className:"flex items-center space-x-6",role:"navigation",children:[k.map(e=>{let t=e.isActive(r);return(0,n.jsx)(c,{href:e.href,"aria-current":t?"page":void 0,className:"relative py-1 text-sm font-medium transition-colors after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:rounded-full after:bg-accent-600 dark:after:bg-accent-400 after:origin-center motion-safe:after:transition-transform after:duration-200 after:ease-[var(--motion-ease-out)] ".concat(t?"text-accent-600 dark:text-accent-400 after:scale-x-100":"text-muted-foreground hover:text-foreground after:scale-x-0"),children:o(e.labelKey)},e.href)}),(0,n.jsxs)("button",{type:"button","data-testid":"header-command-palette-trigger",onClick:()=>l(!0),"aria-label":i("mobileTrigger"),className:"hidden md:inline-flex items-center gap-2 rounded-md border border-border bg-surface px-2.5 py-1.5 text-sm text-muted-foreground hover:bg-surface-2 transition-colors",children:[(0,n.jsx)(m.A,{size:16,strokeWidth:2,"aria-hidden":"true",className:"shrink-0"}),(0,n.jsx)("span",{children:i("searchAction")}),x&&(0,n.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,n.jsx)(j.u,{children:x}),(0,n.jsx)(j.u,{children:"K"})]})]}),(0,n.jsx)(y,{}),(0,n.jsx)(f.g,{}),(0,n.jsx)(g,{}),(0,n.jsxs)("a",{href:"https://github.com/kewton/MyCodeBranchDesk",target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-muted-foreground hover:text-foreground transition-colors flex items-center space-x-1",children:[(0,n.jsx)(h.A,{size:20,strokeWidth:2,"aria-hidden":"true"}),(0,n.jsx)("span",{children:"GitHub"})]})]})]})})})}var S=r(32916),C=r(38218);let A={showSidebar:!0,showGlobalNav:!0,showLocalNav:!1,autoCollapseSidebar:!1},M=[{prefix:"/worktrees/",config:{showGlobalNav:!1,showLocalNav:!0}},{prefix:"/sessions",config:{autoCollapseSidebar:!0}}];var E=r(22592),L=r(85710),R=r(17787),z=r(49027),B=r(27587),T=r(39649),D=r(47650),K=r(38606),W=r(48481);let P=(0,s.memo)(function(e){let{status:t,label:r,waitingKind:s}=e;return(0,n.jsx)(W.m,{"data-testid":"status-indicator",status:t,label:r,waitingKind:s,size:"lg"})});function I(e,t,r){let n=r-8-t;return n<=8?8:Math.min(Math.max(e,8),n)}function O(e){let{id:t,branch:r,isVisible:a,anchorRef:i,nextActionLabel:o}=e,[l,c]=(0,s.useState)({top:-9999,left:-9999}),d=(0,s.useRef)(null);if((0,s.useEffect)(()=>{var e,t,r;if(!a||!i.current)return;let n=i.current.getBoundingClientRect(),s=null==(e=d.current)?void 0:e.getBoundingClientRect(),o=null!=(t=null==s?void 0:s.width)?t:0,l=null!=(r=null==s?void 0:s.height)?r:0,u=window.innerWidth,m=window.innerHeight,h=n.right+8;if(h+o>u-8){let e=n.left-8-o;e>=8&&(h=e)}c({top:I(n.top,l,m),left:I(h,o,u)})},[a,i]),"undefined"==typeof document||!a)return null;let u=Math.min(384,Math.max(0,window.innerWidth-16));return D.createPortal((0,n.jsxs)("div",{ref:d,id:t,role:"tooltip",className:" fixed z-[9999] px-3 py-2 rounded-md shadow-lg bg-sidebar text-xs text-sidebar-foreground border border-sidebar-border pointer-events-none max-w-sm transition-opacity duration-150 ",style:{top:l.top,left:l.left,maxWidth:u},children:[(0,n.jsx)("p",{className:"font-medium text-sidebar-foreground whitespace-nowrap",children:r.name}),(0,n.jsx)("p",{className:"text-sidebar-muted whitespace-nowrap",children:r.repositoryName}),(0,n.jsxs)("p",{className:"text-sidebar-muted whitespace-nowrap",children:["Status: ",r.status]}),r.worktreePath&&(0,n.jsx)("p",{className:"text-sidebar-muted truncate",children:r.worktreePath}),o&&(0,n.jsxs)("p",{className:"text-sidebar-muted whitespace-nowrap",children:["Next: ",o]}),r.description&&(0,n.jsx)("p",{className:"text-sidebar-muted mt-1 border-t border-sidebar-border pt-1 whitespace-pre-wrap break-words",children:r.description})]}),document.body)}let _=0,F=(0,s.memo)(function(e){let{branch:t,isSelected:r,onClick:a,showRepositoryName:i=!0}=e,o=(0,d.c)("common"),l=(0,d.c)("worktree"),c="tooltip-".concat(t.id),u=(0,s.useRef)(null),[m,h]=(0,s.useState)(!1),f=(0,s.useRef)(null),x=(0,s.useCallback)(()=>{null!==f.current&&(clearTimeout(f.current),f.current=null)},[]);(0,s.useEffect)(()=>()=>x(),[x]);let p=(0,K.A7)(t.cliStatus),b="waiting"===p,g=!0===t.awaitingInstruction,v=t.nextActionKey?l(t.nextActionKey):null,y=(b||g)&&null!==v,j=m&&!r;return(0,s.useEffect)(()=>{r&&h(!1)},[r]),(0,s.useEffect)(()=>{if(!m)return;let e=()=>h(!1);return document.addEventListener("click",e),()=>document.removeEventListener("click",e)},[m]),(0,n.jsxs)("button",{ref:u,"data-testid":"branch-list-item",onClick:()=>{x(),_=Date.now()+400,h(!1),a()},onMouseEnter:()=>{x(),Date.now()>=_&&(f.current=setTimeout(()=>{h(!0)},150))},onMouseLeave:()=>{x(),h(!1)},onFocus:e=>{x(),e.target.matches(":focus-visible")&&(f.current=setTimeout(()=>{h(!0)},150))},onBlur:()=>{x(),h(!1)},"aria-current":r?"true":void 0,"aria-describedby":j?c:void 0,"aria-label":i?void 0:"".concat(t.name," - ").concat(t.repositoryName),className:"\n group relative w-full px-4 py-3 flex flex-col gap-1\n hover:bg-sidebar-hover transition-colors\n focus:outline-none focus:ring-2 focus:ring-inset focus:ring-ring\n ".concat(r?"bg-sidebar-hover border-l-2 border-accent-500":"border-l-2 border-transparent","\n "),children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[t.cliStatus&&Object.keys(t.cliStatus).length>0&&(0,n.jsx)("div",{className:"flex items-center justify-center flex-shrink-0 w-4","aria-label":o("branchItem.cliToolStatus"),children:(0,n.jsx)(P,{status:p,label:(0,K.dw)(t.cliStatus,t.cliStatusLabels),waitingKind:t.waitingKind})}),(0,n.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-sidebar-foreground truncate",children:t.name}),i&&(0,n.jsx)("p",{className:"text-xs text-sidebar-muted truncate",children:t.repositoryName}),y&&(0,n.jsx)("p",{"data-testid":"branch-next-action",className:"text-xs font-medium truncate ".concat(b?"text-warning-foreground":"text-success-foreground"),children:v})]}),g&&(0,n.jsx)("span",{"data-testid":"awaiting-instruction-badge",className:"flex-shrink-0 rounded-full bg-success-subtle px-1.5 py-0.5 text-[10px] font-medium leading-4 text-success-foreground",title:l("awaitingInstruction.label"),children:l("awaitingInstruction.badge")}),t.hasUnread&&(0,n.jsx)("span",{"data-testid":"unread-indicator",className:"w-2 h-2 rounded-full bg-accent-500 flex-shrink-0","aria-label":o("branchItem.hasUnread")})]}),t.description&&(0,n.jsx)("div",{"data-testid":"branch-description",className:"pl-6 pr-2 mt-1 text-left",children:(0,n.jsx)("p",{className:"text-xs text-sidebar-muted line-clamp-2",children:t.description})}),(0,n.jsx)(O,{id:c,branch:t,isVisible:j,anchorRef:u,nextActionLabel:v})]})});var V=r(41898);function H(e,t,r){if(t<=0||r<=0)return 0;let n=e+t+8-r;return n>0?-Math.min(n,Math.max(0,e-8)):e<8?8-e:0}let G=(0,s.memo)(function(e){var t;let{sortKey:r,sortDirection:a,onSortKeyChange:i,onSortDirectionChange:o,options:l,defaultDirections:c,compact:u,tooltip:m,iconClassName:h="w-3 h-3"}=e,f=(0,d.c)("common"),[x,p]=(0,s.useState)(!1),b=(0,s.useRef)(null),g=(0,s.useRef)(null),v=(0,s.useRef)({x:0,y:0}),[y,j]=(0,s.useState)({x:0,y:0});(0,s.useEffect)(()=>{function e(e){b.current&&!b.current.contains(e.target)&&p(!1)}if(x)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[x]),(0,s.useEffect)(()=>{function e(e){"Escape"===e.key&&p(!1)}if(x)return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[x]),(0,s.useLayoutEffect)(()=>{let e=e=>{v.current=e,j(t=>t.x===e.x&&t.y===e.y?t:e)};if(!x)return void e({x:0,y:0});let t=g.current;if(!t)return;let r=t.getBoundingClientRect();e({x:H(r.left-v.current.x,r.width,window.innerWidth),y:H(r.top-v.current.y,r.height,window.innerHeight)})},[x]);let w=(0,s.useCallback)(()=>{p(e=>!e)},[]),k=(0,s.useCallback)(e=>{if(e===r)o("asc"===a?"desc":"asc");else{var t;i(e),o(null!=(t=null==c?void 0:c[e])?t:"asc")}p(!1)},[r,a,i,o,c]),N=(0,s.useCallback)(()=>{o("asc"===a?"desc":"asc")},[a,o]),S=(null==(t=l.find(e=>e.key===r))?void 0:t.label)||"Sort",C=(0,n.jsxs)("button",{type:"button",onClick:w,"aria-expanded":x,"aria-haspopup":"listbox","aria-label":"Sort by ".concat(S),className:" flex items-center gap-1 px-2 py-1 rounded text-xs text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors ",children:[(0,n.jsx)(J,{className:h}),(0,n.jsx)("span",{className:u?"hidden":"hidden sm:inline",children:S})]});return(0,n.jsxs)("div",{ref:b,className:"relative","data-testid":"sort-selector-base",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[m?(0,n.jsx)(V.m_,{content:m,placement:"bottom",children:C}):C,(0,n.jsx)("button",{type:"button",onClick:N,"aria-label":"asc"===a?"Sort ascending":"Sort descending",className:" p-1 rounded text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors ",children:"asc"===a?(0,n.jsx)(U,{className:h}):(0,n.jsx)(X,{className:h})})]}),x&&(0,n.jsx)("div",{ref:g,role:"listbox","aria-label":f("sort.options"),className:" absolute right-0 top-full mt-1 z-50 min-w-[140px] py-1 rounded-md shadow-lg bg-sidebar border border-sidebar-border ",style:0!==y.x||0!==y.y?{transform:"translate(".concat(y.x,"px, ").concat(y.y,"px)")}:void 0,children:l.map(e=>(0,n.jsxs)("button",{type:"button",role:"option","aria-selected":r===e.key,onClick:()=>k(e.key),className:"\n w-full px-3 py-2 text-left text-sm\n flex items-center justify-between\n hover:bg-sidebar-hover transition-colors\n ".concat(r===e.key?"text-accent-700 dark:text-accent-400":"text-sidebar-muted","\n "),children:[(0,n.jsx)("span",{children:e.label}),r===e.key&&(0,n.jsx)("span",{className:"text-xs",children:"asc"===a?"ASC":"DESC"})]},e.key))})]})});function J(e){let{className:t}=e;return(0,n.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12"})})}function U(e){let{className:t}=e;return(0,n.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}function X(e){let{className:t}=e;return(0,n.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}let q=[{key:"updatedAt",labelKey:"sort.updatedAt"},{key:"repositoryName",labelKey:"sort.repositoryName"},{key:"branchName",labelKey:"sort.branchName"},{key:"status",labelKey:"sort.status"}],Y={updatedAt:"desc"},Z=(0,s.memo)(function(){let{sortKey:e,sortDirection:t,setSortKey:r,setSortDirection:a}=(0,S.VF)(),i=(0,d.c)("common"),o=(0,s.useMemo)(()=>q.map(e=>{let{key:t,labelKey:r}=e;return{key:t,label:i(r)}}),[i]);return(0,n.jsx)(G,{sortKey:e,sortDirection:t,onSortKeyChange:r,onSortDirectionChange:a,options:o,defaultDirections:Y,compact:!0,tooltip:i("tooltips.sort"),iconClassName:"w-4 h-4"})});var $=r(43361),Q=r(30061),ee=r(36809);let et=["en","ja"],er={en:"English",ja:"日本語"};function en(){return{currentLocale:(0,ee.Ym)(),switchLocale:e=>{if(et.includes(e)){let t="https:"===window.location.protocol;document.cookie="".concat("locale","=").concat(e,";path=/;max-age=").concat(31536e3,";SameSite=Lax").concat(t?";Secure":""),localStorage.setItem("locale",e),window.location.reload()}}}}function es(){let{currentLocale:e,switchLocale:t}=en(),r=(0,d.c)("common");return(0,n.jsx)("select",{value:e,onChange:e=>t(e.target.value),"data-testid":"locale-switcher","aria-label":r("language"),className:" w-full px-3 py-2 rounded-md bg-sidebar text-sidebar-foreground border border-sidebar-border focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent text-sm ",children:et.map(e=>(0,n.jsx)("option",{value:e,children:er[e]},e))})}var ea=r(65380);function ei(){let e=(0,d.c)("auth"),t=(0,ea.H)(),[r,a]=(0,s.useState)(!1);if(!t)return null;async function i(){a(!0);try{await fetch("/api/auth/logout",{method:"POST"}),window.location.href="/login"}catch(e){window.location.href="/login"}}return(0,n.jsx)("button",{type:"button",onClick:i,disabled:r,"data-testid":"logout-button",className:" w-full px-3 py-2 text-sm text-left rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50 transition-colors ",children:r?"...":e("logout.button")})}var eo=r(94442),el=r(44308),ec=r(24373);function ed(){let e=(0,d.c)("common"),{count:t}=(0,ec.Lv)();return 0===t?null:(0,n.jsxs)(o(),{href:el.ks,"data-testid":"attention-badge","aria-label":e("attention.badgeLabel",{count:t}),className:"mt-2 inline-flex w-full items-center justify-between gap-2 rounded-md border border-warning-border bg-warning-subtle px-2 py-1 text-xs font-medium text-warning-foreground transition-colors hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,n.jsx)("span",{className:"min-w-0 truncate",children:e("attention.label")}),(0,n.jsx)("span",{"data-testid":"attention-badge-count",className:"tabular-nums font-semibold",children:t})]})}function eu(e){let{count:t}=e,r=(0,d.c)("common");return 0===t?null:(0,n.jsx)("span",{"data-testid":"attention-badge-bubble",role:"status","aria-label":r("attention.badgeLabel",{count:t}),className:"absolute -top-1.5 -right-2.5 min-w-[1.05rem] rounded-full bg-warning-foreground px-1 text-[0.625rem] font-bold leading-[1.05rem] text-warning-subtle tabular-nums text-center",children:t>99?"99+":t})}var em=r(80344),eh=r(7636);let ef="mcbd-sidebar-group-collapsed",ex="mcbd-sidebar-scroll-top",ep="mcbd-sidebar-group-order-cache",eb="w-4 h-4",eg=0;function ev(){try{let e=localStorage.getItem(ep);if(!e)return[];let t=function(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return[];return t.filter(e=>"string"==typeof e).slice(0,500)}catch(e){return[]}}(e);return t.length,t}catch(e){return[]}}function ey(e){try{localStorage.setItem(ep,JSON.stringify(e))}catch(e){}}let ej=(0,s.memo)(function(){var e,t;let r=(0,l.Hq)(),{worktrees:a,repositories:i,selectedWorktreeId:c,selectWorktree:u,refreshWorktrees:m}=(0,T.$f)(),{closeMobileDrawer:h,sortKey:f,sortDirection:x,viewMode:p,setViewMode:b}=(0,S.VF)(),v=(0,d.c)("common"),[y,j]=(0,s.useState)(""),w=(0,s.useRef)(null),[k,N]=(0,s.useState)(()=>{try{let e=localStorage.getItem(ef);return e?function(e){try{let t=JSON.parse(e);if("object"!=typeof t||null===t||Array.isArray(t))return{};let r={},n=0;for(let[e,s]of Object.entries(t))if(!ek.has(e)&&"boolean"==typeof s){if(++n>100)break;r[e]=s}return r}catch(e){return{}}}(e):{}}catch(e){return{}}}),[C,A]=(0,s.useState)(ev),M=(0,s.useRef)(!1);(0,s.useEffect)(()=>{M.current||(M.current=!0,fetch("/api/sidebar/group-order").then(e=>e.json()).then(e=>{e.success&&Array.isArray(e.order)&&(A(e.order),ey(e.order))}).catch(()=>{}))},[]);let E=(0,s.useMemo)(()=>(0,eh.UZ)(i),[i]),B=(0,s.useMemo)(()=>(0,eh.s6)(a,E),[a,E]),D=(0,s.useMemo)(()=>B.map(K.XK),[B]),W=(0,s.useDeferredValue)(D),P=(0,s.useRef)(null),I=(0,s.useRef)(null);(0,s.useEffect)(()=>()=>{null!==I.current&&clearTimeout(I.current)},[]);let O=(0,s.useMemo)(()=>{let e=P.current;return!e||Date.now()>=e.expiresAt?W:e.items},[W]),_=(0,s.useRef)(O);(0,s.useLayoutEffect)(()=>{_.current=O});let H=(0,s.useCallback)(()=>{null!==I.current&&(clearTimeout(I.current),I.current=null);let e=P.current;if(e&&Date.now()<e.expiresAt){P.current={...e,expiresAt:1/0};return}P.current={items:_.current,expiresAt:1/0}},[]),G=(0,s.useCallback)(()=>{P.current&&(P.current={...P.current,expiresAt:Date.now()+1e3},null!==I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{P.current=null},1e3))},[]),{sortedItems:J,groupedItems:U}=function(e){let{items:t,sortKey:r,sortDirection:n,viewMode:a,filterText:i}=e,o=(0,s.useMemo)(()=>{if(!i)return t;let e=i.toLowerCase();return t.filter(t=>t.name.toLowerCase().includes(e)||t.repositoryName.toLowerCase().includes(e))},[t,i]);return{sortedItems:(0,s.useMemo)(()=>(0,eh.Xn)(o,r,n),[o,r,n]),groupedItems:(0,s.useMemo)(()=>"grouped"===a?(0,eh._s)(o,r,n):[],[o,r,n,a])}}({items:O,sortKey:f,sortDirection:x,viewMode:p,filterText:y}),X=(0,s.useMemo)(()=>{if("grouped"!==p||!U)return null;if(y.trim()||0===C.length)return U;let e=new Map(C.map((e,t)=>[e,t]));return[...U].sort((t,r)=>{let n=e.has(t.repositoryName)?e.get(t.repositoryName):1/0,s=e.has(r.repositoryName)?e.get(r.repositoryName):1/0;return n===s?t.repositoryName.localeCompare(r.repositoryName):n-s})},[p,U,C,y]),q="grouped"===p?X:null;(0,s.useEffect)(()=>{try{localStorage.setItem(ef,JSON.stringify(k))}catch(e){}},[k]);let Y=(0,s.useCallback)(e=>{N(t=>({...t,[e]:!t[e]}))},[]),Q=(0,s.useCallback)(()=>{var e,t,r=null!=(t=null==(e=w.current)?void 0:e.scrollTop)?t:0;let n=Number.isFinite(r)&&r>0?r:0;eg=n;try{localStorage.setItem(ex,String(n))}catch(e){}},[]),ee=J.length>0||(null!=(e=null==q?void 0:q.length)?e:0)>0;(0,s.useEffect)(()=>{let e=w.current;if(!e)return;let t=window.requestAnimationFrame(()=>{e.scrollTop=function(){try{let e=localStorage.getItem(ex);if(!e)return eg=0,0;let t=Number(e);Number.isFinite(t)&&t>=0&&(eg=t)}catch(e){}return eg}()});return()=>{window.cancelAnimationFrame(t)}},[ee,p]);let et=(0,s.useCallback)(e=>{Q(),u(e),r.push("/worktrees/".concat(e)),h()},[Q,u,r,h]),er=(0,R.FR)((0,R.MS)(R.AN,{activationConstraint:{distance:8}})),en=(0,s.useCallback)(e=>{let{active:t,over:r}=e;if(!r||t.id===r.id||!q)return;let n=q.map(e=>e.repositoryName),s=n.indexOf(String(t.id)),a=n.indexOf(String(r.id));if(-1===s||-1===a)return;let i=(0,z.be)(n,s,a);A(i),ey(i),fetch("/api/sidebar/group-order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({order:i})}).catch(()=>{A(n),ey(n)})},[q]),ea="flat"===p?0===J.length:(null!=(t=null==q?void 0:q.length)?t:0)===0;return(0,n.jsxs)("nav",{"data-testid":"sidebar","aria-label":v("sidebar.branchNavigation"),className:"h-full flex flex-col bg-sidebar text-sidebar-foreground",role:"navigation",children:[(0,n.jsxs)("div",{"data-testid":"sidebar-header",className:"flex-shrink-0 px-4 py-4 border-b border-sidebar-border",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[(0,n.jsx)("h2",{className:"min-w-0 truncate text-lg font-semibold text-sidebar-foreground",children:v("sidebar.branches")}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,n.jsx)(eS,{viewMode:p,onToggle:b}),(0,n.jsx)(Z,{}),(0,n.jsx)(eR,{refreshWorktrees:m}),(0,n.jsx)(V.m_,{content:v("tooltips.repositories"),placement:"bottom",children:(0,n.jsx)(o(),{href:"/repositories","aria-label":v("nav.repositories"),className:"p-1 rounded-md text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors inline-flex items-center",children:(0,n.jsx)(L.A,{className:eb,"aria-hidden":"true"})})})]})]}),(0,n.jsx)(ed,{})]}),(0,n.jsx)("div",{className:"flex-shrink-0 px-4 py-3 border-b border-sidebar-border",children:(0,n.jsx)($.pd,{type:"text",placeholder:v("sidebar.searchBranches"),value:y,onChange:e=>j(e.target.value),className:"bg-background shadow-none"})}),(0,n.jsx)("div",{ref:w,"data-testid":"branch-list",onScroll:Q,onMouseEnter:H,onMouseLeave:G,className:"flex-1 overflow-y-auto overflow-x-hidden",children:ea?(0,n.jsx)("div",{className:"px-4 py-8 text-center text-sidebar-muted",children:v(y?"sidebar.noBranchesFound":"sidebar.noBranchesAvailable")}):"grouped"===p&&q?(0,n.jsx)(R.Mp,{sensors:er,collisionDetection:R.fp,onDragEnd:en,children:(0,n.jsx)(z.gB,{items:q.map(e=>e.repositoryName),strategy:z._G,children:q.map(e=>{let t=!k[e.repositoryName]||!!y.trim();return(0,n.jsx)(ew,{group:e,isExpanded:t,selectedWorktreeId:c,onToggle:()=>Y(e.repositoryName),onBranchClick:et,isDragDisabled:!!y.trim()},e.repositoryName)})})}):J.map(e=>(0,n.jsx)(F,{branch:e,isSelected:e.id===c,onClick:()=>et(e.id)},e.id))}),(0,n.jsxs)("div",{className:"flex-shrink-0 px-4 py-3 border-t border-sidebar-border space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("div",{className:"flex-1",children:(0,n.jsx)(es,{})}),(0,n.jsx)(g,{})]}),(0,n.jsx)(ei,{})]})]})});function ew(e){let{group:t,isExpanded:r,selectedWorktreeId:s,onToggle:a,onBranchClick:i,isDragDisabled:o}=e,{attributes:l,listeners:c,setNodeRef:d,setActivatorNodeRef:u,transform:m,transition:h,isDragging:f}=(0,z.gl)({id:t.repositoryName,disabled:o}),x={transform:B.Ks.Transform.toString(m),transition:h,opacity:f?.5:1};return(0,n.jsxs)("div",{ref:d,style:x,className:"w-full min-w-0",children:[(0,n.jsx)(eN,{repositoryName:t.repositoryName,branchCount:t.branches.length,isExpanded:r,onClick:a,dragHandleRef:u,dragHandleListeners:o?void 0:c,dragHandleAttributes:o?void 0:l}),r&&t.branches.map(e=>(0,n.jsx)(F,{branch:e,isSelected:e.id===s,onClick:()=>i(e.id),showRepositoryName:!1},e.id))]})}let ek=new Set(["__proto__","constructor","prototype"]);function eN(e){let{repositoryName:t,branchCount:r,isExpanded:s,onClick:a,dragHandleRef:i,dragHandleListeners:o,dragHandleAttributes:l}=e,c=(0,d.c)("common");return(0,n.jsxs)("div",{className:"flex items-center w-full",children:[o&&(0,n.jsx)("div",{ref:i,...o,...l,"aria-label":c("sidebar.dragToReorderGroup"),className:" flex-shrink-0 flex items-center justify-center w-6 h-full pl-2 cursor-grab active:cursor-grabbing text-sidebar-muted hover:text-sidebar-foreground transition-colors ",children:(0,n.jsx)(eE,{})}),(0,n.jsxs)("button",{"data-testid":"group-header",type:"button",onClick:a,"aria-expanded":s,className:" flex-1 min-w-0 flex items-center gap-2 px-2 py-2 text-xs font-semibold text-sidebar-muted uppercase tracking-wider focus:outline-none focus:ring-2 focus:ring-inset focus:ring-ring transition-colors ",children:[(0,n.jsx)(eC,{isExpanded:s}),(0,n.jsx)(eA,{color:(0,eh.LV)(t)}),(0,n.jsx)(Q.nR,{content:t,className:"flex-1 min-w-0 text-left truncate",children:t}),(0,n.jsx)("span",{className:"text-sidebar-muted font-normal tabular-nums pr-2",children:r})]})]})}function eS(e){let{viewMode:t,onToggle:r}=e,s=(0,d.c)("common");return(0,n.jsx)(V.m_,{content:s("tooltips.viewMode"),placement:"bottom",children:(0,n.jsx)("button",{"data-testid":"view-mode-toggle",type:"button",onClick:()=>{r("grouped"===t?"flat":"grouped")},"aria-label":s("grouped"===t?"sidebar.switchToFlatView":"sidebar.switchToGroupedView"),className:" p-1 rounded-md text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors ",children:"grouped"===t?(0,n.jsx)(eM,{className:eb}):(0,n.jsx)(eA,{className:eb})})})}function eC(e){let{isExpanded:t}=e;return(0,n.jsx)("svg",{className:"w-3 h-3 flex-shrink-0 transition-transform ".concat(t?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})}function eA(e){let{className:t="w-3.5 h-3.5",color:r}=e;return(0,n.jsx)("svg",{className:"".concat(t," flex-shrink-0"),viewBox:"0 0 24 24",fill:null!=r?r:"none",stroke:r?"none":"currentColor",strokeWidth:2*!r,"aria-hidden":"true",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}function eM(e){let{className:t="w-3 h-3"}=e;return(0,n.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}function eE(){return(0,n.jsxs)("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,n.jsx)("circle",{cx:"9",cy:"5",r:"1.5"}),(0,n.jsx)("circle",{cx:"15",cy:"5",r:"1.5"}),(0,n.jsx)("circle",{cx:"9",cy:"12",r:"1.5"}),(0,n.jsx)("circle",{cx:"15",cy:"12",r:"1.5"}),(0,n.jsx)("circle",{cx:"9",cy:"19",r:"1.5"}),(0,n.jsx)("circle",{cx:"15",cy:"19",r:"1.5"})]})}function eL(e){let{className:t=""}=e;return(0,n.jsx)("svg",{className:"".concat(eb," ").concat(t),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h5M20 20v-5h-5M20.49 9A9 9 0 005.64 5.64L4 4m16 16l-1.64-1.64A9 9 0 014.51 15"})})}let eR=(0,s.memo)(function(e){let{refreshWorktrees:t}=e,[r,a]=(0,s.useState)(!1),i=(0,s.useRef)(!1),{showToast:o}=(0,eo.dj)(),l=(0,d.c)("common"),c=(0,s.useCallback)(async()=>{if(!i.current){i.current=!0,a(!0);try{let e=await em.Rx.sync();await t(),o(l("syncSuccess",{count:e.worktreeCount}),"success",3e3)}catch(e){e instanceof em.hD&&401===e.status?o(l("syncAuthError"),"error",5e3):o(l("syncError"),"error",5e3)}finally{i.current=!1,a(!1)}}},[t,o,l]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(V.m_,{content:l("tooltips.sync"),placement:"bottom",children:(0,n.jsx)("button",{type:"button",onClick:c,disabled:r,"aria-label":l("syncButtonLabel"),className:"p-1 rounded-md text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:(0,n.jsx)(eL,{className:r?"animate-spin":""})})})})});var ez=r(65993),eB=r(37586),eT=r(66685),eD=r(61362),eK=r(37772);let eW=[{labelKey:"nav.home",href:"/",isActive:e=>"/"===e,icon:(0,n.jsx)(ez.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.chat",href:"/chat",isActive:e=>e.startsWith("/chat"),icon:(0,n.jsx)(eB.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.sessions",href:"/sessions",isActive:e=>e.startsWith("/sessions"),icon:(0,n.jsx)(eT.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.review",href:"/review",isActive:e=>e.startsWith("/review"),icon:(0,n.jsx)(eD.A,{size:20,"aria-hidden":"true"}),showsAttentionBadge:!0},{labelKey:"nav.more",href:"/more",isActive:e=>e.startsWith("/more"),icon:(0,n.jsx)(eK.A,{size:20,"aria-hidden":"true"})}];function eP(){let e=(0,a.usePathname)(),{setOpen:t}=(0,w.C)(),r=(0,d.c)("commandPalette"),s=(0,d.c)("common"),{count:i}=(0,ec.Lv)();return(0,n.jsx)("nav",{"data-testid":"global-mobile-nav",className:"fixed bottom-0 left-0 right-0 z-50 border-t border-border bg-background supports-[backdrop-filter]:bg-background/80 backdrop-blur-md pb-safe",children:(0,n.jsxs)("div",{className:"flex items-center justify-around h-14",children:[eW.map(t=>{let r=t.isActive(e),a=!0===t.showsAttentionBadge&&i>0;return(0,n.jsxs)(c,{href:a?el.ks:t.href,className:"flex flex-col items-center justify-center flex-1 h-full text-xs transition-colors ".concat(r?"text-accent-600 dark:text-accent-400":"text-muted-foreground hover:text-foreground"),children:[(0,n.jsxs)("span",{className:"relative inline-flex",children:[t.icon,!0===t.showsAttentionBadge&&(0,n.jsx)(eu,{count:i})]}),(0,n.jsx)("span",{className:"mt-1 whitespace-nowrap",children:s(t.labelKey)})]},t.href)}),(0,n.jsxs)("button",{type:"button","data-testid":"mobile-command-palette-trigger",onClick:()=>t(!0),"aria-label":r("mobileTrigger"),className:"flex flex-col items-center justify-center flex-1 h-full text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,n.jsx)(m.A,{size:20,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"mt-1 whitespace-nowrap",children:r("mobileLabel")})]})]})})}var eI=r(79698),eO=r(24533),e_=r(95740),eF=r(79451),eV=r(89559),eH=r(97470),eG=r(76482),eJ=r(39332),eU=r(87531),eX=r(59854),eq=r(70628),eY=r(66966),eZ=r(68704);let e$=[{key:"home",href:"/"},{key:"chat",href:"/chat"},{key:"sessions",href:"/sessions"},{key:"repositories",href:"/repositories"},{key:"review",href:"/review"},{key:"skills",href:"/skills"},{key:"more",href:"/more"}],eQ={home:ez.A,chat:eB.A,sessions:eT.A,repositories:eO.A,review:eD.A,skills:e_.A,more:eK.A},e0="cm.palette.recents";function e1(e){if(!e||"object"!=typeof e)return!1;let{kind:t,id:r}=e;return("nav"===t||"worktree"===t||"action"===t)&&"string"==typeof r}function e2(e){return e.isWaitingForResponse?"waiting":e.isProcessing?"running":e.isSessionRunning?"ready":"idle"}function e5(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return!!("INPUT"===t||"TEXTAREA"===t||"SELECT"===t||e.isContentEditable||e.closest('[role="log"]'))}let e4=(0,eU.cn)("flex cursor-pointer items-center gap-2 rounded-md px-2 py-2 text-sm","text-foreground","data-[selected=true]:bg-accent-500/15 data-[selected=true]:text-accent-700","dark:data-[selected=true]:text-accent-300"),e9="shrink-0 text-muted-foreground";function e6(){var e,t,r;let{open:i,setOpen:o}=(0,w.C)(),{setOpen:l}=(0,eq.K)(),c=(0,a.useRouter)(),u=(0,d.c)("commandPalette"),f=(0,d.c)("common"),{theme:g,setTheme:v}=(0,x.D)(),{setSize:y,isMobile:k}=(0,E.Ps)(),{currentLocale:N,switchLocale:S}=en(),C=(0,eY.rC)(),{showToast:A}=(0,eo.dj)(),[M,L]=(0,s.useState)(!1),[R,z]=(0,s.useState)(""),[B,T]=(0,s.useState)([]),K=(0,s.useRef)(null),P=(0,s.useRef)(null),I=(0,s.useRef)(i);(0,s.useEffect)(()=>{I.current=i},[i]),(0,s.useEffect)(()=>{L(!0)},[]),(0,s.useEffect)(()=>{function e(e){if(("k"===e.key||"K"===e.key)&&(e.metaKey||e.ctrlKey)){if(I.current){e.preventDefault(),e.stopPropagation(),o(!1);return}if(e5(e.target))return;e.preventDefault(),o(!0);return}"Escape"===e.key&&I.current&&(e.preventDefault(),e.stopPropagation(),o(!1))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[o]),(0,s.useEffect)(()=>{var e,t,r,n;i?(P.current=null!=(t=document.activeElement)?t:null,null==(e=K.current)||e.focus(),z(""),T(function(){try{let e=localStorage.getItem(e0);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return t.filter(e1).slice(0,8)}catch(e){return[]}}())):P.current&&(null==(r=(n=P.current).focus)||r.call(n),P.current=null)},[i]);let O=(0,s.useCallback)((e,t)=>{t&&T(e=>(function(e,t){let r=e.filter(e=>e.kind!==t.kind||e.id!==t.id),n=[t,...r].slice(0,8);try{localStorage.setItem(e0,JSON.stringify(n))}catch(e){}return n})(e,t)),o(!1),e()},[o]),_=(0,s.useCallback)(async()=>{try{var e;await em.Rx.sync(),await (null==C||null==(e=C.refresh)?void 0:e.call(C)),A(u("actions.syncSuccess"),"success")}catch(e){A(u("actions.syncError"),"error")}},[C,A,u]),F="dark"===g,V=""===R.trim(),H=null!=(e=null==C?void 0:C.error)?e:null,G=null!=(t=null==C?void 0:C.isLoading)&&t,J=H?[]:null!=(r=null==C?void 0:C.worktrees)?r:[],U=J.length>0,X=!H&&G&&0===J.length,q=[...J].sort((e,t)=>{let r=+!!e.isSessionRunning,n=+!!t.isSessionRunning;if(r!==n)return n-r;let s=e.updatedAt?new Date(e.updatedAt).getTime():0;return(t.updatedAt?new Date(t.updatedAt).getTime():0)-s}),Y=V?q.slice(0,8):q,Z=[{id:"theme",label:F?u("actions.toLight"):u("actions.toDark"),icon:F?p.A:b.A,run:()=>v(F?"light":"dark")},...k?[]:eZ.Uf.map(e=>({id:"displaysize:".concat(e),label:"".concat(u("actions.displaySizePrefix"),": ").concat(f("displaySize.".concat(e))),icon:eF.A,run:()=>y(e)})),{id:"sync",label:u("actions.syncRepositories"),icon:eV.A,run:()=>{_()}},{id:"locale",label:u("actions.switchLanguage"),icon:eH.A,run:()=>S("ja"===N?"en":"ja")},{id:"github",label:u("actions.openGitHub"),icon:h.A,run:()=>window.open("https://github.com/kewton/MyCodeBranchDesk","_blank","noopener,noreferrer")},{id:"keyboardShortcuts",label:u("actions.keyboardShortcuts"),icon:eG.A,run:()=>l(!0)}],$=V?B.map(e=>{if("nav"===e.kind){let t=e$.find(t=>t.key===e.id);if(!t)return null;let r=eQ[t.key],s=f("nav.".concat(t.key));return{id:"nav-".concat(t.key),value:"recent nav ".concat(t.key),node:(0,n.jsxs)(n.Fragment,{children:[r&&(0,n.jsx)(r,{size:16,className:e9,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:s})]}),onSelect:()=>O(()=>c.push(t.href),{kind:"nav",id:t.key})}}if("worktree"===e.kind){let t=J.find(t=>t.id===e.id);if(!t)return null;let r=t.repositoryDisplayName||t.repositoryName||"",s=t.branch||t.name;return{id:"worktree-".concat(t.id),value:"recent worktree ".concat(t.id),node:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eJ.A,{size:16,className:e9,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:s}),r&&(0,n.jsx)("span",{className:"ml-auto truncate pl-2 text-xs text-muted-foreground",children:r}),(0,n.jsx)(W.m,{status:e2(t),size:"sm",className:r?"ml-2":"ml-auto"})]}),onSelect:()=>O(()=>c.push("/worktrees/".concat(t.id)),{kind:"worktree",id:t.id})}}let t=Z.find(t=>t.id===e.id);if(!t)return null;let r=t.icon;return{id:"action-".concat(t.id),value:"recent action ".concat(t.id),node:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r,{size:16,className:e9,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:t.label})]}),onSelect:()=>O(t.run,{kind:"action",id:t.id})}}).filter(e=>null!==e):[];return M?(0,D.createPortal)((0,n.jsx)(n.Fragment,{children:i&&(0,n.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:eX.M.MODAL},"data-testid":"command-palette",children:[(0,n.jsx)("div",{"data-state":"open","aria-hidden":"true",className:"fixed inset-0 bg-black/40 backdrop-blur-sm transition-opacity data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-200",onClick:()=>o(!1)}),(0,n.jsx)("div",{className:"relative flex min-h-full items-start justify-center p-4 pt-[15vh]",children:(0,n.jsx)("div",{"data-state":"open","data-testid":"command-palette-panel",className:(0,eU.cn)("relative w-full max-w-lg overflow-hidden rounded-xl bg-surface/95 shadow-2xl ring-1 ring-border backdrop-blur-xl","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:duration-200"),children:(0,n.jsxs)(eI.uB,{label:u("title"),className:(0,eU.cn)("flex flex-col","[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-2","[&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground"),children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[(0,n.jsx)(m.A,{size:16,strokeWidth:2,"aria-hidden":"true",className:"shrink-0 text-muted-foreground"}),(0,n.jsx)(eI.uB.Input,{ref:K,value:R,onValueChange:z,placeholder:u("placeholder"),"data-testid":"command-palette-input",className:"flex-1 bg-transparent py-3 text-sm text-foreground outline-none placeholder:text-muted-foreground"})]}),(0,n.jsxs)(eI.uB.List,{className:"max-h-[min(60vh,360px)] overflow-y-auto p-2",children:[(0,n.jsx)(eI.uB.Empty,{"data-testid":"command-palette-empty",className:"py-6 text-center text-sm text-muted-foreground",children:u("empty")}),X&&(0,n.jsx)(eI.uB.Loading,{"data-testid":"command-palette-loading",className:"py-6 text-center text-sm text-muted-foreground",children:u("loading")}),$.length>0&&(0,n.jsx)(eI.uB.Group,{heading:u("groups.recent"),children:$.map(e=>(0,n.jsx)(eI.uB.Item,{value:e.value,onSelect:e.onSelect,className:e4,children:e.node},e.id))}),(0,n.jsx)(eI.uB.Group,{heading:u("groups.navigation"),children:e$.map(e=>{let t=f("nav.".concat(e.key)),r=eQ[e.key];return(0,n.jsxs)(eI.uB.Item,{value:"nav ".concat(t," ").concat(e.href),onSelect:()=>O(()=>c.push(e.href),{kind:"nav",id:e.key}),className:e4,children:[r&&(0,n.jsx)(r,{size:16,className:e9,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:t})]},e.key)})}),U&&(0,n.jsx)(eI.uB.Group,{heading:u("groups.worktrees"),children:Y.map(e=>{let t=e.repositoryDisplayName||e.repositoryName||"",r=e.branch||e.name;return(0,n.jsxs)(eI.uB.Item,{value:"worktree ".concat(t," ").concat(r," ").concat(e.name," ").concat(e.id),onSelect:()=>O(()=>c.push("/worktrees/".concat(e.id)),{kind:"worktree",id:e.id}),className:e4,children:[(0,n.jsx)(eJ.A,{size:16,className:e9,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:r}),t&&(0,n.jsx)("span",{className:"ml-auto truncate pl-2 text-xs text-muted-foreground",children:t}),(0,n.jsx)(W.m,{status:e2(e),size:"sm",className:t?"ml-2":"ml-auto"})]},e.id)})}),(0,n.jsx)(eI.uB.Group,{heading:u("groups.actions"),children:Z.map(e=>{let t=e.icon;return(0,n.jsxs)(eI.uB.Item,{value:"action ".concat(e.id," ").concat(e.label),onSelect:()=>O(e.run,{kind:"action",id:e.id}),className:e4,children:[(0,n.jsx)(t,{size:16,className:e9,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:e.label})]},e.id)})})]}),(0,n.jsxs)("div",{className:"flex items-center gap-3 border-t border-border bg-surface-2 px-3 py-2 text-[11px] text-muted-foreground",children:[(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)(j.u,{children:"↑"}),(0,n.jsx)(j.u,{children:"↓"}),u("footer.navigate")]}),(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)(j.u,{children:"↵"}),u("footer.select")]}),(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)(j.u,{children:"esc"}),u("footer.close")]})]})]})})})]})}),document.body):null}var e3=r(94465);let e8=["global","terminal","composer","editor"],e7=[{id:"commandPalette",keys:["MOD","K"],scope:"global"},{id:"keyboardHelp",keys:["?"],scope:"global"},{id:"closeOverlay",keys:["Esc"],scope:"global"},{id:"navigateList",keys:["↑","↓"],scope:"global"},{id:"terminalSearch",keys:["MOD","F"],scope:"terminal"},{id:"sendMessage",keys:["↵"],scope:"composer"},{id:"composerNewline",keys:["Shift","↵"],scope:"composer"},{id:"editorIndent",keys:["Tab"],scope:"editor"},{id:"editorOutdent",keys:["Shift","Tab"],scope:"editor"},{id:"editorTabFocus",keys:["Ctrl","M"],scope:"editor"},{id:"editorSave",keys:["MOD","S"],scope:"editor"},{id:"editorFullscreen",keys:["MOD","Shift","F"],scope:"editor"}];function te(){let{open:e,setOpen:t}=(0,eq.K)(),{open:r}=(0,w.C)(),a=(0,d.c)("keyboardShortcuts"),[i,o]=(0,s.useState)(!1);(0,s.useEffect)(()=>o(function(){if("undefined"==typeof navigator)return!1;let e=navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/.test(e)}()),[]);let l=(0,s.useRef)(e);(0,s.useEffect)(()=>{l.current=e},[e]);let c=(0,s.useRef)(r);(0,s.useEffect)(()=>{c.current=r},[r]),(0,s.useEffect)(()=>{function e(e){"?"!==e.key||e.isComposing||229===e.keyCode||e5(e.target)||c.current||l.current||(e.preventDefault(),t(!0))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t]);let u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e7;return e8.map(t=>({scope:t,shortcuts:e.filter(e=>e.scope===t)})).filter(e=>e.shortcuts.length>0)}();return(0,n.jsx)(e3.a,{isOpen:e,onClose:()=>t(!1),title:a("title"),size:"md",children:(0,n.jsx)("div",{"data-testid":"keyboard-shortcuts-overlay",className:"space-y-6",children:u.map(e=>{let{scope:t,shortcuts:r}=e;return(0,n.jsxs)("section",{"data-testid":"keyboard-shortcuts-scope-".concat(t),children:[(0,n.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:a("scopes.".concat(t))}),(0,n.jsx)("ul",{className:"divide-y divide-border",children:r.map(e=>(0,n.jsxs)("li",{"data-testid":"keyboard-shortcut-".concat(e.id),className:"flex items-center justify-between gap-4 py-2",children:[(0,n.jsx)("span",{className:"text-sm text-foreground",children:a("shortcuts.".concat(e.id))}),(0,n.jsx)("span",{className:"flex flex-shrink-0 items-center gap-1",children:e.keys.map((e,t)=>(0,n.jsx)(j.u,{children:"MOD"===e?i?"⌘":"Ctrl":e},t))})]},e.id))})]},t)})})})}var tt=r(52056),tr=r(65229),tn=r(52703);function ts(){let e=(0,d.c)("common"),[t,r]=(0,s.useState)(null),[a,i]=(0,s.useState)(null),o=(0,s.useCallback)(e=>{if(e.type!==tn.Oo)return;let{serverVersion:t,clientVersion:n}=e;"string"==typeof t&&"string"==typeof n&&t&&n&&t!==a&&r({serverVersion:t,clientVersion:n})},[a]);(0,v.T3)(o);let l=(0,s.useCallback)(()=>{window.location.reload()},[]),c=(0,s.useCallback)(()=>{r(e=>(e&&i(e.serverVersion),null))},[]);return t?(0,n.jsxs)("div",{"data-testid":"version-mismatch-banner",role:"alert","aria-live":"assertive",className:"fixed top-3 left-1/2 -translate-x-1/2 flex items-start gap-3 max-w-[92vw] rounded-lg border border-warning-border bg-warning-subtle px-4 py-3 text-warning-foreground shadow-lg",style:{zIndex:eX.M.TOAST},children:[(0,n.jsx)(tt.A,{className:"h-5 w-5 shrink-0 mt-0.5","aria-hidden":"true"}),(0,n.jsxs)("div",{className:"flex flex-col gap-0.5 text-sm",children:[(0,n.jsx)("span",{className:"font-semibold",children:e("versionMismatch.title")}),(0,n.jsx)("span",{children:e("versionMismatch.description",{serverVersion:t.serverVersion,clientVersion:t.clientVersion})})]}),(0,n.jsxs)("button",{type:"button","data-testid":"version-mismatch-reload",onClick:l,className:"shrink-0 inline-flex items-center gap-1.5 rounded-md border border-warning-border px-3 py-1.5 text-sm font-medium hover:opacity-80 focus:outline-none focus:ring-2 focus:ring-offset-2",children:[(0,n.jsx)(eV.A,{className:"h-4 w-4","aria-hidden":"true"}),e("versionMismatch.reload")]}),(0,n.jsx)("button",{type:"button","data-testid":"version-mismatch-dismiss",onClick:c,"aria-label":e("versionMismatch.dismiss"),className:"shrink-0 hover:opacity-70 focus:outline-none focus:ring-2 focus:ring-offset-2",children:(0,n.jsx)(tr.A,{className:"h-4 w-4","aria-hidden":"true"})})]}):null}let ta="transform transition-transform duration-300 ease-out",ti=(0,s.memo)(function(e){let{children:t}=e,{isOpen:r,isMobileDrawerOpen:i,closeMobileDrawer:o,width:l,setWidth:c}=(0,S.VF)(),d=(0,C.a)(),{showSidebar:u,showGlobalNav:m}=function(){var e=(0,a.usePathname)();for(let t of M)if(e.startsWith(t.prefix))return{...A,...t.config};return{...A}}(),{factor:h}=(0,E.Ps)(),f=Math.round(160*h),x=Math.round(480*h),p=Math.round(Math.min(x,Math.max(f,l*h))),b=(0,s.useRef)(null),g=(0,s.useRef)(null),v=(0,s.useCallback)(e=>{c(Math.round(e/h))},[c,h]);return d?(0,n.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[i&&(0,n.jsx)("div",{"data-testid":"drawer-overlay",className:"fixed inset-0 bg-black/50 z-40",onClick:o,"aria-hidden":"true"}),u&&(0,n.jsx)("aside",{"data-testid":"sidebar-container",className:"\n fixed left-0 top-0 h-full w-72 z-50\n ".concat(ta,"\n ").concat(i?"translate-x-0":"-translate-x-full","\n "),role:"complementary",children:(0,n.jsx)(ej,{})}),(0,n.jsx)("main",{className:"flex-1 min-h-0 overflow-hidden ".concat(m?"pb-14":""),role:"main","data-view-transition":"content",children:t}),m&&(0,n.jsx)(eP,{}),(0,n.jsx)(e6,{}),(0,n.jsx)(te,{}),(0,n.jsx)(ts,{})]}):(0,n.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[m&&(0,n.jsx)(N,{}),(0,n.jsxs)("div",{className:"flex flex-1 min-h-0",children:[u&&(0,n.jsxs)("aside",{ref:b,"data-testid":"sidebar-container",className:"\n fixed left-0\n ".concat(m?"top-16 h-[calc(100vh-4rem)]":"top-0 h-full","\n border-r border-border\n ").concat(ta,"\n ").concat(r?"translate-x-0":"-translate-x-full","\n "),style:{width:"".concat(p,"px"),zIndex:eX.M.SIDEBAR},role:"complementary","aria-hidden":!r,children:[(0,n.jsx)(ej,{}),(0,n.jsx)(to,{currentWidth:p,minWidth:f,maxWidth:x,sidebarRef:b,mainRef:g,onWidthChange:v})]}),(0,n.jsx)("main",{ref:g,className:"flex-1 min-w-0 h-full overflow-hidden transition-[padding] duration-300 ease-out",style:{paddingLeft:u&&r?"".concat(p,"px"):0},role:"main","data-view-transition":"content",children:t})]}),(0,n.jsx)(e6,{}),(0,n.jsx)(te,{}),(0,n.jsx)(ts,{})]})});function to(e){let{currentWidth:t,minWidth:r,maxWidth:s,sidebarRef:a,mainRef:i,onWidthChange:o}=e;return(0,n.jsx)("div",{"data-testid":"sidebar-resize-handle","aria-hidden":"true",onMouseDown:e=>{e.preventDefault();let n=e.clientX,l=t;i.current&&(i.current.style.transition="none");let c=e=>{l=Math.max(r,Math.min(s,t+(e.clientX-n))),a.current&&(a.current.style.width="".concat(l,"px")),i.current&&(i.current.style.paddingLeft="".concat(l,"px"))},d=()=>{document.body.style.cursor="",document.body.style.userSelect="",i.current&&(i.current.style.transition=""),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",d),o(l)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",c),document.addEventListener("mouseup",d)},className:"absolute top-0 right-0 w-1 h-full cursor-col-resize hover:bg-accent-500/40 transition-colors"})}},30061:(e,t,r)=>{r.d(t,{nR:()=>i});var n=r(95155),s=r(12115),a=r(47650);function i(e){let{content:t,delay:r=200,className:i,children:o,metadata:l}=e,c=(0,s.useRef)(null),d=(0,s.useRef)(null),u=(0,s.useRef)(null),m=(0,s.useRef)(null),[h,f]=(0,s.useState)(!1),[x,p]=(0,s.useState)({top:-9999,left:-9999}),b=(0,s.useCallback)(()=>{null!==u.current&&(clearTimeout(u.current),u.current=null)},[]),g=(0,s.useCallback)(()=>{let e=c.current;e&&(e.scrollWidth>e.clientWidth||l)&&(b(),u.current=setTimeout(()=>{let t=e.getBoundingClientRect(),r=Math.max(4,window.innerWidth-384-4);m.current={top:t.top,bottom:t.bottom},p({top:t.bottom+4,left:Math.min(t.left,r)}),f(!0),u.current=null},r))},[b,r,l]);(0,s.useLayoutEffect)(()=>{if(!h)return;let e=d.current,t=m.current;if(!e||!t)return;let{height:r}=e.getBoundingClientRect();if(r<=0)return;let n=window.innerHeight;if(t.bottom+4+r+4<=n)return;let s=t.top-4-r,a=s>=4?s:Math.max(4,n-r-4);p(e=>e.top===a?e:{...e,top:a})},[h]);let v=(0,s.useCallback)(()=>{b(),f(!1)},[b]);return(0,s.useEffect)(()=>()=>b(),[b]),(0,n.jsxs)("span",{ref:c,className:i,onMouseEnter:g,onMouseLeave:v,children:[null!=o?o:t,h&&"undefined"!=typeof document&&(0,a.createPortal)((0,n.jsxs)("span",{ref:d,role:"tooltip","aria-hidden":"true",className:"fixed z-[9999] max-w-md px-2 py-1 text-xs font-medium rounded bg-foreground text-background shadow-lg pointer-events-none",style:{top:x.top,left:x.left},children:[(0,n.jsx)("span",{className:"block break-all",children:t}),l&&(0,n.jsx)("span",{className:"mt-0.5 block whitespace-pre-line font-normal text-background/70",children:l})]}),document.body)]})}},34681:(e,t,r)=>{r.d(t,{g:()=>o});var n=r(95155);r(12115);var s=r(18955),a=r(22592),i=r(68704);function o(){let{size:e,setSize:t,isMobile:r}=(0,a.Ps)(),o=(0,s.c)("common");if(r)return null;let l=o("displaySize.ariaLabel");return(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)("label",{htmlFor:"pc-display-size",className:"sr-only",children:l}),(0,n.jsx)("select",{id:"pc-display-size","data-testid":"pc-display-size-select","aria-label":l,value:e,onChange:e=>{let r=e.target.value;(0,i.fM)(r)&&t(r)},className:"text-sm bg-transparent text-foreground border border-input rounded-md px-2 py-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:i.Uf.map(e=>(0,n.jsx)("option",{value:e,children:o("displaySize.".concat(e))},e))})]})}},41898:(e,t,r)=>{r.d(t,{m_:()=>l});var n=r(95155),s=r(12115),a=r(47650);function i(e,t,r){return Math.min(Math.max(e,4),Math.max(4,r-t-4))}let o={top:-9999,left:-9999};function l(e){let{content:t,placement:r="right",delay:l=100,children:c}=e,[d,u]=(0,s.useState)(!1),[m,h]=(0,s.useState)(null),f=(0,s.useRef)(null),x=(0,s.useRef)(null),p=(0,s.useRef)(null),b=(0,s.useCallback)(()=>{null!==p.current&&(clearTimeout(p.current),p.current=null)},[]),g=(0,s.useCallback)(()=>{b(),p.current=setTimeout(()=>{u(!0),p.current=null},l)},[l,b]),v=(0,s.useCallback)(()=>{b(),u(!1),h(null)},[b]),y=(0,s.useCallback)(()=>{let e=f.current,t=x.current;if(!e||!t)return;let n=e.getBoundingClientRect(),s=t.getBoundingClientRect();h(function(e,t,r,n){let s,a,o=t.left+t.width/2-r.width/2,l=t.top+t.height/2-r.height/2;switch(e){case"top":s=t.top-r.height-8,a=o;break;case"bottom":s=t.top+t.height+8,a=o;break;case"left":s=l,a=t.left-r.width-8;break;default:s=l,a=t.left+t.width+8}return{top:i(s,r.height,n.height),left:i(a,r.width,n.width)}}(r,{top:n.top,left:n.left,width:n.width,height:n.height},{width:s.width,height:s.height},{width:window.innerWidth,height:window.innerHeight}))},[r]);return(0,s.useLayoutEffect)(()=>{if(d)return y(),window.addEventListener("resize",y),window.addEventListener("scroll",y,!0),()=>{window.removeEventListener("resize",y),window.removeEventListener("scroll",y,!0)}},[d,y]),(0,s.useEffect)(()=>()=>{b()},[b]),(0,n.jsxs)("span",{ref:f,"data-testid":"tooltip-wrapper",className:"relative inline-flex",tabIndex:-1,onMouseEnter:g,onMouseLeave:v,children:[c,d&&"undefined"!=typeof document&&(0,a.createPortal)((0,n.jsx)("span",{ref:x,role:"tooltip","aria-hidden":"true","data-placement":r,className:"fixed z-40 whitespace-nowrap px-2 py-1 text-xs font-medium rounded bg-foreground text-background shadow-lg pointer-events-none",style:null!=m?m:o,children:t}),document.body)]})}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6381],{2317:(e,t,r)=>{r.d(t,{V:()=>i});var n=r(12115);function o(){try{let e="__localStorage_test__";return window.localStorage.setItem(e,"test"),window.localStorage.removeItem(e),!0}catch(e){return!1}}function i(e){let{key:t,defaultValue:r,validate:i,serialize:a=JSON.stringify,deserialize:s=JSON.parse}=e,l=(0,n.useRef)(r),c=(0,n.useRef)(i),u=(0,n.useRef)(a),d=(0,n.useRef)(s);l.current=r,c.current=i,u.current=a,d.current=s;let[f,p]=(0,n.useState)(!1),[g,y]=(0,n.useState)(r),m=(0,n.useCallback)(()=>{if(!o())return l.current;try{let e=window.localStorage.getItem(t);if(null===e)return l.current;let r=d.current(e);if(c.current)return c.current(r)?r:l.current;return r}catch(e){return l.current}},[t]),w=(0,n.useCallback)(e=>{if(o())try{let r=u.current(e);window.localStorage.setItem(t,r)}catch(e){}},[t]),h=(0,n.useCallback)(e=>{y(t=>{let r="function"==typeof e?e(t):e;return w(r),r})},[w]),S=(0,n.useCallback)(()=>{if(o())try{window.localStorage.removeItem(t)}catch(e){}y(l.current)},[t]);return(0,n.useEffect)(()=>{p(o()),y(m())},[m]),{value:g,setValue:h,removeValue:S,isAvailable:f}}},7636:(e,t,r)=>{r.d(t,{LV:()=>c,Si:()=>i,UZ:()=>s,Xn:()=>f,_s:()=>p,nO:()=>u,s6:()=>l});var n=r(38606);let o=["updatedAt","repositoryName","branchName","status","lastSent"],i=e=>o.includes(e),a={waiting:0,ready:1,running:2,generating:3,idle:4};function s(e){let t=new Set;for(let r of e)!1===r.visible&&t.add(r.path);return t}function l(e,t){return 0===t.size?e.slice():e.filter(e=>{let r=e.repositoryPath;return!r||!t.has(r)})}function c(e){let t=function(e){let t=5381;for(let r=0;r<e.length;r++)t=(t<<5)+t+e.charCodeAt(r)|0;return Math.abs(t)}(e)%360;return"hsl(".concat(t,", ").concat(65,"%, ").concat(60,"%)")}function u(e,t){if(!e&&!t)return 0;if(!e)return 1;if(!t)return -1;let r=e instanceof Date?e.getTime():new Date(e).getTime();return(t instanceof Date?t.getTime():new Date(t).getTime())-r}function d(e){return"waiting"===(e.cliStatus&&Object.keys(e.cliStatus).length>0?(0,n.A7)(e.cliStatus):e.status)}function f(e,t,r){let n=[...e],o="status"!==t;return n.sort((e,n)=>{if(o){let t=Number(d(n))-Number(d(e));if(0!==t)return t}let i=0;switch(t){case"updatedAt":{let t=e=>e?e instanceof Date?e.getTime():new Date(e).getTime():0,r=t(e.lastActivity);i=t(n.lastActivity)-r;break}case"repositoryName":{let t=e.repositoryName.toLowerCase(),r=n.repositoryName.toLowerCase();i=t.localeCompare(r);break}case"branchName":{let t=e.name.toLowerCase(),r=n.name.toLowerCase();i=t.localeCompare(r);break}case"status":i=a[e.status]-a[n.status];break;case"lastSent":{let t=u(e.lastActivity,n.lastActivity);if(!e.lastActivity&&!n.lastActivity){i=0;break}if(!e.lastActivity)return 1;if(!n.lastActivity)return -1;i=t;break}default:i=0}return("updatedAt"===t||"lastSent"===t?"desc"===r:"asc"===r)?i:-i}),n}function p(e,t,r){let n=new Map;for(let t of e){let e=t.repositoryName;n.has(e)||n.set(e,[]),n.get(e).push(t)}return[...n.keys()].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase())).map(e=>({repositoryName:e,branches:f(n.get(e),t,r)}))}},22592:(e,t,r)=>{r.d(t,{Ps:()=>d,W5:()=>u});var n=r(95155),o=r(12115),i=r(38218),a=r(68704);let s="data-pc-size",l={size:a.r5,setSize:()=>{},isMobile:!1,factor:a.d8[a.r5].factor,isAvailable:!1},c=(0,o.createContext)(l);function u(e){let{children:t}=e,{size:r,setSize:l,isAvailable:u}=(0,a.of)(),d=(0,i.a)();(0,o.useEffect)(()=>{if("undefined"==typeof document)return;let e=document.documentElement;return d?void e.removeAttribute(s):(e.setAttribute(s,r),()=>{e.removeAttribute(s)})},[r,d]);let f=(0,o.useMemo)(()=>({size:r,setSize:l,isMobile:d,factor:a.d8[r].factor,isAvailable:u}),[r,l,d,u]);return(0,n.jsx)(c.Provider,{value:f,children:t})}function d(){return(0,o.useContext)(c)}},24373:(e,t,r)=>{r.d(t,{Kg:()=>i,Lv:()=>a});var n=r(12115),o=r(66966);function i(e){let t=0;for(let r of e)!0===r.isWaitingForResponse&&t++;return t}function a(){let e=(0,o.rC)(),t=null==e?void 0:e.worktrees;return(0,n.useMemo)(()=>{let e=t?t.filter(e=>!0===e.isWaitingForResponse):[];return{count:e.length,worktrees:e}},[t])}r(44308)},32916:(e,t,r)=>{r.d(t,{GB:()=>u,VF:()=>d});var n=r(95155),o=r(12115),i=r(7636);let a="updatedAt",s=(0,o.createContext)(null);function l(e,t,r,n){let i=(0,o.useRef)(!0);(0,o.useEffect)(()=>{try{let t=localStorage.getItem(e);t&&n(t)}catch(e){}},[]),(0,o.useEffect)(()=>{if(i.current){i.current=!1;return}try{localStorage.setItem(e,r())}catch(e){}},[t])}function c(e,t){switch(t.type){case"TOGGLE":return{...e,isOpen:!e.isOpen};case"SET_WIDTH":return{...e,width:t.width};case"OPEN_MOBILE_DRAWER":return{...e,isMobileDrawerOpen:!0};case"CLOSE_MOBILE_DRAWER":return{...e,isMobileDrawerOpen:!1};case"SET_SORT_KEY":return{...e,sortKey:t.sortKey};case"SET_SORT_DIRECTION":return{...e,sortDirection:t.sortDirection};case"LOAD_SORT_SETTINGS":return{...e,sortKey:t.sortKey,sortDirection:t.sortDirection};case"SET_VIEW_MODE":return{...e,viewMode:t.viewMode};default:return e}}function u(e){let{children:t,initialOpen:r=!0,initialWidth:u=224}=e,[d,f]=(0,o.useReducer)(c,{isOpen:r,width:u,isMobileDrawerOpen:!1,sortKey:a,sortDirection:"desc",viewMode:"grouped"});l("mcbd-sidebar-sort","".concat(d.sortKey,":").concat(d.sortDirection),()=>JSON.stringify({sortKey:d.sortKey,sortDirection:d.sortDirection}),e=>{try{let t=JSON.parse(e),r=t.sortDirection,n=(0,i.Si)(t.sortKey)?t.sortKey:a;n&&("asc"===r||"desc"===r)&&f({type:"LOAD_SORT_SETTINGS",sortKey:n,sortDirection:r})}catch(e){}}),l("mcbd-sidebar-view-mode",d.viewMode,()=>d.viewMode,e=>{("grouped"===e||"flat"===e)&&f({type:"SET_VIEW_MODE",viewMode:e})}),l("mcbd-sidebar-width",d.width,()=>String(d.width),e=>{let t=Number(e);!isNaN(t)&&t>0&&f({type:"SET_WIDTH",width:288===t?224:t})});let p=(0,o.useCallback)(()=>{f({type:"TOGGLE"})},[]),g=(0,o.useCallback)(e=>{f({type:"SET_WIDTH",width:e})},[]),y=(0,o.useCallback)(()=>{f({type:"OPEN_MOBILE_DRAWER"})},[]),m=(0,o.useCallback)(()=>{f({type:"CLOSE_MOBILE_DRAWER"})},[]),w=(0,o.useCallback)(e=>{f({type:"SET_SORT_KEY",sortKey:e})},[]),h=(0,o.useCallback)(e=>{f({type:"SET_SORT_DIRECTION",sortDirection:e})},[]),S=(0,o.useCallback)(e=>{f({type:"SET_VIEW_MODE",viewMode:e})},[]),b=(0,o.useMemo)(()=>({isOpen:d.isOpen,width:d.width,isMobileDrawerOpen:d.isMobileDrawerOpen,sortKey:d.sortKey,sortDirection:d.sortDirection,toggle:p,setWidth:g,openMobileDrawer:y,closeMobileDrawer:m,setSortKey:w,setSortDirection:h,viewMode:d.viewMode,setViewMode:S}),[d.isOpen,d.width,d.isMobileDrawerOpen,d.sortKey,d.sortDirection,d.viewMode,p,g,y,m,w,h,S]);return(0,n.jsx)(s.Provider,{value:b,children:t})}function d(){let e=(0,o.useContext)(s);if(!e)throw Error("useSidebarContext must be used within a SidebarProvider");return e}},38218:(e,t,r)=>{r.d(t,{D:()=>i,a:()=>a});var n=r(12115);let o=n.useLayoutEffect,i=768;function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{breakpoint:t=i}=e,[r,a]=(0,n.useState)(!1);return o(()=>{let e=window.matchMedia("(max-width: ".concat(t-1,"px)"));a(e.matches);let r=e=>{a(e.matches)};return e.addEventListener("change",r),()=>{e.removeEventListener("change",r)}},[t]),r}},38606:(e,t,r)=>{r.d(t,{A7:()=>l,kA:()=>i,f_:()=>d,dw:()=>c,XK:()=>f});var n=r(54014),o=r(63001);function i(e){return e?e.isWaitingForResponse?"waiting":e.isProcessing?"running":e.isRunning?"ready":"idle":"idle"}let a={start:"nextAction.start",sendMessage:"nextAction.sendMessage",approveReject:"nextAction.approveReject",replyToPrompt:"nextAction.replyToPrompt",checkStalled:"nextAction.checkStalled",running:"nextAction.running"};Object.values(a);let s={idle:null,ready:"ready",running:"running",generating:"running",waiting:"waiting"};function l(e){if(!e)return"idle";let t=Object.values(e).filter(e=>void 0!==e);return 0===t.length?"idle":t.includes("waiting")?"waiting":t.includes("running")?"running":t.includes("generating")?"generating":t.includes("ready")?"ready":"idle"}function c(e,t){return e?Object.entries(e).map(e=>{var r;let[o,i]=e;return"".concat(null!=(r=null==t?void 0:t[o])?r:(0,n.f_)(o,o),": ").concat(null!=i?i:"idle")}).join(", "):""}let u=["prompt","menu","unclassified"];function d(e){var t,r,n;let o=Object.values(null!=(r=null!=(t=e.sessionStatusByInstance)?t:e.sessionStatusByCli)?r:{}).filter(e=>void 0!==e),i=!1,a=new Set;for(let e of o)e.awaitingInstruction&&(i=!0),e.waitingKind&&a.add(e.waitingKind);return{waitingKind:null!=(n=u.find(e=>a.has(e)))?n:null,awaitingInstruction:i}}function f(e){var t,r,c,u,f,p;let g=i(void 0!==e.isSessionRunning?{isRunning:null!=(t=e.isSessionRunning)&&t,isWaitingForResponse:null!=(r=e.isWaitingForResponse)&&r,isProcessing:null!=(c=e.isProcessing)&&c}:void 0),y=!!e.lastAssistantMessageAt&&(!e.lastViewedAt||new Date(e.lastAssistantMessageAt)>new Date(e.lastViewedAt)),{cliStatus:m,cliStatusLabels:w}=function(e){var t,r,a;let s={},l={},c=e.sessionStatusByInstance;if(!c){for(let a of null!=(t=e.selectedAgents)?t:o.fJ)s[a]=i(null==(r=e.sessionStatusByCli)?void 0:r[a]),l[a]=(0,n.oo)(a);return{cliStatus:s,cliStatusLabels:l}}let u=e.agentInstances&&e.agentInstances.length>0?e.agentInstances:(0,n.lu)(null!=(a=e.selectedAgents)?a:o.fJ),d=new Set;for(let e of u)d.add(e.id),s[e.id]=i(c[e.id]),l[e.id]=(0,n.sw)(e);for(let[e,t]of Object.entries(c)){if(d.has(e))continue;let r=i(t);"idle"!==r&&(s[e]=r,l[e]=function(e){let t=n.XH.find(t=>e.startsWith("".concat(t,"-")));if(t){let r=e.slice(t.length+1);return"".concat((0,n.oo)(t)," ").concat(r)}return(0,n.f_)(e,e)}(e))}return{cliStatus:s,cliStatusLabels:l}}(e),h=l(m),{waitingKind:S,awaitingInstruction:b}=d(e);return{id:e.id,name:e.name,repositoryName:null!=(u=e.repositoryDisplayName)?u:e.repositoryName,status:g,hasUnread:y,lastActivity:e.updatedAt,description:e.description,cliStatus:m,cliStatusLabels:w,worktreePath:e.path,waitingKind:S,awaitingInstruction:b,nextActionKey:(f=s[h],p="waiting"===h?"approval":null,f&&"idle"!==f?"ready"===f?a.sendMessage:"waiting"===f&&"approval"===p?a.approveReject:"waiting"===f?a.replyToPrompt:(0,a.running):a.start)}}},39649:(e,t,r)=>{r.d(t,{$f:()=>d,H8:()=>u});var n=r(95155),o=r(12115),i=r(80344);let a={PROCESSING:2e3,SESSION_RUNNING:5e3,IDLE:1e4},s=(0,o.createContext)(null),l={selectedWorktreeId:null,worktrees:[],repositories:[],selectedWorktreeDetail:null,isLoading:!0,isLoadingDetail:!1,error:null};function c(e,t){switch(t.type){case"SET_WORKTREES":return{...e,worktrees:t.worktrees,isLoading:!1};case"SET_REPOSITORIES":return{...e,repositories:t.repositories};case"SELECT_WORKTREE":{var r;let n=null!=(r=e.worktrees.find(e=>e.id===t.id))?r:null;return{...e,selectedWorktreeId:t.id,selectedWorktreeDetail:null!=n?n:e.selectedWorktreeDetail,isLoadingDetail:null===n}}case"SET_WORKTREE_DETAIL":return{...e,selectedWorktreeDetail:t.detail};case"SET_LOADING":return{...e,isLoading:t.isLoading};case"SET_LOADING_DETAIL":return{...e,isLoadingDetail:t.isLoadingDetail};case"SET_ERROR":return{...e,error:t.error,isLoading:!1};default:return e}}function u(e){let{children:t,externalWorktrees:r,externalRepositories:u}=e,d=void 0!==r,[f,p]=(0,o.useReducer)(c,l);(0,o.useEffect)(()=>{d&&r&&p({type:"SET_WORKTREES",worktrees:r})},[d,r]),(0,o.useEffect)(()=>{d&&u&&p({type:"SET_REPOSITORIES",repositories:u})},[d,u]);let g=(0,o.useCallback)(async()=>{if(!d){p({type:"SET_LOADING",isLoading:!0}),p({type:"SET_ERROR",error:null});try{var e;let t=await i.y.getAll();p({type:"SET_WORKTREES",worktrees:t.worktrees}),p({type:"SET_REPOSITORIES",repositories:null!=(e=t.repositories)?e:[]})}catch(e){p({type:"SET_ERROR",error:e instanceof Error?e.message:"Failed to fetch worktrees"})}}},[d]),y=(0,o.useCallback)(async e=>{p({type:"SELECT_WORKTREE",id:e}),p({type:"SET_ERROR",error:null});try{i.y.markAsViewed(e).catch(e=>{console.warn("[WorktreeSelectionContext] Failed to mark as viewed:",e)});let t=await i.y.getById(e);p({type:"SET_WORKTREE_DETAIL",detail:t})}catch(e){p({type:"SET_ERROR",error:e instanceof Error?e.message:"Failed to fetch worktree detail"})}finally{p({type:"SET_LOADING_DETAIL",isLoadingDetail:!1})}},[]),m=(0,o.useCallback)(async()=>{await g()},[g]);(0,o.useEffect)(()=>{d||g()},[g,d]),(0,o.useEffect)(()=>{if(d)return;let e=null,t=!0,r=async()=>{if(t)try{var n,o;let s=await i.y.getAll();p({type:"SET_WORKTREES",worktrees:s.worktrees}),p({type:"SET_REPOSITORIES",repositories:null!=(n=s.repositories)?n:[]});let l=(o=s.worktrees).some(e=>e.isProcessing||e.isWaitingForResponse)?a.PROCESSING:o.some(e=>e.isSessionRunning)?a.SESSION_RUNNING:a.IDLE;t&&(e=setTimeout(r,l))}catch(n){if(n instanceof i.hD&&401===n.status)return;console.error("[WorktreeSelectionContext] Polling error:",n),t&&(e=setTimeout(r,a.SESSION_RUNNING))}};return r(),()=>{t=!1,e&&clearTimeout(e)}},[d]);let w={selectedWorktreeId:f.selectedWorktreeId,worktrees:f.worktrees,repositories:f.repositories,selectedWorktreeDetail:f.selectedWorktreeDetail,isLoadingDetail:f.isLoadingDetail,error:f.error,selectWorktree:y,refreshWorktrees:m};return(0,n.jsx)(s.Provider,{value:w,children:t})}function d(){let e=(0,o.useContext)(s);if(!e)throw Error("useWorktreeSelection must be used within a WorktreeSelectionProvider");return e}},44308:(e,t,r)=>{r.d(t,{$h:()=>d,DR:()=>o,IH:()=>c,Iu:()=>n,Nb:()=>f,SD:()=>i,_d:()=>l,bm:()=>p,ks:()=>s,t7:()=>u,z7:()=>a});let n=7e3,o=["in_review","approval","stalled"],i="in_review",a="filter",s="/review?".concat(a,"=approval");function l(e){return e&&o.includes(e)?e:null}let c=["claude","codex","copilot","antigravity"],u=1e3,d=5,f=100,p=1e3},52703:(e,t,r)=>{r.d(t,{Oo:()=>o,ST:()=>n,zS:()=>i});let n="client_version",o="version_mismatch";function i(e){let t;try{t=JSON.parse(e)}catch(e){return null}if(!t||"object"!=typeof t)return null;let r=t;if("broadcast"===r.type){let e=r.data;return e&&"object"==typeof e?"string"!=typeof e.type?null:(void 0===e.worktreeId&&"string"==typeof r.worktreeId&&(e.worktreeId=r.worktreeId),e):null}return"string"==typeof r.type?r:null}},54014:(e,t,r)=>{r.d(t,{Ab:()=>o,NL:()=>m,O6:()=>p,XH:()=>n,f_:()=>d,hR:()=>c,lu:()=>g,n6:()=>s,oo:()=>u,pQ:()=>i,sw:()=>f,vz:()=>y});let n=["claude","codex","gemini","vibe-local","opencode","copilot","antigravity"],o=10,i=50,a=/^[a-zA-Z0-9_-]+$/;function s(e){return"string"==typeof e&&e.length>0&&e.length<=64&&a.test(e)}let l={claude:"Claude",codex:"Codex",gemini:"Gemini","vibe-local":"Vibe Local",opencode:"OpenCode",copilot:"Copilot",antigravity:"Antigravity"};function c(e){return n.includes(e)}function u(e){var t;return null!=(t=l[e])?t:e}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Assistant";return e&&c(e)?u(e):t}function f(e){let t=e.alias;return"string"==typeof t&&t.trim().length>0?t:u(e.cliTool)}function p(e,t,r){let n=e.find(e=>e.id===t);return n?f(n):u(r)}function g(e){return e.map((e,t)=>({id:e,cliTool:e,alias:u(e),order:t}))}let y=128,m=2097152},63001:(e,t,r)=>{r.d(t,{fJ:()=>n}),r(54014);let n=["claude","codex","antigravity"]},63365:(e,t,r)=>{r.d(t,{tS:()=>u,xM:()=>d,T3:()=>f});var n=r(95155),o=r(12115),i=r(52703);function a(){return"undefined"!=typeof globalThis&&"function"==typeof globalThis.WebSocket?globalThis.WebSocket:null}let s=()=>{},l={status:"disconnected",connected:!1,subscribe:s,unsubscribe:s,addListener:()=>s},c=(0,o.createContext)(null);function u(e){let{children:t,enabled:r=!0}=e,s=(0,o.useRef)(new Set),l=(0,o.useRef)(new Map),{status:u,subscribe:d,unsubscribe:f}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{onEvent:t,onStatusChange:r,autoReconnect:n=!0,reconnectBaseDelay:s=1e3,reconnectMaxDelay:l=3e4,enabled:c=!0}=e,[u,d]=(0,o.useState)("disconnected"),f=(0,o.useRef)(null),p=(0,o.useRef)(null),g=(0,o.useRef)(0),y=(0,o.useRef)(new Set),m=(0,o.useRef)(!1),w=(0,o.useRef)(t);w.current=t;let h=(0,o.useRef)(r);h.current=r;let S=(0,o.useCallback)(e=>{var t;d(e),null==(t=h.current)||t.call(h,e)},[]),b=(0,o.useCallback)(()=>{null!==p.current&&(clearTimeout(p.current),p.current=null)},[]),v=(0,o.useCallback)(()=>{if(!c)return;let e=a();if(!e||f.current&&(f.current.readyState===e.OPEN||f.current.readyState===e.CONNECTING))return;b(),m.current=!1,S("connecting");let t="https:"===window.location.protocol?"wss:":"ws:",r=new e("".concat(t,"//").concat(window.location.host));f.current=r,r.onopen=()=>{g.current=0,S("connected");try{r.send(JSON.stringify({type:i.ST,version:"0.26.1"}))}catch(e){}y.current.forEach(e=>{try{r.send(JSON.stringify({type:"subscribe",worktreeId:e}))}catch(e){}})},r.onmessage=e=>{var t;let r="string"==typeof e.data?e.data:String(e.data),n=(0,i.zS)(r);n&&(null==(t=w.current)||t.call(w,n))},r.onerror=()=>{S("error")},r.onclose=()=>{var e;if(f.current=null,S("disconnected"),m.current||!n||"undefined"!=typeof document&&"hidden"===document.visibilityState)return;let t=(e=g.current,Math.min(s*2**Math.max(0,e),l));g.current+=1,p.current=setTimeout(()=>{p.current=null,v()},t)}},[c,n,s,l,S,b]),E=(0,o.useCallback)(()=>{if(b(),m.current=!0,f.current){try{f.current.close(1e3,"Client disconnect")}catch(e){}f.current=null}},[b]),C=(0,o.useCallback)(e=>{let t=f.current,r=a();if(t&&r&&t.readyState===r.OPEN)try{t.send(JSON.stringify(e))}catch(e){}},[]),k=(0,o.useCallback)(e=>{y.current.has(e)||(y.current.add(e),C({type:"subscribe",worktreeId:e}))},[C]),T=(0,o.useCallback)(e=>{y.current.has(e)&&(y.current.delete(e),C({type:"unsubscribe",worktreeId:e}))},[C]);return(0,o.useEffect)(()=>{if(c)return v(),()=>{E()}},[c,v,E]),(0,o.useEffect)(()=>{if(!c||"undefined"==typeof document)return;let e=()=>{"visible"===document.visibilityState&&(f.current||(g.current=0,v()))};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[c,v]),{status:u,subscribe:k,unsubscribe:T,send:C}}({enabled:r,onEvent:(0,o.useCallback)(e=>{s.current.forEach(t=>{try{t(e)}catch(e){}})},[])}),p=(0,o.useCallback)(e=>{var t;let r=l.current,n=null!=(t=r.get(e))?t:0;r.set(e,n+1),0===n&&d(e)},[d]),g=(0,o.useCallback)(e=>{var t;let r=l.current,n=null!=(t=r.get(e))?t:0;n<=1?(r.delete(e),f(e)):r.set(e,n-1)},[f]),y=(0,o.useCallback)(e=>(s.current.add(e),()=>{s.current.delete(e)}),[]),m=(0,o.useMemo)(()=>({status:u,connected:"connected"===u,subscribe:p,unsubscribe:g,addListener:y}),[u,p,g,y]);return(0,n.jsx)(c.Provider,{value:m,children:t})}function d(){var e;return null!=(e=(0,o.useContext)(c))?e:l}function f(e){let{addListener:t}=d(),r=(0,o.useRef)(e);r.current=e,(0,o.useEffect)(()=>t(e=>r.current(e)),[t])}},65380:(e,t,r)=>{r.d(t,{H:()=>s,O:()=>a});var n=r(95155),o=r(12115);let i=(0,o.createContext)(!1);function a(e){let{children:t,authEnabled:r}=e;return(0,n.jsx)(i.Provider,{value:r,children:t})}function s(){return(0,o.useContext)(i)}},66966:(e,t,r)=>{r.d(t,{g7:()=>l,rC:()=>u,Fn:()=>c});var n=r(95155),o=r(12115),i=r(63365),a=r(39649);let s=(0,o.createContext)(null);function l(e){let{children:t}=e,{worktrees:r,repositories:l,isLoading:c,error:u,refresh:d}=function(){let[e,t]=(0,o.useState)([]),[r,n]=(0,o.useState)([]),[a,s]=(0,o.useState)(!0),[l,c]=(0,o.useState)(null),u=(0,o.useRef)(null),d=(0,o.useRef)([]),f=(0,o.useRef)(null),{connected:p,subscribe:g,unsubscribe:y,addListener:m}=(0,i.xM)(),w=(0,o.useRef)(p);w.current=p;let h=(0,o.useCallback)(async()=>{try{var e,r;c(null);let i=await fetch("/api/worktrees");if(!i.ok)throw Error("Failed to fetch worktrees: ".concat(i.status));let a=await i.json(),s=null!=(e=a.worktrees)?e:[],l=null!=(r=a.repositories)?r:[];(0,o.startTransition)(()=>{t(s),n(l)}),d.current=s}catch(e){c(e instanceof Error?e:Error(String(e)))}finally{s(!1)}},[]);(0,o.useEffect)(()=>{h()},[h]);let S=(0,o.useCallback)(()=>d.current.some(e=>!0===e.isSessionRunning),[]),b=(0,o.useCallback)(()=>{let e=S();return w.current?e?2e4:6e4:e?5e3:3e4},[S]),v=(0,o.useCallback)(()=>{null!==u.current&&(clearInterval(u.current),u.current=null),f.current=null},[]),E=(0,o.useCallback)(()=>{v();let e=b();f.current=e,u.current=setInterval(()=>{h()},e)},[b,h,v]);(0,o.useEffect)(()=>{let e=()=>{document.hidden?v():(h(),E())},t=setTimeout(()=>{E()},0);return document.addEventListener("visibilitychange",e),()=>{clearTimeout(t),v(),document.removeEventListener("visibilitychange",e)}},[h,E,v]),(0,o.useEffect)(()=>{if(d.current=e,"undefined"!=typeof document&&document.hidden||null===f.current)return;let t=b();f.current!==t&&E()},[e,p,b,E]);let C=e.map(e=>e.id).sort().join(" ");return(0,o.useEffect)(()=>{let e=C.length>0?C.split(" "):[];return e.forEach(e=>g(e)),()=>{e.forEach(e=>y(e))}},[C,g,y]),(0,o.useEffect)(()=>m(e=>{if("session_status_changed"===e.type&&"string"==typeof e.worktreeId){let i=e.worktreeId,a=e.isWaitingForResponse;if("boolean"==typeof a){var r,n;let s=null!=(r=e.instance)?r:null,l=null!=(n=e.waitingKind)?n:null;(0,o.startTransition)(()=>{t(e=>{let t=!1,r=e.map(e=>{if(e.id!==i)return e;let r=function(e,t){var r,n,o;let i,a=null!=(n=t.instance)?n:null,s=a?null==(r=e.sessionStatusByInstance)?void 0:r[a]:void 0,l=e.sessionStatusByInstance;if(a&&s&&s.isWaitingForResponse!==t.waiting&&(l={...e.sessionStatusByInstance,[a]:{...s,isWaitingForResponse:t.waiting,waitingKind:null!=(o=t.waitingKind)?o:null}}),t.waiting)i=!0;else{let e=l?Object.values(l):[];i=e.length>0&&e.some(e=>(null==e?void 0:e.isWaitingForResponse)===!0)}return l===e.sessionStatusByInstance&&i===e.isWaitingForResponse?e:{...e,sessionStatusByInstance:l,isWaitingForResponse:i}}(e,{waiting:a,instance:s,waitingKind:l});return r!==e&&(t=!0),r});return t?r:e})});return}let s=e.isRunning;if("boolean"==typeof s){if((null!=e.cliTool||null!=e.instance)&&!1===s)return void h();(0,o.startTransition)(()=>{t(e=>{let t=!1,r=e.map(e=>e.id===i&&e.isSessionRunning!==s?(t=!0,{...e,isSessionRunning:s}):e);return t?r:e})})}}else("message"===e.type||"message_updated"===e.type)&&h()}),[m,h]),{worktrees:e,repositories:r,isLoading:a,error:l,refresh:h}}(),f=(0,o.useMemo)(()=>({worktrees:r,repositories:l,isLoading:c,error:u,refresh:d}),[r,l,c,u,d]);return(0,n.jsx)(s.Provider,{value:f,children:(0,n.jsx)(a.H8,{externalWorktrees:r,externalRepositories:l,children:t})})}function c(){let e=(0,o.useContext)(s);if(null===e)throw Error("useWorktreesCacheContext must be used within a WorktreesCacheProvider");return e}function u(){return(0,o.useContext)(s)}},68704:(e,t,r)=>{r.d(t,{Uf:()=>i,d8:()=>a,fM:()=>s,of:()=>c,r5:()=>o,rq:()=>l});var n=r(2317);let o="medium",i=["large","medium","small","xsmall"],a={large:{value:"large",rootFontSizePx:18,factor:1.125,terminalFontSize:16},medium:{value:"medium",rootFontSizePx:16,factor:1,terminalFontSize:14},small:{value:"small",rootFontSizePx:14,factor:.875,terminalFontSize:12},xsmall:{value:"xsmall",rootFontSizePx:12.5,factor:.78,terminalFontSize:11}};function s(e){return"string"==typeof e&&Object.prototype.hasOwnProperty.call(a,e)}function l(e){return a[e].terminalFontSize}function c(){let{value:e,setValue:t,isAvailable:r}=(0,n.V)({key:"mcbd-pc-display-size",defaultValue:o,validate:s});return{size:e,setSize:t,isAvailable:r}}},70628:(e,t,r)=>{r.d(t,{K:()=>s,S:()=>a});var n=r(95155),o=r(12115);let i=(0,o.createContext)({open:!1,setOpen:()=>{},toggle:()=>{}});function a(e){let{children:t}=e,[r,a]=(0,o.useState)(!1),s=(0,o.useCallback)(()=>a(e=>!e),[]),l=(0,o.useMemo)(()=>({open:r,setOpen:a,toggle:s}),[r,s]);return(0,n.jsx)(i.Provider,{value:l,children:t})}function s(){return(0,o.useContext)(i)}},80344:(e,t,r)=>{r.d(t,{$T:()=>c,GQ:()=>d,Rx:()=>s,gC:()=>l,hD:()=>n,hS:()=>u,y:()=>a});class n extends Error{constructor(e,t,r){super(e),this.status=t,this.data=r,this.name="ApiError"}}async function o(e,t,r){if(!(e.headers.get("content-type")||"").includes("application/json"))return t;try{return await e.json()}catch(e){return t}}async function i(e,t){try{let r=new Headers(null==t?void 0:t.headers);r.set("Content-Type","application/json");let i=await fetch(e,{...t,headers:r}),a=i.headers.get("content-type")||"";if(i.redirected&&i.url.includes("/login"))throw new n("Authentication required",401);if(!i.ok){let e=await o(i,{},"error-body");throw new n(e.error||"HTTP error ".concat(i.status),i.status,e)}if(!a.includes("application/json"))throw new n("Unexpected response format",i.status);return i.json()}catch(e){if(e instanceof n)throw e;throw new n(e instanceof Error?e.message:"Unknown error",0,e)}}let a={getAll:async()=>i("/api/worktrees"),getById:async e=>i("/api/worktrees/".concat(e)),updateDescription:async(e,t)=>i("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({description:t})}),updateLink:async(e,t)=>i("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({link:t})}),toggleFavorite:async(e,t)=>i("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({favorite:t})}),updateStatus:async(e,t)=>i("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({status:t})}),updateCliTool:async(e,t)=>i("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({cliToolId:t})}),markAsViewed:async e=>i("/api/worktrees/".concat(e,"/viewed"),{method:"PATCH"}),async getMessages(e,t,r,n){let o=new URLSearchParams;return t&&o.append("cliTool",t),r&&o.append("includeArchived","true"),"number"==typeof n&&Number.isFinite(n)&&o.append("limit",String(n)),i("/api/worktrees/".concat(e,"/messages").concat(o.toString()?"?".concat(o.toString()):""))},async sendMessage(e,t,r){let n={content:t};return(null==r?void 0:r.cliToolId)&&(n.cliToolId=r.cliToolId),(null==r?void 0:r.instanceId)&&(n.instanceId=r.instanceId),(null==r?void 0:r.imagePath)&&(n.imagePath=r.imagePath),i("/api/worktrees/".concat(e,"/send"),{method:"POST",body:JSON.stringify(n)})},async uploadImageFile(e,t){let r=Date.now(),n="".concat(r,"-").concat(t.name),i=".commandmate/attachments",a=new FormData;a.append("file",new File([t],n,{type:t.type}));let s=await fetch("/api/worktrees/".concat(e,"/upload/").concat(i),{method:"POST",body:a});if(!s.ok){var l;let e=await o(s,{},"error-body");throw Error((null==e||null==(l=e.error)?void 0:l.message)||"Upload failed (HTTP ".concat(s.status,")"))}return{path:(await o(s,{},"response-body")).path||"".concat(i,"/").concat(n)}},getLogs:async e=>i("/api/worktrees/".concat(e,"/logs")),async getLogFile(e,t,r){let n=(null==r?void 0:r.sanitize)?"?sanitize=true":"";return i("/api/worktrees/".concat(e,"/logs/").concat(t).concat(n))},async killSession(e,t,r){let n=new URLSearchParams;t&&n.set("cliTool",t),r&&n.set("instance",r);let o=n.toString();return i("/api/worktrees/".concat(e,"/kill-session").concat(o?"?".concat(o):""),{method:"POST"})}},s={scan:async e=>i("/api/repositories/scan",{method:"POST",body:JSON.stringify({repositoryPath:e})}),sync:async()=>i("/api/repositories/sync",{method:"POST"}),delete:async e=>i("/api/repositories",{method:"DELETE",body:JSON.stringify({repositoryPath:e})}),async clone(e,t){var r;return i("/api/repositories/clone",{method:"POST",body:JSON.stringify({cloneUrl:e,fork:null!=(r=null==t?void 0:t.fork)&&r})})},getCloneStatus:async e=>i("/api/repositories/clone/".concat(e)),getExcluded:async()=>i("/api/repositories/excluded"),restore:async e=>i("/api/repositories/restore",{method:"PUT",body:JSON.stringify({repositoryPath:e})}),list:async()=>i("/api/repositories"),updateDisplayName:async(e,t)=>i("/api/repositories/".concat(encodeURIComponent(e)),{method:"PUT",body:JSON.stringify({displayName:t})}),updateVisibility:async(e,t)=>i("/api/repositories/".concat(encodeURIComponent(e)),{method:"PUT",body:JSON.stringify({visible:t})}),updateEnabled:async(e,t)=>i("/api/repositories/".concat(encodeURIComponent(e)),{method:"PUT",body:JSON.stringify({enabled:t})}),validatePath:async e=>i("/api/repositories/validate-path",{method:"POST",body:JSON.stringify({repositoryPath:e})})},l={async browse(e){let t=e?"?path=".concat(encodeURIComponent(e)):"";return i("/api/fs/browse".concat(t))},addRecentPath:async e=>i("/api/fs/recent-paths",{method:"POST",body:JSON.stringify({path:e})})},c={getAll:async e=>(await i("/api/worktrees/".concat(e,"/memos"))).memos,create:async(e,t)=>(await i("/api/worktrees/".concat(e,"/memos"),{method:"POST",body:JSON.stringify(t||{})})).memo,update:async(e,t,r)=>(await i("/api/worktrees/".concat(e,"/memos/").concat(t),{method:"PUT",body:JSON.stringify(r)})).memo,delete:async(e,t)=>i("/api/worktrees/".concat(e,"/memos/").concat(t),{method:"DELETE"}),async reorder(e,t){await i("/api/worktrees/".concat(e,"/memos"),{method:"PATCH",body:JSON.stringify({memoIds:t})})}};function u(e){return e instanceof n||e instanceof Error?e.message:"An unknown error occurred"}let d={checkForUpdate:async()=>i("/api/app/update-check",{method:"GET"}),startUpdate:async()=>i("/api/app/update",{method:"POST"}),async ping(){try{return(await fetch("/api/auth/status",{cache:"no-store"})).ok}catch(e){return!1}}}},89275:(e,t,r)=>{r.d(t,{Bo:()=>u,Hq:()=>l});var n=r(95155),o=r(12115),i=r(20063);let a={startTransition:e=>e()},s=(0,o.createContext)(null);function l(){var e;let t=(0,i.useRouter)(),{startTransition:r}=null!=(e=(0,o.useContext)(s))?e:a;return(0,o.useMemo)(()=>({push:e=>r(()=>t.push(e)),replace:e=>r(()=>t.replace(e))}),[t,r])}function c(e){let{onCommit:t}=e,r=(0,i.usePathname)(),n=(0,o.useRef)(!1);return(0,o.useEffect)(()=>{if(!n.current){n.current=!0;return}t()},[r,t]),null}function u(e){let{children:t}=e,r=(0,o.useRef)(null),i=(0,o.useCallback)(()=>{var e;null==(e=r.current)||e.call(r)},[]),a=(0,o.useCallback)(e=>{var t;t=()=>new Promise(t=>{let n=!1,o=()=>{n||(n=!0,t())};r.current=o,e(),window.setTimeout(o,500)}),"undefined"==typeof document||"function"!=typeof document.startViewTransition||"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?t():document.startViewTransition(t)},[]),l=(0,o.useMemo)(()=>({startTransition:a}),[a]);return(0,n.jsxs)(s.Provider,{value:l,children:[(0,n.jsx)(c,{onCommit:i}),t]})}},92614:(e,t,r)=>{r.d(t,{C:()=>s,E:()=>a});var n=r(95155),o=r(12115);let i=(0,o.createContext)({open:!1,setOpen:()=>{},toggle:()=>{}});function a(e){let{children:t}=e,[r,a]=(0,o.useState)(!1),s=(0,o.useCallback)(()=>a(e=>!e),[]),l=(0,o.useMemo)(()=>({open:r,setOpen:a,toggle:s}),[r,s]);return(0,n.jsx)(i.Provider,{value:l,children:t})}function s(){return(0,o.useContext)(i)}},94442:(e,t,r)=>{r.d(t,{dj:()=>v,tE:()=>b});var n=r(95155),o=r(12115),i=r(47650),a=r(18955),s=r(42529),l=r(78874),c=r(52056),u=r(23327),d=r(65229),f=r(59854),p=r(9900),g=r(9286);function y(e){let{type:t,iconColor:r}=e,o="h-5 w-5 ".concat(r);switch(t){case"success":return(0,n.jsx)(s.A,{className:o,"data-testid":"toast-icon-success"});case"error":return(0,n.jsx)(l.A,{className:o,"data-testid":"toast-icon-error"});case"warning":return(0,n.jsx)(c.A,{className:o,"data-testid":"toast-icon-warning"});default:return(0,n.jsx)(u.A,{className:o,"data-testid":"toast-icon-info"})}}function m(e){let{id:t,message:r,type:i,onClose:s,duration:l=3e3,onClick:c}=e,u=(0,a.c)("common"),f=(0,o.useRef)(null),m=function(e){switch(e){case"success":return{bgColor:"bg-success-subtle",borderColor:"border-success-border",textColor:"text-success-foreground",iconColor:"text-success-foreground"};case"error":return{bgColor:"bg-danger-subtle",borderColor:"border-danger-border",textColor:"text-danger-foreground",iconColor:"text-danger-foreground"};case"warning":return{bgColor:"bg-warning-subtle",borderColor:"border-warning-border",textColor:"text-warning-foreground",iconColor:"text-warning-foreground"};default:return{bgColor:"bg-info-subtle",borderColor:"border-info-border",textColor:"text-info-foreground",iconColor:"text-info-foreground"}}}(i),[w,h]=(0,o.useState)(!0),{shouldRender:S,isExiting:b}=(0,g.O)(w,p.Ys),v=(0,o.useRef)(s);v.current=s,(0,o.useEffect)(()=>{S||v.current(t)},[S,t]),(0,o.useEffect)(()=>(l>0&&(f.current=setTimeout(()=>{h(!1)},l)),()=>{f.current&&clearTimeout(f.current)}),[l]);let E=(0,o.useCallback)(()=>{f.current&&clearTimeout(f.current),h(!1)},[]);return(0,n.jsxs)("div",{"data-testid":"toast-".concat(t),role:"alert",className:"\n ".concat(m.bgColor,"\n ").concat(m.borderColor,"\n ").concat(m.textColor,"\n border rounded-lg shadow-lg p-4 min-w-[300px] max-w-[400px]\n flex items-start gap-3\n ").concat(b?"animate-out fade-out-0 slide-out-to-right-full duration-200 fill-mode-forwards pointer-events-none":"animate-slide-in","\n "),children:[(0,n.jsx)(y,{type:i,iconColor:m.iconColor}),c?(0,n.jsx)("button",{type:"button","data-testid":"toast-action-button",onClick:()=>{c(),E()},className:"flex-1 text-left text-sm font-medium underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:r}):(0,n.jsx)("p",{className:"flex-1 text-sm font-medium",children:r}),(0,n.jsx)("button",{"data-testid":"toast-close-button",onClick:E,"aria-label":u("closeNotification"),className:"\n ".concat(m.textColor,"\n hover:opacity-70\n focus:outline-none focus:ring-2 focus:ring-offset-2\n transition-opacity\n "),children:(0,n.jsx)(d.A,{className:"h-4 w-4"})})]})}function w(e){let{toasts:t,onClose:r}=e,[a,s]=(0,o.useState)(!1);(0,o.useEffect)(()=>{s(!0)},[]);let l=(0,n.jsx)("div",{"data-testid":"toast-container","aria-live":"polite",className:"fixed bottom-4 right-4 flex flex-col gap-2",style:{zIndex:f.M.TOAST},children:t.map(e=>(0,n.jsx)(m,{id:e.id,message:e.message,type:e.type,onClose:r,duration:e.duration,onClick:e.onClick},e.id))});return a?(0,i.createPortal)(l,document.body):null}function h(){let[e,t]=(0,o.useState)([]),r=(0,o.useRef)(0),n=(0,o.useCallback)(function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3,i=arguments.length>3?arguments[3]:void 0,a="toast-".concat(++r.current,"-").concat(Date.now()),s={id:a,message:e,type:n,duration:o,...(null==i?void 0:i.onClick)?{onClick:i.onClick}:{}};return t(e=>[...e,s]),a},[]),i=(0,o.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]),a=(0,o.useCallback)(()=>{t([])},[]);return(0,o.useMemo)(()=>({toasts:e,showToast:n,removeToast:i,clearToasts:a}),[e,n,i,a])}let S=(0,o.createContext)(null);function b(e){let{children:t}=e,r=h();return(0,n.jsxs)(S.Provider,{value:r,children:[t,(0,n.jsx)(w,{toasts:r.toasts,onClose:r.removeToast})]})}function v(){let e=(0,o.useContext)(S),t=h();return null!=e?e:t}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6381],{2317:(e,t,r)=>{r.d(t,{V:()=>i});var n=r(12115);function o(){try{let e="__localStorage_test__";return window.localStorage.setItem(e,"test"),window.localStorage.removeItem(e),!0}catch(e){return!1}}function i(e){let{key:t,defaultValue:r,validate:i,serialize:a=JSON.stringify,deserialize:s=JSON.parse}=e,l=(0,n.useRef)(r),c=(0,n.useRef)(i),u=(0,n.useRef)(a),d=(0,n.useRef)(s);l.current=r,c.current=i,u.current=a,d.current=s;let[f,p]=(0,n.useState)(!1),[g,y]=(0,n.useState)(r),m=(0,n.useCallback)(()=>{if(!o())return l.current;try{let e=window.localStorage.getItem(t);if(null===e)return l.current;let r=d.current(e);if(c.current)return c.current(r)?r:l.current;return r}catch(e){return l.current}},[t]),w=(0,n.useCallback)(e=>{if(o())try{let r=u.current(e);window.localStorage.setItem(t,r)}catch(e){}},[t]),h=(0,n.useCallback)(e=>{y(t=>{let r="function"==typeof e?e(t):e;return w(r),r})},[w]),S=(0,n.useCallback)(()=>{if(o())try{window.localStorage.removeItem(t)}catch(e){}y(l.current)},[t]);return(0,n.useEffect)(()=>{p(o()),y(m())},[m]),{value:g,setValue:h,removeValue:S,isAvailable:f}}},7636:(e,t,r)=>{r.d(t,{LV:()=>c,Si:()=>i,UZ:()=>s,Xn:()=>f,_s:()=>p,nO:()=>u,s6:()=>l});var n=r(38606);let o=["updatedAt","repositoryName","branchName","status","lastSent"],i=e=>o.includes(e),a={waiting:0,ready:1,running:2,generating:3,idle:4};function s(e){let t=new Set;for(let r of e)!1===r.visible&&t.add(r.path);return t}function l(e,t){return 0===t.size?e.slice():e.filter(e=>{let r=e.repositoryPath;return!r||!t.has(r)})}function c(e){let t=function(e){let t=5381;for(let r=0;r<e.length;r++)t=(t<<5)+t+e.charCodeAt(r)|0;return Math.abs(t)}(e)%360;return"hsl(".concat(t,", ").concat(65,"%, ").concat(60,"%)")}function u(e,t){if(!e&&!t)return 0;if(!e)return 1;if(!t)return -1;let r=e instanceof Date?e.getTime():new Date(e).getTime();return(t instanceof Date?t.getTime():new Date(t).getTime())-r}function d(e){return"waiting"===(e.cliStatus&&Object.keys(e.cliStatus).length>0?(0,n.A7)(e.cliStatus):e.status)}function f(e,t,r){let n=[...e],o="status"!==t;return n.sort((e,n)=>{if(o){let t=Number(d(n))-Number(d(e));if(0!==t)return t}let i=0;switch(t){case"updatedAt":{let t=e=>e?e instanceof Date?e.getTime():new Date(e).getTime():0,r=t(e.lastActivity);i=t(n.lastActivity)-r;break}case"repositoryName":{let t=e.repositoryName.toLowerCase(),r=n.repositoryName.toLowerCase();i=t.localeCompare(r);break}case"branchName":{let t=e.name.toLowerCase(),r=n.name.toLowerCase();i=t.localeCompare(r);break}case"status":i=a[e.status]-a[n.status];break;case"lastSent":{let t=u(e.lastActivity,n.lastActivity);if(!e.lastActivity&&!n.lastActivity){i=0;break}if(!e.lastActivity)return 1;if(!n.lastActivity)return -1;i=t;break}default:i=0}return("updatedAt"===t||"lastSent"===t?"desc"===r:"asc"===r)?i:-i}),n}function p(e,t,r){let n=new Map;for(let t of e){let e=t.repositoryName;n.has(e)||n.set(e,[]),n.get(e).push(t)}return[...n.keys()].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase())).map(e=>({repositoryName:e,branches:f(n.get(e),t,r)}))}},22592:(e,t,r)=>{r.d(t,{Ps:()=>d,W5:()=>u});var n=r(95155),o=r(12115),i=r(38218),a=r(68704);let s="data-pc-size",l={size:a.r5,setSize:()=>{},isMobile:!1,factor:a.d8[a.r5].factor,isAvailable:!1},c=(0,o.createContext)(l);function u(e){let{children:t}=e,{size:r,setSize:l,isAvailable:u}=(0,a.of)(),d=(0,i.a)();(0,o.useEffect)(()=>{if("undefined"==typeof document)return;let e=document.documentElement;return d?void e.removeAttribute(s):(e.setAttribute(s,r),()=>{e.removeAttribute(s)})},[r,d]);let f=(0,o.useMemo)(()=>({size:r,setSize:l,isMobile:d,factor:a.d8[r].factor,isAvailable:u}),[r,l,d,u]);return(0,n.jsx)(c.Provider,{value:f,children:t})}function d(){return(0,o.useContext)(c)}},24373:(e,t,r)=>{r.d(t,{Kg:()=>i,Lv:()=>a});var n=r(12115),o=r(66966);function i(e){let t=0;for(let r of e)!0===r.isWaitingForResponse&&t++;return t}function a(){let e=(0,o.rC)(),t=null==e?void 0:e.worktrees;return(0,n.useMemo)(()=>{let e=t?t.filter(e=>!0===e.isWaitingForResponse):[];return{count:e.length,worktrees:e}},[t])}r(44308)},32916:(e,t,r)=>{r.d(t,{GB:()=>u,VF:()=>d});var n=r(95155),o=r(12115),i=r(7636);let a="updatedAt",s=(0,o.createContext)(null);function l(e,t,r,n){let i=(0,o.useRef)(!0);(0,o.useEffect)(()=>{try{let t=localStorage.getItem(e);t&&n(t)}catch(e){}},[]),(0,o.useEffect)(()=>{if(i.current){i.current=!1;return}try{localStorage.setItem(e,r())}catch(e){}},[t])}function c(e,t){switch(t.type){case"TOGGLE":return{...e,isOpen:!e.isOpen};case"SET_WIDTH":return{...e,width:t.width};case"OPEN_MOBILE_DRAWER":return{...e,isMobileDrawerOpen:!0};case"CLOSE_MOBILE_DRAWER":return{...e,isMobileDrawerOpen:!1};case"SET_SORT_KEY":return{...e,sortKey:t.sortKey};case"SET_SORT_DIRECTION":return{...e,sortDirection:t.sortDirection};case"LOAD_SORT_SETTINGS":return{...e,sortKey:t.sortKey,sortDirection:t.sortDirection};case"SET_VIEW_MODE":return{...e,viewMode:t.viewMode};default:return e}}function u(e){let{children:t,initialOpen:r=!0,initialWidth:u=224}=e,[d,f]=(0,o.useReducer)(c,{isOpen:r,width:u,isMobileDrawerOpen:!1,sortKey:a,sortDirection:"desc",viewMode:"grouped"});l("mcbd-sidebar-sort","".concat(d.sortKey,":").concat(d.sortDirection),()=>JSON.stringify({sortKey:d.sortKey,sortDirection:d.sortDirection}),e=>{try{let t=JSON.parse(e),r=t.sortDirection,n=(0,i.Si)(t.sortKey)?t.sortKey:a;n&&("asc"===r||"desc"===r)&&f({type:"LOAD_SORT_SETTINGS",sortKey:n,sortDirection:r})}catch(e){}}),l("mcbd-sidebar-view-mode",d.viewMode,()=>d.viewMode,e=>{("grouped"===e||"flat"===e)&&f({type:"SET_VIEW_MODE",viewMode:e})}),l("mcbd-sidebar-width",d.width,()=>String(d.width),e=>{let t=Number(e);!isNaN(t)&&t>0&&f({type:"SET_WIDTH",width:288===t?224:t})});let p=(0,o.useCallback)(()=>{f({type:"TOGGLE"})},[]),g=(0,o.useCallback)(e=>{f({type:"SET_WIDTH",width:e})},[]),y=(0,o.useCallback)(()=>{f({type:"OPEN_MOBILE_DRAWER"})},[]),m=(0,o.useCallback)(()=>{f({type:"CLOSE_MOBILE_DRAWER"})},[]),w=(0,o.useCallback)(e=>{f({type:"SET_SORT_KEY",sortKey:e})},[]),h=(0,o.useCallback)(e=>{f({type:"SET_SORT_DIRECTION",sortDirection:e})},[]),S=(0,o.useCallback)(e=>{f({type:"SET_VIEW_MODE",viewMode:e})},[]),b=(0,o.useMemo)(()=>({isOpen:d.isOpen,width:d.width,isMobileDrawerOpen:d.isMobileDrawerOpen,sortKey:d.sortKey,sortDirection:d.sortDirection,toggle:p,setWidth:g,openMobileDrawer:y,closeMobileDrawer:m,setSortKey:w,setSortDirection:h,viewMode:d.viewMode,setViewMode:S}),[d.isOpen,d.width,d.isMobileDrawerOpen,d.sortKey,d.sortDirection,d.viewMode,p,g,y,m,w,h,S]);return(0,n.jsx)(s.Provider,{value:b,children:t})}function d(){let e=(0,o.useContext)(s);if(!e)throw Error("useSidebarContext must be used within a SidebarProvider");return e}},38218:(e,t,r)=>{r.d(t,{D:()=>i,a:()=>a});var n=r(12115);let o=n.useLayoutEffect,i=768;function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{breakpoint:t=i}=e,[r,a]=(0,n.useState)(!1);return o(()=>{let e=window.matchMedia("(max-width: ".concat(t-1,"px)"));a(e.matches);let r=e=>{a(e.matches)};return e.addEventListener("change",r),()=>{e.removeEventListener("change",r)}},[t]),r}},38606:(e,t,r)=>{r.d(t,{A7:()=>l,kA:()=>i,f_:()=>d,dw:()=>c,XK:()=>f});var n=r(54014),o=r(63001);function i(e){return e?e.isWaitingForResponse?"waiting":e.isProcessing?"running":e.isRunning?"ready":"idle":"idle"}let a={start:"nextAction.start",sendMessage:"nextAction.sendMessage",approveReject:"nextAction.approveReject",replyToPrompt:"nextAction.replyToPrompt",checkStalled:"nextAction.checkStalled",running:"nextAction.running"};Object.values(a);let s={idle:null,ready:"ready",running:"running",generating:"running",waiting:"waiting"};function l(e){if(!e)return"idle";let t=Object.values(e).filter(e=>void 0!==e);return 0===t.length?"idle":t.includes("waiting")?"waiting":t.includes("running")?"running":t.includes("generating")?"generating":t.includes("ready")?"ready":"idle"}function c(e,t){return e?Object.entries(e).map(e=>{var r;let[o,i]=e;return"".concat(null!=(r=null==t?void 0:t[o])?r:(0,n.f_)(o,o),": ").concat(null!=i?i:"idle")}).join(", "):""}let u=["prompt","menu","unclassified"];function d(e){var t,r,n;let o=Object.values(null!=(r=null!=(t=e.sessionStatusByInstance)?t:e.sessionStatusByCli)?r:{}).filter(e=>void 0!==e),i=!1,a=new Set;for(let e of o)e.awaitingInstruction&&(i=!0),e.waitingKind&&a.add(e.waitingKind);return{waitingKind:null!=(n=u.find(e=>a.has(e)))?n:null,awaitingInstruction:i}}function f(e){var t,r,c,u,f,p;let g=i(void 0!==e.isSessionRunning?{isRunning:null!=(t=e.isSessionRunning)&&t,isWaitingForResponse:null!=(r=e.isWaitingForResponse)&&r,isProcessing:null!=(c=e.isProcessing)&&c}:void 0),y=!!e.lastAssistantMessageAt&&(!e.lastViewedAt||new Date(e.lastAssistantMessageAt)>new Date(e.lastViewedAt)),{cliStatus:m,cliStatusLabels:w}=function(e){var t,r,a;let s={},l={},c=e.sessionStatusByInstance;if(!c){for(let a of null!=(t=e.selectedAgents)?t:o.fJ)s[a]=i(null==(r=e.sessionStatusByCli)?void 0:r[a]),l[a]=(0,n.oo)(a);return{cliStatus:s,cliStatusLabels:l}}let u=e.agentInstances&&e.agentInstances.length>0?e.agentInstances:(0,n.lu)(null!=(a=e.selectedAgents)?a:o.fJ),d=new Set;for(let e of u)d.add(e.id),s[e.id]=i(c[e.id]),l[e.id]=(0,n.sw)(e);for(let[e,t]of Object.entries(c)){if(d.has(e))continue;let r=i(t);"idle"!==r&&(s[e]=r,l[e]=function(e){let t=n.XH.find(t=>e.startsWith("".concat(t,"-")));if(t){let r=e.slice(t.length+1);return"".concat((0,n.oo)(t)," ").concat(r)}return(0,n.f_)(e,e)}(e))}return{cliStatus:s,cliStatusLabels:l}}(e),h=l(m),{waitingKind:S,awaitingInstruction:b}=d(e);return{id:e.id,name:e.name,repositoryName:null!=(u=e.repositoryDisplayName)?u:e.repositoryName,status:g,hasUnread:y,lastActivity:e.updatedAt,description:e.description,cliStatus:m,cliStatusLabels:w,worktreePath:e.path,waitingKind:S,awaitingInstruction:b,nextActionKey:(f=s[h],p="waiting"===h?"approval":null,f&&"idle"!==f?"ready"===f?a.sendMessage:"waiting"===f&&"approval"===p?a.approveReject:"waiting"===f?a.replyToPrompt:(0,a.running):a.start)}}},39649:(e,t,r)=>{r.d(t,{$f:()=>d,H8:()=>u});var n=r(95155),o=r(12115),i=r(80344);let a={PROCESSING:2e3,SESSION_RUNNING:5e3,IDLE:1e4},s=(0,o.createContext)(null),l={selectedWorktreeId:null,worktrees:[],repositories:[],selectedWorktreeDetail:null,isLoading:!0,isLoadingDetail:!1,error:null};function c(e,t){switch(t.type){case"SET_WORKTREES":return{...e,worktrees:t.worktrees,isLoading:!1};case"SET_REPOSITORIES":return{...e,repositories:t.repositories};case"SELECT_WORKTREE":{var r;let n=null!=(r=e.worktrees.find(e=>e.id===t.id))?r:null;return{...e,selectedWorktreeId:t.id,selectedWorktreeDetail:null!=n?n:e.selectedWorktreeDetail,isLoadingDetail:null===n}}case"SET_WORKTREE_DETAIL":return{...e,selectedWorktreeDetail:t.detail};case"SET_LOADING":return{...e,isLoading:t.isLoading};case"SET_LOADING_DETAIL":return{...e,isLoadingDetail:t.isLoadingDetail};case"SET_ERROR":return{...e,error:t.error,isLoading:!1};default:return e}}function u(e){let{children:t,externalWorktrees:r,externalRepositories:u}=e,d=void 0!==r,[f,p]=(0,o.useReducer)(c,l);(0,o.useEffect)(()=>{d&&r&&p({type:"SET_WORKTREES",worktrees:r})},[d,r]),(0,o.useEffect)(()=>{d&&u&&p({type:"SET_REPOSITORIES",repositories:u})},[d,u]);let g=(0,o.useCallback)(async()=>{if(!d){p({type:"SET_LOADING",isLoading:!0}),p({type:"SET_ERROR",error:null});try{var e;let t=await i.y.getAll();p({type:"SET_WORKTREES",worktrees:t.worktrees}),p({type:"SET_REPOSITORIES",repositories:null!=(e=t.repositories)?e:[]})}catch(e){p({type:"SET_ERROR",error:e instanceof Error?e.message:"Failed to fetch worktrees"})}}},[d]),y=(0,o.useCallback)(async e=>{p({type:"SELECT_WORKTREE",id:e}),p({type:"SET_ERROR",error:null});try{i.y.markAsViewed(e).catch(e=>{console.warn("[WorktreeSelectionContext] Failed to mark as viewed:",e)});let t=await i.y.getById(e);p({type:"SET_WORKTREE_DETAIL",detail:t})}catch(e){p({type:"SET_ERROR",error:e instanceof Error?e.message:"Failed to fetch worktree detail"})}finally{p({type:"SET_LOADING_DETAIL",isLoadingDetail:!1})}},[]),m=(0,o.useCallback)(async()=>{await g()},[g]);(0,o.useEffect)(()=>{d||g()},[g,d]),(0,o.useEffect)(()=>{if(d)return;let e=null,t=!0,r=async()=>{if(t)try{var n,o;let s=await i.y.getAll();p({type:"SET_WORKTREES",worktrees:s.worktrees}),p({type:"SET_REPOSITORIES",repositories:null!=(n=s.repositories)?n:[]});let l=(o=s.worktrees).some(e=>e.isProcessing||e.isWaitingForResponse)?a.PROCESSING:o.some(e=>e.isSessionRunning)?a.SESSION_RUNNING:a.IDLE;t&&(e=setTimeout(r,l))}catch(n){if(n instanceof i.hD&&401===n.status)return;console.error("[WorktreeSelectionContext] Polling error:",n),t&&(e=setTimeout(r,a.SESSION_RUNNING))}};return r(),()=>{t=!1,e&&clearTimeout(e)}},[d]);let w={selectedWorktreeId:f.selectedWorktreeId,worktrees:f.worktrees,repositories:f.repositories,selectedWorktreeDetail:f.selectedWorktreeDetail,isLoadingDetail:f.isLoadingDetail,error:f.error,selectWorktree:y,refreshWorktrees:m};return(0,n.jsx)(s.Provider,{value:w,children:t})}function d(){let e=(0,o.useContext)(s);if(!e)throw Error("useWorktreeSelection must be used within a WorktreeSelectionProvider");return e}},44308:(e,t,r)=>{r.d(t,{$h:()=>d,DR:()=>o,IH:()=>c,Iu:()=>n,Nb:()=>f,SD:()=>i,_d:()=>l,bm:()=>p,ks:()=>s,t7:()=>u,z7:()=>a});let n=7e3,o=["in_review","approval","stalled"],i="in_review",a="filter",s="/review?".concat(a,"=approval");function l(e){return e&&o.includes(e)?e:null}let c=["claude","codex","copilot","antigravity"],u=1e3,d=5,f=100,p=1e3},52703:(e,t,r)=>{r.d(t,{Oo:()=>o,ST:()=>n,zS:()=>i});let n="client_version",o="version_mismatch";function i(e){let t;try{t=JSON.parse(e)}catch(e){return null}if(!t||"object"!=typeof t)return null;let r=t;if("broadcast"===r.type){let e=r.data;return e&&"object"==typeof e?"string"!=typeof e.type?null:(void 0===e.worktreeId&&"string"==typeof r.worktreeId&&(e.worktreeId=r.worktreeId),e):null}return"string"==typeof r.type?r:null}},54014:(e,t,r)=>{r.d(t,{Ab:()=>o,NL:()=>m,O6:()=>p,XH:()=>n,f_:()=>d,hR:()=>c,lu:()=>g,n6:()=>s,oo:()=>u,pQ:()=>i,sw:()=>f,vz:()=>y});let n=["claude","codex","gemini","vibe-local","opencode","copilot","antigravity"],o=10,i=50,a=/^[a-zA-Z0-9_-]+$/;function s(e){return"string"==typeof e&&e.length>0&&e.length<=64&&a.test(e)}let l={claude:"Claude",codex:"Codex",gemini:"Gemini","vibe-local":"Vibe Local",opencode:"OpenCode",copilot:"Copilot",antigravity:"Antigravity"};function c(e){return n.includes(e)}function u(e){var t;return null!=(t=l[e])?t:e}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Assistant";return e&&c(e)?u(e):t}function f(e){let t=e.alias;return"string"==typeof t&&t.trim().length>0?t:u(e.cliTool)}function p(e,t,r){let n=e.find(e=>e.id===t);return n?f(n):u(r)}function g(e){return e.map((e,t)=>({id:e,cliTool:e,alias:u(e),order:t}))}let y=128,m=2097152},63001:(e,t,r)=>{r.d(t,{fJ:()=>n}),r(54014);let n=["claude","codex","antigravity"]},63365:(e,t,r)=>{r.d(t,{tS:()=>u,xM:()=>d,T3:()=>f});var n=r(95155),o=r(12115),i=r(52703);function a(){return"undefined"!=typeof globalThis&&"function"==typeof globalThis.WebSocket?globalThis.WebSocket:null}let s=()=>{},l={status:"disconnected",connected:!1,subscribe:s,unsubscribe:s,addListener:()=>s},c=(0,o.createContext)(null);function u(e){let{children:t,enabled:r=!0}=e,s=(0,o.useRef)(new Set),l=(0,o.useRef)(new Map),{status:u,subscribe:d,unsubscribe:f}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{onEvent:t,onStatusChange:r,autoReconnect:n=!0,reconnectBaseDelay:s=1e3,reconnectMaxDelay:l=3e4,enabled:c=!0}=e,[u,d]=(0,o.useState)("disconnected"),f=(0,o.useRef)(null),p=(0,o.useRef)(null),g=(0,o.useRef)(0),y=(0,o.useRef)(new Set),m=(0,o.useRef)(!1),w=(0,o.useRef)(t);w.current=t;let h=(0,o.useRef)(r);h.current=r;let S=(0,o.useCallback)(e=>{var t;d(e),null==(t=h.current)||t.call(h,e)},[]),b=(0,o.useCallback)(()=>{null!==p.current&&(clearTimeout(p.current),p.current=null)},[]),v=(0,o.useCallback)(()=>{if(!c)return;let e=a();if(!e||f.current&&(f.current.readyState===e.OPEN||f.current.readyState===e.CONNECTING))return;b(),m.current=!1,S("connecting");let t="https:"===window.location.protocol?"wss:":"ws:",r=new e("".concat(t,"//").concat(window.location.host));f.current=r,r.onopen=()=>{g.current=0,S("connected");try{r.send(JSON.stringify({type:i.ST,version:"0.27.1"}))}catch(e){}y.current.forEach(e=>{try{r.send(JSON.stringify({type:"subscribe",worktreeId:e}))}catch(e){}})},r.onmessage=e=>{var t;let r="string"==typeof e.data?e.data:String(e.data),n=(0,i.zS)(r);n&&(null==(t=w.current)||t.call(w,n))},r.onerror=()=>{S("error")},r.onclose=()=>{var e;if(f.current=null,S("disconnected"),m.current||!n||"undefined"!=typeof document&&"hidden"===document.visibilityState)return;let t=(e=g.current,Math.min(s*2**Math.max(0,e),l));g.current+=1,p.current=setTimeout(()=>{p.current=null,v()},t)}},[c,n,s,l,S,b]),E=(0,o.useCallback)(()=>{if(b(),m.current=!0,f.current){try{f.current.close(1e3,"Client disconnect")}catch(e){}f.current=null}},[b]),C=(0,o.useCallback)(e=>{let t=f.current,r=a();if(t&&r&&t.readyState===r.OPEN)try{t.send(JSON.stringify(e))}catch(e){}},[]),k=(0,o.useCallback)(e=>{y.current.has(e)||(y.current.add(e),C({type:"subscribe",worktreeId:e}))},[C]),T=(0,o.useCallback)(e=>{y.current.has(e)&&(y.current.delete(e),C({type:"unsubscribe",worktreeId:e}))},[C]);return(0,o.useEffect)(()=>{if(c)return v(),()=>{E()}},[c,v,E]),(0,o.useEffect)(()=>{if(!c||"undefined"==typeof document)return;let e=()=>{"visible"===document.visibilityState&&(f.current||(g.current=0,v()))};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[c,v]),{status:u,subscribe:k,unsubscribe:T,send:C}}({enabled:r,onEvent:(0,o.useCallback)(e=>{s.current.forEach(t=>{try{t(e)}catch(e){}})},[])}),p=(0,o.useCallback)(e=>{var t;let r=l.current,n=null!=(t=r.get(e))?t:0;r.set(e,n+1),0===n&&d(e)},[d]),g=(0,o.useCallback)(e=>{var t;let r=l.current,n=null!=(t=r.get(e))?t:0;n<=1?(r.delete(e),f(e)):r.set(e,n-1)},[f]),y=(0,o.useCallback)(e=>(s.current.add(e),()=>{s.current.delete(e)}),[]),m=(0,o.useMemo)(()=>({status:u,connected:"connected"===u,subscribe:p,unsubscribe:g,addListener:y}),[u,p,g,y]);return(0,n.jsx)(c.Provider,{value:m,children:t})}function d(){var e;return null!=(e=(0,o.useContext)(c))?e:l}function f(e){let{addListener:t}=d(),r=(0,o.useRef)(e);r.current=e,(0,o.useEffect)(()=>t(e=>r.current(e)),[t])}},65380:(e,t,r)=>{r.d(t,{H:()=>s,O:()=>a});var n=r(95155),o=r(12115);let i=(0,o.createContext)(!1);function a(e){let{children:t,authEnabled:r}=e;return(0,n.jsx)(i.Provider,{value:r,children:t})}function s(){return(0,o.useContext)(i)}},66966:(e,t,r)=>{r.d(t,{g7:()=>l,rC:()=>u,Fn:()=>c});var n=r(95155),o=r(12115),i=r(63365),a=r(39649);let s=(0,o.createContext)(null);function l(e){let{children:t}=e,{worktrees:r,repositories:l,isLoading:c,error:u,refresh:d}=function(){let[e,t]=(0,o.useState)([]),[r,n]=(0,o.useState)([]),[a,s]=(0,o.useState)(!0),[l,c]=(0,o.useState)(null),u=(0,o.useRef)(null),d=(0,o.useRef)([]),f=(0,o.useRef)(null),{connected:p,subscribe:g,unsubscribe:y,addListener:m}=(0,i.xM)(),w=(0,o.useRef)(p);w.current=p;let h=(0,o.useCallback)(async()=>{try{var e,r;c(null);let i=await fetch("/api/worktrees");if(!i.ok)throw Error("Failed to fetch worktrees: ".concat(i.status));let a=await i.json(),s=null!=(e=a.worktrees)?e:[],l=null!=(r=a.repositories)?r:[];(0,o.startTransition)(()=>{t(s),n(l)}),d.current=s}catch(e){c(e instanceof Error?e:Error(String(e)))}finally{s(!1)}},[]);(0,o.useEffect)(()=>{h()},[h]);let S=(0,o.useCallback)(()=>d.current.some(e=>!0===e.isSessionRunning),[]),b=(0,o.useCallback)(()=>{let e=S();return w.current?e?2e4:6e4:e?5e3:3e4},[S]),v=(0,o.useCallback)(()=>{null!==u.current&&(clearInterval(u.current),u.current=null),f.current=null},[]),E=(0,o.useCallback)(()=>{v();let e=b();f.current=e,u.current=setInterval(()=>{h()},e)},[b,h,v]);(0,o.useEffect)(()=>{let e=()=>{document.hidden?v():(h(),E())},t=setTimeout(()=>{E()},0);return document.addEventListener("visibilitychange",e),()=>{clearTimeout(t),v(),document.removeEventListener("visibilitychange",e)}},[h,E,v]),(0,o.useEffect)(()=>{if(d.current=e,"undefined"!=typeof document&&document.hidden||null===f.current)return;let t=b();f.current!==t&&E()},[e,p,b,E]);let C=e.map(e=>e.id).sort().join(" ");return(0,o.useEffect)(()=>{let e=C.length>0?C.split(" "):[];return e.forEach(e=>g(e)),()=>{e.forEach(e=>y(e))}},[C,g,y]),(0,o.useEffect)(()=>m(e=>{if("session_status_changed"===e.type&&"string"==typeof e.worktreeId){let i=e.worktreeId,a=e.isWaitingForResponse;if("boolean"==typeof a){var r,n;let s=null!=(r=e.instance)?r:null,l=null!=(n=e.waitingKind)?n:null;(0,o.startTransition)(()=>{t(e=>{let t=!1,r=e.map(e=>{if(e.id!==i)return e;let r=function(e,t){var r,n,o;let i,a=null!=(n=t.instance)?n:null,s=a?null==(r=e.sessionStatusByInstance)?void 0:r[a]:void 0,l=e.sessionStatusByInstance;if(a&&s&&s.isWaitingForResponse!==t.waiting&&(l={...e.sessionStatusByInstance,[a]:{...s,isWaitingForResponse:t.waiting,waitingKind:null!=(o=t.waitingKind)?o:null}}),t.waiting)i=!0;else{let e=l?Object.values(l):[];i=e.length>0&&e.some(e=>(null==e?void 0:e.isWaitingForResponse)===!0)}return l===e.sessionStatusByInstance&&i===e.isWaitingForResponse?e:{...e,sessionStatusByInstance:l,isWaitingForResponse:i}}(e,{waiting:a,instance:s,waitingKind:l});return r!==e&&(t=!0),r});return t?r:e})});return}let s=e.isRunning;if("boolean"==typeof s){if((null!=e.cliTool||null!=e.instance)&&!1===s)return void h();(0,o.startTransition)(()=>{t(e=>{let t=!1,r=e.map(e=>e.id===i&&e.isSessionRunning!==s?(t=!0,{...e,isSessionRunning:s}):e);return t?r:e})})}}else("message"===e.type||"message_updated"===e.type)&&h()}),[m,h]),{worktrees:e,repositories:r,isLoading:a,error:l,refresh:h}}(),f=(0,o.useMemo)(()=>({worktrees:r,repositories:l,isLoading:c,error:u,refresh:d}),[r,l,c,u,d]);return(0,n.jsx)(s.Provider,{value:f,children:(0,n.jsx)(a.H8,{externalWorktrees:r,externalRepositories:l,children:t})})}function c(){let e=(0,o.useContext)(s);if(null===e)throw Error("useWorktreesCacheContext must be used within a WorktreesCacheProvider");return e}function u(){return(0,o.useContext)(s)}},68704:(e,t,r)=>{r.d(t,{Uf:()=>i,d8:()=>a,fM:()=>s,of:()=>c,r5:()=>o,rq:()=>l});var n=r(2317);let o="medium",i=["large","medium","small","xsmall"],a={large:{value:"large",rootFontSizePx:18,factor:1.125,terminalFontSize:16},medium:{value:"medium",rootFontSizePx:16,factor:1,terminalFontSize:14},small:{value:"small",rootFontSizePx:14,factor:.875,terminalFontSize:12},xsmall:{value:"xsmall",rootFontSizePx:12.5,factor:.78,terminalFontSize:11}};function s(e){return"string"==typeof e&&Object.prototype.hasOwnProperty.call(a,e)}function l(e){return a[e].terminalFontSize}function c(){let{value:e,setValue:t,isAvailable:r}=(0,n.V)({key:"mcbd-pc-display-size",defaultValue:o,validate:s});return{size:e,setSize:t,isAvailable:r}}},70628:(e,t,r)=>{r.d(t,{K:()=>s,S:()=>a});var n=r(95155),o=r(12115);let i=(0,o.createContext)({open:!1,setOpen:()=>{},toggle:()=>{}});function a(e){let{children:t}=e,[r,a]=(0,o.useState)(!1),s=(0,o.useCallback)(()=>a(e=>!e),[]),l=(0,o.useMemo)(()=>({open:r,setOpen:a,toggle:s}),[r,s]);return(0,n.jsx)(i.Provider,{value:l,children:t})}function s(){return(0,o.useContext)(i)}},80344:(e,t,r)=>{r.d(t,{$T:()=>c,GQ:()=>d,Rx:()=>s,gC:()=>l,hD:()=>n,hS:()=>u,y:()=>a});class n extends Error{constructor(e,t,r){super(e),this.status=t,this.data=r,this.name="ApiError"}}async function o(e,t,r){if(!(e.headers.get("content-type")||"").includes("application/json"))return t;try{return await e.json()}catch(e){return t}}async function i(e,t){try{let r=new Headers(null==t?void 0:t.headers);r.set("Content-Type","application/json");let i=await fetch(e,{...t,headers:r}),a=i.headers.get("content-type")||"";if(i.redirected&&i.url.includes("/login"))throw new n("Authentication required",401);if(!i.ok){let e=await o(i,{},"error-body");throw new n(e.error||"HTTP error ".concat(i.status),i.status,e)}if(!a.includes("application/json"))throw new n("Unexpected response format",i.status);return i.json()}catch(e){if(e instanceof n)throw e;throw new n(e instanceof Error?e.message:"Unknown error",0,e)}}let a={getAll:async()=>i("/api/worktrees"),getById:async e=>i("/api/worktrees/".concat(e)),updateDescription:async(e,t)=>i("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({description:t})}),updateLink:async(e,t)=>i("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({link:t})}),toggleFavorite:async(e,t)=>i("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({favorite:t})}),updateStatus:async(e,t)=>i("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({status:t})}),updateCliTool:async(e,t)=>i("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({cliToolId:t})}),markAsViewed:async e=>i("/api/worktrees/".concat(e,"/viewed"),{method:"PATCH"}),async getMessages(e,t,r,n){let o=new URLSearchParams;return t&&o.append("cliTool",t),r&&o.append("includeArchived","true"),"number"==typeof n&&Number.isFinite(n)&&o.append("limit",String(n)),i("/api/worktrees/".concat(e,"/messages").concat(o.toString()?"?".concat(o.toString()):""))},async sendMessage(e,t,r){let n={content:t};return(null==r?void 0:r.cliToolId)&&(n.cliToolId=r.cliToolId),(null==r?void 0:r.instanceId)&&(n.instanceId=r.instanceId),(null==r?void 0:r.imagePath)&&(n.imagePath=r.imagePath),i("/api/worktrees/".concat(e,"/send"),{method:"POST",body:JSON.stringify(n)})},async uploadImageFile(e,t){let r=Date.now(),n="".concat(r,"-").concat(t.name),i=".commandmate/attachments",a=new FormData;a.append("file",new File([t],n,{type:t.type}));let s=await fetch("/api/worktrees/".concat(e,"/upload/").concat(i),{method:"POST",body:a});if(!s.ok){var l;let e=await o(s,{},"error-body");throw Error((null==e||null==(l=e.error)?void 0:l.message)||"Upload failed (HTTP ".concat(s.status,")"))}return{path:(await o(s,{},"response-body")).path||"".concat(i,"/").concat(n)}},getLogs:async e=>i("/api/worktrees/".concat(e,"/logs")),async getLogFile(e,t,r){let n=(null==r?void 0:r.sanitize)?"?sanitize=true":"";return i("/api/worktrees/".concat(e,"/logs/").concat(t).concat(n))},async killSession(e,t,r){let n=new URLSearchParams;t&&n.set("cliTool",t),r&&n.set("instance",r);let o=n.toString();return i("/api/worktrees/".concat(e,"/kill-session").concat(o?"?".concat(o):""),{method:"POST"})}},s={scan:async e=>i("/api/repositories/scan",{method:"POST",body:JSON.stringify({repositoryPath:e})}),sync:async()=>i("/api/repositories/sync",{method:"POST"}),delete:async e=>i("/api/repositories",{method:"DELETE",body:JSON.stringify({repositoryPath:e})}),async clone(e,t){var r;return i("/api/repositories/clone",{method:"POST",body:JSON.stringify({cloneUrl:e,fork:null!=(r=null==t?void 0:t.fork)&&r})})},getCloneStatus:async e=>i("/api/repositories/clone/".concat(e)),getExcluded:async()=>i("/api/repositories/excluded"),restore:async e=>i("/api/repositories/restore",{method:"PUT",body:JSON.stringify({repositoryPath:e})}),list:async()=>i("/api/repositories"),updateDisplayName:async(e,t)=>i("/api/repositories/".concat(encodeURIComponent(e)),{method:"PUT",body:JSON.stringify({displayName:t})}),updateVisibility:async(e,t)=>i("/api/repositories/".concat(encodeURIComponent(e)),{method:"PUT",body:JSON.stringify({visible:t})}),updateEnabled:async(e,t)=>i("/api/repositories/".concat(encodeURIComponent(e)),{method:"PUT",body:JSON.stringify({enabled:t})}),validatePath:async e=>i("/api/repositories/validate-path",{method:"POST",body:JSON.stringify({repositoryPath:e})})},l={async browse(e){let t=e?"?path=".concat(encodeURIComponent(e)):"";return i("/api/fs/browse".concat(t))},addRecentPath:async e=>i("/api/fs/recent-paths",{method:"POST",body:JSON.stringify({path:e})})},c={getAll:async e=>(await i("/api/worktrees/".concat(e,"/memos"))).memos,create:async(e,t)=>(await i("/api/worktrees/".concat(e,"/memos"),{method:"POST",body:JSON.stringify(t||{})})).memo,update:async(e,t,r)=>(await i("/api/worktrees/".concat(e,"/memos/").concat(t),{method:"PUT",body:JSON.stringify(r)})).memo,delete:async(e,t)=>i("/api/worktrees/".concat(e,"/memos/").concat(t),{method:"DELETE"}),async reorder(e,t){await i("/api/worktrees/".concat(e,"/memos"),{method:"PATCH",body:JSON.stringify({memoIds:t})})}};function u(e){return e instanceof n||e instanceof Error?e.message:"An unknown error occurred"}let d={checkForUpdate:async()=>i("/api/app/update-check",{method:"GET"}),startUpdate:async()=>i("/api/app/update",{method:"POST"}),async ping(){try{return(await fetch("/api/auth/status",{cache:"no-store"})).ok}catch(e){return!1}}}},89275:(e,t,r)=>{r.d(t,{Bo:()=>u,Hq:()=>l});var n=r(95155),o=r(12115),i=r(20063);let a={startTransition:e=>e()},s=(0,o.createContext)(null);function l(){var e;let t=(0,i.useRouter)(),{startTransition:r}=null!=(e=(0,o.useContext)(s))?e:a;return(0,o.useMemo)(()=>({push:e=>r(()=>t.push(e)),replace:e=>r(()=>t.replace(e))}),[t,r])}function c(e){let{onCommit:t}=e,r=(0,i.usePathname)(),n=(0,o.useRef)(!1);return(0,o.useEffect)(()=>{if(!n.current){n.current=!0;return}t()},[r,t]),null}function u(e){let{children:t}=e,r=(0,o.useRef)(null),i=(0,o.useCallback)(()=>{var e;null==(e=r.current)||e.call(r)},[]),a=(0,o.useCallback)(e=>{var t;t=()=>new Promise(t=>{let n=!1,o=()=>{n||(n=!0,t())};r.current=o,e(),window.setTimeout(o,500)}),"undefined"==typeof document||"function"!=typeof document.startViewTransition||"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?t():document.startViewTransition(t)},[]),l=(0,o.useMemo)(()=>({startTransition:a}),[a]);return(0,n.jsxs)(s.Provider,{value:l,children:[(0,n.jsx)(c,{onCommit:i}),t]})}},92614:(e,t,r)=>{r.d(t,{C:()=>s,E:()=>a});var n=r(95155),o=r(12115);let i=(0,o.createContext)({open:!1,setOpen:()=>{},toggle:()=>{}});function a(e){let{children:t}=e,[r,a]=(0,o.useState)(!1),s=(0,o.useCallback)(()=>a(e=>!e),[]),l=(0,o.useMemo)(()=>({open:r,setOpen:a,toggle:s}),[r,s]);return(0,n.jsx)(i.Provider,{value:l,children:t})}function s(){return(0,o.useContext)(i)}},94442:(e,t,r)=>{r.d(t,{dj:()=>v,tE:()=>b});var n=r(95155),o=r(12115),i=r(47650),a=r(18955),s=r(42529),l=r(78874),c=r(52056),u=r(23327),d=r(65229),f=r(59854),p=r(9900),g=r(9286);function y(e){let{type:t,iconColor:r}=e,o="h-5 w-5 ".concat(r);switch(t){case"success":return(0,n.jsx)(s.A,{className:o,"data-testid":"toast-icon-success"});case"error":return(0,n.jsx)(l.A,{className:o,"data-testid":"toast-icon-error"});case"warning":return(0,n.jsx)(c.A,{className:o,"data-testid":"toast-icon-warning"});default:return(0,n.jsx)(u.A,{className:o,"data-testid":"toast-icon-info"})}}function m(e){let{id:t,message:r,type:i,onClose:s,duration:l=3e3,onClick:c}=e,u=(0,a.c)("common"),f=(0,o.useRef)(null),m=function(e){switch(e){case"success":return{bgColor:"bg-success-subtle",borderColor:"border-success-border",textColor:"text-success-foreground",iconColor:"text-success-foreground"};case"error":return{bgColor:"bg-danger-subtle",borderColor:"border-danger-border",textColor:"text-danger-foreground",iconColor:"text-danger-foreground"};case"warning":return{bgColor:"bg-warning-subtle",borderColor:"border-warning-border",textColor:"text-warning-foreground",iconColor:"text-warning-foreground"};default:return{bgColor:"bg-info-subtle",borderColor:"border-info-border",textColor:"text-info-foreground",iconColor:"text-info-foreground"}}}(i),[w,h]=(0,o.useState)(!0),{shouldRender:S,isExiting:b}=(0,g.O)(w,p.Ys),v=(0,o.useRef)(s);v.current=s,(0,o.useEffect)(()=>{S||v.current(t)},[S,t]),(0,o.useEffect)(()=>(l>0&&(f.current=setTimeout(()=>{h(!1)},l)),()=>{f.current&&clearTimeout(f.current)}),[l]);let E=(0,o.useCallback)(()=>{f.current&&clearTimeout(f.current),h(!1)},[]);return(0,n.jsxs)("div",{"data-testid":"toast-".concat(t),role:"alert",className:"\n ".concat(m.bgColor,"\n ").concat(m.borderColor,"\n ").concat(m.textColor,"\n border rounded-lg shadow-lg p-4 min-w-[300px] max-w-[400px]\n flex items-start gap-3\n ").concat(b?"animate-out fade-out-0 slide-out-to-right-full duration-200 fill-mode-forwards pointer-events-none":"animate-slide-in","\n "),children:[(0,n.jsx)(y,{type:i,iconColor:m.iconColor}),c?(0,n.jsx)("button",{type:"button","data-testid":"toast-action-button",onClick:()=>{c(),E()},className:"flex-1 text-left text-sm font-medium underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:r}):(0,n.jsx)("p",{className:"flex-1 text-sm font-medium",children:r}),(0,n.jsx)("button",{"data-testid":"toast-close-button",onClick:E,"aria-label":u("closeNotification"),className:"\n ".concat(m.textColor,"\n hover:opacity-70\n focus:outline-none focus:ring-2 focus:ring-offset-2\n transition-opacity\n "),children:(0,n.jsx)(d.A,{className:"h-4 w-4"})})]})}function w(e){let{toasts:t,onClose:r}=e,[a,s]=(0,o.useState)(!1);(0,o.useEffect)(()=>{s(!0)},[]);let l=(0,n.jsx)("div",{"data-testid":"toast-container","aria-live":"polite",className:"fixed bottom-4 right-4 flex flex-col gap-2",style:{zIndex:f.M.TOAST},children:t.map(e=>(0,n.jsx)(m,{id:e.id,message:e.message,type:e.type,onClose:r,duration:e.duration,onClick:e.onClick},e.id))});return a?(0,i.createPortal)(l,document.body):null}function h(){let[e,t]=(0,o.useState)([]),r=(0,o.useRef)(0),n=(0,o.useCallback)(function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3,i=arguments.length>3?arguments[3]:void 0,a="toast-".concat(++r.current,"-").concat(Date.now()),s={id:a,message:e,type:n,duration:o,...(null==i?void 0:i.onClick)?{onClick:i.onClick}:{}};return t(e=>[...e,s]),a},[]),i=(0,o.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]),a=(0,o.useCallback)(()=>{t([])},[]);return(0,o.useMemo)(()=>({toasts:e,showToast:n,removeToast:i,clearToasts:a}),[e,n,i,a])}let S=(0,o.createContext)(null);function b(e){let{children:t}=e,r=h();return(0,n.jsxs)(S.Provider,{value:r,children:[t,(0,n.jsx)(w,{toasts:r.toasts,onClose:r.removeToast})]})}function v(){let e=(0,o.useContext)(S),t=h();return null!=e?e:t}}}]);
|