commandmate 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +366 -321
- package/.next/app-path-routes-manifest.json +31 -26
- package/.next/build-manifest.json +5 -5
- package/.next/prerender-manifest.json +9 -9
- package/.next/react-loadable-manifest.json +11 -11
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +15 -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_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/start/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/terminal/route_client-reference-manifest.js +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/daily-summary/route.js +1 -1
- package/.next/server/app/api/daily-summary/route.js.nft.json +1 -1
- package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/status/route.js +1 -1
- package/.next/server/app/api/daily-summary/status/route.js.nft.json +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_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/claude-done/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/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_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_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_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_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +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_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.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.js +23 -0
- package/.next/server/app/api/skills/installations/route.js.nft.json +1 -0
- package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/skills/operations/route.js +13 -0
- package/.next/server/app/api/skills/operations/route.js.nft.json +1 -0
- package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/skills/reindex/route.js +23 -0
- package/.next/server/app/api/skills/reindex/route.js.nft.json +1 -0
- package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/skills/route.js +1 -1
- package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/slash-commands/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/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
- 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_client-reference-manifest.js +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]/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_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js.nft.json +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.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/checkout/route.js.nft.json +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.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/diff/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/fetch/route.js.nft.json +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.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/pull/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/push/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/reset/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/revert/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stage/route.js.nft.json +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.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/unstage/route.js.nft.json +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.js.nft.json +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_client-reference-manifest.js +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.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_client-reference-manifest.js +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 -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_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/route.js +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_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route.js +1 -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 +18 -0
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route.js.nft.json +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/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_client-reference-manifest.js +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_client-reference-manifest.js +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_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_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_client-reference-manifest.js +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]/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_client-reference-manifest.js +1 -1
- package/.next/server/app/chat/page_client-reference-manifest.js +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 +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_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_client-reference-manifest.js +1 -1
- package/.next/server/app/review/page_client-reference-manifest.js +1 -1
- package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/[skillId]/page.js +1 -1
- 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 -0
- package/.next/server/app/skills/installed/page.js.nft.json +1 -0
- package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -0
- 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_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/page.js +3 -3
- 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 +31 -26
- package/.next/server/chunks/1117.js +1 -1
- package/.next/server/chunks/1185.js +1 -0
- package/.next/server/chunks/1239.js +1 -0
- package/.next/server/chunks/22.js +1 -1
- package/.next/server/chunks/2328.js +1 -1
- package/.next/server/chunks/2710.js +2 -0
- package/.next/server/chunks/28.js +35 -0
- package/.next/server/chunks/3042.js +1 -2
- package/.next/server/chunks/4440.js +2 -0
- package/.next/server/chunks/4548.js +1 -0
- package/.next/server/chunks/5064.js +1 -1
- package/.next/server/chunks/5381.js +1 -1
- package/.next/server/chunks/5456.js +1 -1
- package/.next/server/chunks/5737.js +1 -0
- package/.next/server/chunks/5793.js +1 -0
- package/.next/server/chunks/5959.js +2 -2
- package/.next/server/chunks/6130.js +1 -1
- package/.next/server/chunks/8681.js +1 -1
- package/.next/server/chunks/8807.js +66 -3
- package/.next/server/chunks/9051.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/AKqbAyuzbFfg05qpbCI_K/_buildManifest.js +1 -0
- package/.next/static/chunks/2751-7fabd91275b14ca3.js +1 -0
- package/.next/static/chunks/{4459.03172449db395039.js → 4459.a94b52985a76509a.js} +1 -1
- package/.next/static/chunks/{6488-93870a55f4a3e3cd.js → 6488-c2a968ec806975c2.js} +1 -1
- package/.next/static/chunks/{7485.43871aedf3dbb980.js → 7485.442b21101fca7257.js} +1 -1
- package/.next/static/chunks/8562-6e2ab32452f4fa5b.js +1 -0
- package/.next/static/chunks/app/api/app/update/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/app/update-check/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/assistant/conversation/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/assistant/current-output/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/assistant/messages/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/assistant/session/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/assistant/start/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/assistant/terminal/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/assistant/tools/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/auth/login/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/auth/status/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/daily-summary/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/daily-summary/status/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/external-apps/[id]/health/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/external-apps/[id]/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/external-apps/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/fs/browse/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/fs/recent-paths/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/hooks/claude-done/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/ollama/models/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/push/subscriptions/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/push/vapid/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/repositories/[id]/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/repositories/[id]/todos/[todoId]/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/repositories/[id]/todos/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/repositories/clone/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/repositories/excluded/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/repositories/restore/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/repositories/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/repositories/scan/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/repositories/sync/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/repositories/validate-path/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/sidebar/group-order/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/skills/[id]/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/skills/installations/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/skills/operations/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/skills/reindex/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/skills/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/slash-commands/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/templates/[id]/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/templates/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/todos/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/capture/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/logs/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/memos/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/messages/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/respond/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/search/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/send/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/start-polling/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/timers/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/todos/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/tree/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/api/worktrees/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/manifest.webmanifest/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/more/{page-082d4ae496f9a36e.js → page-1619018cac999bbc.js} +1 -1
- package/.next/static/chunks/app/proxy/[...path]/route-55e398bd20e2d7a9.js +1 -0
- package/.next/static/chunks/app/skills/[skillId]/page-6008b904225ebb25.js +1 -0
- package/.next/static/chunks/app/skills/installed/page-6641f95e6a6e5f9d.js +1 -0
- package/.next/static/chunks/app/skills/page-184f8e23e31a3667.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/{page-6da38f0a06dfd9db.js → page-59a63a2c013ec1eb.js} +1 -1
- package/.next/static/chunks/{webpack-6b35d37d50302d27.js → webpack-180bebdee221b6f4.js} +1 -1
- package/.next/static/css/{5127edd9aa8f3b49.css → d3453a6876553d32.css} +1 -1
- package/.next/trace +11 -11
- package/.next/types/app/api/skills/installations/route.ts +347 -0
- package/.next/types/app/api/skills/operations/route.ts +347 -0
- package/.next/types/app/api/skills/reindex/route.ts +347 -0
- package/.next/types/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.ts +347 -0
- package/.next/types/app/skills/installed/page.ts +84 -0
- package/.next/types/routes.d.ts +7 -2
- package/.next/types/validator.ts +45 -0
- package/dist/cli/commands/skill.d.ts +2 -1
- package/dist/cli/commands/skill.d.ts.map +1 -1
- package/dist/cli/commands/skill.js +136 -2
- package/dist/cli/types/api-responses.d.ts +40 -0
- package/dist/cli/types/api-responses.d.ts.map +1 -1
- package/dist/cli/types/index.d.ts +6 -0
- package/dist/cli/types/index.d.ts.map +1 -1
- package/dist/server/src/lib/db/migrations/index.js +2 -0
- package/dist/server/src/lib/db/migrations/runner.js +1 -1
- package/dist/server/src/lib/db/migrations/v48-skill-operations-audit-index.js +117 -0
- package/dist/server/src/lib/skills/compatibility-matrix.js +256 -0
- package/dist/server/src/lib/skills/compatibility.js +132 -11
- package/dist/server/src/lib/skills/operation-audit.js +85 -15
- package/dist/server/src/lib/skills/operation-journal.js +14 -1
- package/package.json +1 -1
- package/.next/server/chunks/1808.js +0 -1
- package/.next/server/chunks/5226.js +0 -28
- package/.next/server/chunks/5306.js +0 -2
- package/.next/server/chunks/593.js +0 -1
- package/.next/server/chunks/9192.js +0 -1
- package/.next/static/MqlW91_Se_kEW6mtm-1x0/_buildManifest.js +0 -1
- package/.next/static/chunks/3418-7e47651340d940b0.js +0 -1
- package/.next/static/chunks/9142-41b13a2f278529cc.js +0 -1
- package/.next/static/chunks/app/api/app/update/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/app/update-check/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/assistant/conversation/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/assistant/current-output/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/assistant/messages/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/assistant/session/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/assistant/start/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/assistant/terminal/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/assistant/tools/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/auth/login/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/auth/status/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/daily-summary/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/daily-summary/status/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/external-apps/[id]/health/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/external-apps/[id]/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/external-apps/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/fs/browse/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/fs/recent-paths/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/hooks/claude-done/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/ollama/models/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/push/subscriptions/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/push/vapid/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/repositories/[id]/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/repositories/[id]/todos/[todoId]/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/repositories/[id]/todos/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/repositories/clone/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/repositories/excluded/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/repositories/restore/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/repositories/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/repositories/scan/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/repositories/sync/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/repositories/validate-path/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/sidebar/group-order/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/skills/[id]/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/skills/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/slash-commands/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/templates/[id]/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/templates/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/todos/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/capture/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/logs/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/memos/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/messages/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/respond/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/search/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/send/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/start-polling/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/timers/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/todos/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/tree/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/api/worktrees/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/manifest.webmanifest/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/proxy/[...path]/route-8c8bebe20cebf964.js +0 -1
- package/.next/static/chunks/app/skills/[skillId]/page-8c40c9683f242207.js +0 -1
- package/.next/static/chunks/app/skills/page-46242c428ee8bccf.js +0 -1
- /package/.next/static/{MqlW91_Se_kEW6mtm-1x0 → AKqbAyuzbFfg05qpbCI_K}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
exports.id=5959,exports.ids=[1296,5959,9358],exports.modules={60:(a,b,c)=>{"use strict";c.d(b,{Q:()=>f,b:()=>e});var d=c(26283);function e(a){return d.Md.test(a)&&!d.kD.test(a)}function f(a,b,c,d,e){if(a=Math.max(0,a),"opencode"===d||"copilot"===d){let a=e(b);return a>=0?a+1:0}if("antigravity"===d){let c=e(b);return c>=0?c+1:Math.max(0,a)}if(a>=b||c){let a=e(40);return a>=0?a+1:0}if("codex"===d)return Math.max(0,a);if(a>=b-5){let a=e(50);return a>=0?a+1:Math.max(0,b-40)}return Math.max(0,a)}},3523:(a,b,c)=>{"use strict";c.d(b,{z$:()=>A,zX:()=>B});var d=c(31766),e=c(88807),f=c(56791),g=c(69297),h=c(25129),i=c(18778),j=c(15194),k=c(8988),l=c(26283),m=c(72626),n=c(46423),o=c(60),p=c(82450),q=c(56263),r=c(13033),s=c(72457),t=c(71080),u=c(45146),v=c(63865);let w=(0,m.h)("response-poller");function x(a){return{response:"",isComplete:!1,lineCount:a}}function y(a,b,c,d,e,f,g){let h=(0,o.Q)(b,c,d,e,f),i=a.slice(h);return{response:(0,l.aJ)(i.join("\n")),isComplete:!0,lineCount:c,promptDetection:g,bufferReset:d}}function z(a,b){let c=(0,l.KO)(b);return(0,h.gF)((0,l._A)((0,l.aJ)(a)),c)}function A(a,b,c){let d=a.split("\n"),e=d.length;for(;e>0&&""===d[e-1].trim();)e--;let f=d.slice(0,e),g=f.length,h="claude"===c?(0,l.GT)(f):-1,i=h>=0?h:g,j=g>0&&b>25&&g+25<b,k=g>0&&b>50&&g<50,m=j||k;if(!m&&g<b-5)return null;let p=Math.max(0,g-20),q=f.slice(p),r="opencode"===c?(0,l.aJ)(f.join("\n")):q.join("\n"),{promptPattern:s,separatorPattern:t,thinkingPattern:v,skipPatterns:w}=(0,l._X)(c),A=(a=60)=>{let b;if("codex"===c)b=/^›\s+(?!Implement|Find and fix|Type|Summarize)/;else if("opencode"===c){let b=0;for(let c=g-1;c>=Math.max(0,g-a);c--){let a=(0,l.aJ)(f[c]);if(l.Md.test(a)&&2==++b)return c}return -1}else b=/^[>❯]\s+\S/;for(let c=i-1;c>=Math.max(0,i-a);c--){let a=(0,l.aJ)(f[c]);if(b.test(a))return c}return -1};if("claude"===c||"codex"===c||"copilot"===c){let a=z(f.join("\n"),c);if(a.isPrompt)return y(f,b,g,m,c,A,a)}let B=(0,l.aJ)(r),C=s.test(B),D=t.test(B),E=v.test(B),F=("codex"===c||"gemini"===c||"vibe-local"===c||"copilot"===c||"antigravity"===c)&&C&&!E,G="claude"===c&&C&&D&&!E,H="opencode"===c&&(0,o.b)(B);if(F||G||H){let a=[],d=(0,o.Q)(b,g,m,c,A),e=g;for(let b=d;b<i;b++){let d=f[b],g=(0,l.aJ)(d);if("codex"===c&&/^›\s+/.test(g)||"gemini"===c&&/^(%|\$|.*@.*[%$#])\s*$/.test(g)||"antigravity"===c&&/^>\s*$/.test(g)||"opencode"===c&&(l.sy.test(g)||l.uA.test(g))){e=b;break}w.some(a=>a.test(g))||a.push(d)}let h=a.join("\n").trim(),j=h.split("\n").slice(-n.$).join("\n");if(v.test(j))return x(g);if("claude"===c){let a=(0,l.aJ)(h),b=/[╭╮╰╯│]/.test(a)||/░{3,}/.test(a)||/▓{3,}/.test(a),c=/Claude Code|claude\/|v\d+\.\d+/.test(a),d=/Tip:|for shortcuts|\?\s*for help/.test(a),e=/^\s*\/Users\/.*$/m.test(a)&&a.split("\n").length<30,f=a.match(/^[>❯]\s+(\S.*)$/m);if(f){let b=a.indexOf(f[0]);if(0===a.substring(b+f[0].length).trim().split("\n").filter(a=>{let b=a.trim();return b&&!w.some(a=>a.test(b))&&!/^─+$/.test(b)}).length)return x(g)}else if((b||c||d||e)&&h.length<2e3)return x(g)}if("gemini"===c&&((h.match(/[░███]/g)||[]).length>.3*h.length||u.SI.some(a=>h.includes(a))||!h.includes("✦")&&h.length<10))return x(g);if("opencode"===c){let a=(0,l.aJ)(h);if((a.length<50||!l.Md.test(B))&&0===a.split("\n").filter(a=>{let b=a.trim();return b&&!l.sx.some(a=>a.test(b))}).length)return x(g)}return{response:h,isComplete:!0,lineCount:e,bufferReset:m}}if("opencode"!==c){let a=z(f.join("\n"),c);if(a.isPrompt)return y(f,b,g,m,c,A,a)}let I=[],J=m||b>=g-5,K=J?A(80):-1,L=J?K>=0?K+1:Math.max(0,g-80):Math.max(0,b);for(let a=L;a<Math.min(g,i);a++){let b=f[a],c=(0,l.aJ)(b);w.some(a=>a.test(c))||I.push(b)}let M=I.join("\n").trim();return M?{response:M,isComplete:!1,lineCount:g}:x(g)}async function B(a,b,c){let h=(0,e.getDbInstance)(),m=c??b;try{let e=(0,f.Ui)(h,a);if(!e)return w.error("worktree-worktreeid-not"),(0,u.Et)(a,b,c),!1;if(!await (0,d.K1)(a,b,c))return w.info("session-not-running"),(0,u.Et)(a,b,c),!1;let o=(0,f.y1)(h,a,m),x=o?.lastCapturedLine||0,y=await (0,d.Wh)(a,b,1e4,c);if("opencode"===b||"copilot"===b){let d=(0,u.MN)(a,b,c);(0,r.IZ)(d,y,b)}let B=A(y,x,b);if(!B||!B.isComplete){let{thinkingPattern:c}=(0,l._X)(b),d=(0,l.aJ)(y).split("\n").slice(-n.$).join("\n");return c.test(d)&&(0,f.PL)(h,a,b,m)>0&&w.info("marked-answeredcount-pending"),!1}let C="opencode"===b||"copilot"===b,D=!(0,j.VA)(b);if(D&&!B.bufferReset&&B.lineCount===x&&!o?.inProgressMessageId)return!1;if(D&&!B.bufferReset&&B.lineCount<=x)return w.info("already-saved-up-to-line-lastcapturedlin"),!1;let E=B.promptDetection??z(B.response,b);if(E.isPrompt){let d=E.rawContent||E.cleanContent,i=(0,u.MN)(a,b,c),j=(0,s.zm)(d,b);if((0,s.gv)(i,j))return w.info("duplicate-prompt-skipped",{worktreeId:a,cliToolId:b}),!1;let k=d;"copilot"===b&&(k=(0,p.LH)(d),k=(0,p.Sj)(k,q.Rf,q.ky)),(0,f.YX)(h,a,b,m);let l=(0,f.oH)(h,{worktreeId:a,role:"assistant",content:k,messageType:"prompt",promptData:E.promptData,timestamp:new Date,cliToolId:b,instanceId:m});return(0,f.gb)(h,a,b,B.lineCount,m),(0,g.Lo)("message",{worktreeId:a,message:l}),(0,v.J$)({worktreeId:a,worktreeName:e.name,kind:"prompt",agentName:m,excerpt:E.promptData?.question??k}).catch(()=>{}),C||(0,u.Et)(a,b,c),!0}if(!B.response||""===B.response.trim())return(0,f.gb)(h,a,b,B.lineCount,m),!1;let F="claude"===b?(0,k.R)(B.response):void 0,G=B.response;if("gemini"===b)G=(0,p.IS)(B.response);else if("claude"===b)G=(0,p.NN)(B.response);else if("copilot"===b){let d=(0,u.MN)(a,b,c),e=(0,r.Uz)(d)||B.response;G=(0,p.LH)(e),G=(0,p.Sj)(G,q.Rf,q.ky),(0,r.q1)(d)}else if("opencode"===b){G=(0,p.aW)(B.response);let d=(0,u.MN)(a,b,c);(0,r.q1)(d)}if(!G||""===G.trim()||"[No content]"===G)return(0,f.gb)(h,a,b,B.lineCount,m),(0,f.YX)(h,a,b,m),!1;if((0,j.VA)(b)){let d=(0,u.MN)(a,b,c);if((0,t.j)(d,G))return(0,f.gb)(h,a,b,B.lineCount,m),!1}G&&await (0,i.T)(h,a,G,b),(0,f.PL)(h,a,b,m)>0&&w.info("marked-answeredcount-pending");let H=(0,f.y1)(h,a,m);if(D&&H&&B.lineCount<=H.lastCapturedLine)return w.info("race-condition-detected-skipping-save-re"),!1;let I=(0,f.oH)(h,{worktreeId:a,role:"assistant",content:G,messageType:"normal",timestamp:new Date,cliToolId:b,instanceId:m,summary:F?.summary,logFileName:F?.logFileName,requestId:F?.requestId});return(0,g.Lo)("message",{worktreeId:a,message:I}),(0,v.J$)({worktreeId:a,worktreeName:e.name,kind:"completion",agentName:m,excerpt:G}).catch(()=>{}),(0,f.gb)(h,a,b,B.lineCount,m),C&&(0,u.Et)(a,b,c),!0}catch(a){return w.error("response:check-failed",{error:a instanceof Error?a.message:String(a)}),!1}}},5344:(a,b,c)=>{"use strict";c.d(b,{v7:()=>i,LP:()=>s,pL:()=>k,GE:()=>l,aq:()=>n,kC:()=>r,xU:()=>D,bZ:()=>E,W8:()=>o,W5:()=>K,_i:()=>L,_C:()=>M});var d=c(68901),e=c(66007),f=c(15194),g=c(72626);let h=(0,g.h)("auto-yes-state");function i(a,b,c){if(a.includes(":"))throw Error(`worktreeId must not contain ':': ${a}`);if(!c||c===b)return`${a}:${b}`;if(c.includes(":"))throw Error(`instanceId must not contain ':': ${c}`);return`${a}:${b}:${c}`}function j(a){let b=a.indexOf(":");return -1===b?a:a.substring(0,b)}function k(a){let b=a.split(":")[1];return void 0===b?null:(0,f.hR)(b)?b:null}function l(a){let b=a.split(":");return b[2]??b[1]??null}let m=globalThis.__autoYesStates??(globalThis.__autoYesStates=new Map);function n(a,b="claude",c){let d=i(a,b,c),e=m.get(d);return e?Date.now()>=e.expiresAt?p(a,b,"expired",c):e:null}function o(a,b,c,e,f,g){let h=i(a,b,g);if(!c)return p(a,b,void 0,g);{let a=Date.now(),b={enabled:!0,enabledAt:a,expiresAt:a+(e??d.t6),stopPattern:f};return m.set(h,b),b}}function p(a,b="claude",c,d){let e=i(a,b,d),f=m.get(e),g={enabled:!1,enabledAt:f?.enabledAt??0,expiresAt:f?.expiresAt??0,stopPattern:f?.stopPattern,stopReason:c};return m.set(e,g),g}function q(a,b){return a.filter(a=>j(a)===b)}function r(a){return q(Array.from(m.keys()),a)}function s(a){let b=r(a);return b.forEach(a=>m.delete(a)),b.length}var t=c(31766),u=c(25129),v=c(63869),w=c(31268),x=c(26283),y=c(77093),z=c(93997);let A=(0,g.h)("auto-yes-poller"),B=globalThis.__autoYesPollerStates??(globalThis.__autoYesPollerStates=new Map);function C(a){return B.get(a)}function D(a){let b=C(a);return b?.lastServerResponseTimestamp??null}function E(a){return B.has(a)}function F(a){let b=C(a);if(b){var c;if(b.consecutiveErrors++,b.currentInterval=(c=b.consecutiveErrors)<5?2e3:Math.min(2e3*Math.pow(2,c-5+1),6e4),b.consecutiveErrors>=d.ul){let b=j(a),c=k(a);c&&p(b,c,"consecutive_errors",l(a)??void 0),L(a)}}}async function G(a,b,c,e){let f=c??d.FW,g=await (0,t.Wh)(a,b,f,e);return(0,x._A)((0,x.aJ)(g))}async function H(a,b,d,e,f,g){let h=i(a,d,g);try{let i=(0,x.KO)(d),l=(0,u.gF)(e,{...i,...f&&{precomputedLines:f}});if(!l.isPrompt||!l.promptData)return b.lastAnsweredPromptKey=null,b.lastAnsweredAt=null,"no_prompt";let m=(j=l.promptData,`${j.type}:${j.question}`);if(b.lastAnsweredPromptKey===m&&null!==b.lastAnsweredAt&&Date.now()-b.lastAnsweredAt<1e4)return"duplicate";let n=function(a){if("yes_no"===a.type)return"y";if("multiple_choice"===a.type){let b=a.options.find(a=>a.isDefault)??a.options[0];return!b||b.requiresTextInput?null:b.number.toString()}return null}(l.promptData);if(null===n)return"no_answer";let o=w.s.getInstance().getTool(d).getSessionName(a,g);try{await (0,v.t)({sessionName:o,answer:n,cliToolId:d,promptData:l.promptData})}finally{(0,z.gm)(o)}var j,k=Date.now();let p=C(h);p&&(p.lastServerResponseTimestamp=k);let q=C(h);q&&(q.consecutiveErrors=0,q.currentInterval=2e3),b.lastAnsweredPromptKey=m,b.lastAnsweredAt=Date.now(),A.info("poller:response-sent",{worktreeId:a,cliToolId:d,instanceId:g});let[{startPolling:r},{broadcastTerminalSnapshotAfterInteraction:s}]=await Promise.all([Promise.resolve().then(c.bind(c,95220)),Promise.resolve().then(c.bind(c,99508))]);return r(a,d,g),s(a,d,g),"responded"}catch{return F(h),A.warn("poller:detect-respond-error",{worktreeId:a,cliToolId:d,instanceId:g}),"error"}}async function I(a,b,c){let e=i(a,b,c),f=C(e);if("valid"===function(a,b){if(!b)return"stopped";let c=j(a),d=k(a);if(!d)return L(a),"expired";let e=n(c,d,l(a)??void 0);return e?.enabled?"valid":(L(a),"expired")}(e,f)){try{let g=n(a,b,c),i=g?.stopPattern?d.FW:d.Ke,m=await G(a,b,i,c),o=m.split("\n");if(function(a,b,c){if(b.stopCheckBaselineLength<0)return b.stopCheckBaselineLength=c.length,!1;let e=b.stopCheckBaselineLength;if(c.length>e){let f=c.substring(e);return b.stopCheckBaselineLength=c.length,function(a,b,c){let e=j(a),f=k(a);if(!f)return!1;let g=l(a)??void 0,i=n(e,f,g);if(!i?.stopPattern)return!1;if(!(0,d.P0)(i.stopPattern).valid)return h.warn("invalid-stop-pattern",{detail:String({compositeKey:a})}),p(e,f,void 0,g),!1;try{let d=new RegExp(i.stopPattern),j=function(a,b,c=100){try{return a.test(b)}catch{return null}}(d,b);if(null===j)return h.warn("stop-condition-check",{detail:String({compositeKey:a})}),p(e,f,void 0,g),!1;if(j)return p(e,f,"stop_pattern_matched",g),c&&c(a),h.warn("stop-condition-matched",{detail:String({compositeKey:a})}),!0}catch{h.warn("stop-condition-check",{detail:String({compositeKey:a})})}return!1}(a,f,L)}return c.length<e&&(b.stopCheckBaselineLength=c.length),!1}(e,f,m))return;let q=await H(a,f,b,m,o,c);if("responded"===q)return void J(a,b,c,5e3);if("no_prompt"===q){let e=o.slice(-50).join("\n");if((0,x.ut)(b,e))return void J(a,b,c,d.QN)}}catch(d){F(e),A.warn("poller:poll-error",{worktreeId:a,cliToolId:b,instanceId:c,error:(0,y.u1)(d)})}J(a,b,c)}}function J(a,b,c,d){let e=C(i(a,b,c));if(!e)return;let f=Math.max(d??e.currentInterval,2e3);e.timerId=setTimeout(()=>{I(a,b,c)},f)}function K(a,b,c){if(!(0,e.h6)(a))return{started:!1,reason:"invalid worktree ID"};let d=c??b,f=n(a,b,d);if(!f?.enabled)return{started:!1,reason:"auto-yes not enabled"};let g=i(a,b,d),h=C(g);if(!h&&B.size>=50)return{started:!1,reason:"max concurrent pollers reached"};if(h&&h.cliToolId===b)return{started:!0,reason:"already_running"};h&&L(g);let j={timerId:null,cliToolId:b,instanceId:d,consecutiveErrors:0,currentInterval:2e3,lastServerResponseTimestamp:null,lastAnsweredPromptKey:null,lastAnsweredAt:null,stopCheckBaselineLength:-1};return B.set(g,j),j.timerId=setTimeout(()=>{I(a,b,d)},2e3),A.info("poller:started",{worktreeId:a,cliToolId:b,instanceId:d}),{started:!0}}function L(a){let b=C(a);b&&(b.timerId&&clearTimeout(b.timerId),B.delete(a),A.info("poller:stopped",{compositeKey:a}))}function M(a){q(Array.from(B.keys()),a).forEach(a=>L(a))}},7015:(a,b,c)=>{"use strict";c.d(b,{Ds:()=>g});var d=c(81719);class e{constructor(a,b=3e4){this.cache=new Map,this.allAppsCache=null,this.lastRefresh=0,this.db=a,this.ttl=b}getTTL(){return this.ttl}isStale(){return Date.now()-this.lastRefresh>this.ttl}async refresh(){let a=(0,d.$i)(this.db);for(let b of(this.cache.clear(),a))this.cache.set(b.pathPrefix,b);this.allAppsCache=a,this.lastRefresh=Date.now()}async getByPathPrefix(a){return this.isStale()&&await this.refresh(),this.cache.get(a)??null}async getAll(){return this.isStale()&&await this.refresh(),this.allAppsCache??[]}invalidate(){this.cache.clear(),this.allAppsCache=null,this.lastRefresh=0}invalidateByIssueNo(a){this.invalidate()}}let f=null;function g(a){if(!f){if(!a)throw Error("Database instance required to initialize cache");f=new e(a)}return f}},8988:(a,b,c)=>{"use strict";c.d(b,{R:()=>g});let d=/📄 Session log: (.+?\/([^\/\s]+\.jsonl))/,e=/Request ID: ([^\s\n]+)/,f=/Summary: (.+?)(?:\n─|$)/s;function g(a){let b={content:a},c=d.exec(a);c&&(b.logFileName=c[2]);let g=e.exec(a);g&&(b.requestId=g[1]);let h=f.exec(a);return h&&(b.summary=h[1].trim()),b}},11508:(a,b,c)=>{"use strict";c.d(b,{H:()=>m,m:()=>n});var d=c(44265),e=c(11665),f=c(40236),g=c(93997),h=c(26283),i=c(72626),j=c(20610);let k=(0,i.h)("cli-tools/gemini");function l(a){return a instanceof Error?a.message:String(a)}let m=200;class n extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,e.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("Gemini CLI is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,e.N)(d)){await this.reconcileExistingSession(d),k.info("gemini-session-sessionname");return}try{await (0,e.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,j.Uc)),await (0,e.V1)(d,"gemini",!0),await new Promise(a=>setTimeout(a,6e3)),await this.waitForReady(d),k.info("started-gemini-session:sessionname")}catch(b){let a=l(b);throw Error(`Failed to start Gemini session: ${a}`)}}async waitForReady(a){let b=!1;for(let c=0;c<30;c++){try{let c=await (0,e.Xg)(a,m),d=(0,h.aJ)(c);if(h.wN.test(d))return void k.info("gemini-prompt-detected");!b&&d.includes("Do you trust this folder?")&&(await (0,e.ds)(a,"Enter"),b=!0,k.info("auto-trusted-folder-for"))}catch{}await new Promise(a=>setTimeout(a,1e3))}k.info("gemini-prompt-detection")}async waitForPrompt(a){let b=Date.now();for(;Date.now()-b<15e3;){try{let b=await (0,e.Xg)(a,m),c=(0,h.aJ)(b);if(h.wN.test(c))return}catch{}await new Promise(a=>setTimeout(a,500))}k.info("gemini-prompt-not")}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,e.N)(d))throw Error(`Gemini session ${d} does not exist. Start the session first.`);try{await this.waitForPrompt(d),await (0,f.FW)({sessionName:d,message:b,cliToolId:"gemini"}),(0,g.gm)(d),k.info("sent-message-to-gemini-session:sessionna")}catch(b){let a=l(b);throw Error(`Failed to send message to Gemini: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,e.N)(c)&&(await (0,e.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,j.Is)),await (0,e.V1)(c,"/quit",!0),await new Promise(a=>setTimeout(a,j.Zf))),await (0,e.fY)(c)&&k.info("stopped-gemini-session:sessionname")}catch(a){throw k.error("session:stop-failed",{error:l(a)}),a}}constructor(...a){super(...a),this.id="gemini",this.name="Gemini CLI",this.command="gemini"}}},11665:(a,b,c)=>{"use strict";c.d(b,{Ce:()=>w,GW:()=>n,KB:()=>r,N:()=>m,N6:()=>y,Sb:()=>z,V1:()=>p,Xg:()=>s,ds:()=>v,fY:()=>t,jw:()=>o,lA:()=>k,zT:()=>l});var d=c(79646),e=c(28354),f=c(93997),g=c(16983),h=c(72626);let i=(0,e.promisify)(d.execFile),j=(0,h.h)("tmux");function k(a){return`=${a}:`}async function l(a,b={}){let c,d,e,f=b.windowWidth??g.J,h=b.windowHeight??g.s,m=k(a);try{c=(await i("tmux",["show-window-options","-v","-t",m,"window-size"],{timeout:5e3})).stdout.trim();let[a,b]=(await i("tmux",["display-message","-p","-t",m,"#{window_width}|#{window_height}"],{timeout:5e3})).stdout.trim().split("|").map(Number);Number.isFinite(a)&&(d=a),Number.isFinite(b)&&(e=b)}catch{}let n="manual"===c,o=d===f&&e===h;if(n&&o)return!1;try{return n||await i("tmux",["set-window-option","-t",m,"window-size","manual"],{timeout:5e3}),o||await i("tmux",["resize-window","-t",m,"-x",String(f),"-y",String(h)],{timeout:5e3}),!0}catch(b){return j.warn("session-geometry:reconcile-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)}),!1}}async function m(a){try{return await i("tmux",["has-session","-t",k(a)],{timeout:5e3}),!0}catch{return!1}}async function n(){try{let{stdout:a}=await i("tmux",["list-sessions","-F","#{session_name}|#{session_windows}|#{session_attached}"],{timeout:5e3});if(!a||""===a.trim())return[];return a.trim().split("\n").map(a=>{let[b,c,d]=a.split("|");return{name:b,windows:parseInt(c,10)||0,attached:"1"===d}})}catch{return[]}}async function o(a,b){let c,d,e,f,h;"string"==typeof a?(c=a,d=b,e=5e4,f=g.J,h=g.s):(c=a.sessionName,d=a.workingDirectory,e=a.historyLimit||5e4,f=a.windowWidth||g.J,h=a.windowHeight||g.s);try{await i("tmux",["new-session","-d","-s",c,"-c",d,"-x",String(f),"-y",String(h)],{timeout:5e3}),await l(c,{windowWidth:f,windowHeight:h}),await i("tmux",["set-option","-t",k(c),"history-limit",String(e)],{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to create tmux session: ${a}`)}}async function p(a,b,c=!0){let d=c?["send-keys","-t",k(a),b,"C-m"]:["send-keys","-t",k(a),b];try{await i("tmux",d,{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send keys to tmux session: ${a}`)}}let q=new Set(["Up","Down","Left","Right","Enter","Space","Tab","Escape","BSpace","DC","PageUp","PageDown","Home","End","q"]);async function r(a,b){if(0!==b.length){for(let a of b)if(!q.has(a))throw Error(`Invalid special key: ${a}`);try{for(let c=0;c<b.length;c++)await i("tmux",["send-keys","-t",k(a),b[c]],{timeout:5e3}),c<b.length-1&&await new Promise(a=>setTimeout(a,100))}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send special keys to tmux session: ${a}`)}}}async function s(a,b){let c,d;"number"==typeof b?(c=-b,d="-"):b?(c=b.startLine??-1e4,d=b.endLine??"-"):(c=-1e3,d="-");try{let{stdout:b}=await i("tmux",["capture-pane","-t",k(a),"-p","-e","-S",String(c),"-E",String(d)],{timeout:5e3,maxBuffer:0xa00000});return b}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to capture pane: ${a}`)}}async function t(a){try{return await i("tmux",["kill-session","-t",k(a)],{timeout:5e3}),!0}catch(b){let a=b instanceof Error?b.message:String(b);if(a?.includes("no server running")||a?.includes("can't find session"))return!1;throw Error(`Failed to kill tmux session: ${a}`)}}let u=new Set(["Escape","C-c","C-d","C-m","Enter"]);async function v(a,b){if(!u.has(b))throw Error(`Invalid special key: ${b}`);try{await i("tmux",["send-keys","-t",k(a),b],{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send special key: ${a}`)}}async function w(a){try{await i("tmux",["send-keys","-t",k(a),"C-u"],{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to clear tmux input line: ${a}`)}}let x=["Up","Down","Left","Right","Enter","Escape","Tab","BTab","PageUp","PageDown","Home","End","q"];function y(a){return x.includes(a)}async function z(a,b){await r(a,b),(0,f.gm)(a)}},13033:(a,b,c)=>{"use strict";c.d(b,{IW:()=>h,IZ:()=>l,K0:()=>g,Uz:()=>m,l1:()=>f,o0:()=>i,q1:()=>n,tb:()=>k,vQ:()=>j});var d=c(26283);let e=new Map;function f(a){return(0,d._A)((0,d.aJ)(a)).replace(/^\u2503\s?/,"").replace(/\s*\u2503$/,"").trim()}function g(a){let b=a.split("\n"),c=[];for(let a of b){let b=f(a);!(!b||d.sx.some(a=>a.test(b)))&&(d.Md.test(b)||c.push(b))}return c}function h(a){return a.replace(/[\u2500-\u257F]/g,"").replace(/\s{2,}/g," ").trim()}function i(a){let b=(0,d.aJ)(a).split("\n"),c=[];for(let a of b){let b=h(a);b&&(d.J7.some(a=>a.test(b))||c.push(b))}return c}function j(a,b){if(0===a.length||0===b.length)return 0;let c=Math.min(a.length,b.length);for(let d=c;d>=1;d--){let c=a.slice(-d),e=b.slice(0,d),f=!0;for(let a=0;a<d;a++)if(c[a]!==e[a]){f=!1;break}if(f)return d}return 0}function k(a){e.set(a,{lines:[],lastFingerprint:[],pollCount:0})}function l(a,b,c="opencode"){let d=e.get(a);if(!d)return;let f="copilot"===c?i(b):g(b);if(0!==f.length){if(d.pollCount++,0===d.lines.length)d.lines=[...f];else{let a=j(d.lastFingerprint,f);if(a>0){let b=f.slice(a);d.lines.push(...b)}else d.lines.push(...f)}d.lastFingerprint=f.slice(-10)}}function m(a){let b=e.get(a);return b&&0!==b.lines.length?b.lines.join("\n"):""}function n(a){e.delete(a)}},16983:(a,b,c)=>{"use strict";c.d(b,{J:()=>e,s:()=>d});let d=1e3,e=200},18778:(a,b,c)=>{"use strict";c.d(b,{T:()=>g});var d=c(56791),e=c(41364);let f=(0,c(72626).h)("conversation-logger");async function g(a,b,c,h="claude"){let i=(0,d.r8)(a,b);if(i)try{await (0,e.hM)(b,i.content,c,h)}catch(a){f.error("conversation:log-failed",{error:a instanceof Error?a.message:String(a)})}}},20610:(a,b,c)=>{"use strict";c.d(b,{CV:()=>i,Em:()=>l,Is:()=>g,KI:()=>j,PY:()=>k,Uc:()=>d,Zf:()=>h,pL:()=>e,x9:()=>f});let d=100,e=100,f=200,g=300,h=500,i=500,j=2e3,k=200,l=100},21684:(a,b,c)=>{"use strict";c.d(b,{U:()=>g});var d=c(33873),e=c.n(d),f=c(87447);function g(){return(0,f._p)("CM_LOG_DIR")||e().join(process.cwd(),"data","logs")}},25129:(a,b,c)=>{"use strict";c.d(b,{gF:()=>B,xn:()=>v});var d=c(72626),e=c(68652),f=c(26283);let g=/^\s*[\u276F\u25CF\u203A][^\d]*(\d+)(?:\.(?!\d)|\s{2,})\s*(.+)$/,h=/^\s*[^\d]{0,3}(\d+)(?:\.(?!\d)|\s+)\s*(.+)$/,i=/^[-─]+$/,j=/^\s*\[[^\]]*\d+\s+lines?\]/i,k=/^\s*[…]?\s*[+\-↑↓⏵⏷]?\s*\d+\s+(?:pending|more)\b/i,l=/Esc\s+to\s+cancel\s*[·•]\s*Tab\s+to\s+amend/i,m=/Enter\s+to\s+select\b.*\bnavigate\b/i,n=/press\s+(?:enter|number)\s+to\s+confirm/i,o=/press\s+number\s+to\s+confirm/i,p=/(?:select|choose|pick|which|what|how|where|enter|type|specify|confirm|approve|accept|reject|decide|preference|option)/i,q=[/type\s+here/i,/tell\s+(me|claude)/i,/enter\s+/i,/custom/i,/differently/i];function r(a,b){if(0===b.length)return!0;let c=b[0].number;return a<c&&a>=c-2}function s(a){return{isPrompt:!1,cleanContent:a.trim()}}function t(a){return 0!==a.length&&!!(a.includes("?")||a.includes("?")||p.test(a))}function u(a,b){let c=b.endsWith("?")||b.endsWith("?");return!!(!c&&/^\s{2,}[^\d]/.test(a)&&!/^\s*\d+\./.test(a)||!c&&/^\s{4,}/.test(a)&&!/^\s*\d+\.\s/.test(a)||b.length<5&&!c||/^[\/~]/.test(b)||b.length>=2&&/^[a-zA-Z0-9_-]+$/.test(b))}function v(a,b="yes_no"){let c=a.toLowerCase().trim();if("multiple_choice"===b){if(/^\d+$/.test(c))return c;throw Error("Invalid answer for multiple choice prompt. Expected a number.")}if("yes"===c||"y"===c)return"y";if("no"===c||"n"===c)return"n";throw Error("Invalid answer for yes/no prompt. Expected 'yes', 'no', 'y', or 'n'.")}let w=(0,d.h)("prompt-detector"),x=null;function y(a){let b=a.split("\n"),c=(b.length>200?b.slice(-200):b).join("\n");return c.length>5e3&&(c=c.slice(-5e3)),c}let z=[{regex:/^(.+)\s+\(y\/n\)\s*$/m},{regex:/^(.+)\s+\[y\/N\]\s*$/m,defaultOption:"no"},{regex:/^(.+)\s+\[Y\/n\]\s*$/m,defaultOption:"yes"},{regex:/^(.+)\s+\(yes\/no\)\s*$/m}];function A(a,b,c,d){return{isPrompt:!0,promptData:{type:"yes_no",question:a,options:["yes","no"],status:"pending",...void 0!==d&&{defaultOption:d},instructionText:c},cleanContent:b,rawContent:c}}function B(a,b){let c=(0,e.N)(a),d=c===a&&b?.precomputedLines?b.precomputedLines:c.split("\n"),p=d.slice(-50).join("\n"),v=p===x;v||w.debug("detectPrompt:start",{outputLength:c.length}),x=p;let B=d.slice(-20).join("\n"),C=function(a,b,c){var d,p;a=(0,e.N)(a);let v=b?.requireDefaultIndicator??!0,w=a.split("\n"),x=w.length;for(;x>0&&""===w[x-1].trim();)x--;let y=Math.max(0,x-50),z=!1;for(let a=x-1;a>=y;a--){let b=m.test(w[a]);if(l.test(w[a])||b){x=a,z=b;break}}let A=w.slice(y,x);for(let b of A)if(f.l8.test(b))return s(a);let B=!1,C=!1;for(let a of A){let b=a.trim();if(!B&&n.test(b)){B=!0,o.test(b)&&(C=!0);break}}if(v){let b=!1;for(let a of A){let c=a.trim();if(g.test(c)){b=!0;break}}if(!b&&!B)return s(a)}let D=[],E=-1,F=0;for(let b=x-1;b>=y;b--){let c=w[b].trim();if(j.test(c)||k.test(c)){F++;continue}let d=c.match(g);if(d){let a=parseInt(d[1],10);if(a<=20&&r(a,D)){let b=d[2].trim();D.unshift({number:a,label:b,isDefault:!0}),F=0;continue}}let e=c.match(h);if(e){let a=parseInt(e[1],10);if(a>20);else if(r(a,D)){let b=e[2].trim();D.unshift({number:a,label:b,isDefault:!1}),F=0;continue}}if(0===D.length&&(c.startsWith("❯")||c.startsWith("●")||c.startsWith("›")))return s(a);if(D.length>0&&c&&!i.test(c)){let a=w[b];if(/^\s{4,}/.test(a)&&u(a,c)){if(++F>25){E=b;break}continue}if(t(c)){E=b;break}if(u(a,c)){if(++F>(/^\s{4,}/.test(a)?25:5)){E=b;break}continue}E=b;break}}if(!function(a){if(0===a.length||1!==a[0])return!1;let b=0;for(let c=1;c<a.length;c++){let d=a[c]-a[c-1];if(d<1||d>2||(2===d&&b++,b>1))return!1}return!0}(D.map(a=>a.number)))return s(a);let G=D.some(a=>a.isDefault),H=v&&B;if(D.length<2||v&&!G&&!H||!v&&(-1===E||!t(w[E]?.trim()??"")&&!function(a,b,c,d){let e=Math.max(d,b-3);for(let c=b-1;c>=e;c--){let b=a[c]?.trim()??"";if(!(!b||i.test(b))&&t(b))return!0}return!1}(w,E,0,y)))return s(a);let I=function(a,b){if(b<0)return"Please select an option:";let c=[];for(let d=Math.max(0,b-5);d<=b;d++){let b=a[d].trim();b&&!i.test(b)&&c.push(b)}return c.join(" ")}(w,E),J=function(a,b,c){if(b<0)return;let d=Math.max(0,b-19),e=a.slice(d,c).map(a=>a.trimEnd()).join("\n").trim();return e.length>0?e:void 0}(w,E,x),K=B?C?"answer_only":"answer_then_enter":void 0;return d=a,p=z,{isPrompt:!0,promptData:{type:"multiple_choice",question:I.trim(),options:D.map(a=>{let b=q.some(b=>b.test(a.label));return{number:a.number,label:a.label,isDefault:a.isDefault,requiresTextInput:b}}),status:"pending",instructionText:J,...K?{submitMode:K}:{},...p?{isAskUserQuestion:!0}:{}},cleanContent:I.trim(),rawContent:c(d.trim())}}(c,b,y);if(C.isPrompt)return v||w.info("detectPrompt:multipleChoice",{isPrompt:!0,question:C.promptData?.question,optionsCount:C.promptData?.options?.length}),C;let D=B.trim();for(let a of z){let b=B.match(a.regex);if(b){let c=b[1].trim();return A(c,c,D,a.defaultOption)}}let E=B.match(/^(.*?)Approve\?\s*$/m);if(E){let a=E[1].trim();return A(a?`${a} Approve?`:"Approve?",a||"Approve?",D)}return v||w.debug("detectPrompt:complete",{isPrompt:!1}),{isPrompt:!1,cleanContent:c.trim()}}},25754:(a,b,c)=>{"use strict";c.d(b,{Xn:()=>e,d9:()=>g,gB:()=>f,rv:()=>h});let d=["en","ja"],e="en",f="locale";function g(a){return"string"==typeof a&&d.includes(a)}function h(a,b){return g(a)?a:d.find(a=>(b??"").includes(a))??e}},26838:(a,b,c)=>{"use strict";c.d(b,{Mj:()=>k,Sw:()=>j,lX:()=>l});var d=c(29021),e=c(33873),f=c(90164);let g=/^v?\d+\.\d+\.\d+$/,h=/^[a-zA-Z0-9.\-\s_v]+$/,i=globalThis.__versionCheckCache??(globalThis.__versionCheckCache={result:null,fetchedAt:0,rateLimitResetAt:null});function j(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.15.0"}function k(){return j()}async function l(){try{var a,b,c;if(null!==i.result&&Date.now()-i.fetchedAt<36e5||i.rateLimitResetAt&&(!(Date.now()>=i.rateLimitResetAt)||(i.rateLimitResetAt=null,0)))return i.result;let d=await fetch("https://api.github.com/repos/Kewton/CommandMate/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":`CommandMate/${k()}`},cache:"no-store",signal:AbortSignal.timeout(5e3)});if(403===d.status)return function(a){let b=a.headers.get("X-RateLimit-Reset");b?i.rateLimitResetAt=1e3*parseInt(b,10):i.rateLimitResetAt=Date.now()+36e5}(d),i.result;if(!d.ok)return i.result;let e=await d.json(),j=k(),l=e.tag_name.replace(/^v/,""),m={hasUpdate:function(a,b){if(!g.test(a)||!g.test(b))return!1;let c=a=>a.replace(/^v/,"").split(".").map(Number),[d,e,f]=c(a),[h,i,j]=c(b);return h!==d?h>d:i!==e?i>e:j>f}(j,e.tag_name),currentVersion:j,latestVersion:l,releaseUrl:(a=e.html_url).startsWith(f.Dk)?a:null,releaseName:(b=e.name,c=e.tag_name,h.test(b)&&b.length<=128?b:c),publishedAt:e.published_at};return i.result=m,i.fetchedAt=Date.now(),m}catch{return i.result}}},30618:(a,b,c)=>{"use strict";c.d(b,{xT:()=>w,Ui:()=>x});var d=c(44265),e=c(11665),f=c(40236),g=c(93997),h=c(29021),i=c(33873),j=c(72626);let k=(0,j.h)("cli-tools/opencode-config"),l=/^[a-zA-Z0-9._:/-]{1,100}$/,m=/^[a-zA-Z0-9._:/@-]{1,200}$/;async function n(){let a={};try{let b=new AbortController,c=setTimeout(()=>b.abort(),3e3),d=await fetch("http://localhost:11434/api/tags",{signal:b.signal}).finally(()=>{clearTimeout(c)});if(!d.ok)return k.warn("ollama-api-returned"),{};let e=await d.text();if(e.length>1048576)return k.warn("ollama-api-response"),{};let f=JSON.parse(e);if(!f||!Array.isArray(f.models))return k.warn("invalid-ollama-api"),{};for(let b of f.models.slice(0,100))"string"==typeof b?.name&&l.test(b.name)&&(a[b.name]={name:function(a){let b=String(a.name),c=a.details;if(!c)return b;let d=[b];return"string"==typeof c.parameter_size&&/^[\d.]+[BKMGT]?B?$/i.test(c.parameter_size)&&d.push(c.parameter_size),"string"==typeof c.quantization_level&&/^[A-Z0-9_]{1,20}$/i.test(c.quantization_level)&&d.push(c.quantization_level),d.length>1?`${b} (${d.slice(1).join(", ")})`:b}(b)})}catch(a){a instanceof Error&&"AbortError"===a.name?k.warn("ollama-api-timeout"):k.warn("failed-to-fetch")}return a}async function o(){let a={};try{let b=new AbortController,c=setTimeout(()=>b.abort(),3e3),d=await fetch("http://localhost:1234/v1/models",{signal:b.signal}).finally(()=>{clearTimeout(c)});if(!d.ok)return k.warn("lm-studio-api"),{};let e=await d.text();if(e.length>1048576)return k.warn("lm-studio-api"),{};let f=JSON.parse(e);if(!f||!Array.isArray(f.data))return k.warn("invalid-lm-studio"),{};for(let b of f.data.slice(0,100))"string"==typeof b?.id&&m.test(b.id)&&(a[b.id]={name:b.id})}catch(a){a instanceof Error&&"AbortError"===a.name?k.warn("lm-studio-api"):k.warn("failed-to-fetch")}return a}async function p(a){let b=function(a){let b=i.resolve(a);try{if(!h.lstatSync(b).isDirectory())throw Error(`Path is not a directory: ${b}`)}catch(a){if("ENOENT"===a.code)throw Error(`Path does not exist: ${b}`);throw a}return h.realpathSync(b)}(a),c=i.join(b,"opencode.json");if(h.existsSync(c))return;let[d,e]=await Promise.all([n(),o()]),f={};if(Object.keys(d).length>0&&(f.ollama={npm:"@ai-sdk/openai-compatible",name:"Ollama (local)",options:{baseURL:"http://localhost:11434/v1"},models:d}),Object.keys(e).length>0&&(f.lmstudio={npm:"@ai-sdk/openai-compatible",name:"LM Studio (local)",options:{baseURL:"http://localhost:1234/v1"},models:e}),0!==Object.keys(f).length)try{h.writeFileSync(c,JSON.stringify({$schema:"https://opencode.ai/config.json",provider:f},null,2),{encoding:"utf-8",flag:"wx"})}catch(a){if("EEXIST"===a.code)return;k.warn("failed-to-write-opencodejson:error-insta")}}var q=c(79646),r=c(28354),s=c(20610);let t=(0,j.h)("cli-tools/opencode"),u=(0,r.promisify)(q.execFile);function v(a){return a instanceof Error?a.message:String(a)}let w=200;class x extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,e.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("OpenCode is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,e.N)(d)){await this.reconcileExistingSession(d,{windowWidth:80,windowHeight:w}),t.info("opencode-session-sessionname");return}try{await p(b),await (0,e.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,s.Uc));try{await u("tmux",["resize-window","-t",(0,e.lA)(d),"-x","80","-y",String(w)])}catch{}await (0,e.V1)(d,"opencode",!0),await new Promise(a=>setTimeout(a,15e3)),t.info("started-opencode-session:sessionname")}catch(b){let a=v(b);throw Error(`Failed to start OpenCode session: ${a}`)}}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,e.N)(d))throw Error(`OpenCode session ${d} does not exist. Start the session first.`);try{await (0,f.FW)({sessionName:d,message:b,cliToolId:"opencode"}),(0,g.gm)(d),t.info("sent-message-to-opencode-session:session")}catch(b){let a=v(b);throw Error(`Failed to send message to OpenCode: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,e.N)(c)?(await (0,e.V1)(c,"/exit",!0),await new Promise(a=>setTimeout(a,s.KI)),await (0,e.N)(c)&&await (0,e.fY)(c)):await (0,e.fY)(c),(0,g.gm)(c),t.info("stopped-opencode-session:sessionname")}catch(a){throw t.error("session:stop-failed",{error:v(a)}),a}}constructor(...a){super(...a),this.id="opencode",this.name="OpenCode",this.command="opencode"}}},31268:(a,b,c)=>{"use strict";c.d(b,{s:()=>K});var d=c(44265),e=c(57905);class f extends d.M{async isInstalled(){return await (0,e.zw)()}async isRunning(a,b){return await (0,e.Yq)(a,b)}async startSession(a,b,c){await (0,e.R7)({worktreeId:a,worktreePath:b,instanceId:c})}async sendMessage(a,b,c){await (0,e.pU)(a,b,c)}supportsImage(){return!0}async sendMessageWithImage(a,b,c,d){let e=`
|
|
1
|
+
exports.id=5959,exports.ids=[1296,5959,9358],exports.modules={60:(a,b,c)=>{"use strict";c.d(b,{Q:()=>f,b:()=>e});var d=c(26283);function e(a){return d.Md.test(a)&&!d.kD.test(a)}function f(a,b,c,d,e){if(a=Math.max(0,a),"opencode"===d||"copilot"===d){let a=e(b);return a>=0?a+1:0}if("antigravity"===d){let c=e(b);return c>=0?c+1:Math.max(0,a)}if(a>=b||c){let a=e(40);return a>=0?a+1:0}if("codex"===d)return Math.max(0,a);if(a>=b-5){let a=e(50);return a>=0?a+1:Math.max(0,b-40)}return Math.max(0,a)}},3523:(a,b,c)=>{"use strict";c.d(b,{z$:()=>A,zX:()=>B});var d=c(31766),e=c(88807),f=c(56791),g=c(69297),h=c(25129),i=c(18778),j=c(15194),k=c(8988),l=c(26283),m=c(72626),n=c(46423),o=c(60),p=c(82450),q=c(56263),r=c(13033),s=c(72457),t=c(71080),u=c(45146),v=c(63865);let w=(0,m.h)("response-poller");function x(a){return{response:"",isComplete:!1,lineCount:a}}function y(a,b,c,d,e,f,g){let h=(0,o.Q)(b,c,d,e,f),i=a.slice(h);return{response:(0,l.aJ)(i.join("\n")),isComplete:!0,lineCount:c,promptDetection:g,bufferReset:d}}function z(a,b){let c=(0,l.KO)(b);return(0,h.gF)((0,l._A)((0,l.aJ)(a)),c)}function A(a,b,c){let d=a.split("\n"),e=d.length;for(;e>0&&""===d[e-1].trim();)e--;let f=d.slice(0,e),g=f.length,h="claude"===c?(0,l.GT)(f):-1,i=h>=0?h:g,j=g>0&&b>25&&g+25<b,k=g>0&&b>50&&g<50,m=j||k;if(!m&&g<b-5)return null;let p=Math.max(0,g-20),q=f.slice(p),r="opencode"===c?(0,l.aJ)(f.join("\n")):q.join("\n"),{promptPattern:s,separatorPattern:t,thinkingPattern:v,skipPatterns:w}=(0,l._X)(c),A=(a=60)=>{let b;if("codex"===c)b=/^›\s+(?!Implement|Find and fix|Type|Summarize)/;else if("opencode"===c){let b=0;for(let c=g-1;c>=Math.max(0,g-a);c--){let a=(0,l.aJ)(f[c]);if(l.Md.test(a)&&2==++b)return c}return -1}else b=/^[>❯]\s+\S/;for(let c=i-1;c>=Math.max(0,i-a);c--){let a=(0,l.aJ)(f[c]);if(b.test(a))return c}return -1};if("claude"===c||"codex"===c||"copilot"===c){let a=z(f.join("\n"),c);if(a.isPrompt)return y(f,b,g,m,c,A,a)}let B=(0,l.aJ)(r),C=s.test(B),D=t.test(B),E=v.test(B),F=("codex"===c||"gemini"===c||"vibe-local"===c||"copilot"===c||"antigravity"===c)&&C&&!E,G="claude"===c&&C&&D&&!E,H="opencode"===c&&(0,o.b)(B);if(F||G||H){let a=[],d=(0,o.Q)(b,g,m,c,A),e=g;for(let b=d;b<i;b++){let d=f[b],g=(0,l.aJ)(d);if("codex"===c&&/^›\s+/.test(g)||"gemini"===c&&/^(%|\$|.*@.*[%$#])\s*$/.test(g)||"antigravity"===c&&/^>\s*$/.test(g)||"opencode"===c&&(l.sy.test(g)||l.uA.test(g))){e=b;break}w.some(a=>a.test(g))||a.push(d)}let h=a.join("\n").trim(),j=h.split("\n").slice(-n.$).join("\n");if(v.test(j))return x(g);if("claude"===c){let a=(0,l.aJ)(h),b=/[╭╮╰╯│]/.test(a)||/░{3,}/.test(a)||/▓{3,}/.test(a),c=/Claude Code|claude\/|v\d+\.\d+/.test(a),d=/Tip:|for shortcuts|\?\s*for help/.test(a),e=/^\s*\/Users\/.*$/m.test(a)&&a.split("\n").length<30,f=a.match(/^[>❯]\s+(\S.*)$/m);if(f){let b=a.indexOf(f[0]);if(0===a.substring(b+f[0].length).trim().split("\n").filter(a=>{let b=a.trim();return b&&!w.some(a=>a.test(b))&&!/^─+$/.test(b)}).length)return x(g)}else if((b||c||d||e)&&h.length<2e3)return x(g)}if("gemini"===c&&((h.match(/[░███]/g)||[]).length>.3*h.length||u.SI.some(a=>h.includes(a))||!h.includes("✦")&&h.length<10))return x(g);if("opencode"===c){let a=(0,l.aJ)(h);if((a.length<50||!l.Md.test(B))&&0===a.split("\n").filter(a=>{let b=a.trim();return b&&!l.sx.some(a=>a.test(b))}).length)return x(g)}return{response:h,isComplete:!0,lineCount:e,bufferReset:m}}if("opencode"!==c){let a=z(f.join("\n"),c);if(a.isPrompt)return y(f,b,g,m,c,A,a)}let I=[],J=m||b>=g-5,K=J?A(80):-1,L=J?K>=0?K+1:Math.max(0,g-80):Math.max(0,b);for(let a=L;a<Math.min(g,i);a++){let b=f[a],c=(0,l.aJ)(b);w.some(a=>a.test(c))||I.push(b)}let M=I.join("\n").trim();return M?{response:M,isComplete:!1,lineCount:g}:x(g)}async function B(a,b,c){let h=(0,e.getDbInstance)(),m=c??b;try{let e=(0,f.Ui)(h,a);if(!e)return w.error("worktree-worktreeid-not"),(0,u.Et)(a,b,c),!1;if(!await (0,d.K1)(a,b,c))return w.info("session-not-running"),(0,u.Et)(a,b,c),!1;let o=(0,f.y1)(h,a,m),x=o?.lastCapturedLine||0,y=await (0,d.Wh)(a,b,1e4,c);if("opencode"===b||"copilot"===b){let d=(0,u.MN)(a,b,c);(0,r.IZ)(d,y,b)}let B=A(y,x,b);if(!B||!B.isComplete){let{thinkingPattern:c}=(0,l._X)(b),d=(0,l.aJ)(y).split("\n").slice(-n.$).join("\n");return c.test(d)&&(0,f.PL)(h,a,b,m)>0&&w.info("marked-answeredcount-pending"),!1}let C="opencode"===b||"copilot"===b,D=!(0,j.VA)(b);if(D&&!B.bufferReset&&B.lineCount===x&&!o?.inProgressMessageId)return!1;if(D&&!B.bufferReset&&B.lineCount<=x)return w.info("already-saved-up-to-line-lastcapturedlin"),!1;let E=B.promptDetection??z(B.response,b);if(E.isPrompt){let d=E.rawContent||E.cleanContent,i=(0,u.MN)(a,b,c),j=(0,s.zm)(d,b);if((0,s.gv)(i,j))return w.info("duplicate-prompt-skipped",{worktreeId:a,cliToolId:b}),!1;let k=d;"copilot"===b&&(k=(0,p.LH)(d),k=(0,p.Sj)(k,q.Rf,q.ky)),(0,f.YX)(h,a,b,m);let l=(0,f.oH)(h,{worktreeId:a,role:"assistant",content:k,messageType:"prompt",promptData:E.promptData,timestamp:new Date,cliToolId:b,instanceId:m});return(0,f.gb)(h,a,b,B.lineCount,m),(0,g.Lo)("message",{worktreeId:a,message:l}),(0,v.J$)({worktreeId:a,worktreeName:e.name,kind:"prompt",agentName:m,excerpt:E.promptData?.question??k}).catch(()=>{}),C||(0,u.Et)(a,b,c),!0}if(!B.response||""===B.response.trim())return(0,f.gb)(h,a,b,B.lineCount,m),!1;let F="claude"===b?(0,k.R)(B.response):void 0,G=B.response;if("gemini"===b)G=(0,p.IS)(B.response);else if("claude"===b)G=(0,p.NN)(B.response);else if("copilot"===b){let d=(0,u.MN)(a,b,c),e=(0,r.Uz)(d)||B.response;G=(0,p.LH)(e),G=(0,p.Sj)(G,q.Rf,q.ky),(0,r.q1)(d)}else if("opencode"===b){G=(0,p.aW)(B.response);let d=(0,u.MN)(a,b,c);(0,r.q1)(d)}if(!G||""===G.trim()||"[No content]"===G)return(0,f.gb)(h,a,b,B.lineCount,m),(0,f.YX)(h,a,b,m),!1;if((0,j.VA)(b)){let d=(0,u.MN)(a,b,c);if((0,t.j)(d,G))return(0,f.gb)(h,a,b,B.lineCount,m),!1}G&&await (0,i.T)(h,a,G,b),(0,f.PL)(h,a,b,m)>0&&w.info("marked-answeredcount-pending");let H=(0,f.y1)(h,a,m);if(D&&H&&B.lineCount<=H.lastCapturedLine)return w.info("race-condition-detected-skipping-save-re"),!1;let I=(0,f.oH)(h,{worktreeId:a,role:"assistant",content:G,messageType:"normal",timestamp:new Date,cliToolId:b,instanceId:m,summary:F?.summary,logFileName:F?.logFileName,requestId:F?.requestId});return(0,g.Lo)("message",{worktreeId:a,message:I}),(0,v.J$)({worktreeId:a,worktreeName:e.name,kind:"completion",agentName:m,excerpt:G}).catch(()=>{}),(0,f.gb)(h,a,b,B.lineCount,m),C&&(0,u.Et)(a,b,c),!0}catch(a){return w.error("response:check-failed",{error:a instanceof Error?a.message:String(a)}),!1}}},5344:(a,b,c)=>{"use strict";c.d(b,{v7:()=>i,LP:()=>s,pL:()=>k,GE:()=>l,aq:()=>n,kC:()=>r,xU:()=>D,bZ:()=>E,W8:()=>o,W5:()=>K,_i:()=>L,_C:()=>M});var d=c(68901),e=c(66007),f=c(15194),g=c(72626);let h=(0,g.h)("auto-yes-state");function i(a,b,c){if(a.includes(":"))throw Error(`worktreeId must not contain ':': ${a}`);if(!c||c===b)return`${a}:${b}`;if(c.includes(":"))throw Error(`instanceId must not contain ':': ${c}`);return`${a}:${b}:${c}`}function j(a){let b=a.indexOf(":");return -1===b?a:a.substring(0,b)}function k(a){let b=a.split(":")[1];return void 0===b?null:(0,f.hR)(b)?b:null}function l(a){let b=a.split(":");return b[2]??b[1]??null}let m=globalThis.__autoYesStates??(globalThis.__autoYesStates=new Map);function n(a,b="claude",c){let d=i(a,b,c),e=m.get(d);return e?Date.now()>=e.expiresAt?p(a,b,"expired",c):e:null}function o(a,b,c,e,f,g){let h=i(a,b,g);if(!c)return p(a,b,void 0,g);{let a=Date.now(),b={enabled:!0,enabledAt:a,expiresAt:a+(e??d.t6),stopPattern:f};return m.set(h,b),b}}function p(a,b="claude",c,d){let e=i(a,b,d),f=m.get(e),g={enabled:!1,enabledAt:f?.enabledAt??0,expiresAt:f?.expiresAt??0,stopPattern:f?.stopPattern,stopReason:c};return m.set(e,g),g}function q(a,b){return a.filter(a=>j(a)===b)}function r(a){return q(Array.from(m.keys()),a)}function s(a){let b=r(a);return b.forEach(a=>m.delete(a)),b.length}var t=c(31766),u=c(25129),v=c(63869),w=c(31268),x=c(26283),y=c(77093),z=c(93997);let A=(0,g.h)("auto-yes-poller"),B=globalThis.__autoYesPollerStates??(globalThis.__autoYesPollerStates=new Map);function C(a){return B.get(a)}function D(a){let b=C(a);return b?.lastServerResponseTimestamp??null}function E(a){return B.has(a)}function F(a){let b=C(a);if(b){var c;if(b.consecutiveErrors++,b.currentInterval=(c=b.consecutiveErrors)<5?2e3:Math.min(2e3*Math.pow(2,c-5+1),6e4),b.consecutiveErrors>=d.ul){let b=j(a),c=k(a);c&&p(b,c,"consecutive_errors",l(a)??void 0),L(a)}}}async function G(a,b,c,e){let f=c??d.FW,g=await (0,t.Wh)(a,b,f,e);return(0,x._A)((0,x.aJ)(g))}async function H(a,b,d,e,f,g){let h=i(a,d,g);try{let i=(0,x.KO)(d),l=(0,u.gF)(e,{...i,...f&&{precomputedLines:f}});if(!l.isPrompt||!l.promptData)return b.lastAnsweredPromptKey=null,b.lastAnsweredAt=null,"no_prompt";let m=(j=l.promptData,`${j.type}:${j.question}`);if(b.lastAnsweredPromptKey===m&&null!==b.lastAnsweredAt&&Date.now()-b.lastAnsweredAt<1e4)return"duplicate";let n=function(a){if("yes_no"===a.type)return"y";if("multiple_choice"===a.type){let b=a.options.find(a=>a.isDefault)??a.options[0];return!b||b.requiresTextInput?null:b.number.toString()}return null}(l.promptData);if(null===n)return"no_answer";let o=w.s.getInstance().getTool(d).getSessionName(a,g);try{await (0,v.t)({sessionName:o,answer:n,cliToolId:d,promptData:l.promptData})}finally{(0,z.gm)(o)}var j,k=Date.now();let p=C(h);p&&(p.lastServerResponseTimestamp=k);let q=C(h);q&&(q.consecutiveErrors=0,q.currentInterval=2e3),b.lastAnsweredPromptKey=m,b.lastAnsweredAt=Date.now(),A.info("poller:response-sent",{worktreeId:a,cliToolId:d,instanceId:g});let[{startPolling:r},{broadcastTerminalSnapshotAfterInteraction:s}]=await Promise.all([Promise.resolve().then(c.bind(c,95220)),Promise.resolve().then(c.bind(c,99508))]);return r(a,d,g),s(a,d,g),"responded"}catch{return F(h),A.warn("poller:detect-respond-error",{worktreeId:a,cliToolId:d,instanceId:g}),"error"}}async function I(a,b,c){let e=i(a,b,c),f=C(e);if("valid"===function(a,b){if(!b)return"stopped";let c=j(a),d=k(a);if(!d)return L(a),"expired";let e=n(c,d,l(a)??void 0);return e?.enabled?"valid":(L(a),"expired")}(e,f)){try{let g=n(a,b,c),i=g?.stopPattern?d.FW:d.Ke,m=await G(a,b,i,c),o=m.split("\n");if(function(a,b,c){if(b.stopCheckBaselineLength<0)return b.stopCheckBaselineLength=c.length,!1;let e=b.stopCheckBaselineLength;if(c.length>e){let f=c.substring(e);return b.stopCheckBaselineLength=c.length,function(a,b,c){let e=j(a),f=k(a);if(!f)return!1;let g=l(a)??void 0,i=n(e,f,g);if(!i?.stopPattern)return!1;if(!(0,d.P0)(i.stopPattern).valid)return h.warn("invalid-stop-pattern",{detail:String({compositeKey:a})}),p(e,f,void 0,g),!1;try{let d=new RegExp(i.stopPattern),j=function(a,b,c=100){try{return a.test(b)}catch{return null}}(d,b);if(null===j)return h.warn("stop-condition-check",{detail:String({compositeKey:a})}),p(e,f,void 0,g),!1;if(j)return p(e,f,"stop_pattern_matched",g),c&&c(a),h.warn("stop-condition-matched",{detail:String({compositeKey:a})}),!0}catch{h.warn("stop-condition-check",{detail:String({compositeKey:a})})}return!1}(a,f,L)}return c.length<e&&(b.stopCheckBaselineLength=c.length),!1}(e,f,m))return;let q=await H(a,f,b,m,o,c);if("responded"===q)return void J(a,b,c,5e3);if("no_prompt"===q){let e=o.slice(-50).join("\n");if((0,x.ut)(b,e))return void J(a,b,c,d.QN)}}catch(d){F(e),A.warn("poller:poll-error",{worktreeId:a,cliToolId:b,instanceId:c,error:(0,y.u1)(d)})}J(a,b,c)}}function J(a,b,c,d){let e=C(i(a,b,c));if(!e)return;let f=Math.max(d??e.currentInterval,2e3);e.timerId=setTimeout(()=>{I(a,b,c)},f)}function K(a,b,c){if(!(0,e.h6)(a))return{started:!1,reason:"invalid worktree ID"};let d=c??b,f=n(a,b,d);if(!f?.enabled)return{started:!1,reason:"auto-yes not enabled"};let g=i(a,b,d),h=C(g);if(!h&&B.size>=50)return{started:!1,reason:"max concurrent pollers reached"};if(h&&h.cliToolId===b)return{started:!0,reason:"already_running"};h&&L(g);let j={timerId:null,cliToolId:b,instanceId:d,consecutiveErrors:0,currentInterval:2e3,lastServerResponseTimestamp:null,lastAnsweredPromptKey:null,lastAnsweredAt:null,stopCheckBaselineLength:-1};return B.set(g,j),j.timerId=setTimeout(()=>{I(a,b,d)},2e3),A.info("poller:started",{worktreeId:a,cliToolId:b,instanceId:d}),{started:!0}}function L(a){let b=C(a);b&&(b.timerId&&clearTimeout(b.timerId),B.delete(a),A.info("poller:stopped",{compositeKey:a}))}function M(a){q(Array.from(B.keys()),a).forEach(a=>L(a))}},7015:(a,b,c)=>{"use strict";c.d(b,{Ds:()=>g});var d=c(81719);class e{constructor(a,b=3e4){this.cache=new Map,this.allAppsCache=null,this.lastRefresh=0,this.db=a,this.ttl=b}getTTL(){return this.ttl}isStale(){return Date.now()-this.lastRefresh>this.ttl}async refresh(){let a=(0,d.$i)(this.db);for(let b of(this.cache.clear(),a))this.cache.set(b.pathPrefix,b);this.allAppsCache=a,this.lastRefresh=Date.now()}async getByPathPrefix(a){return this.isStale()&&await this.refresh(),this.cache.get(a)??null}async getAll(){return this.isStale()&&await this.refresh(),this.allAppsCache??[]}invalidate(){this.cache.clear(),this.allAppsCache=null,this.lastRefresh=0}invalidateByIssueNo(a){this.invalidate()}}let f=null;function g(a){if(!f){if(!a)throw Error("Database instance required to initialize cache");f=new e(a)}return f}},8988:(a,b,c)=>{"use strict";c.d(b,{R:()=>g});let d=/📄 Session log: (.+?\/([^\/\s]+\.jsonl))/,e=/Request ID: ([^\s\n]+)/,f=/Summary: (.+?)(?:\n─|$)/s;function g(a){let b={content:a},c=d.exec(a);c&&(b.logFileName=c[2]);let g=e.exec(a);g&&(b.requestId=g[1]);let h=f.exec(a);return h&&(b.summary=h[1].trim()),b}},11508:(a,b,c)=>{"use strict";c.d(b,{H:()=>m,m:()=>n});var d=c(44265),e=c(11665),f=c(40236),g=c(93997),h=c(26283),i=c(72626),j=c(20610);let k=(0,i.h)("cli-tools/gemini");function l(a){return a instanceof Error?a.message:String(a)}let m=200;class n extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,e.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("Gemini CLI is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,e.N)(d)){await this.reconcileExistingSession(d),k.info("gemini-session-sessionname");return}try{await (0,e.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,j.Uc)),await (0,e.V1)(d,"gemini",!0),await new Promise(a=>setTimeout(a,6e3)),await this.waitForReady(d),k.info("started-gemini-session:sessionname")}catch(b){let a=l(b);throw Error(`Failed to start Gemini session: ${a}`)}}async waitForReady(a){let b=!1;for(let c=0;c<30;c++){try{let c=await (0,e.Xg)(a,m),d=(0,h.aJ)(c);if(h.wN.test(d))return void k.info("gemini-prompt-detected");!b&&d.includes("Do you trust this folder?")&&(await (0,e.ds)(a,"Enter"),b=!0,k.info("auto-trusted-folder-for"))}catch{}await new Promise(a=>setTimeout(a,1e3))}k.info("gemini-prompt-detection")}async waitForPrompt(a){let b=Date.now();for(;Date.now()-b<15e3;){try{let b=await (0,e.Xg)(a,m),c=(0,h.aJ)(b);if(h.wN.test(c))return}catch{}await new Promise(a=>setTimeout(a,500))}k.info("gemini-prompt-not")}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,e.N)(d))throw Error(`Gemini session ${d} does not exist. Start the session first.`);try{await this.waitForPrompt(d),await (0,f.FW)({sessionName:d,message:b,cliToolId:"gemini"}),(0,g.gm)(d),k.info("sent-message-to-gemini-session:sessionna")}catch(b){let a=l(b);throw Error(`Failed to send message to Gemini: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,e.N)(c)&&(await (0,e.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,j.Is)),await (0,e.V1)(c,"/quit",!0),await new Promise(a=>setTimeout(a,j.Zf))),await (0,e.fY)(c)&&k.info("stopped-gemini-session:sessionname")}catch(a){throw k.error("session:stop-failed",{error:l(a)}),a}}constructor(...a){super(...a),this.id="gemini",this.name="Gemini CLI",this.command="gemini"}}},11665:(a,b,c)=>{"use strict";c.d(b,{Ce:()=>w,GW:()=>n,KB:()=>r,N:()=>m,N6:()=>y,Sb:()=>z,V1:()=>p,Xg:()=>s,ds:()=>v,fY:()=>t,jw:()=>o,lA:()=>k,zT:()=>l});var d=c(79646),e=c(28354),f=c(93997),g=c(16983),h=c(72626);let i=(0,e.promisify)(d.execFile),j=(0,h.h)("tmux");function k(a){return`=${a}:`}async function l(a,b={}){let c,d,e,f=b.windowWidth??g.J,h=b.windowHeight??g.s,m=k(a);try{c=(await i("tmux",["show-window-options","-v","-t",m,"window-size"],{timeout:5e3})).stdout.trim();let[a,b]=(await i("tmux",["display-message","-p","-t",m,"#{window_width}|#{window_height}"],{timeout:5e3})).stdout.trim().split("|").map(Number);Number.isFinite(a)&&(d=a),Number.isFinite(b)&&(e=b)}catch{}let n="manual"===c,o=d===f&&e===h;if(n&&o)return!1;try{return n||await i("tmux",["set-window-option","-t",m,"window-size","manual"],{timeout:5e3}),o||await i("tmux",["resize-window","-t",m,"-x",String(f),"-y",String(h)],{timeout:5e3}),!0}catch(b){return j.warn("session-geometry:reconcile-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)}),!1}}async function m(a){try{return await i("tmux",["has-session","-t",k(a)],{timeout:5e3}),!0}catch{return!1}}async function n(){try{let{stdout:a}=await i("tmux",["list-sessions","-F","#{session_name}|#{session_windows}|#{session_attached}"],{timeout:5e3});if(!a||""===a.trim())return[];return a.trim().split("\n").map(a=>{let[b,c,d]=a.split("|");return{name:b,windows:parseInt(c,10)||0,attached:"1"===d}})}catch{return[]}}async function o(a,b){let c,d,e,f,h;"string"==typeof a?(c=a,d=b,e=5e4,f=g.J,h=g.s):(c=a.sessionName,d=a.workingDirectory,e=a.historyLimit||5e4,f=a.windowWidth||g.J,h=a.windowHeight||g.s);try{await i("tmux",["new-session","-d","-s",c,"-c",d,"-x",String(f),"-y",String(h)],{timeout:5e3}),await l(c,{windowWidth:f,windowHeight:h}),await i("tmux",["set-option","-t",k(c),"history-limit",String(e)],{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to create tmux session: ${a}`)}}async function p(a,b,c=!0){let d=c?["send-keys","-t",k(a),b,"C-m"]:["send-keys","-t",k(a),b];try{await i("tmux",d,{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send keys to tmux session: ${a}`)}}let q=new Set(["Up","Down","Left","Right","Enter","Space","Tab","Escape","BSpace","DC","PageUp","PageDown","Home","End","q"]);async function r(a,b){if(0!==b.length){for(let a of b)if(!q.has(a))throw Error(`Invalid special key: ${a}`);try{for(let c=0;c<b.length;c++)await i("tmux",["send-keys","-t",k(a),b[c]],{timeout:5e3}),c<b.length-1&&await new Promise(a=>setTimeout(a,100))}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send special keys to tmux session: ${a}`)}}}async function s(a,b){let c,d;"number"==typeof b?(c=-b,d="-"):b?(c=b.startLine??-1e4,d=b.endLine??"-"):(c=-1e3,d="-");try{let{stdout:b}=await i("tmux",["capture-pane","-t",k(a),"-p","-e","-S",String(c),"-E",String(d)],{timeout:5e3,maxBuffer:0xa00000});return b}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to capture pane: ${a}`)}}async function t(a){try{return await i("tmux",["kill-session","-t",k(a)],{timeout:5e3}),!0}catch(b){let a=b instanceof Error?b.message:String(b);if(a?.includes("no server running")||a?.includes("can't find session"))return!1;throw Error(`Failed to kill tmux session: ${a}`)}}let u=new Set(["Escape","C-c","C-d","C-m","Enter"]);async function v(a,b){if(!u.has(b))throw Error(`Invalid special key: ${b}`);try{await i("tmux",["send-keys","-t",k(a),b],{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send special key: ${a}`)}}async function w(a){try{await i("tmux",["send-keys","-t",k(a),"C-u"],{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to clear tmux input line: ${a}`)}}let x=["Up","Down","Left","Right","Enter","Escape","Tab","BTab","PageUp","PageDown","Home","End","q"];function y(a){return x.includes(a)}async function z(a,b){await r(a,b),(0,f.gm)(a)}},13033:(a,b,c)=>{"use strict";c.d(b,{IW:()=>h,IZ:()=>l,K0:()=>g,Uz:()=>m,l1:()=>f,o0:()=>i,q1:()=>n,tb:()=>k,vQ:()=>j});var d=c(26283);let e=new Map;function f(a){return(0,d._A)((0,d.aJ)(a)).replace(/^\u2503\s?/,"").replace(/\s*\u2503$/,"").trim()}function g(a){let b=a.split("\n"),c=[];for(let a of b){let b=f(a);!(!b||d.sx.some(a=>a.test(b)))&&(d.Md.test(b)||c.push(b))}return c}function h(a){return a.replace(/[\u2500-\u257F]/g,"").replace(/\s{2,}/g," ").trim()}function i(a){let b=(0,d.aJ)(a).split("\n"),c=[];for(let a of b){let b=h(a);b&&(d.J7.some(a=>a.test(b))||c.push(b))}return c}function j(a,b){if(0===a.length||0===b.length)return 0;let c=Math.min(a.length,b.length);for(let d=c;d>=1;d--){let c=a.slice(-d),e=b.slice(0,d),f=!0;for(let a=0;a<d;a++)if(c[a]!==e[a]){f=!1;break}if(f)return d}return 0}function k(a){e.set(a,{lines:[],lastFingerprint:[],pollCount:0})}function l(a,b,c="opencode"){let d=e.get(a);if(!d)return;let f="copilot"===c?i(b):g(b);if(0!==f.length){if(d.pollCount++,0===d.lines.length)d.lines=[...f];else{let a=j(d.lastFingerprint,f);if(a>0){let b=f.slice(a);d.lines.push(...b)}else d.lines.push(...f)}d.lastFingerprint=f.slice(-10)}}function m(a){let b=e.get(a);return b&&0!==b.lines.length?b.lines.join("\n"):""}function n(a){e.delete(a)}},16983:(a,b,c)=>{"use strict";c.d(b,{J:()=>e,s:()=>d});let d=1e3,e=200},18778:(a,b,c)=>{"use strict";c.d(b,{T:()=>g});var d=c(56791),e=c(41364);let f=(0,c(72626).h)("conversation-logger");async function g(a,b,c,h="claude"){let i=(0,d.r8)(a,b);if(i)try{await (0,e.hM)(b,i.content,c,h)}catch(a){f.error("conversation:log-failed",{error:a instanceof Error?a.message:String(a)})}}},20610:(a,b,c)=>{"use strict";c.d(b,{CV:()=>i,Em:()=>l,Is:()=>g,KI:()=>j,PY:()=>k,Uc:()=>d,Zf:()=>h,pL:()=>e,x9:()=>f});let d=100,e=100,f=200,g=300,h=500,i=500,j=2e3,k=200,l=100},21684:(a,b,c)=>{"use strict";c.d(b,{U:()=>g});var d=c(33873),e=c.n(d),f=c(87447);function g(){return(0,f._p)("CM_LOG_DIR")||e().join(process.cwd(),"data","logs")}},25129:(a,b,c)=>{"use strict";c.d(b,{gF:()=>B,xn:()=>v});var d=c(72626),e=c(68652),f=c(26283);let g=/^\s*[\u276F\u25CF\u203A][^\d]*(\d+)(?:\.(?!\d)|\s{2,})\s*(.+)$/,h=/^\s*[^\d]{0,3}(\d+)(?:\.(?!\d)|\s+)\s*(.+)$/,i=/^[-─]+$/,j=/^\s*\[[^\]]*\d+\s+lines?\]/i,k=/^\s*[…]?\s*[+\-↑↓⏵⏷]?\s*\d+\s+(?:pending|more)\b/i,l=/Esc\s+to\s+cancel\s*[·•]\s*Tab\s+to\s+amend/i,m=/Enter\s+to\s+select\b.*\bnavigate\b/i,n=/press\s+(?:enter|number)\s+to\s+confirm/i,o=/press\s+number\s+to\s+confirm/i,p=/(?:select|choose|pick|which|what|how|where|enter|type|specify|confirm|approve|accept|reject|decide|preference|option)/i,q=[/type\s+here/i,/tell\s+(me|claude)/i,/enter\s+/i,/custom/i,/differently/i];function r(a,b){if(0===b.length)return!0;let c=b[0].number;return a<c&&a>=c-2}function s(a){return{isPrompt:!1,cleanContent:a.trim()}}function t(a){return 0!==a.length&&!!(a.includes("?")||a.includes("?")||p.test(a))}function u(a,b){let c=b.endsWith("?")||b.endsWith("?");return!!(!c&&/^\s{2,}[^\d]/.test(a)&&!/^\s*\d+\./.test(a)||!c&&/^\s{4,}/.test(a)&&!/^\s*\d+\.\s/.test(a)||b.length<5&&!c||/^[\/~]/.test(b)||b.length>=2&&/^[a-zA-Z0-9_-]+$/.test(b))}function v(a,b="yes_no"){let c=a.toLowerCase().trim();if("multiple_choice"===b){if(/^\d+$/.test(c))return c;throw Error("Invalid answer for multiple choice prompt. Expected a number.")}if("yes"===c||"y"===c)return"y";if("no"===c||"n"===c)return"n";throw Error("Invalid answer for yes/no prompt. Expected 'yes', 'no', 'y', or 'n'.")}let w=(0,d.h)("prompt-detector"),x=null;function y(a){let b=a.split("\n"),c=(b.length>200?b.slice(-200):b).join("\n");return c.length>5e3&&(c=c.slice(-5e3)),c}let z=[{regex:/^(.+)\s+\(y\/n\)\s*$/m},{regex:/^(.+)\s+\[y\/N\]\s*$/m,defaultOption:"no"},{regex:/^(.+)\s+\[Y\/n\]\s*$/m,defaultOption:"yes"},{regex:/^(.+)\s+\(yes\/no\)\s*$/m}];function A(a,b,c,d){return{isPrompt:!0,promptData:{type:"yes_no",question:a,options:["yes","no"],status:"pending",...void 0!==d&&{defaultOption:d},instructionText:c},cleanContent:b,rawContent:c}}function B(a,b){let c=(0,e.N)(a),d=c===a&&b?.precomputedLines?b.precomputedLines:c.split("\n"),p=d.slice(-50).join("\n"),v=p===x;v||w.debug("detectPrompt:start",{outputLength:c.length}),x=p;let B=d.slice(-20).join("\n"),C=function(a,b,c){var d,p;a=(0,e.N)(a);let v=b?.requireDefaultIndicator??!0,w=a.split("\n"),x=w.length;for(;x>0&&""===w[x-1].trim();)x--;let y=Math.max(0,x-50),z=!1;for(let a=x-1;a>=y;a--){let b=m.test(w[a]);if(l.test(w[a])||b){x=a,z=b;break}}let A=w.slice(y,x);for(let b of A)if(f.l8.test(b))return s(a);let B=!1,C=!1;for(let a of A){let b=a.trim();if(!B&&n.test(b)){B=!0,o.test(b)&&(C=!0);break}}if(v){let b=!1;for(let a of A){let c=a.trim();if(g.test(c)){b=!0;break}}if(!b&&!B)return s(a)}let D=[],E=-1,F=0;for(let b=x-1;b>=y;b--){let c=w[b].trim();if(j.test(c)||k.test(c)){F++;continue}let d=c.match(g);if(d){let a=parseInt(d[1],10);if(a<=20&&r(a,D)){let b=d[2].trim();D.unshift({number:a,label:b,isDefault:!0}),F=0;continue}}let e=c.match(h);if(e){let a=parseInt(e[1],10);if(a>20);else if(r(a,D)){let b=e[2].trim();D.unshift({number:a,label:b,isDefault:!1}),F=0;continue}}if(0===D.length&&(c.startsWith("❯")||c.startsWith("●")||c.startsWith("›")))return s(a);if(D.length>0&&c&&!i.test(c)){let a=w[b];if(/^\s{4,}/.test(a)&&u(a,c)){if(++F>25){E=b;break}continue}if(t(c)){E=b;break}if(u(a,c)){if(++F>(/^\s{4,}/.test(a)?25:5)){E=b;break}continue}E=b;break}}if(!function(a){if(0===a.length||1!==a[0])return!1;let b=0;for(let c=1;c<a.length;c++){let d=a[c]-a[c-1];if(d<1||d>2||(2===d&&b++,b>1))return!1}return!0}(D.map(a=>a.number)))return s(a);let G=D.some(a=>a.isDefault),H=v&&B;if(D.length<2||v&&!G&&!H||!v&&(-1===E||!t(w[E]?.trim()??"")&&!function(a,b,c,d){let e=Math.max(d,b-3);for(let c=b-1;c>=e;c--){let b=a[c]?.trim()??"";if(!(!b||i.test(b))&&t(b))return!0}return!1}(w,E,0,y)))return s(a);let I=function(a,b){if(b<0)return"Please select an option:";let c=[];for(let d=Math.max(0,b-5);d<=b;d++){let b=a[d].trim();b&&!i.test(b)&&c.push(b)}return c.join(" ")}(w,E),J=function(a,b,c){if(b<0)return;let d=Math.max(0,b-19),e=a.slice(d,c).map(a=>a.trimEnd()).join("\n").trim();return e.length>0?e:void 0}(w,E,x),K=B?C?"answer_only":"answer_then_enter":void 0;return d=a,p=z,{isPrompt:!0,promptData:{type:"multiple_choice",question:I.trim(),options:D.map(a=>{let b=q.some(b=>b.test(a.label));return{number:a.number,label:a.label,isDefault:a.isDefault,requiresTextInput:b}}),status:"pending",instructionText:J,...K?{submitMode:K}:{},...p?{isAskUserQuestion:!0}:{}},cleanContent:I.trim(),rawContent:c(d.trim())}}(c,b,y);if(C.isPrompt)return v||w.info("detectPrompt:multipleChoice",{isPrompt:!0,question:C.promptData?.question,optionsCount:C.promptData?.options?.length}),C;let D=B.trim();for(let a of z){let b=B.match(a.regex);if(b){let c=b[1].trim();return A(c,c,D,a.defaultOption)}}let E=B.match(/^(.*?)Approve\?\s*$/m);if(E){let a=E[1].trim();return A(a?`${a} Approve?`:"Approve?",a||"Approve?",D)}return v||w.debug("detectPrompt:complete",{isPrompt:!1}),{isPrompt:!1,cleanContent:c.trim()}}},25754:(a,b,c)=>{"use strict";c.d(b,{Xn:()=>e,d9:()=>g,gB:()=>f,rv:()=>h});let d=["en","ja"],e="en",f="locale";function g(a){return"string"==typeof a&&d.includes(a)}function h(a,b){return g(a)?a:d.find(a=>(b??"").includes(a))??e}},26838:(a,b,c)=>{"use strict";c.d(b,{Mj:()=>k,Sw:()=>j,lX:()=>l});var d=c(29021),e=c(33873),f=c(90164);let g=/^v?\d+\.\d+\.\d+$/,h=/^[a-zA-Z0-9.\-\s_v]+$/,i=globalThis.__versionCheckCache??(globalThis.__versionCheckCache={result:null,fetchedAt:0,rateLimitResetAt:null});function j(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.16.0"}function k(){return j()}async function l(){try{var a,b,c;if(null!==i.result&&Date.now()-i.fetchedAt<36e5||i.rateLimitResetAt&&(!(Date.now()>=i.rateLimitResetAt)||(i.rateLimitResetAt=null,0)))return i.result;let d=await fetch("https://api.github.com/repos/Kewton/CommandMate/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":`CommandMate/${k()}`},cache:"no-store",signal:AbortSignal.timeout(5e3)});if(403===d.status)return function(a){let b=a.headers.get("X-RateLimit-Reset");b?i.rateLimitResetAt=1e3*parseInt(b,10):i.rateLimitResetAt=Date.now()+36e5}(d),i.result;if(!d.ok)return i.result;let e=await d.json(),j=k(),l=e.tag_name.replace(/^v/,""),m={hasUpdate:function(a,b){if(!g.test(a)||!g.test(b))return!1;let c=a=>a.replace(/^v/,"").split(".").map(Number),[d,e,f]=c(a),[h,i,j]=c(b);return h!==d?h>d:i!==e?i>e:j>f}(j,e.tag_name),currentVersion:j,latestVersion:l,releaseUrl:(a=e.html_url).startsWith(f.Dk)?a:null,releaseName:(b=e.name,c=e.tag_name,h.test(b)&&b.length<=128?b:c),publishedAt:e.published_at};return i.result=m,i.fetchedAt=Date.now(),m}catch{return i.result}}},30618:(a,b,c)=>{"use strict";c.d(b,{xT:()=>w,Ui:()=>x});var d=c(44265),e=c(11665),f=c(40236),g=c(93997),h=c(29021),i=c(33873),j=c(72626);let k=(0,j.h)("cli-tools/opencode-config"),l=/^[a-zA-Z0-9._:/-]{1,100}$/,m=/^[a-zA-Z0-9._:/@-]{1,200}$/;async function n(){let a={};try{let b=new AbortController,c=setTimeout(()=>b.abort(),3e3),d=await fetch("http://localhost:11434/api/tags",{signal:b.signal}).finally(()=>{clearTimeout(c)});if(!d.ok)return k.warn("ollama-api-returned"),{};let e=await d.text();if(e.length>1048576)return k.warn("ollama-api-response"),{};let f=JSON.parse(e);if(!f||!Array.isArray(f.models))return k.warn("invalid-ollama-api"),{};for(let b of f.models.slice(0,100))"string"==typeof b?.name&&l.test(b.name)&&(a[b.name]={name:function(a){let b=String(a.name),c=a.details;if(!c)return b;let d=[b];return"string"==typeof c.parameter_size&&/^[\d.]+[BKMGT]?B?$/i.test(c.parameter_size)&&d.push(c.parameter_size),"string"==typeof c.quantization_level&&/^[A-Z0-9_]{1,20}$/i.test(c.quantization_level)&&d.push(c.quantization_level),d.length>1?`${b} (${d.slice(1).join(", ")})`:b}(b)})}catch(a){a instanceof Error&&"AbortError"===a.name?k.warn("ollama-api-timeout"):k.warn("failed-to-fetch")}return a}async function o(){let a={};try{let b=new AbortController,c=setTimeout(()=>b.abort(),3e3),d=await fetch("http://localhost:1234/v1/models",{signal:b.signal}).finally(()=>{clearTimeout(c)});if(!d.ok)return k.warn("lm-studio-api"),{};let e=await d.text();if(e.length>1048576)return k.warn("lm-studio-api"),{};let f=JSON.parse(e);if(!f||!Array.isArray(f.data))return k.warn("invalid-lm-studio"),{};for(let b of f.data.slice(0,100))"string"==typeof b?.id&&m.test(b.id)&&(a[b.id]={name:b.id})}catch(a){a instanceof Error&&"AbortError"===a.name?k.warn("lm-studio-api"):k.warn("failed-to-fetch")}return a}async function p(a){let b=function(a){let b=i.resolve(a);try{if(!h.lstatSync(b).isDirectory())throw Error(`Path is not a directory: ${b}`)}catch(a){if("ENOENT"===a.code)throw Error(`Path does not exist: ${b}`);throw a}return h.realpathSync(b)}(a),c=i.join(b,"opencode.json");if(h.existsSync(c))return;let[d,e]=await Promise.all([n(),o()]),f={};if(Object.keys(d).length>0&&(f.ollama={npm:"@ai-sdk/openai-compatible",name:"Ollama (local)",options:{baseURL:"http://localhost:11434/v1"},models:d}),Object.keys(e).length>0&&(f.lmstudio={npm:"@ai-sdk/openai-compatible",name:"LM Studio (local)",options:{baseURL:"http://localhost:1234/v1"},models:e}),0!==Object.keys(f).length)try{h.writeFileSync(c,JSON.stringify({$schema:"https://opencode.ai/config.json",provider:f},null,2),{encoding:"utf-8",flag:"wx"})}catch(a){if("EEXIST"===a.code)return;k.warn("failed-to-write-opencodejson:error-insta")}}var q=c(79646),r=c(28354),s=c(20610);let t=(0,j.h)("cli-tools/opencode"),u=(0,r.promisify)(q.execFile);function v(a){return a instanceof Error?a.message:String(a)}let w=200;class x extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,e.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("OpenCode is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,e.N)(d)){await this.reconcileExistingSession(d,{windowWidth:80,windowHeight:w}),t.info("opencode-session-sessionname");return}try{await p(b),await (0,e.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,s.Uc));try{await u("tmux",["resize-window","-t",(0,e.lA)(d),"-x","80","-y",String(w)])}catch{}await (0,e.V1)(d,"opencode",!0),await new Promise(a=>setTimeout(a,15e3)),t.info("started-opencode-session:sessionname")}catch(b){let a=v(b);throw Error(`Failed to start OpenCode session: ${a}`)}}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,e.N)(d))throw Error(`OpenCode session ${d} does not exist. Start the session first.`);try{await (0,f.FW)({sessionName:d,message:b,cliToolId:"opencode"}),(0,g.gm)(d),t.info("sent-message-to-opencode-session:session")}catch(b){let a=v(b);throw Error(`Failed to send message to OpenCode: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,e.N)(c)?(await (0,e.V1)(c,"/exit",!0),await new Promise(a=>setTimeout(a,s.KI)),await (0,e.N)(c)&&await (0,e.fY)(c)):await (0,e.fY)(c),(0,g.gm)(c),t.info("stopped-opencode-session:sessionname")}catch(a){throw t.error("session:stop-failed",{error:v(a)}),a}}constructor(...a){super(...a),this.id="opencode",this.name="OpenCode",this.command="opencode"}}},31268:(a,b,c)=>{"use strict";c.d(b,{s:()=>K});var d=c(44265),e=c(57905);class f extends d.M{async isInstalled(){return await (0,e.zw)()}async isRunning(a,b){return await (0,e.Yq)(a,b)}async startSession(a,b,c){await (0,e.R7)({worktreeId:a,worktreePath:b,instanceId:c})}async sendMessage(a,b,c){await (0,e.pU)(a,b,c)}supportsImage(){return!0}async sendMessageWithImage(a,b,c,d){let e=`
|
|
2
2
|
`,f=b?`${b}${e}`:e;await this.sendMessage(a,f,d)}async killSession(a,b){await (0,e.VU)(a,b)}constructor(...a){super(...a),this.id="claude",this.name="Claude Code",this.command="claude"}}var g=c(11665),h=c(40236),i=c(93997),j=c(26283),k=c(72626),l=c(20610);let m=(0,k.h)("cli-tools/codex");function n(a){return a instanceof Error?a.message:String(a)}class o extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("Codex CLI is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,g.N)(d)){await this.reconcileExistingSession(d),m.info("codex-session-sessionname");return}try{await (0,g.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,l.Uc)),await (0,g.V1)(d,"codex",!0),await new Promise(a=>setTimeout(a,3e3)),await this.waitForReady(d),m.info("started-codex-session:sessionname")}catch(b){let a=n(b);throw Error(`Failed to start Codex session: ${a}`)}}async waitForReady(a){let b=!1,c=!1;for(let d=0;d<30;d++){try{let d=await (0,g.Xg)(a,50),e=(0,j.aJ)(d);if((0,j.zZ)(e))return void m.info("codex-prompt-detected");let f=(0,j.Qh)(e);if("update"===f&&!b){await (0,g.V1)(a,"2",!1),b=!0,m.info("skipped-codex-update"),await new Promise(a=>setTimeout(a,l.CV));continue}if("press-enter"===f){await (0,g.ds)(a,"Enter"),m.info("dismissed-codex-notification"),await new Promise(a=>setTimeout(a,l.CV));continue}if("trust"===f&&!c){await (0,g.V1)(a,"1",!1),c=!0,m.info("auto-trusted-folder-for"),await new Promise(a=>setTimeout(a,l.CV));continue}}catch{}await new Promise(a=>setTimeout(a,1e3))}m.info("codex-prompt-detection")}async waitForPrompt(a){let b=Date.now();for(;Date.now()-b<15e3;){try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if((0,j.zZ)(c))return}catch{}await new Promise(a=>setTimeout(a,500))}throw m.info("codex-prompt-not"),Error("Codex prompt not ready: timed out waiting for the input prompt before sending")}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Codex session ${d} does not exist. Start the session first.`);try{await this.waitForPrompt(d),await (0,h.FW)({sessionName:d,message:b,cliToolId:"codex"}),(0,i.gm)(d),m.info("sent-message-to-codex-session:sessionnam")}catch(b){let a=n(b);throw Error(`Failed to send message to Codex: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,g.N)(c)&&(await (0,g.ds)(c,"C-d"),await new Promise(a=>setTimeout(a,l.Zf))),await (0,g.fY)(c)&&m.info("stopped-codex-session:sessionname")}catch(a){throw m.error("session:stop-failed",{error:n(a)}),a}}constructor(...a){super(...a),this.id="codex",this.name="Codex CLI",this.command="codex"}}var p=c(11508),q=c(15194),r=c(88807),s=c(56791);let t=(0,k.h)("cli-tools/vibe-local");function u(a){return a instanceof Error?a.message:String(a)}class v extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("vibe-local is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,g.N)(d)){await this.reconcileExistingSession(d),t.info("vibe-local-session");return}try{await (0,g.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,l.Uc));let c="vibe-local -y";try{let b=(0,r.getDbInstance)(),d=(0,s.Ui)(b,a);d?.vibeLocalModel&&q.QP.test(d.vibeLocalModel)&&(c+=` -m ${d.vibeLocalModel}`);let e=d?.vibeLocalContextWindow;(0,q.FV)(e)&&(c+=` --context-window ${Number(e)}`)}catch{}await (0,g.V1)(d,c,!0),await new Promise(a=>setTimeout(a,5e3)),t.info("started-vibe-local-session:sessionname")}catch(b){let a=u(b);throw Error(`Failed to start Vibe Local session: ${a}`)}}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Vibe Local session ${d} does not exist. Start the session first.`);try{await (0,h.FW)({sessionName:d,message:b,cliToolId:"vibe-local",submitEnterCount:2,interEnterWaitMs:l.PY}),(0,i.gm)(d),t.info("sent-message-to-vibe-local-session:sessi")}catch(b){let a=u(b);throw Error(`Failed to send message to Vibe Local: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,g.N)(c)&&(await (0,g.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,l.Is)),await (0,g.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,l.Zf))),await (0,g.fY)(c)&&t.info("stopped-vibe-local-session:sessionname")}catch(a){throw t.error("session:stop-failed",{error:u(a)}),a}}constructor(...a){super(...a),this.id="vibe-local",this.name="Vibe Local",this.command="vibe-local"}}var w=c(30618),x=c(79646),y=c(56263),z=c(77093);let A=(0,k.h)("cli-tools/copilot"),B=new Set(["model","agent","theme"]);class C extends d.M{async isInstalled(){try{return await new Promise((a,b)=>{(0,x.execFile)("gh",["--version"],{timeout:5e3},c=>{c?b(c):a()})}),await new Promise((a,b)=>{(0,x.execFile)("gh",["copilot","--help"],{timeout:5e3},c=>{c?b(c):a()})}),!0}catch{return!1}}async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("GitHub Copilot CLI is not installed. Install with: gh extension install github/gh-copilot");let d=this.getSessionName(a,c);if(await (0,g.N)(d)){await this.reconcileExistingSession(d),A.info("copilot-session-exists");return}try{await (0,g.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,l.Uc)),await (0,g.V1)(d,"gh copilot",!0),await new Promise(a=>setTimeout(a,4e3)),await this.waitForReady(d),A.info("started-copilot-session")}catch(b){let a=(0,z.u1)(b);throw Error(`Failed to start Copilot session: ${a}`)}}async waitForReady(a){for(let b=0;b<30;b++){try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if(j.Du.test(c))return void A.info("copilot-prompt-detected")}catch{}await new Promise(a=>setTimeout(a,1e3))}A.info("copilot-prompt-detection-timeout")}async waitForPrompt(a,b=15e3){let c=Date.now();for(;Date.now()-c<b;){try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if(j.Du.test(c))return}catch{}await new Promise(a=>setTimeout(a,500))}A.info("copilot-prompt-not-detected")}extractSlashCommand(a){let b=a.trim();if(!b.startsWith("/"))return null;let c=b.match(/^\/(\S+)/);return c?c[1]:null}async waitForSelectionList(a){let b=Date.now();for(;Date.now()-b<5e3;){await new Promise(a=>setTimeout(a,300));try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if(j.Mi.test(c))return A.info("copilot-selection-list-detected"),!0}catch{}}return A.info("copilot-selection-list-not-detected-timeout"),!1}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Copilot session ${d} does not exist. Start the session first.`);try{await this.waitForPrompt(d);let a=this.extractSlashCommand(b);if(a&&B.has(a)){await (0,g.V1)(d,b,!0),await this.waitForSelectionList(d),(0,i.gm)(d),A.info("sent-selection-list-command-to-copilot",{command:a});return}await (0,h.FW)({sessionName:d,message:b,cliToolId:"copilot",textInputWaitMs:y.L1,verifyDelayMs:y.wp}),(0,i.gm)(d),A.info("sent-message-to-copilot-session")}catch(b){let a=(0,z.u1)(b);throw Error(`Failed to send message to Copilot: ${a}`)}}async sendModelCommand(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Copilot session ${d} does not exist. Start the session first.`);try{await (0,g.V1)(d,`/model ${b}`,!0),await this.waitForSelectionList(d)&&await (0,g.ds)(d,"C-m"),await this.waitForPrompt(d,y.pL),(0,i.gm)(d),A.info("copilot-model-switched",{model:b})}catch(c){let a=(0,z.u1)(c);throw Error(`Failed to switch Copilot model to ${b}: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,g.N)(c)&&(await (0,g.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,l.Is)),await (0,g.V1)(c,"exit",!0),await new Promise(a=>setTimeout(a,l.Zf))),await (0,g.fY)(c)&&A.info("stopped-copilot-session")}catch(a){throw A.error("session:stop-failed",{error:(0,z.u1)(a)}),a}}constructor(...a){super(...a),this.id="copilot",this.name="Copilot",this.command="gh"}}let D=(0,k.h)("cli-tools/antigravity");function E(a){return a instanceof Error?a.message:String(a)}let F=/\?\s+for\s+shortcuts/,G=/Do you trust the contents of this project\?/;function H(a){return F.test(a)&&!G.test(a)}class I extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async startSession(a,b,c,d){if(!await this.isInstalled())throw Error("Antigravity CLI (agy) is not installed or not in PATH");let e=this.getSessionName(a,c);if(await (0,g.N)(e)){await this.reconcileExistingSession(e),D.info("antigravity-session-exists");return}try{await (0,g.jw)({sessionName:e,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,l.Uc));let a=d?`agy --model '${d.replace(/'/g,"'\\''")}'`:"agy";await (0,g.V1)(e,a,!0),await new Promise(a=>setTimeout(a,3e3)),await this.waitForReady(e),D.info("started-antigravity-session")}catch(b){let a=E(b);throw Error(`Failed to start Antigravity session: ${a}`)}}async waitForReady(a){let b=!1;for(let c=0;c<30;c++){try{let c=await (0,g.Xg)(a,50),d=(0,j.aJ)(c);if(H(d))return void D.info("antigravity-prompt-detected");if(!b&&G.test(d)){await (0,g.ds)(a,"Enter"),b=!0,D.info("auto-trusted-folder-for-antigravity"),await new Promise(a=>setTimeout(a,500));continue}}catch{}await new Promise(a=>setTimeout(a,1e3))}D.info("antigravity-prompt-detection-timeout")}async waitForPrompt(a){let b=Date.now();for(;Date.now()-b<15e3;){try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if(H(c))return}catch{}await new Promise(a=>setTimeout(a,500))}throw D.info("antigravity-prompt-not-ready"),Error("Antigravity prompt not ready: timed out waiting for the input prompt before sending")}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Antigravity session ${d} does not exist. Start the session first.`);try{await this.waitForPrompt(d),await (0,h.FW)({sessionName:d,message:b,cliToolId:"antigravity"}),(0,i.gm)(d),D.info("sent-message-to-antigravity-session")}catch(b){let a=E(b);throw Error(`Failed to send message to Antigravity: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,g.N)(c)&&(await (0,g.ds)(c,"C-d"),await new Promise(a=>setTimeout(a,l.Zf)));let a=await (0,g.fY)(c);(0,i.gm)(c),a&&D.info("stopped-antigravity-session")}catch(a){throw D.error("session:stop-failed",{error:E(a)}),a}}constructor(...a){super(...a),this.id="antigravity",this.name="Antigravity CLI",this.command="agy"}}var J=c(95220);class K{constructor(){this.tools=new Map,this.tools.set("claude",new f),this.tools.set("codex",new o),this.tools.set("gemini",new p.m),this.tools.set("vibe-local",new v),this.tools.set("opencode",new w.Ui),this.tools.set("copilot",new C),this.tools.set("antigravity",new I)}static getInstance(){return K.instance||(K.instance=new K),K.instance}getTool(a){let b=this.tools.get(a);if(!b)throw Error(`CLI tool '${a}' not found`);return b}getAllTools(){return Array.from(this.tools.values())}async getToolInfo(a){let b=this.getTool(a),c=await b.isInstalled();return{id:b.id,name:b.name,command:b.command,installed:c}}async getAllToolsInfo(){return Promise.all(this.getAllTools().map(async a=>{let b=await a.isInstalled();return{id:a.id,name:a.name,command:a.command,installed:b}}))}async getInstalledTools(){return(await this.getAllToolsInfo()).filter(a=>a.installed)}stopPollers(a,b,c){(0,J.stopPolling)(a,b,c)}}},31766:(a,b,c)=>{"use strict";c.d(b,{Wh:()=>p,WD:()=>q,K1:()=>o});var d=c(31268),e=c(72626),f=c(11665);let g={streamingOutput:!1,explicitResize:!1,snapshotFallback:!0};class h{async unsubscribe(){}}class i{async ensureSession(a,b){await (0,f.N)(a)||await (0,f.jw)(a,b)}async sessionExists(a){return(0,f.N)(a)}async sendInput(a,b){await (0,f.V1)(a,b)}async sendSpecialKey(a,b){if("Escape"!==b&&"C-c"!==b&&"C-d"!==b&&"C-m"!==b&&"Enter"!==b)throw Error(`Unsupported special key for PollingTmuxTransport: ${b}`);await (0,f.ds)(a,b)}async resize(){throw Error("PollingTmuxTransport does not support explicit resize")}async captureSnapshot(a,b){return(0,f.Xg)(a,b)}async subscribe(){return new h}getCapabilities(){return g}async killSession(a){return(0,f.fY)(a)}}let j=null;var k=c(93997);let l=(0,e.h)("cli-session");function m(){return j||(j=new i),j}function n(a,b,c){let e=d.s.getInstance().getTool(b),f=e.getSessionName(a,c);return{cliTool:e,sessionName:f}}async function o(a,b,c){let{sessionName:d}=n(a,b,c);return m().sessionExists(d)}async function p(a,b,c=1e3,d){let e=l.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutput:start",{requestedLines:c});let{cliTool:f,sessionName:g}=n(a,b,d),h=m();try{let a=await (0,k.aq)(g,c,async()=>{if(!await h.sessionExists(g))throw Error(`${f.name} session ${g} does not exist`);return await h.captureSnapshot(g,{startLine:-k.xE})});return e.debug("captureSessionOutput:success",{actualLines:a.split("\n").length,lastFewLines:a.split("\n").slice(-3).join(" | ")}),a}catch(b){let a=b instanceof Error?b.message:String(b);if(a.includes("does not exist"))throw e.debug("captureSessionOutput:sessionNotFound",{sessionName:g}),b;throw e.error("captureSessionOutput:failed",{error:a}),Error(`Failed to capture ${f.name} output: ${a}`)}}async function q(a,b,c=5e3,d){let e=l.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutputFresh:start",{requestedLines:c});let{cliTool:f,sessionName:g}=n(a,b,d),h=m();try{let a=await h.captureSnapshot(g,{startLine:-c});return a.length>0?(0,k.vF)(g,a,c):(0,k.gm)(g),(0,k.wd)(a,c)}catch(b){(0,k.gm)(g);let a=b instanceof Error?b.message:String(b);throw e.error("captureSessionOutputFresh:failed",{error:a}),Error(`Failed to capture ${f.name} output: ${a}`)}}},34405:(a,b,c)=>{"use strict";c.d(b,{G:()=>e,_:()=>d});let d=1e4,e=1e3},34892:(a,b,c)=>{"use strict";c.d(b,{$:()=>j});var d=c(56791),e=c(31268),f=c(31766),g=c(95595),h=c(5344),i=c(34405);async function j(a,b,c,j){let k=j??c,l=e.s.getInstance().getTool(c);if(!await l.isRunning(b,j))return{isRunning:!1,content:"",lineCount:0,cliToolId:c,sessionStatus:"idle",sessionStatusReason:"session_not_running"};let m=(0,d.y1)(a,b,k),n=m?.lastCapturedLine||0,o=await (0,f.Wh)(b,c,i._,j),p=o.split("\n"),q=p.length,r=p.slice(Math.max(0,n)).join("\n"),s=(0,h.v7)(b,c,j),t=(0,h.xU)(s),u=t?new Date(t):void 0,v=(0,g.WC)(o,c,u),w="running"===v.status&&v.reason===g.gv.THINKING_INDICATOR,x=v.hasActivePrompt,y="waiting"===v.status&&g.ug.has(v.reason),z=v.reason===g.gv.CODEX_PAGER,A="running"===v.status&&v.reason===g.gv.DEFAULT||"ready"===v.status&&v.reason===g.gv.NO_RECENT_OUTPUT,B=p.slice(-100).join("\n"),C=(0,h.aq)(b,c,j);return{isRunning:!0,cliToolId:c,sessionStatus:v.status,sessionStatusReason:v.reason,content:r,fullOutput:o,realtimeSnippet:B,lineCount:q,lastCapturedLine:n,isComplete:x,isGenerating:w,thinking:w,thinkingMessage:w?"Claude is thinking...":null,isPromptWaiting:x,promptData:x?v.promptDetection.promptData??null:null,autoYes:{enabled:C?.enabled??!1,expiresAt:C?.enabled?C.expiresAt:null,stopReason:C?.stopReason},isSelectionListActive:y,isPagerActive:z,isUnclassifiedActive:A,lastServerResponseTimestamp:t,serverPollerActive:(0,h.bZ)(s)}}},39727:()=>{},40236:(a,b,c)=>{"use strict";c.d(b,{FW:()=>l});var d=c(11665),e=c(93997),f=c(26283),g=c(20610);let h=(0,c(72626).h)("cli-tools/submit-verified-sender"),i=/\[Pasted text[\s#]/,j=/^\/[A-Za-z]/,k=/^\s*(?:ctx:\d+%\s*)?[>❯›]/;async function l(a){let{sessionName:b,message:c,cliToolId:l,textInputWaitMs:m=g.pL,submitEnterCount:n=1,interEnterWaitMs:o=g.pL,verifyAttempts:p=4,verifyDelayMs:q=g.x9}=a;await (0,d.V1)(b,c,!1),await new Promise(a=>setTimeout(a,m));for(let a=0;a<Math.max(1,n);a++)await (0,d.KB)(b,["Enter"]),a<n-1&&await new Promise(a=>setTimeout(a,o));let r=Math.max(1,p);for(let a=0;a<r;a++){await new Promise(a=>setTimeout(a,q));let g=function(a,b,c){let d=(0,f.aJ)(a).split("\n").slice(-12),e=d.join("\n");if((0,f.ut)(b,e))return"submitted";let g=function(a){for(let b=a.length-1;b>=0;b--)if(k.test(a[b]))return a[b];return null}(d);if(!g)return"submitted";let h=g.replace(k,"").trim();return 0===h.length?"submitted":i.test(g)||function(a,b){let c=b.split("\n").map(a=>a.trim()).find(a=>a.length>0)??"";return 0!==c.length&&c.startsWith(a)}(h,c)?"pending":j.test(h)?"replaced":"submitted"}(await (0,d.Xg)(b,{startLine:-12}),l,c);if("submitted"===g)return void(0,e.gm)(b);if("replaced"===g){try{await (0,d.Ce)(b)}catch(a){h.error("submit-clear-input-failed",{sessionName:b,cliToolId:l,error:a instanceof Error?a.message:String(a)})}throw(0,e.gm)(b),h.error("submit-replaced-by-tui-completion",{sessionName:b,cliToolId:l,attempt:a}),Error(`Message was replaced by a TUI autocompletion for session ${b}; the input no longer matches the sent text. Cleared the input line without submitting to avoid executing a different command.`)}h.warn("submit-not-confirmed:resending-enter",{sessionName:b,cliToolId:l,attempt:a}),await (0,d.KB)(b,["Enter"])}throw(0,e.gm)(b),h.error("submit-verification-failed",{sessionName:b,cliToolId:l,attempts:r}),Error(`Message submit could not be confirmed for session ${b} after ${r} attempts (typed but unsent)`)}},41364:(a,b,c)=>{"use strict";c.d(b,{Gv:()=>o,hM:()=>n});var d=c(79748),e=c.n(d),f=c(33873),g=c.n(f),h=c(1634),i=c(21684),j=c(72626),k=c(15194);function l(a="claude"){return g().join((0,i.U)(),a)}async function m(a="claude"){let b=l(a);try{await e().access(b)}catch{await e().mkdir(b,{recursive:!0})}}async function n(a,b,c,d="claude"){await m(d);let f=function(a,b="claude"){let c=(0,h.GP)(new Date,"yyyy-MM-dd"),d=`${a}-${c}.md`,e=l(b);return g().join(e,d)}(a,d),i=(0,h.GP)(new Date,"yyyy-MM-dd HH:mm:ss"),j="";try{j=await e().readFile(f,"utf-8")}catch{let b=(0,k.hR)(d)?k.ef[d]:d;j=`# ${b} Conversation Log: ${a}
|
|
3
3
|
|
|
4
4
|
Created: ${i}
|
|
@@ -17,4 +17,4 @@ Created: ${i}
|
|
|
17
17
|
|
|
18
18
|
`,j+=`---
|
|
19
19
|
|
|
20
|
-
`,await e().writeFile(f,j,"utf-8"),f}async function o(a,b="all"){let c="all"===b?[...k.XH]:[b],d=[];for(let b of c){await m(b);let c=l(b);try{let b=(await e().readdir(c)).filter(b=>b.startsWith(`${a}-`)&&b.endsWith(".md")).map(a=>g().join(c,a));d.push(...b)}catch{}}return d.sort().reverse()}(0,j.h)("log-manager")},44265:(a,b,c)=>{"use strict";c.d(b,{M:()=>k});var d=c(79646),e=c(28354),f=c(15194);let g=/^[a-zA-Z0-9_-]+$/;function h(a){if(!g.test(a))throw Error(`Invalid session name format: ${a}`)}var i=c(11665);let j=(0,e.promisify)(d.exec);class k{async isInstalled(){try{return await j(`which ${this.command}`,{timeout:5e3}),!0}catch{return!1}}getSessionName(a,b){let c=`mcbd-${this.id}-${a}`;if(!b||b===this.id)return h(c),c;let d=(0,f.pL)(b,this.id),e=d?`${c}-${d}`:c;return h(e),e}async reconcileExistingSession(a,b){await (0,i.zT)(a,b)}async interrupt(a,b){let c=this.getSessionName(a,b);await (0,i.ds)(c,"Escape")}}},45146:(a,b,c)=>{"use strict";c.d(b,{Et:()=>q,KQ:()=>s,MN:()=>n,SI:()=>k,fq:()=>r,g8:()=>o});var d=c(72626),e=c(13033),f=c(72457),g=c(71080),h=c(3523),i=c(99508);let j=(0,d.h)("response-poller"),k=["Waiting for auth","⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],l=new Map,m=new Map;function n(a,b,c){return`${a}:${c??b}`}function o(a,b,c){let d=n(a,b,c);q(a,b,c),m.set(d,Date.now()),("opencode"===b||"copilot"===b)&&(0,e.tb)(d),function a(b,c,d){let e=n(b,c,d),f=setTimeout(async()=>{let f=m.get(e);if(f&&Date.now()-f>18e5)return void q(b,c,d);try{await (0,h.zX)(b,c,d)}catch(a){j.error("error:",{error:a instanceof Error?a.message:String(a)})}(0,i.broadcastTerminalSnapshot)(b,c,d),l.has(e)&&a(b,c,d)},2e3);l.set(e,f)}(a,b,c)}function p(a){let b=l.get(a);b&&(clearTimeout(b),l.delete(a),m.delete(a)),(0,e.q1)(a),(0,f.iX)(a),(0,g.L)(a)}function q(a,b,c){p(n(a,b,c))}function r(){for(let a of Array.from(l.keys()))p(a)}function s(){return Array.from(l.keys())}},46423:(a,b,c)=>{"use strict";c.d(b,{$:()=>d});let d=5},47990:()=>{},49358:a=>{"use strict";a.exports=JSON.parse('{"title":"Notifications","description":"Get a push notification when an agent is waiting for you or finishes a session — even when the app is closed.","enable":"Enable notifications","enabling":"Enabling…","enabledOnThisDevice":"Notifications are enabled on this device.","unsubscribe":"Unsubscribe this device","types":{"heading":"Notify me about","promptWaiting":"Prompt waiting","promptWaitingDesc":"When an agent is waiting for your reply","completion":"Session complete","completionDesc":"When an agent finishes a session"},"permission":{"denied":"Notifications are blocked in your browser settings. Allow them for this site to receive push notifications."},"unsupported":"This browser does not support push notifications.","notConfigured":"Push notifications are not configured on this server. Set the VAPID keys to enable them.","ios":{"guidance":"On iPhone/iPad, add this app to your Home Screen and open it from there to enable notifications."},"toast":{"enabled":"Notifications enabled on this device","disabled":"Notifications turned off on this device","error":"Could not enable notifications","updated":"Notification settings updated"},"push":{"promptWaitingWithExcerpt":"Waiting for reply: {excerpt}","promptWaiting":"Waiting for your reply","completionWithExcerpt":"Done: {excerpt}","completion":"Session complete"}}')},56263:(a,b,c)=>{"use strict";c.d(b,{L1:()=>e,MJ:()=>j,Rf:()=>f,ky:()=>g,lM:()=>i,pL:()=>h,wp:()=>d});let d=200,e=100,f=1e5,g="[... truncated ...]",h=3e4,i=/^[a-zA-Z0-9][a-zA-Z0-9\-._/:]*$/,j=128},56791:(a,b,c)=>{"use strict";c.d(b,{AC:()=>d.AC,ug:()=>d.ug,lm:()=>d.lm,KG:()=>d.KG,cD:()=>d.cD,Jj:()=>d.Jj,YX:()=>d.YX,G4:()=>d.G4,hL:()=>d.hL,qp:()=>d.qp,To:()=>d.To,oH:()=>d.oH,py:()=>d.py,yy:()=>d.yy,pE:()=>d.pE,z2:()=>d.z2,cP:()=>d.cP,DF:()=>d.DF,lA:()=>d.lA,Qp:()=>d.Qp,th:()=>d.th,oZ:()=>d.oZ,ZP:()=>d.ZP,Ys:()=>d.Ys,vg:()=>d.vg,Rm:()=>d.Rm,BN:()=>d.BN,m0:()=>d.m0,Tk:()=>d.Tk,iT:()=>d.iT,gp:()=>d.gp,yE:()=>d.yE,BE:()=>d.BE,qK:()=>d.qK,p4:()=>d.p4,r8:()=>d.r8,of:()=>d.of,DN:()=>d.DN,pZ:()=>d.pZ,kA:()=>d.kA,VL:()=>d.VL,CF:()=>d.CF,NV:()=>d.NV,ce:()=>d.ce,y1:()=>d.y1,Nr:()=>d.Nr,ob:()=>d.ob,fr:()=>d.fr,Ui:()=>d.Ui,P9:()=>d.P9,eN:()=>d.eN,vi:()=>d.vi,uJ:()=>d.uJ,yT:()=>d.yT,PL:()=>d.PL,jp:()=>d.jp,nQ:()=>d.nQ,yb:()=>d.yb,GA:()=>d.GA,Cs:()=>d.Cs,xR:()=>d.xR,az:()=>d.az,nZ:()=>d.nZ,PP:()=>d.PP,Dx:()=>d.Dx,O:()=>d.O,EU:()=>d.EU,HZ:()=>d.HZ,UY:()=>d.UY,cw:()=>d.cw,jJ:()=>d.jJ,DC:()=>d.DC,gb:()=>d.gb,yB:()=>d.yB,uy:()=>d.uy,s:()=>d.s,iu:()=>d.iu,hq:()=>d.hq,z1:()=>d.z1,bl:()=>d.bl,jA:()=>d.jA,ZL:()=>d.ZL});var d=c(25537);c(88807),c(80499),c(20416),c(10406),c(29021),c(33873),c(21820),c(7956),(0,c(72626).h)("db-migration-path")},57905:(a,b,c)=>{"use strict";c.d(b,{c0:()=>I,zw:()=>E,Yq:()=>F,oV:()=>B,pU:()=>H,R7:()=>G,VU:()=>J});var d=c(11665),e=c(26283),f=c(40236),g=c(93997),h=c(77093),i=c(20610),j=c(79646),k=c(28354),l=c(72626);let m=(0,l.h)("session-key-sender"),n=(0,k.promisify)(j.exec);async function o(a,b=50){let c=await (0,d.Xg)(a,{startLine:-b});return(0,e.aJ)(c)}async function p(a){await n("tmux set-environment -g -u CLAUDECODE 2>/dev/null || true"),await (0,d.V1)(a,"unset CLAUDECODE",!0),await new Promise(a=>setTimeout(a,i.Em))}async function q(a,b){let c=Date.now();for(;Date.now()-c<b;){let b=await o(a);if(e.hx.test(b))return;await new Promise(a=>setTimeout(a,200))}throw Error(`Prompt detection timeout (${b}ms)`)}async function r(a,b,c,h){if(!await (0,d.N)(a))throw Error(`Claude session ${a} does not exist. Start the session first.`);let i=await o(a);e.hx.test(i)||await q(a,h),await new Promise(a=>setTimeout(a,c)),await (0,f.FW)({sessionName:a,message:b,cliToolId:"claude"}),(0,g.gm)(a),m.info("sent-message-to-session",{sessionName:a})}async function s(a){try{await (0,d.N)(a)&&(await (0,d.V1)(a,"",!1),await (0,d.ds)(a,"C-d"),(0,g.gm)(a),await new Promise(a=>setTimeout(a,i.Zf)));let b=await (0,d.fY)(a);return b&&m.info("stopped-session",{sessionName:a}),b}catch(a){return m.error("session:stop-failed",{error:(0,h.u1)(a)}),!1}}var t=c(79748),u=c(15194);let v=(0,l.h)("claude-session"),w=(0,k.promisify)(j.exec),x=["$","%","#"],y=null;async function z(){if(y)return y;let a=process.env.CLAUDE_PATH;if(a&&(/^[/a-zA-Z0-9._-]+$/.test(a)?!a.includes("..")||(v.info("claudepath-contains-path"),!1):(v.info("claudepath-contains-invalid-characters-i"),!1)))try{return await (0,t.access)(a,t.constants.X_OK),y=a}catch{v.info("claudepath-is-not-executable:envclaudepa")}try{let{stdout:a}=await w("which claude",{timeout:5e3});return y=a.trim()}catch{for(let a of["/opt/homebrew/bin/claude","/usr/local/bin/claude","/usr/bin/claude"])try{return await w(`test -x "${a}"`,{timeout:1e3}),y=a}catch{}throw Error("Claude CLI not found. Set CLAUDE_PATH environment variable or install Claude CLI.")}}async function A(a,b=50){let c=await (0,d.Xg)(a,{startLine:-b});return(0,e.aJ)(c)}async function B(a){try{let b=(await A(a)).trim();if(""===b)return{healthy:!1,reason:"empty output"};if(e.hx.test(b))return{healthy:!0};let c=b.split("\n").filter(a=>""!==a.trim()),d=c.slice(-10).join("\n");for(let a of e.F0)if(d.includes(a))return{healthy:!1,reason:`error pattern: ${a}`};for(let a of e.Fw)if(a.test(d))return{healthy:!1,reason:`error pattern: ${a.source}`};let f=c[c.length-1]?.trim()??"";if(f.length>=40)return{healthy:!0};if(x.some(a=>!(!f.endsWith(a)||"%"===a&&/\d+%$/.test(f))))return{healthy:!1,reason:`shell prompt ending detected: ${f}`};return{healthy:!0}}catch{return{healthy:!1,reason:"capture error"}}}async function C(a){return!!(await B(a)).healthy||(v.warn("session-sessionname-unhealthy:resultreas"),await (0,d.fY)(a),!1)}function D(a,b){let c=`mcbd-claude-${a}`;if(!b||"claude"===b)return c;let d=(0,u.pL)(b,"claude");return d?`${c}-${d}`:c}async function E(){try{return await w("which claude",{timeout:5e3}),!0}catch{return!1}}async function F(a,b){let c=D(a,b);return!!await (0,d.N)(c)&&(!!(await B(c)).healthy||(v.warn("session-sessionname-unhealthy:resultreas"),!1))}async function G(a){let{worktreeId:b,worktreePath:c,instanceId:f}=a;if(!await E())throw Error("Claude CLI is not installed or not in PATH");let g=D(b,f);if(await (0,d.N)(g)&&await C(g)){await (0,d.zT)(g),v.info("claude-session-sessionname");return}try{await (0,d.jw)({sessionName:g,workingDirectory:c,historyLimit:5e4}),await p(g);let a=await z();await (0,d.V1)(g,a,!0);let b=Date.now(),f=!1,h=!1;for(;Date.now()-b<15e3;){await new Promise(a=>setTimeout(a,300));try{let a=await A(g);if(e.hx.test(a)){await new Promise(a=>setTimeout(a,500)),v.info("claude-initialized-in"),f=!0;break}!h&&e.CX.test(a)&&(await (0,d.V1)(g,"",!0),h=!0,v.info("trust-dialog-detected"))}catch{}}if(!f)throw Error("Claude initialization timeout (15000ms)");v.info("started-claude-session:sessionname")}catch(a){throw y=null,v.error("session:start-failed",{error:a instanceof Error?a.message:String(a)}),Error("Failed to start Claude session")}}async function H(a,b,c){let d=D(a,c);await r(d,b,500,1e4)}async function I(a,b=1e3,c){let e=D(a,c);if(!await (0,d.N)(e))throw Error(`Claude session ${e} does not exist`);try{return await (0,d.Xg)(e,{startLine:-b})}catch(a){throw Error(`Failed to capture Claude output: ${a instanceof Error?a.message:String(a)}`)}}async function J(a,b){return s(D(a,b))}},61296:a=>{"use strict";a.exports=JSON.parse('{"title":"通知","description":"エージェントが応答待ちになったり、セッションが完了したときに、アプリを開いていなくてもプッシュ通知を受け取れます。","enable":"通知を有効にする","enabling":"有効化中…","enabledOnThisDevice":"この端末で通知が有効です。","unsubscribe":"この端末の通知を解除","types":{"heading":"通知する種別","promptWaiting":"応答待ち","promptWaitingDesc":"エージェントがあなたの応答を待っているとき","completion":"セッション完了","completionDesc":"エージェントがセッションを完了したとき"},"permission":{"denied":"ブラウザの設定で通知がブロックされています。このサイトの通知を許可してください。"},"unsupported":"このブラウザはプッシュ通知に対応していません。","notConfigured":"このサーバーではプッシュ通知が設定されていません。VAPID鍵を設定すると有効になります。","ios":{"guidance":"iPhone/iPadでは、このアプリをホーム画面に追加し、そこから開くと通知を有効にできます。"},"toast":{"enabled":"この端末で通知を有効にしました","disabled":"この端末の通知をオフにしました","error":"通知を有効にできませんでした","updated":"通知設定を更新しました"},"push":{"promptWaitingWithExcerpt":"応答待ち: {excerpt}","promptWaiting":"応答待ちです","completionWithExcerpt":"完了: {excerpt}","completion":"セッションが完了しました"}}')},63865:(a,b,c)=>{"use strict";function d(){let a=process.env.CM_VAPID_PUBLIC_KEY?.trim(),b=process.env.CM_VAPID_PRIVATE_KEY?.trim();return a&&b?{publicKey:a,privateKey:b,subject:process.env.CM_VAPID_SUBJECT?.trim()||"mailto:commandmate@localhost"}:null}function e(){return d()?.publicKey??null}c.d(b,{HR:()=>e,J$:()=>t});var f=c(48975),g=c.n(f),h=c(88807),i=c(43167),j=c(72626),k=c(25754),l=c(49358),m=c(61296),n=c(55511);let o=new Map,p=(0,j.h)("push/sender"),q={en:l.push,ja:m.push};function r(a){return(0,k.d9)(a)?a:k.Xn}async function s(a,b){try{await g().sendNotification({endpoint:a.endpoint,keys:a.keys},b)}catch(c){let b=c.statusCode;if(404===b||410===b){(0,i.th)((0,h.getDbInstance)(),a.endpoint),p.info("push-subscription-removed",{statusCode:b});return}p.warn("push-send-failed",{statusCode:b??"unknown"})}}async function t(a){try{let b=d();if(!b||!function(a,b=Date.now(),c=3e4){var d;let e=`${a.worktreeId}:${a.kind}`,f=(d=a.content??"",(0,n.createHash)("sha256").update(d).digest("hex")),g=o.get(e);return(!g||g.hash!==f||!(b-g.at<c))&&(o.set(e,{hash:f,at:b}),!0)}({worktreeId:a.worktreeId,kind:a.kind,content:a.excerpt}))return;let c=(0,h.getDbInstance)(),e=(0,i.gn)(c,a.kind);if(0===e.length)return;g().setVapidDetails(b.subject,b.publicKey,b.privateKey);let f=new Map;for(let a of e){let b=r(a.locale),c=f.get(b);c?c.push(a):f.set(b,[a])}await Promise.all(Array.from(f,([b,c])=>{let d=JSON.stringify(function(a,b=k.Xn,c=Date.now()){let d=function(a,b=120){if(!a)return"";let c=a.replace(/\s+/g," ").trim();return c.length<=b?c:c.slice(0,b-1).trimEnd()+"…"}(a.excerpt),e=a.agentName?` (${a.agentName})`:"",f=`${a.worktreeName}${e}`,g=q[r(b)],h="prompt"===a.kind?d?g.promptWaitingWithExcerpt.replace("{excerpt}",d):g.promptWaiting:d?g.completionWithExcerpt.replace("{excerpt}",d):g.completion;return{kind:a.kind,title:f,body:h,worktreeId:a.worktreeId,url:`/worktrees/${a.worktreeId}`,tag:`${a.worktreeId}:${a.kind}`,timestamp:c}}(a,b));return Promise.all(c.map(a=>s(a,d)))}))}catch(a){p.warn("push-fanout-error",{error:a instanceof Error?a.message:String(a)})}}},63869:(a,b,c)=>{"use strict";c.d(b,{t:()=>j});var d=c(11665),e=c(81254),f=c(93997),g=c(20610);let h=/^\[[ x]\] /;function i(a){if(0===a)return[];let b=a>0?"Down":"Up";return Array.from({length:Math.abs(a)},()=>b)}async function j(a){let{sessionName:b,answer:c,cliToolId:j,promptData:k,fallbackPromptType:l,fallbackDefaultOptionNumber:m}=a;if(("claude"===j||"antigravity"===j)&&(k?.type==="multiple_choice"||"multiple_choice"===l)&&/^\d+$/.test(c)){let a,e=parseInt(c,10),f=null;if(k?.type==="multiple_choice"){let b=(f=k.options).find(a=>a.isDefault);a=b?.number??1}else a=m??1;let g=e-a;if(null!==f&&f.some(a=>h.test(a.label))&&null!==f){let a=f.filter(a=>h.test(a.label)).length,c=[...i(g),"Space"];c.push(...i(a-e+1)),c.push("Enter"),await (0,d.KB)(b,c)}else{let a=i(g),c=k?.type==="multiple_choice"&&!0===k.isAskUserQuestion&&0===g?["Down","Up","Enter"]:[...a,"Enter"];await (0,d.KB)(b,c)}}else{await (0,d.V1)(b,c,!1);let f=function(a){let b=(a.promptData?.type==="multiple_choice"?a.promptData.submitMode:void 0)??a.fallbackSubmitMode??"answer_then_enter";return(0,e.M)(b)?b:"answer_then_enter"}(a);"answer_only"===f&&(a.promptData?.type==="multiple_choice"||"multiple_choice"===a.fallbackPromptType)&&/^\d+$/.test(a.answer)||(await new Promise(a=>setTimeout(a,g.pL)),await (0,d.V1)(b,"",!0))}(0,f.gm)(b)}},68652:(a,b,c)=>{"use strict";c.d(b,{N:()=>g});let d=/Esc\s+to\s+cancel\s*[·•]\s*Tab\s+to\s+amend/i,e=/Enter\s+to\s+select\b.*\bnavigate\b/i,f=/^\s*[>❯]\s*(?:\d{1,2}[.)])?|esc\s+to\s+interrupt|[✻✽✶✢✳⦿◉●⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏]\s+.+…/i;function g(a){if(""===a)return"";let b=a.split("\n"),c=-1;for(let a=b.length-1;a>=0;a--){var g;if(g=b[a],d.test(g)||e.test(g)){c=a;break}}let h=b;return c>=0&&(h=b.slice(c+1).some(a=>f.test(a))?b.slice(c+1):b.slice(0,c+1)),(function(a){let b=[],c=!1;for(let d of a){let a=""===d.trim();a&&c||(b.push(d),c=a)}for(;b.length>0&&""===b[b.length-1].trim();)b.pop();return b})(h).join("\n")}},68901:(a,b,c)=>{"use strict";c.d(b,{FW:()=>l,Ke:()=>k,P0:()=>n,QN:()=>j,dR:()=>i,t6:()=>h,ul:()=>m});var d=c(82366),e=c.n(d),f=c(16983);let g=[36e5,108e5,288e5],h=36e5;function i(a){return"number"==typeof a&&g.includes(a)}let j=5e3,k=f.s,l=5e3,m=20;function n(a){if(a.length>500)return{valid:!1,error:"Pattern must be 500 characters or less"};if(!e()(a))return{valid:!1,error:"Pattern may cause performance issues (catastrophic backtracking detected)"};try{return new RegExp(a),{valid:!0}}catch{return{valid:!1,error:"Invalid regular expression syntax"}}}},69297:(a,b,c)=>{"use strict";c.d(b,{mq:()=>l,Lo:()=>n,TB:()=>o,h7:()=>m});var d=c(81503);c(91645),c(93390),c(3453);c(15194),c(31268),c(88807),c(56791);var e=c(11665),f=c(72626),g=c(79646);(0,f.h)("tmux-control-client");(0,f.h)("tmux-control-registry");c(7015),c(26838);let h=(0,f.h)("ws-server"),i=new Map,j=new Map;function k(a,b){let c=j.get(a);if(c&&0!==c.size)try{let e=JSON.stringify({type:"broadcast",worktreeId:a,data:b});c.forEach(a=>{if(a.readyState===d.kb.OPEN)try{a.send(e)}catch(a){h.error("broadcast:send-failed",{error:a instanceof Error?a.message:String(a)})}})}catch(b){h.error("broadcast:failed",{worktreeId:a,error:b instanceof Error?b.message:String(b)});try{let b=JSON.stringify({type:"broadcast",worktreeId:a,data:{error:"Message encoding error"}});c.forEach(a=>{if(a.readyState===d.kb.OPEN)try{a.send(b)}catch{}})}catch(a){h.error("fallback:send-failed",{error:a instanceof Error?a.message:String(a)})}}}function l(a,b){k(a,b)}function m(a){let b=j.get(a);return!!b&&b.size>0}function n(a,b){b.worktreeId?k(b.worktreeId,{type:a,...b}):h.warn("broadcast:missing-worktree-id")}function o(a){for(let b of a){let a=j.get(b);a&&(a.forEach(a=>{let c=i.get(a);c&&c.worktreeIds.delete(b)}),j.delete(b))}}},71080:(a,b,c)=>{"use strict";c.d(b,{L:()=>g,j:()=>f});var d=c(55511);let e=new Map;function f(a,b){let c=(0,d.createHash)("sha256").update(b).digest("hex");return e.get(a)===c||(e.set(a,c),!1)}function g(a){e.delete(a)}},72457:(a,b,c)=>{"use strict";c.d(b,{gv:()=>f,iX:()=>g,zm:()=>h});var d=c(55511);let e=new Map;function f(a,b){let c=(0,d.createHash)("sha256").update(b).digest("hex");return e.get(a)===c||(e.set(a,c),!1)}function g(a){e.delete(a)}function h(a,b){return"copilot"!==b?a:a.replace(/^[❯>]\s/gm," ")}},77093:(a,b,c)=>{"use strict";function d(a){return a instanceof Error?a.message:String(a)}c.d(b,{u1:()=>d})},81254:(a,b,c)=>{"use strict";function d(a){return"answer_only"===a||"answer_then_enter"===a}c.d(b,{M:()=>d})},82450:(a,b,c)=>{"use strict";c.d(b,{IS:()=>h,LH:()=>m,NN:()=>g,Sj:()=>o,aW:()=>n});var d=c(26283),e=c(13033),f=c(56263);function g(a){let b=(0,d.aJ)(a).split("\n"),c=(0,d.GT)(b),e=c>=0?b.slice(0,c):b,f=-1;for(let a=e.length-1;a>=0;a--)if(/^❯\s+\S/.test(e[a])){f=a;break}let g=f>=0?f+1:0,h=e.slice(g),i=[/CLAUDE_HOOKS_/,/\/bin\/claude/,/^claude\s*$/,/@.*\s+%\s*$/,/^[^⏺]*curl.*POST/,/^[^⏺]*Content-Type/,/^[^⏺]*export\s+CLAUDE_/,/^\s*$/,/^[╭╮╰╯│─\s]+$/,/^[│╭╮╰╯].*[│╭╮╰╯]$/,/Claude Code v[\d.]+/,/^Tips for getting started/,/^Welcome back/,/Run \/init to create/,/^Recent activity/,/^No recent activity/,/▐▛███▜▌|▝▜█████▛▘|▘▘ ▝▝/,/^\s*Opus \d+\.\d+\s*·\s*Claude Max/,/\.com's Organization/,/\?\s*for shortcuts\s*$/,/^─{10,}$/,/^❯\s*$/,d.fW],j=[];for(let a of h)!i.some(b=>b.test(a))&&a.trim()&&j.push(a);return j.join("\n").trim()}function h(a){let b=(0,d.aJ)(a).split("\n"),c=[],e=[/^maenokota@.*%/,/^zsh:/,/^feature-issue-\d+/,/^\s*$/],f=!1,g=[];for(let a of b){if(a.includes("✦")){f=!0;let b=a.indexOf("✦"),c=a.substring(b+1).trim();c&&g.push(c);continue}if(f){if(e.some(b=>b.test(a)))continue;g.push(a)}}if(g.length>0)return g.join("\n").trim();for(let a of b)e.some(b=>b.test(a))||c.push(a);return c.join("\n").trim()}let i=/^●\s+(?:Get |Read |Run |Search |Write |Delete |Edit |List |Create |Check |Fetch |Map |Explore |Execute |Find |Install |Update |Open |Close |Copy |Move |Rename |Set |Test |Build |Deploy |Start |Stop |Restart |Kill |Call |Send |Upload |Download |Compile |Analyze |Scan |Apply |Revert |Reset |Push |Pull |Clone |Merge |Commit |Checkout |Branch |Tag |Diff |Log |Show |Status |Init |Config |Add |Remove |Index |Query |Connect |Disconnect |Ping |Trace |Debug |Validate |Verify |Inspect |Monitor |Watch |Clean |Purge |Flush |Load |Save |Export |Import |Format |Lint |Parse |Generate |Transform |Convert |Migrate |Upgrade |Patch |Enable |Disable |Grant |Revoke |Approve |Deny |Lock |Unlock |Mount |Unmount |Attach |Detach |Register |Unregister |Subscribe |Unsubscribe |Publish |Unpublish |Encrypt |Decrypt |Sign |Hash |Encode |Decode |Compress |Decompress |Archive |Extract |Backup |Restore |Dump |Model changed to:)/,j=/^\d+\s+lines\.\.\.$/,k=/^[◐◑◒◓]/,l=/^(?:git\s+--no-pager|git\s+(?:log|diff|show|status|branch|remote|fetch|pull|push|merge|rebase|checkout|reset|stash|tag|config|clone|init|add|commit|rm|mv|bisect|grep|ls-files|rev-parse|describe|shortlog|blame|reflog|cherry-pick|revert|submodule|worktree)\b|npm\s+|npx\s+|node\s+|yarn\s+|pnpm\s+|cargo\s+|pip\s+|python\s+|ruby\s+|go\s+|rustc\s+|make\s+|cmake\s+|docker\s+|kubectl\s+|aws\s+|gcloud\s+|az\s+|terraform\s+|ansible\s+|curl\s+|wget\s+|ssh\s+|scp\s+|rsync\s+|find\s+|grep\s+|sed\s+|awk\s+|cat\s+|ls\s+|cd\s+|mkdir\s+|rm\s+|cp\s+|mv\s+|chmod\s+|chown\s+|echo\s+)/;function m(a){let b=(0,d.aJ)(a).split("\n"),c=-1;for(let a=b.length-1;a>=0;a--){let d=(0,e.IW)(b[a]);if(d&&/^❯\s+\S/.test(d)){c=a;break}}let f=c>=0?c+1:0,g=b.slice(f),h=[],m=!1,n=!1;for(let a of g){let b=(0,e.IW)(a);if(!(!b||d.J7.some(a=>a.test(b)))){if(i.test(b)){n=!0,m=!1;continue}if(k.test(b)){m=!0,n=!1;continue}if(!(j.test(b)||l.test(b)||/^❯\s*/.test(b)||/^[│└]/.test(b))){if(/^●/.test(b)){m=!1,n=!1,h.push(b.replace(/^●\s*/,""));continue}m||n||h.push(b)}}}return h.join("\n").trim()}function n(a){let b=a.split("\n"),c=[];for(let a=0;a<b.length;a++){let f=(0,e.l1)(b[a]);f&&d.Md.test(f)&&c.push(a)}let f=0;c.length>=2&&(f=c[c.length-2]+1);let g=[];for(let a=f;a<b.length;a++){let c=(0,e.l1)(b[a]);!(!c||d.sx.some(a=>a.test(c)))&&(d.Md.test(c)||g.push(c))}return g.join("\n").trim()}function o(a,b=f.Rf,c=f.ky){if(!a||a.length<=b)return a;let d=c+"\n",e=b-d.length;if(e<=0)return c.slice(0,b);let g=a.length-e;if(g>0&&g<a.length){let b=a.charCodeAt(g);b>=56320&&b<=57343&&(g+=1)}return d+a.slice(g)}},90164:(a,b,c)=>{"use strict";c.d(b,{Dk:()=>e,kD:()=>f});let d="https://github.com/Kewton/CommandMate",e=`${d}/releases/`,f=`${d}/blob/main/docs/security-guide.md`},93997:(a,b,c)=>{"use strict";c.d(b,{aq:()=>l,gm:()=>j,pc:()=>k,vF:()=>i,wd:()=>h,xE:()=>e});let d=(0,c(72626).h)("tmux-capture-cache"),e=1e4;function f(){return globalThis.__tmuxCaptureCache??=new Map}function g(){return globalThis.__tmuxCaptureCacheInflight??=new Map}function h(a,b){if(""===a)return"";let c=a.split("\n");return b>=c.length?a:c.slice(-b).join("\n")}function i(a,b,c){let d=f(),e=Date.now();for(let[a,b]of d)e-b.timestamp>5e3&&d.delete(a);if(d.size>=100&&!d.has(a)){let a=null,b=1/0;for(let[c,e]of d)e.timestamp<b&&(b=e.timestamp,a=c);a&&d.delete(a)}d.set(a,{output:b,capturedLines:c,timestamp:e})}function j(a){f().delete(a),d.debug("cache:invalidate",{sessionName:a})}function k(){f().clear(),g().clear()}async function l(a,b,c){let d=function(a,b){let c=f(),d=c.get(a);return d?Date.now()-d.timestamp>5e3?(c.delete(a),null):b>d.capturedLines?null:h(d.output,b):null}(a,b);if(null!==d)return d;let j=g(),k=j.get(a);if(k)return h(await k,b);let l=c();j.set(a,l);try{let c=await l;return c.length>0&&i(a,c,e),h(c,b)}finally{j.delete(a)}}},95220:(a,b,c)=>{"use strict";c.r(b),c.d(b,{accumulateTuiContent:()=>g.IZ,cleanClaudeResponse:()=>f.NN,cleanCopilotResponse:()=>f.LH,cleanGeminiResponse:()=>f.IS,cleanOpenCodeResponse:()=>f.aW,clearPromptHashCache:()=>h.iX,clearTuiAccumulator:()=>g.q1,extractCopilotContentLines:()=>g.o0,extractTuiContentLines:()=>g.K0,findOverlapIndex:()=>g.vQ,getAccumulatedContent:()=>g.Uz,getActivePollers:()=>d.KQ,initTuiAccumulator:()=>g.tb,isDuplicatePrompt:()=>h.gv,isOpenCodeComplete:()=>e.b,normalizeCopilotLine:()=>g.IW,normalizePromptForDedup:()=>h.zm,resolveExtractionStartIndex:()=>e.Q,startPolling:()=>d.g8,stopAllPolling:()=>d.fq,stopPolling:()=>d.Et,truncateMessage:()=>f.Sj});var d=c(45146),e=c(60),f=c(82450),g=c(13033),h=c(72457)},95595:(a,b,c)=>{"use strict";c.d(b,{WC:()=>l,gv:()=>h,ug:()=>i});var d=c(26283),e=c(25129),f=c(68652),g=c(46423);let h={PROMPT_DETECTED:"prompt_detected",THINKING_INDICATOR:"thinking_indicator",OPENCODE_PROCESSING_INDICATOR:"opencode_processing_indicator",OPENCODE_SELECTION_LIST:"opencode_selection_list",CLAUDE_SELECTION_LIST:"claude_selection_list",COPILOT_SELECTION_LIST:"copilot_selection_list",CODEX_SELECTION_LIST:"codex_selection_list",CODEX_PAGER:"codex_pager",ANTIGRAVITY_SELECTION_LIST:"antigravity_selection_list",OPENCODE_RESPONSE_COMPLETE:"opencode_response_complete",INPUT_PROMPT:"input_prompt",NO_RECENT_OUTPUT:"no_recent_output",DEFAULT:"default"},i=new Set([h.OPENCODE_SELECTION_LIST,h.CLAUDE_SELECTION_LIST,h.COPILOT_SELECTION_LIST,h.CODEX_SELECTION_LIST,h.CODEX_PAGER,h.ANTIGRAVITY_SELECTION_LIST]),j=/press\s+(?:number|enter)\s+to\s+confirm/i,k=/^\s*[❯›●]?\s*\d{1,2}[.)]\s/;function l(a,b,c){let i=(0,f.N)((0,d.aJ)(a)),l=i.split("\n"),m=l.length-1;for(;m>=0&&""===l[m].trim();)m--;let n=l.slice(0,m+1),o=n.slice(-15).join("\n"),p=n.slice(-g.$).join("\n"),q=n.slice(-30).join("\n");if("copilot"===b&&d.Mi.test(q)){let a=(0,d.KO)(b),c=(0,e.gF)((0,d._A)(i),a);return c.isPrompt&&(c.promptData?.options?.length??0)<=3?{status:"waiting",confidence:"high",reason:"prompt_detected",hasActivePrompt:!0,promptDetection:c}:{status:"waiting",confidence:"high",reason:h.COPILOT_SELECTION_LIST,hasActivePrompt:!1,promptDetection:c}}let r=n.slice(-15).join("\n");if("copilot"===b&&(0,d.ut)(b,r)){let a=(0,d.KO)(b);return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:(0,e.gF)((0,d._A)(i),a)}}if("codex"===b&&d.pn.test(o)){let a=(0,d.KO)(b),c=(0,e.gF)((0,d._A)(i),a);return{status:"waiting",confidence:"high",reason:h.CODEX_PAGER,hasActivePrompt:!1,promptDetection:c}}if("codex"===b){let a=-1;for(let b=n.length-1;b>=Math.max(0,n.length-10);b--)if(d.aW.test(n[b])){a=b;break}let c=a>=0?a-1:n.length-1;for(;c>=0&&""===n[c].trim();)c--;if(c>=0){let a=n.slice(Math.max(0,c-15+1),c+1).join("\n");if(d.Jn.test(a)){let a=(0,d.KO)(b),c=(0,e.gF)((0,d._A)(i),a);return{status:"waiting",confidence:"high",reason:h.CODEX_SELECTION_LIST,hasActivePrompt:!1,promptDetection:c}}}}if("antigravity"===b&&d.kT.test(o)){let a=(0,d.KO)(b),c=(0,e.gF)((0,d._A)(i),a);return{status:"waiting",confidence:"high",reason:h.ANTIGRAVITY_SELECTION_LIST,hasActivePrompt:!1,promptDetection:c}}let s=(0,d.KO)(b),t="opencode"===b||"codex"===b||"claude"===b||"copilot"===b?(0,d._A)(i):(0,d._A)(o),u=(0,e.gF)(t,s);if(u.isPrompt)if(!("codex"===b&&function(a){let b=-1;for(let c=a.length-1;c>=Math.max(0,a.length-10);c--)if(d.aW.test(a[c])){b=c;break}let c=b>=0?b:a.length,e=-1,f=-1;for(let b=0;b<c;b++){let c=a[b],g=c.trim();""!==g&&((j.test(g)||k.test(g))&&(e=b),(0,d.ut)("codex",c)&&(f=b))}return e>=0&&f>e}(n)))return{status:"waiting",confidence:"high",reason:"prompt_detected",hasActivePrompt:!0,promptDetection:u};else u={...u,isPrompt:!1,promptData:void 0};if("claude"===b&&d.XY.test(o))return{status:"waiting",confidence:"high",reason:h.CLAUDE_SELECTION_LIST,hasActivePrompt:!1,promptDetection:u};if((0,d.ut)(b,p))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:u};if("claude"===b&&d.aU.test(o))return{status:"running",confidence:"high",reason:h.THINKING_INDICATOR,hasActivePrompt:!1,promptDetection:u};if("opencode"===b){if(d.kD.test(o))return{status:"running",confidence:"high",reason:"opencode_processing_indicator",hasActivePrompt:!1,promptDetection:u};let a=(0,d._A)(i).split("\n"),b=Math.max(0,a.length-7);for(let c=a.length-1;c>=Math.max(0,a.length-10);c--)if(/ctrl\+[tp]/.test(a[c])){b=Math.max(0,c-2);break}let c=a.slice(0,b),e=c.length-1;for(;e>=0&&""===c[e].trim();)e--;if(e>=0){let a=c.slice(Math.max(0,e-g.$+1),e+1).join("\n");if((0,d.ut)("opencode",a))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:u};let b=c.slice(Math.max(0,e-15+1),e+1).join("\n"),f=c.join("\n");if(d.LO.test(f))return{status:"waiting",confidence:"high",reason:h.OPENCODE_SELECTION_LIST,hasActivePrompt:!1,promptDetection:u};if(d.Md.test(b))return{status:"ready",confidence:"high",reason:h.OPENCODE_RESPONSE_COMPLETE,hasActivePrompt:!1,promptDetection:u};let{promptPattern:i}=(0,d._X)("opencode");if(i.test(b))return{status:"ready",confidence:"high",reason:h.PROMPT_DETECTED,hasActivePrompt:!0,promptDetection:u}}}if("codex"===b){let a=-1;for(let b=n.length-1;b>=Math.max(0,n.length-10);b--)if(d.aW.test(n[b])){a=b;break}if(a>=0){let b=a-1;for(;b>=0&&""===n[b].trim();)b--;if(b>=0){let a=n.slice(Math.max(0,b-g.$+1),b+1).join("\n");if((0,d.ut)("codex",a))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:u};let c=n[b].trim();return d.gm.test(c)?{status:"ready",confidence:"high",reason:"input_prompt",hasActivePrompt:!1,promptDetection:u}:{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:u}}}else{let a=n.length-1;for(;a>=0&&""===n[a].trim();)a--;if(!(a>=0&&d.gm.test(n[a].trim()))&&(0,d.ut)("codex",o))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:u}}}if("antigravity"===b){if((0,d.ut)("antigravity",o))return{status:"running",confidence:"high",reason:h.THINKING_INDICATOR,hasActivePrompt:!1,promptDetection:u};let{promptPattern:a}=(0,d._X)("antigravity");if(a.test(o))return{status:"ready",confidence:"high",reason:h.INPUT_PROMPT,hasActivePrompt:!1,promptDetection:u}}let{promptPattern:v}=(0,d._X)(b);return v.test(o)?{status:"ready",confidence:"high",reason:"input_prompt",hasActivePrompt:!1,promptDetection:u}:c&&Date.now()-c.getTime()>5e3?{status:"ready",confidence:"low",reason:"no_recent_output",hasActivePrompt:!1,promptDetection:u}:{status:"running",confidence:"low",reason:"default",hasActivePrompt:!1,promptDetection:u}}},99508:(a,b,c)=>{"use strict";c.r(b),c.d(b,{INTERACTION_SNAPSHOT_RETRY_DELAYS_MS:()=>l,__resetTerminalBroadcastState:()=>s,broadcastSessionStatus:()=>r,broadcastTerminalSnapshot:()=>m,broadcastTerminalSnapshotAfterInteraction:()=>q});var d=c(69297),e=c(88807),f=c(34892),g=c(72626),h=c(31268),i=c(93997);let j=(0,g.h)("terminal-broadcast"),k=new Map,l=[100,250,500,750];async function m(a,b,c){if((0,d.h7)(a))try{let d=(0,e.getDbInstance)(),g=await (0,f.$)(d,a,b,c);p(a,b,g,c)}catch(b){j.error("terminal-snapshot:failed",{worktreeId:a,error:b instanceof Error?b.message:String(b)})}}function n(a){return JSON.stringify([a.fullOutput??"",a.isRunning,a.thinking??!1,a.isPromptWaiting??!1,a.isSelectionListActive??!1,a.isPagerActive??!1,a.isUnclassifiedActive??!1])}async function o(a,b,c){let d=h.s.getInstance().getTool(b);return(0,i.gm)(d.getSessionName(a,c)),(0,f.$)((0,e.getDbInstance)(),a,b,c)}function p(a,b,c,e){let f=e??b,g=`${a}:${b}:${f}`;(0,d.mq)(a,{type:"terminal_snapshot",worktreeId:a,cliToolId:b,instanceId:f,output:c.fullOutput??"",isRunning:c.isRunning,thinking:c.thinking??!1,isPromptWaiting:c.isPromptWaiting??!1,promptData:c.promptData??null,isSelectionListActive:c.isSelectionListActive??!1,isPagerActive:c.isPagerActive??!1,isUnclassifiedActive:c.isUnclassifiedActive??!1,version:function(a){let b=(k.get(a)??0)+1;return k.set(a,b),b}(g)})}async function q(a,b,c,e=l){if((0,d.h7)(a))try{let d=await o(a,b,c),f=n(d);for(let g of(p(a,b,d,c),e)){await new Promise(a=>setTimeout(a,g));let d=await o(a,b,c);if(n(d)!==f)return void p(a,b,d,c)}}catch(d){j.error("terminal-snapshot:interaction-refresh-failed",{worktreeId:a,cliToolId:b,instanceId:c,error:d instanceof Error?d.message:String(d)})}}function r(a,b,c){(0,d.mq)(a,{type:"session_status_changed",worktreeId:a,isRunning:b,cliTool:c?.cliTool??null,instance:c?.instance??null})}function s(){k.clear()}}};
|
|
20
|
+
`,await e().writeFile(f,j,"utf-8"),f}async function o(a,b="all"){let c="all"===b?[...k.XH]:[b],d=[];for(let b of c){await m(b);let c=l(b);try{let b=(await e().readdir(c)).filter(b=>b.startsWith(`${a}-`)&&b.endsWith(".md")).map(a=>g().join(c,a));d.push(...b)}catch{}}return d.sort().reverse()}(0,j.h)("log-manager")},44265:(a,b,c)=>{"use strict";c.d(b,{M:()=>k});var d=c(79646),e=c(28354),f=c(15194);let g=/^[a-zA-Z0-9_-]+$/;function h(a){if(!g.test(a))throw Error(`Invalid session name format: ${a}`)}var i=c(11665);let j=(0,e.promisify)(d.exec);class k{async isInstalled(){try{return await j(`which ${this.command}`,{timeout:5e3}),!0}catch{return!1}}getSessionName(a,b){let c=`mcbd-${this.id}-${a}`;if(!b||b===this.id)return h(c),c;let d=(0,f.pL)(b,this.id),e=d?`${c}-${d}`:c;return h(e),e}async reconcileExistingSession(a,b){await (0,i.zT)(a,b)}async interrupt(a,b){let c=this.getSessionName(a,b);await (0,i.ds)(c,"Escape")}}},45146:(a,b,c)=>{"use strict";c.d(b,{Et:()=>q,KQ:()=>s,MN:()=>n,SI:()=>k,fq:()=>r,g8:()=>o});var d=c(72626),e=c(13033),f=c(72457),g=c(71080),h=c(3523),i=c(99508);let j=(0,d.h)("response-poller"),k=["Waiting for auth","⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],l=new Map,m=new Map;function n(a,b,c){return`${a}:${c??b}`}function o(a,b,c){let d=n(a,b,c);q(a,b,c),m.set(d,Date.now()),("opencode"===b||"copilot"===b)&&(0,e.tb)(d),function a(b,c,d){let e=n(b,c,d),f=setTimeout(async()=>{let f=m.get(e);if(f&&Date.now()-f>18e5)return void q(b,c,d);try{await (0,h.zX)(b,c,d)}catch(a){j.error("error:",{error:a instanceof Error?a.message:String(a)})}(0,i.broadcastTerminalSnapshot)(b,c,d),l.has(e)&&a(b,c,d)},2e3);l.set(e,f)}(a,b,c)}function p(a){let b=l.get(a);b&&(clearTimeout(b),l.delete(a),m.delete(a)),(0,e.q1)(a),(0,f.iX)(a),(0,g.L)(a)}function q(a,b,c){p(n(a,b,c))}function r(){for(let a of Array.from(l.keys()))p(a)}function s(){return Array.from(l.keys())}},46423:(a,b,c)=>{"use strict";c.d(b,{$:()=>d});let d=5},47990:()=>{},49358:a=>{"use strict";a.exports=JSON.parse('{"title":"Notifications","description":"Get a push notification when an agent is waiting for you or finishes a session — even when the app is closed.","enable":"Enable notifications","enabling":"Enabling…","enabledOnThisDevice":"Notifications are enabled on this device.","unsubscribe":"Unsubscribe this device","types":{"heading":"Notify me about","promptWaiting":"Prompt waiting","promptWaitingDesc":"When an agent is waiting for your reply","completion":"Session complete","completionDesc":"When an agent finishes a session"},"permission":{"denied":"Notifications are blocked in your browser settings. Allow them for this site to receive push notifications."},"unsupported":"This browser does not support push notifications.","notConfigured":"Push notifications are not configured on this server. Set the VAPID keys to enable them.","ios":{"guidance":"On iPhone/iPad, add this app to your Home Screen and open it from there to enable notifications."},"toast":{"enabled":"Notifications enabled on this device","disabled":"Notifications turned off on this device","error":"Could not enable notifications","updated":"Notification settings updated"},"push":{"promptWaitingWithExcerpt":"Waiting for reply: {excerpt}","promptWaiting":"Waiting for your reply","completionWithExcerpt":"Done: {excerpt}","completion":"Session complete"}}')},56263:(a,b,c)=>{"use strict";c.d(b,{L1:()=>e,MJ:()=>j,Rf:()=>f,ky:()=>g,lM:()=>i,pL:()=>h,wp:()=>d});let d=200,e=100,f=1e5,g="[... truncated ...]",h=3e4,i=/^[a-zA-Z0-9][a-zA-Z0-9\-._/:]*$/,j=128},56791:(a,b,c)=>{"use strict";c.d(b,{AC:()=>d.AC,ug:()=>d.ug,lm:()=>d.lm,KG:()=>d.KG,cD:()=>d.cD,Jj:()=>d.Jj,YX:()=>d.YX,G4:()=>d.G4,hL:()=>d.hL,qp:()=>d.qp,To:()=>d.To,oH:()=>d.oH,py:()=>d.py,yy:()=>d.yy,pE:()=>d.pE,z2:()=>d.z2,cP:()=>d.cP,DF:()=>d.DF,lA:()=>d.lA,Qp:()=>d.Qp,th:()=>d.th,oZ:()=>d.oZ,ZP:()=>d.ZP,Ys:()=>d.Ys,vg:()=>d.vg,Rm:()=>d.Rm,BN:()=>d.BN,m0:()=>d.m0,Tk:()=>d.Tk,iT:()=>d.iT,gp:()=>d.gp,yE:()=>d.yE,BE:()=>d.BE,qK:()=>d.qK,p4:()=>d.p4,r8:()=>d.r8,of:()=>d.of,DN:()=>d.DN,pZ:()=>d.pZ,kA:()=>d.kA,VL:()=>d.VL,CF:()=>d.CF,NV:()=>d.NV,ce:()=>d.ce,y1:()=>d.y1,Nr:()=>d.Nr,ob:()=>d.ob,fr:()=>d.fr,Ui:()=>d.Ui,P9:()=>d.P9,eN:()=>d.eN,vi:()=>d.vi,uJ:()=>d.uJ,yT:()=>d.yT,PL:()=>d.PL,jp:()=>d.jp,nQ:()=>d.nQ,yb:()=>d.yb,GA:()=>d.GA,Cs:()=>d.Cs,xR:()=>d.xR,az:()=>d.az,nZ:()=>d.nZ,PP:()=>d.PP,Dx:()=>d.Dx,O:()=>d.O,EU:()=>d.EU,HZ:()=>d.HZ,UY:()=>d.UY,cw:()=>d.cw,jJ:()=>d.jJ,DC:()=>d.DC,gb:()=>d.gb,yB:()=>d.yB,uy:()=>d.uy,s:()=>d.s,iu:()=>d.iu,hq:()=>d.hq,z1:()=>d.z1,bl:()=>d.bl,jA:()=>d.jA,ZL:()=>d.ZL});var d=c(25537);c(88807),c(71634),c(20416),c(10406),c(29021),c(33873),c(21820),c(7956),(0,c(72626).h)("db-migration-path")},57905:(a,b,c)=>{"use strict";c.d(b,{c0:()=>I,zw:()=>E,Yq:()=>F,oV:()=>B,pU:()=>H,R7:()=>G,VU:()=>J});var d=c(11665),e=c(26283),f=c(40236),g=c(93997),h=c(77093),i=c(20610),j=c(79646),k=c(28354),l=c(72626);let m=(0,l.h)("session-key-sender"),n=(0,k.promisify)(j.exec);async function o(a,b=50){let c=await (0,d.Xg)(a,{startLine:-b});return(0,e.aJ)(c)}async function p(a){await n("tmux set-environment -g -u CLAUDECODE 2>/dev/null || true"),await (0,d.V1)(a,"unset CLAUDECODE",!0),await new Promise(a=>setTimeout(a,i.Em))}async function q(a,b){let c=Date.now();for(;Date.now()-c<b;){let b=await o(a);if(e.hx.test(b))return;await new Promise(a=>setTimeout(a,200))}throw Error(`Prompt detection timeout (${b}ms)`)}async function r(a,b,c,h){if(!await (0,d.N)(a))throw Error(`Claude session ${a} does not exist. Start the session first.`);let i=await o(a);e.hx.test(i)||await q(a,h),await new Promise(a=>setTimeout(a,c)),await (0,f.FW)({sessionName:a,message:b,cliToolId:"claude"}),(0,g.gm)(a),m.info("sent-message-to-session",{sessionName:a})}async function s(a){try{await (0,d.N)(a)&&(await (0,d.V1)(a,"",!1),await (0,d.ds)(a,"C-d"),(0,g.gm)(a),await new Promise(a=>setTimeout(a,i.Zf)));let b=await (0,d.fY)(a);return b&&m.info("stopped-session",{sessionName:a}),b}catch(a){return m.error("session:stop-failed",{error:(0,h.u1)(a)}),!1}}var t=c(79748),u=c(15194);let v=(0,l.h)("claude-session"),w=(0,k.promisify)(j.exec),x=["$","%","#"],y=null;async function z(){if(y)return y;let a=process.env.CLAUDE_PATH;if(a&&(/^[/a-zA-Z0-9._-]+$/.test(a)?!a.includes("..")||(v.info("claudepath-contains-path"),!1):(v.info("claudepath-contains-invalid-characters-i"),!1)))try{return await (0,t.access)(a,t.constants.X_OK),y=a}catch{v.info("claudepath-is-not-executable:envclaudepa")}try{let{stdout:a}=await w("which claude",{timeout:5e3});return y=a.trim()}catch{for(let a of["/opt/homebrew/bin/claude","/usr/local/bin/claude","/usr/bin/claude"])try{return await w(`test -x "${a}"`,{timeout:1e3}),y=a}catch{}throw Error("Claude CLI not found. Set CLAUDE_PATH environment variable or install Claude CLI.")}}async function A(a,b=50){let c=await (0,d.Xg)(a,{startLine:-b});return(0,e.aJ)(c)}async function B(a){try{let b=(await A(a)).trim();if(""===b)return{healthy:!1,reason:"empty output"};if(e.hx.test(b))return{healthy:!0};let c=b.split("\n").filter(a=>""!==a.trim()),d=c.slice(-10).join("\n");for(let a of e.F0)if(d.includes(a))return{healthy:!1,reason:`error pattern: ${a}`};for(let a of e.Fw)if(a.test(d))return{healthy:!1,reason:`error pattern: ${a.source}`};let f=c[c.length-1]?.trim()??"";if(f.length>=40)return{healthy:!0};if(x.some(a=>!(!f.endsWith(a)||"%"===a&&/\d+%$/.test(f))))return{healthy:!1,reason:`shell prompt ending detected: ${f}`};return{healthy:!0}}catch{return{healthy:!1,reason:"capture error"}}}async function C(a){return!!(await B(a)).healthy||(v.warn("session-sessionname-unhealthy:resultreas"),await (0,d.fY)(a),!1)}function D(a,b){let c=`mcbd-claude-${a}`;if(!b||"claude"===b)return c;let d=(0,u.pL)(b,"claude");return d?`${c}-${d}`:c}async function E(){try{return await w("which claude",{timeout:5e3}),!0}catch{return!1}}async function F(a,b){let c=D(a,b);return!!await (0,d.N)(c)&&(!!(await B(c)).healthy||(v.warn("session-sessionname-unhealthy:resultreas"),!1))}async function G(a){let{worktreeId:b,worktreePath:c,instanceId:f}=a;if(!await E())throw Error("Claude CLI is not installed or not in PATH");let g=D(b,f);if(await (0,d.N)(g)&&await C(g)){await (0,d.zT)(g),v.info("claude-session-sessionname");return}try{await (0,d.jw)({sessionName:g,workingDirectory:c,historyLimit:5e4}),await p(g);let a=await z();await (0,d.V1)(g,a,!0);let b=Date.now(),f=!1,h=!1;for(;Date.now()-b<15e3;){await new Promise(a=>setTimeout(a,300));try{let a=await A(g);if(e.hx.test(a)){await new Promise(a=>setTimeout(a,500)),v.info("claude-initialized-in"),f=!0;break}!h&&e.CX.test(a)&&(await (0,d.V1)(g,"",!0),h=!0,v.info("trust-dialog-detected"))}catch{}}if(!f)throw Error("Claude initialization timeout (15000ms)");v.info("started-claude-session:sessionname")}catch(a){throw y=null,v.error("session:start-failed",{error:a instanceof Error?a.message:String(a)}),Error("Failed to start Claude session")}}async function H(a,b,c){let d=D(a,c);await r(d,b,500,1e4)}async function I(a,b=1e3,c){let e=D(a,c);if(!await (0,d.N)(e))throw Error(`Claude session ${e} does not exist`);try{return await (0,d.Xg)(e,{startLine:-b})}catch(a){throw Error(`Failed to capture Claude output: ${a instanceof Error?a.message:String(a)}`)}}async function J(a,b){return s(D(a,b))}},61296:a=>{"use strict";a.exports=JSON.parse('{"title":"通知","description":"エージェントが応答待ちになったり、セッションが完了したときに、アプリを開いていなくてもプッシュ通知を受け取れます。","enable":"通知を有効にする","enabling":"有効化中…","enabledOnThisDevice":"この端末で通知が有効です。","unsubscribe":"この端末の通知を解除","types":{"heading":"通知する種別","promptWaiting":"応答待ち","promptWaitingDesc":"エージェントがあなたの応答を待っているとき","completion":"セッション完了","completionDesc":"エージェントがセッションを完了したとき"},"permission":{"denied":"ブラウザの設定で通知がブロックされています。このサイトの通知を許可してください。"},"unsupported":"このブラウザはプッシュ通知に対応していません。","notConfigured":"このサーバーではプッシュ通知が設定されていません。VAPID鍵を設定すると有効になります。","ios":{"guidance":"iPhone/iPadでは、このアプリをホーム画面に追加し、そこから開くと通知を有効にできます。"},"toast":{"enabled":"この端末で通知を有効にしました","disabled":"この端末の通知をオフにしました","error":"通知を有効にできませんでした","updated":"通知設定を更新しました"},"push":{"promptWaitingWithExcerpt":"応答待ち: {excerpt}","promptWaiting":"応答待ちです","completionWithExcerpt":"完了: {excerpt}","completion":"セッションが完了しました"}}')},63865:(a,b,c)=>{"use strict";function d(){let a=process.env.CM_VAPID_PUBLIC_KEY?.trim(),b=process.env.CM_VAPID_PRIVATE_KEY?.trim();return a&&b?{publicKey:a,privateKey:b,subject:process.env.CM_VAPID_SUBJECT?.trim()||"mailto:commandmate@localhost"}:null}function e(){return d()?.publicKey??null}c.d(b,{HR:()=>e,J$:()=>t});var f=c(48975),g=c.n(f),h=c(88807),i=c(43167),j=c(72626),k=c(25754),l=c(49358),m=c(61296),n=c(55511);let o=new Map,p=(0,j.h)("push/sender"),q={en:l.push,ja:m.push};function r(a){return(0,k.d9)(a)?a:k.Xn}async function s(a,b){try{await g().sendNotification({endpoint:a.endpoint,keys:a.keys},b)}catch(c){let b=c.statusCode;if(404===b||410===b){(0,i.th)((0,h.getDbInstance)(),a.endpoint),p.info("push-subscription-removed",{statusCode:b});return}p.warn("push-send-failed",{statusCode:b??"unknown"})}}async function t(a){try{let b=d();if(!b||!function(a,b=Date.now(),c=3e4){var d;let e=`${a.worktreeId}:${a.kind}`,f=(d=a.content??"",(0,n.createHash)("sha256").update(d).digest("hex")),g=o.get(e);return(!g||g.hash!==f||!(b-g.at<c))&&(o.set(e,{hash:f,at:b}),!0)}({worktreeId:a.worktreeId,kind:a.kind,content:a.excerpt}))return;let c=(0,h.getDbInstance)(),e=(0,i.gn)(c,a.kind);if(0===e.length)return;g().setVapidDetails(b.subject,b.publicKey,b.privateKey);let f=new Map;for(let a of e){let b=r(a.locale),c=f.get(b);c?c.push(a):f.set(b,[a])}await Promise.all(Array.from(f,([b,c])=>{let d=JSON.stringify(function(a,b=k.Xn,c=Date.now()){let d=function(a,b=120){if(!a)return"";let c=a.replace(/\s+/g," ").trim();return c.length<=b?c:c.slice(0,b-1).trimEnd()+"…"}(a.excerpt),e=a.agentName?` (${a.agentName})`:"",f=`${a.worktreeName}${e}`,g=q[r(b)],h="prompt"===a.kind?d?g.promptWaitingWithExcerpt.replace("{excerpt}",d):g.promptWaiting:d?g.completionWithExcerpt.replace("{excerpt}",d):g.completion;return{kind:a.kind,title:f,body:h,worktreeId:a.worktreeId,url:`/worktrees/${a.worktreeId}`,tag:`${a.worktreeId}:${a.kind}`,timestamp:c}}(a,b));return Promise.all(c.map(a=>s(a,d)))}))}catch(a){p.warn("push-fanout-error",{error:a instanceof Error?a.message:String(a)})}}},63869:(a,b,c)=>{"use strict";c.d(b,{t:()=>j});var d=c(11665),e=c(81254),f=c(93997),g=c(20610);let h=/^\[[ x]\] /;function i(a){if(0===a)return[];let b=a>0?"Down":"Up";return Array.from({length:Math.abs(a)},()=>b)}async function j(a){let{sessionName:b,answer:c,cliToolId:j,promptData:k,fallbackPromptType:l,fallbackDefaultOptionNumber:m}=a;if(("claude"===j||"antigravity"===j)&&(k?.type==="multiple_choice"||"multiple_choice"===l)&&/^\d+$/.test(c)){let a,e=parseInt(c,10),f=null;if(k?.type==="multiple_choice"){let b=(f=k.options).find(a=>a.isDefault);a=b?.number??1}else a=m??1;let g=e-a;if(null!==f&&f.some(a=>h.test(a.label))&&null!==f){let a=f.filter(a=>h.test(a.label)).length,c=[...i(g),"Space"];c.push(...i(a-e+1)),c.push("Enter"),await (0,d.KB)(b,c)}else{let a=i(g),c=k?.type==="multiple_choice"&&!0===k.isAskUserQuestion&&0===g?["Down","Up","Enter"]:[...a,"Enter"];await (0,d.KB)(b,c)}}else{await (0,d.V1)(b,c,!1);let f=function(a){let b=(a.promptData?.type==="multiple_choice"?a.promptData.submitMode:void 0)??a.fallbackSubmitMode??"answer_then_enter";return(0,e.M)(b)?b:"answer_then_enter"}(a);"answer_only"===f&&(a.promptData?.type==="multiple_choice"||"multiple_choice"===a.fallbackPromptType)&&/^\d+$/.test(a.answer)||(await new Promise(a=>setTimeout(a,g.pL)),await (0,d.V1)(b,"",!0))}(0,f.gm)(b)}},68652:(a,b,c)=>{"use strict";c.d(b,{N:()=>g});let d=/Esc\s+to\s+cancel\s*[·•]\s*Tab\s+to\s+amend/i,e=/Enter\s+to\s+select\b.*\bnavigate\b/i,f=/^\s*[>❯]\s*(?:\d{1,2}[.)])?|esc\s+to\s+interrupt|[✻✽✶✢✳⦿◉●⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏]\s+.+…/i;function g(a){if(""===a)return"";let b=a.split("\n"),c=-1;for(let a=b.length-1;a>=0;a--){var g;if(g=b[a],d.test(g)||e.test(g)){c=a;break}}let h=b;return c>=0&&(h=b.slice(c+1).some(a=>f.test(a))?b.slice(c+1):b.slice(0,c+1)),(function(a){let b=[],c=!1;for(let d of a){let a=""===d.trim();a&&c||(b.push(d),c=a)}for(;b.length>0&&""===b[b.length-1].trim();)b.pop();return b})(h).join("\n")}},68901:(a,b,c)=>{"use strict";c.d(b,{FW:()=>l,Ke:()=>k,P0:()=>n,QN:()=>j,dR:()=>i,t6:()=>h,ul:()=>m});var d=c(82366),e=c.n(d),f=c(16983);let g=[36e5,108e5,288e5],h=36e5;function i(a){return"number"==typeof a&&g.includes(a)}let j=5e3,k=f.s,l=5e3,m=20;function n(a){if(a.length>500)return{valid:!1,error:"Pattern must be 500 characters or less"};if(!e()(a))return{valid:!1,error:"Pattern may cause performance issues (catastrophic backtracking detected)"};try{return new RegExp(a),{valid:!0}}catch{return{valid:!1,error:"Invalid regular expression syntax"}}}},69297:(a,b,c)=>{"use strict";c.d(b,{mq:()=>l,Lo:()=>n,TB:()=>o,h7:()=>m});var d=c(81503);c(91645),c(93390),c(3453);c(15194),c(31268),c(88807),c(56791);var e=c(11665),f=c(72626),g=c(79646);(0,f.h)("tmux-control-client");(0,f.h)("tmux-control-registry");c(7015),c(26838);let h=(0,f.h)("ws-server"),i=new Map,j=new Map;function k(a,b){let c=j.get(a);if(c&&0!==c.size)try{let e=JSON.stringify({type:"broadcast",worktreeId:a,data:b});c.forEach(a=>{if(a.readyState===d.kb.OPEN)try{a.send(e)}catch(a){h.error("broadcast:send-failed",{error:a instanceof Error?a.message:String(a)})}})}catch(b){h.error("broadcast:failed",{worktreeId:a,error:b instanceof Error?b.message:String(b)});try{let b=JSON.stringify({type:"broadcast",worktreeId:a,data:{error:"Message encoding error"}});c.forEach(a=>{if(a.readyState===d.kb.OPEN)try{a.send(b)}catch{}})}catch(a){h.error("fallback:send-failed",{error:a instanceof Error?a.message:String(a)})}}}function l(a,b){k(a,b)}function m(a){let b=j.get(a);return!!b&&b.size>0}function n(a,b){b.worktreeId?k(b.worktreeId,{type:a,...b}):h.warn("broadcast:missing-worktree-id")}function o(a){for(let b of a){let a=j.get(b);a&&(a.forEach(a=>{let c=i.get(a);c&&c.worktreeIds.delete(b)}),j.delete(b))}}},71080:(a,b,c)=>{"use strict";c.d(b,{L:()=>g,j:()=>f});var d=c(55511);let e=new Map;function f(a,b){let c=(0,d.createHash)("sha256").update(b).digest("hex");return e.get(a)===c||(e.set(a,c),!1)}function g(a){e.delete(a)}},72457:(a,b,c)=>{"use strict";c.d(b,{gv:()=>f,iX:()=>g,zm:()=>h});var d=c(55511);let e=new Map;function f(a,b){let c=(0,d.createHash)("sha256").update(b).digest("hex");return e.get(a)===c||(e.set(a,c),!1)}function g(a){e.delete(a)}function h(a,b){return"copilot"!==b?a:a.replace(/^[❯>]\s/gm," ")}},77093:(a,b,c)=>{"use strict";function d(a){return a instanceof Error?a.message:String(a)}c.d(b,{u1:()=>d})},81254:(a,b,c)=>{"use strict";function d(a){return"answer_only"===a||"answer_then_enter"===a}c.d(b,{M:()=>d})},82450:(a,b,c)=>{"use strict";c.d(b,{IS:()=>h,LH:()=>m,NN:()=>g,Sj:()=>o,aW:()=>n});var d=c(26283),e=c(13033),f=c(56263);function g(a){let b=(0,d.aJ)(a).split("\n"),c=(0,d.GT)(b),e=c>=0?b.slice(0,c):b,f=-1;for(let a=e.length-1;a>=0;a--)if(/^❯\s+\S/.test(e[a])){f=a;break}let g=f>=0?f+1:0,h=e.slice(g),i=[/CLAUDE_HOOKS_/,/\/bin\/claude/,/^claude\s*$/,/@.*\s+%\s*$/,/^[^⏺]*curl.*POST/,/^[^⏺]*Content-Type/,/^[^⏺]*export\s+CLAUDE_/,/^\s*$/,/^[╭╮╰╯│─\s]+$/,/^[│╭╮╰╯].*[│╭╮╰╯]$/,/Claude Code v[\d.]+/,/^Tips for getting started/,/^Welcome back/,/Run \/init to create/,/^Recent activity/,/^No recent activity/,/▐▛███▜▌|▝▜█████▛▘|▘▘ ▝▝/,/^\s*Opus \d+\.\d+\s*·\s*Claude Max/,/\.com's Organization/,/\?\s*for shortcuts\s*$/,/^─{10,}$/,/^❯\s*$/,d.fW],j=[];for(let a of h)!i.some(b=>b.test(a))&&a.trim()&&j.push(a);return j.join("\n").trim()}function h(a){let b=(0,d.aJ)(a).split("\n"),c=[],e=[/^maenokota@.*%/,/^zsh:/,/^feature-issue-\d+/,/^\s*$/],f=!1,g=[];for(let a of b){if(a.includes("✦")){f=!0;let b=a.indexOf("✦"),c=a.substring(b+1).trim();c&&g.push(c);continue}if(f){if(e.some(b=>b.test(a)))continue;g.push(a)}}if(g.length>0)return g.join("\n").trim();for(let a of b)e.some(b=>b.test(a))||c.push(a);return c.join("\n").trim()}let i=/^●\s+(?:Get |Read |Run |Search |Write |Delete |Edit |List |Create |Check |Fetch |Map |Explore |Execute |Find |Install |Update |Open |Close |Copy |Move |Rename |Set |Test |Build |Deploy |Start |Stop |Restart |Kill |Call |Send |Upload |Download |Compile |Analyze |Scan |Apply |Revert |Reset |Push |Pull |Clone |Merge |Commit |Checkout |Branch |Tag |Diff |Log |Show |Status |Init |Config |Add |Remove |Index |Query |Connect |Disconnect |Ping |Trace |Debug |Validate |Verify |Inspect |Monitor |Watch |Clean |Purge |Flush |Load |Save |Export |Import |Format |Lint |Parse |Generate |Transform |Convert |Migrate |Upgrade |Patch |Enable |Disable |Grant |Revoke |Approve |Deny |Lock |Unlock |Mount |Unmount |Attach |Detach |Register |Unregister |Subscribe |Unsubscribe |Publish |Unpublish |Encrypt |Decrypt |Sign |Hash |Encode |Decode |Compress |Decompress |Archive |Extract |Backup |Restore |Dump |Model changed to:)/,j=/^\d+\s+lines\.\.\.$/,k=/^[◐◑◒◓]/,l=/^(?:git\s+--no-pager|git\s+(?:log|diff|show|status|branch|remote|fetch|pull|push|merge|rebase|checkout|reset|stash|tag|config|clone|init|add|commit|rm|mv|bisect|grep|ls-files|rev-parse|describe|shortlog|blame|reflog|cherry-pick|revert|submodule|worktree)\b|npm\s+|npx\s+|node\s+|yarn\s+|pnpm\s+|cargo\s+|pip\s+|python\s+|ruby\s+|go\s+|rustc\s+|make\s+|cmake\s+|docker\s+|kubectl\s+|aws\s+|gcloud\s+|az\s+|terraform\s+|ansible\s+|curl\s+|wget\s+|ssh\s+|scp\s+|rsync\s+|find\s+|grep\s+|sed\s+|awk\s+|cat\s+|ls\s+|cd\s+|mkdir\s+|rm\s+|cp\s+|mv\s+|chmod\s+|chown\s+|echo\s+)/;function m(a){let b=(0,d.aJ)(a).split("\n"),c=-1;for(let a=b.length-1;a>=0;a--){let d=(0,e.IW)(b[a]);if(d&&/^❯\s+\S/.test(d)){c=a;break}}let f=c>=0?c+1:0,g=b.slice(f),h=[],m=!1,n=!1;for(let a of g){let b=(0,e.IW)(a);if(!(!b||d.J7.some(a=>a.test(b)))){if(i.test(b)){n=!0,m=!1;continue}if(k.test(b)){m=!0,n=!1;continue}if(!(j.test(b)||l.test(b)||/^❯\s*/.test(b)||/^[│└]/.test(b))){if(/^●/.test(b)){m=!1,n=!1,h.push(b.replace(/^●\s*/,""));continue}m||n||h.push(b)}}}return h.join("\n").trim()}function n(a){let b=a.split("\n"),c=[];for(let a=0;a<b.length;a++){let f=(0,e.l1)(b[a]);f&&d.Md.test(f)&&c.push(a)}let f=0;c.length>=2&&(f=c[c.length-2]+1);let g=[];for(let a=f;a<b.length;a++){let c=(0,e.l1)(b[a]);!(!c||d.sx.some(a=>a.test(c)))&&(d.Md.test(c)||g.push(c))}return g.join("\n").trim()}function o(a,b=f.Rf,c=f.ky){if(!a||a.length<=b)return a;let d=c+"\n",e=b-d.length;if(e<=0)return c.slice(0,b);let g=a.length-e;if(g>0&&g<a.length){let b=a.charCodeAt(g);b>=56320&&b<=57343&&(g+=1)}return d+a.slice(g)}},90164:(a,b,c)=>{"use strict";c.d(b,{Dk:()=>e,kD:()=>f});let d="https://github.com/Kewton/CommandMate",e=`${d}/releases/`,f=`${d}/blob/main/docs/security-guide.md`},93997:(a,b,c)=>{"use strict";c.d(b,{aq:()=>l,gm:()=>j,pc:()=>k,vF:()=>i,wd:()=>h,xE:()=>e});let d=(0,c(72626).h)("tmux-capture-cache"),e=1e4;function f(){return globalThis.__tmuxCaptureCache??=new Map}function g(){return globalThis.__tmuxCaptureCacheInflight??=new Map}function h(a,b){if(""===a)return"";let c=a.split("\n");return b>=c.length?a:c.slice(-b).join("\n")}function i(a,b,c){let d=f(),e=Date.now();for(let[a,b]of d)e-b.timestamp>5e3&&d.delete(a);if(d.size>=100&&!d.has(a)){let a=null,b=1/0;for(let[c,e]of d)e.timestamp<b&&(b=e.timestamp,a=c);a&&d.delete(a)}d.set(a,{output:b,capturedLines:c,timestamp:e})}function j(a){f().delete(a),d.debug("cache:invalidate",{sessionName:a})}function k(){f().clear(),g().clear()}async function l(a,b,c){let d=function(a,b){let c=f(),d=c.get(a);return d?Date.now()-d.timestamp>5e3?(c.delete(a),null):b>d.capturedLines?null:h(d.output,b):null}(a,b);if(null!==d)return d;let j=g(),k=j.get(a);if(k)return h(await k,b);let l=c();j.set(a,l);try{let c=await l;return c.length>0&&i(a,c,e),h(c,b)}finally{j.delete(a)}}},95220:(a,b,c)=>{"use strict";c.r(b),c.d(b,{accumulateTuiContent:()=>g.IZ,cleanClaudeResponse:()=>f.NN,cleanCopilotResponse:()=>f.LH,cleanGeminiResponse:()=>f.IS,cleanOpenCodeResponse:()=>f.aW,clearPromptHashCache:()=>h.iX,clearTuiAccumulator:()=>g.q1,extractCopilotContentLines:()=>g.o0,extractTuiContentLines:()=>g.K0,findOverlapIndex:()=>g.vQ,getAccumulatedContent:()=>g.Uz,getActivePollers:()=>d.KQ,initTuiAccumulator:()=>g.tb,isDuplicatePrompt:()=>h.gv,isOpenCodeComplete:()=>e.b,normalizeCopilotLine:()=>g.IW,normalizePromptForDedup:()=>h.zm,resolveExtractionStartIndex:()=>e.Q,startPolling:()=>d.g8,stopAllPolling:()=>d.fq,stopPolling:()=>d.Et,truncateMessage:()=>f.Sj});var d=c(45146),e=c(60),f=c(82450),g=c(13033),h=c(72457)},95595:(a,b,c)=>{"use strict";c.d(b,{WC:()=>l,gv:()=>h,ug:()=>i});var d=c(26283),e=c(25129),f=c(68652),g=c(46423);let h={PROMPT_DETECTED:"prompt_detected",THINKING_INDICATOR:"thinking_indicator",OPENCODE_PROCESSING_INDICATOR:"opencode_processing_indicator",OPENCODE_SELECTION_LIST:"opencode_selection_list",CLAUDE_SELECTION_LIST:"claude_selection_list",COPILOT_SELECTION_LIST:"copilot_selection_list",CODEX_SELECTION_LIST:"codex_selection_list",CODEX_PAGER:"codex_pager",ANTIGRAVITY_SELECTION_LIST:"antigravity_selection_list",OPENCODE_RESPONSE_COMPLETE:"opencode_response_complete",INPUT_PROMPT:"input_prompt",NO_RECENT_OUTPUT:"no_recent_output",DEFAULT:"default"},i=new Set([h.OPENCODE_SELECTION_LIST,h.CLAUDE_SELECTION_LIST,h.COPILOT_SELECTION_LIST,h.CODEX_SELECTION_LIST,h.CODEX_PAGER,h.ANTIGRAVITY_SELECTION_LIST]),j=/press\s+(?:number|enter)\s+to\s+confirm/i,k=/^\s*[❯›●]?\s*\d{1,2}[.)]\s/;function l(a,b,c){let i=(0,f.N)((0,d.aJ)(a)),l=i.split("\n"),m=l.length-1;for(;m>=0&&""===l[m].trim();)m--;let n=l.slice(0,m+1),o=n.slice(-15).join("\n"),p=n.slice(-g.$).join("\n"),q=n.slice(-30).join("\n");if("copilot"===b&&d.Mi.test(q)){let a=(0,d.KO)(b),c=(0,e.gF)((0,d._A)(i),a);return c.isPrompt&&(c.promptData?.options?.length??0)<=3?{status:"waiting",confidence:"high",reason:"prompt_detected",hasActivePrompt:!0,promptDetection:c}:{status:"waiting",confidence:"high",reason:h.COPILOT_SELECTION_LIST,hasActivePrompt:!1,promptDetection:c}}let r=n.slice(-15).join("\n");if("copilot"===b&&(0,d.ut)(b,r)){let a=(0,d.KO)(b);return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:(0,e.gF)((0,d._A)(i),a)}}if("codex"===b&&d.pn.test(o)){let a=(0,d.KO)(b),c=(0,e.gF)((0,d._A)(i),a);return{status:"waiting",confidence:"high",reason:h.CODEX_PAGER,hasActivePrompt:!1,promptDetection:c}}if("codex"===b){let a=-1;for(let b=n.length-1;b>=Math.max(0,n.length-10);b--)if(d.aW.test(n[b])){a=b;break}let c=a>=0?a-1:n.length-1;for(;c>=0&&""===n[c].trim();)c--;if(c>=0){let a=n.slice(Math.max(0,c-15+1),c+1).join("\n");if(d.Jn.test(a)){let a=(0,d.KO)(b),c=(0,e.gF)((0,d._A)(i),a);return{status:"waiting",confidence:"high",reason:h.CODEX_SELECTION_LIST,hasActivePrompt:!1,promptDetection:c}}}}if("antigravity"===b&&d.kT.test(o)){let a=(0,d.KO)(b),c=(0,e.gF)((0,d._A)(i),a);return{status:"waiting",confidence:"high",reason:h.ANTIGRAVITY_SELECTION_LIST,hasActivePrompt:!1,promptDetection:c}}let s=(0,d.KO)(b),t="opencode"===b||"codex"===b||"claude"===b||"copilot"===b?(0,d._A)(i):(0,d._A)(o),u=(0,e.gF)(t,s);if(u.isPrompt)if(!("codex"===b&&function(a){let b=-1;for(let c=a.length-1;c>=Math.max(0,a.length-10);c--)if(d.aW.test(a[c])){b=c;break}let c=b>=0?b:a.length,e=-1,f=-1;for(let b=0;b<c;b++){let c=a[b],g=c.trim();""!==g&&((j.test(g)||k.test(g))&&(e=b),(0,d.ut)("codex",c)&&(f=b))}return e>=0&&f>e}(n)))return{status:"waiting",confidence:"high",reason:"prompt_detected",hasActivePrompt:!0,promptDetection:u};else u={...u,isPrompt:!1,promptData:void 0};if("claude"===b&&d.XY.test(o))return{status:"waiting",confidence:"high",reason:h.CLAUDE_SELECTION_LIST,hasActivePrompt:!1,promptDetection:u};if((0,d.ut)(b,p))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:u};if("claude"===b&&d.aU.test(o))return{status:"running",confidence:"high",reason:h.THINKING_INDICATOR,hasActivePrompt:!1,promptDetection:u};if("opencode"===b){if(d.kD.test(o))return{status:"running",confidence:"high",reason:"opencode_processing_indicator",hasActivePrompt:!1,promptDetection:u};let a=(0,d._A)(i).split("\n"),b=Math.max(0,a.length-7);for(let c=a.length-1;c>=Math.max(0,a.length-10);c--)if(/ctrl\+[tp]/.test(a[c])){b=Math.max(0,c-2);break}let c=a.slice(0,b),e=c.length-1;for(;e>=0&&""===c[e].trim();)e--;if(e>=0){let a=c.slice(Math.max(0,e-g.$+1),e+1).join("\n");if((0,d.ut)("opencode",a))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:u};let b=c.slice(Math.max(0,e-15+1),e+1).join("\n"),f=c.join("\n");if(d.LO.test(f))return{status:"waiting",confidence:"high",reason:h.OPENCODE_SELECTION_LIST,hasActivePrompt:!1,promptDetection:u};if(d.Md.test(b))return{status:"ready",confidence:"high",reason:h.OPENCODE_RESPONSE_COMPLETE,hasActivePrompt:!1,promptDetection:u};let{promptPattern:i}=(0,d._X)("opencode");if(i.test(b))return{status:"ready",confidence:"high",reason:h.PROMPT_DETECTED,hasActivePrompt:!0,promptDetection:u}}}if("codex"===b){let a=-1;for(let b=n.length-1;b>=Math.max(0,n.length-10);b--)if(d.aW.test(n[b])){a=b;break}if(a>=0){let b=a-1;for(;b>=0&&""===n[b].trim();)b--;if(b>=0){let a=n.slice(Math.max(0,b-g.$+1),b+1).join("\n");if((0,d.ut)("codex",a))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:u};let c=n[b].trim();return d.gm.test(c)?{status:"ready",confidence:"high",reason:"input_prompt",hasActivePrompt:!1,promptDetection:u}:{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:u}}}else{let a=n.length-1;for(;a>=0&&""===n[a].trim();)a--;if(!(a>=0&&d.gm.test(n[a].trim()))&&(0,d.ut)("codex",o))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:u}}}if("antigravity"===b){if((0,d.ut)("antigravity",o))return{status:"running",confidence:"high",reason:h.THINKING_INDICATOR,hasActivePrompt:!1,promptDetection:u};let{promptPattern:a}=(0,d._X)("antigravity");if(a.test(o))return{status:"ready",confidence:"high",reason:h.INPUT_PROMPT,hasActivePrompt:!1,promptDetection:u}}let{promptPattern:v}=(0,d._X)(b);return v.test(o)?{status:"ready",confidence:"high",reason:"input_prompt",hasActivePrompt:!1,promptDetection:u}:c&&Date.now()-c.getTime()>5e3?{status:"ready",confidence:"low",reason:"no_recent_output",hasActivePrompt:!1,promptDetection:u}:{status:"running",confidence:"low",reason:"default",hasActivePrompt:!1,promptDetection:u}}},99508:(a,b,c)=>{"use strict";c.r(b),c.d(b,{INTERACTION_SNAPSHOT_RETRY_DELAYS_MS:()=>l,__resetTerminalBroadcastState:()=>s,broadcastSessionStatus:()=>r,broadcastTerminalSnapshot:()=>m,broadcastTerminalSnapshotAfterInteraction:()=>q});var d=c(69297),e=c(88807),f=c(34892),g=c(72626),h=c(31268),i=c(93997);let j=(0,g.h)("terminal-broadcast"),k=new Map,l=[100,250,500,750];async function m(a,b,c){if((0,d.h7)(a))try{let d=(0,e.getDbInstance)(),g=await (0,f.$)(d,a,b,c);p(a,b,g,c)}catch(b){j.error("terminal-snapshot:failed",{worktreeId:a,error:b instanceof Error?b.message:String(b)})}}function n(a){return JSON.stringify([a.fullOutput??"",a.isRunning,a.thinking??!1,a.isPromptWaiting??!1,a.isSelectionListActive??!1,a.isPagerActive??!1,a.isUnclassifiedActive??!1])}async function o(a,b,c){let d=h.s.getInstance().getTool(b);return(0,i.gm)(d.getSessionName(a,c)),(0,f.$)((0,e.getDbInstance)(),a,b,c)}function p(a,b,c,e){let f=e??b,g=`${a}:${b}:${f}`;(0,d.mq)(a,{type:"terminal_snapshot",worktreeId:a,cliToolId:b,instanceId:f,output:c.fullOutput??"",isRunning:c.isRunning,thinking:c.thinking??!1,isPromptWaiting:c.isPromptWaiting??!1,promptData:c.promptData??null,isSelectionListActive:c.isSelectionListActive??!1,isPagerActive:c.isPagerActive??!1,isUnclassifiedActive:c.isUnclassifiedActive??!1,version:function(a){let b=(k.get(a)??0)+1;return k.set(a,b),b}(g)})}async function q(a,b,c,e=l){if((0,d.h7)(a))try{let d=await o(a,b,c),f=n(d);for(let g of(p(a,b,d,c),e)){await new Promise(a=>setTimeout(a,g));let d=await o(a,b,c);if(n(d)!==f)return void p(a,b,d,c)}}catch(d){j.error("terminal-snapshot:interaction-refresh-failed",{worktreeId:a,cliToolId:b,instanceId:c,error:d instanceof Error?d.message:String(d)})}}function r(a,b,c){(0,d.mq)(a,{type:"session_status_changed",worktreeId:a,isRunning:b,cliTool:c?.cliTool??null,instance:c?.instance??null})}function s(){k.clear()}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=6130,exports.ids=[6130],exports.modules={26838:(a,b,c)=>{c.d(b,{Mj:()=>k,Sw:()=>j,lX:()=>l});var d=c(29021),e=c(33873),f=c(90164);let g=/^v?\d+\.\d+\.\d+$/,h=/^[a-zA-Z0-9.\-\s_v]+$/,i=globalThis.__versionCheckCache??(globalThis.__versionCheckCache={result:null,fetchedAt:0,rateLimitResetAt:null});function j(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.
|
|
1
|
+
"use strict";exports.id=6130,exports.ids=[6130],exports.modules={26838:(a,b,c)=>{c.d(b,{Mj:()=>k,Sw:()=>j,lX:()=>l});var d=c(29021),e=c(33873),f=c(90164);let g=/^v?\d+\.\d+\.\d+$/,h=/^[a-zA-Z0-9.\-\s_v]+$/,i=globalThis.__versionCheckCache??(globalThis.__versionCheckCache={result:null,fetchedAt:0,rateLimitResetAt:null});function j(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.16.0"}function k(){return j()}async function l(){try{var a,b,c;if(null!==i.result&&Date.now()-i.fetchedAt<36e5||i.rateLimitResetAt&&(!(Date.now()>=i.rateLimitResetAt)||(i.rateLimitResetAt=null,0)))return i.result;let d=await fetch("https://api.github.com/repos/Kewton/CommandMate/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":`CommandMate/${k()}`},cache:"no-store",signal:AbortSignal.timeout(5e3)});if(403===d.status)return function(a){let b=a.headers.get("X-RateLimit-Reset");b?i.rateLimitResetAt=1e3*parseInt(b,10):i.rateLimitResetAt=Date.now()+36e5}(d),i.result;if(!d.ok)return i.result;let e=await d.json(),j=k(),l=e.tag_name.replace(/^v/,""),m={hasUpdate:function(a,b){if(!g.test(a)||!g.test(b))return!1;let c=a=>a.replace(/^v/,"").split(".").map(Number),[d,e,f]=c(a),[h,i,j]=c(b);return h!==d?h>d:i!==e?i>e:j>f}(j,e.tag_name),currentVersion:j,latestVersion:l,releaseUrl:(a=e.html_url).startsWith(f.Dk)?a:null,releaseName:(b=e.name,c=e.tag_name,h.test(b)&&b.length<=128?b:c),publishedAt:e.published_at};return i.result=m,i.fetchedAt=Date.now(),m}catch{return i.result}}},88573:(a,b,c)=>{c.d(b,{Lw:()=>s});let d="https://raw.githubusercontent.com/Kewton/commandmate-skills/main/catalog/v1/catalog.json",e=[d],f=/^[A-Za-z0-9/+=_."-]{1,128}$/;var g=c(72626),h=c(13075);let i=(0,g.h)("lib/skills/catalog-client"),j={FETCH_FAILED:"SKILL_CATALOG_FETCH_FAILED",RATE_LIMITED:"SKILL_CATALOG_RATE_LIMITED",OVERSIZED:"SKILL_CATALOG_OVERSIZED",MALFORMED:"SKILL_CATALOG_MALFORMED",INVALID_SCHEMA:"SKILL_CATALOG_INVALID_SCHEMA"},k=globalThis.__skillCatalogCache??={catalog:null,validatedAt:0,confirmedAt:0,etag:null,revision:null,rateLimitResetAt:null,inflight:null};class l extends Error{}let m={[j.FETCH_FAILED]:"The Skill Catalog could not be retrieved.",[j.RATE_LIMITED]:"The Skill Catalog origin is rate limiting requests.",[j.OVERSIZED]:"The Skill Catalog response exceeded the allowed size.",[j.MALFORMED]:"The Skill Catalog response was not valid JSON.",[j.INVALID_SCHEMA]:"The Skill Catalog response did not match the supported Catalog schema."};function n(a){return new Date(a).toISOString()}function o(a,b,c){return{catalog:a,fetchedAt:n(k.validatedAt),revalidatedAt:n(k.confirmedAt),state:b,stale:"stale"===b,offline:"stale"===b,staleReason:c,source:{repository:"Kewton/commandmate-skills",ref:"main",revision:k.revision}}}function p(a,b=[]){return k.catalog?{ok:!0,snapshot:o(k.catalog,"stale",a)}:{ok:!1,failure:{code:a,message:m[a],errors:b}}}async function q(a,b){let c=a.headers.get("Content-Length");if(null!==c){let a=Number(c);if(!Number.isFinite(a)||a<0||a>b)throw new l("content-length out of bounds")}let d=a.body;if(!d||"function"!=typeof d.getReader){let c=await a.text();if(new TextEncoder().encode(c).length>b)throw new l("body exceeded size cap");return c}let e=d.getReader(),f=[],g=0;for(;;){let{done:a,value:c}=await e.read();if(a)break;if(c){if((g+=c.byteLength)>b)throw await e.cancel(),new l("body exceeded size cap");f.push(c)}}let h=new Uint8Array(g),i=0;for(let a of f)h.set(a,i),i+=a.byteLength;return new TextDecoder("utf-8").decode(h)}async function r(a){let b,c,g;if(!e.includes(d))return p(j.FETCH_FAILED);let m={Accept:"application/json","User-Agent":`CommandMate/${a}`};null!==k.catalog&&null!==k.etag&&(m["If-None-Match"]=k.etag);try{b=await fetch(d,{headers:m,cache:"no-store",signal:AbortSignal.timeout(5e3)})}catch{return i.warn("catalog-fetch-failed",{reason:j.FETCH_FAILED}),p(j.FETCH_FAILED)}if(304===b.status&&null!==k.catalog)return k.confirmedAt=Date.now(),{ok:!0,snapshot:o(k.catalog,"revalidated",null)};if(403===b.status||429===b.status)return!function(a){let b=Date.now(),c=b+864e5,d=a.headers.get("X-RateLimit-Reset");if(null!==d){let a=Number(d);if(Number.isFinite(a)&&a>0){k.rateLimitResetAt=Math.min(1e3*a,c);return}}let e=a.headers.get("Retry-After");if(null!==e){let a=Number(e);if(Number.isFinite(a)&&a>0){k.rateLimitResetAt=Math.min(b+1e3*a,c);return}}k.rateLimitResetAt=b+36e5}(b),i.warn("catalog-rate-limited",{status:b.status}),p(j.RATE_LIMITED);if(!b.ok)return i.warn("catalog-fetch-failed",{status:b.status}),p(j.FETCH_FAILED);try{c=await q(b,1048576)}catch(b){let a=b instanceof l?j.OVERSIZED:j.FETCH_FAILED;return i.warn("catalog-body-rejected",{reason:a}),p(a)}try{g=JSON.parse(c)}catch{return i.warn("catalog-malformed",{reason:j.MALFORMED}),p(j.MALFORMED)}let n=(0,h.JJ)(g);if(!n.ok)return i.warn("catalog-invalid-schema",{errorCount:n.errors.length}),p(j.INVALID_SCHEMA,n.errors);let r=Date.now();return k.catalog=n.value,k.validatedAt=r,k.confirmedAt=r,k.etag=b.headers.get("ETag"),k.revision=function(a){if(null===a)return null;let b=a.trim();return f.test(b)?b:null}(k.etag),{ok:!0,snapshot:o(n.value,"fresh",null)}}async function s(a={}){let{hostVersion:b="0.0.0",forceRevalidate:c=!1}=a;return!c&&null!==k.catalog&&Date.now()-k.confirmedAt<9e5&&null!==k.catalog?{ok:!0,snapshot:o(k.catalog,"cached",null)}:null!==k.rateLimitResetAt&&(!(Date.now()>=k.rateLimitResetAt)||(k.rateLimitResetAt=null,0))?p(j.RATE_LIMITED):(null===k.inflight&&(k.inflight=r(b).finally(()=>{k.inflight=null})),k.inflight)}},90164:(a,b,c)=>{c.d(b,{Dk:()=>e,kD:()=>f});let d="https://github.com/Kewton/CommandMate",e=`${d}/releases/`,f=`${d}/blob/main/docs/security-guide.md`}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=8681,exports.ids=[8681],exports.modules={56791:(a,b,c)=>{c.d(b,{AC:()=>d.AC,ug:()=>d.ug,lm:()=>d.lm,KG:()=>d.KG,cD:()=>d.cD,Jj:()=>d.Jj,YX:()=>d.YX,G4:()=>d.G4,hL:()=>d.hL,qp:()=>d.qp,To:()=>d.To,oH:()=>d.oH,py:()=>d.py,yy:()=>d.yy,pE:()=>d.pE,z2:()=>d.z2,cP:()=>d.cP,DF:()=>d.DF,lA:()=>d.lA,Qp:()=>d.Qp,th:()=>d.th,oZ:()=>d.oZ,ZP:()=>d.ZP,Ys:()=>d.Ys,vg:()=>d.vg,Rm:()=>d.Rm,BN:()=>d.BN,m0:()=>d.m0,Tk:()=>d.Tk,iT:()=>d.iT,gp:()=>d.gp,yE:()=>d.yE,BE:()=>d.BE,qK:()=>d.qK,p4:()=>d.p4,r8:()=>d.r8,of:()=>d.of,DN:()=>d.DN,pZ:()=>d.pZ,kA:()=>d.kA,VL:()=>d.VL,CF:()=>d.CF,NV:()=>d.NV,ce:()=>d.ce,y1:()=>d.y1,Nr:()=>d.Nr,ob:()=>d.ob,fr:()=>d.fr,Ui:()=>d.Ui,P9:()=>d.P9,eN:()=>d.eN,vi:()=>d.vi,uJ:()=>d.uJ,yT:()=>d.yT,PL:()=>d.PL,jp:()=>d.jp,nQ:()=>d.nQ,yb:()=>d.yb,GA:()=>d.GA,Cs:()=>d.Cs,xR:()=>d.xR,az:()=>d.az,nZ:()=>d.nZ,PP:()=>d.PP,Dx:()=>d.Dx,O:()=>d.O,EU:()=>d.EU,HZ:()=>d.HZ,UY:()=>d.UY,cw:()=>d.cw,jJ:()=>d.jJ,DC:()=>d.DC,gb:()=>d.gb,yB:()=>d.yB,uy:()=>d.uy,s:()=>d.s,iu:()=>d.iu,hq:()=>d.hq,z1:()=>d.z1,bl:()=>d.bl,jA:()=>d.jA,ZL:()=>d.ZL});var d=c(25537);c(88807),c(
|
|
1
|
+
"use strict";exports.id=8681,exports.ids=[8681],exports.modules={56791:(a,b,c)=>{c.d(b,{AC:()=>d.AC,ug:()=>d.ug,lm:()=>d.lm,KG:()=>d.KG,cD:()=>d.cD,Jj:()=>d.Jj,YX:()=>d.YX,G4:()=>d.G4,hL:()=>d.hL,qp:()=>d.qp,To:()=>d.To,oH:()=>d.oH,py:()=>d.py,yy:()=>d.yy,pE:()=>d.pE,z2:()=>d.z2,cP:()=>d.cP,DF:()=>d.DF,lA:()=>d.lA,Qp:()=>d.Qp,th:()=>d.th,oZ:()=>d.oZ,ZP:()=>d.ZP,Ys:()=>d.Ys,vg:()=>d.vg,Rm:()=>d.Rm,BN:()=>d.BN,m0:()=>d.m0,Tk:()=>d.Tk,iT:()=>d.iT,gp:()=>d.gp,yE:()=>d.yE,BE:()=>d.BE,qK:()=>d.qK,p4:()=>d.p4,r8:()=>d.r8,of:()=>d.of,DN:()=>d.DN,pZ:()=>d.pZ,kA:()=>d.kA,VL:()=>d.VL,CF:()=>d.CF,NV:()=>d.NV,ce:()=>d.ce,y1:()=>d.y1,Nr:()=>d.Nr,ob:()=>d.ob,fr:()=>d.fr,Ui:()=>d.Ui,P9:()=>d.P9,eN:()=>d.eN,vi:()=>d.vi,uJ:()=>d.uJ,yT:()=>d.yT,PL:()=>d.PL,jp:()=>d.jp,nQ:()=>d.nQ,yb:()=>d.yb,GA:()=>d.GA,Cs:()=>d.Cs,xR:()=>d.xR,az:()=>d.az,nZ:()=>d.nZ,PP:()=>d.PP,Dx:()=>d.Dx,O:()=>d.O,EU:()=>d.EU,HZ:()=>d.HZ,UY:()=>d.UY,cw:()=>d.cw,jJ:()=>d.jJ,DC:()=>d.DC,gb:()=>d.gb,yB:()=>d.yB,uy:()=>d.uy,s:()=>d.s,iu:()=>d.iu,hq:()=>d.hq,z1:()=>d.z1,bl:()=>d.bl,jA:()=>d.jA,ZL:()=>d.ZL});var d=c(25537);c(88807),c(71634),c(20416),c(10406),c(29021),c(33873),c(21820),c(7956),(0,c(72626).h)("db-migration-path")},66007:(a,b,c)=>{c.d(b,{B9:()=>m,Px:()=>o,b$:()=>n,h6:()=>k});var d=c(33873),e=c.n(d),f=c(29021),g=c(72626),h=c(80438);let i=(0,g.h)("path-validator"),j=/^[a-zA-Z0-9_-]+$/;function k(a){return!!a&&0!==a.length&&j.test(a)}function l(a,b){return a===b||a.startsWith(b+e().sep)}function m(a,b){if(!a||""===a.trim()||a.includes("\0"))return!1;let c=a;try{c=decodeURIComponent(a)}catch{c=a}if(c.includes("\0"))return!1;let d=e().resolve(b),f=e().resolve(b,c),g=e().relative(d,f);return!(g.startsWith("..")||e().isAbsolute(g))}function n(a,b){if(!a||""===a.trim())throw Error("Invalid path: Path cannot be empty");if(a.includes("\0"))throw Error("Invalid path: Null bytes not allowed");if(!m(a,b))throw Error(`Path is outside allowed directory: ${a} (allowed root: ${b})`);let c=a;try{c=decodeURIComponent(a)}catch{c=a}return e().resolve(b,c)}function o(a,b){let c;try{c=(0,f.realpathSync)(b)}catch{return!1}let d=e().resolve(b,a);if((0,f.existsSync)(d))try{let b=(0,f.realpathSync)(d),e=l(b,c);return e||(0,h.h)(i,"symlink-rejected",{targetPath:a,resolvedTarget:b}),e}catch{return!1}try{if((0,f.lstatSync)(d).isSymbolicLink())try{let b=(0,f.readlinkSync)(d),g=e().resolve(e().dirname(d),b),j=l(g,c);return j||(0,h.h)(i,"dangling-symlink-rejected",{targetPath:a,resolvedLinkTarget:g}),j}catch{return!1}}catch{}let g=e().dirname(d);for(;g!==e().dirname(g);){if((0,f.existsSync)(g))try{let a=(0,f.realpathSync)(g),b=l(a,c);return b||(0,h.h)(i,"symlink-ancestor-rejected",{currentPath:g,resolvedAncestor:a}),b}catch{break}g=e().dirname(g)}return!1}},80438:(a,b,c)=>{c.d(b,{h:()=>d});function d(a,b,c){a.warn(`security:${b}`,c)}},97399:(a,b,c)=>{c.d(b,{I6:()=>i,Sr:()=>g,eA:()=>k});var d=c(10641),e=c(66007),f=c(65417);function g(a,b){if(!Array.isArray(a)||0===a.length)return d.NextResponse.json({error:"files must be a non-empty array"},{status:400});if(a.length>f.Mo)return d.NextResponse.json({error:`files exceeds the maximum of ${f.Mo}`},{status:400});for(let c of a){if("string"!=typeof c||0===c.length)return d.NextResponse.json({error:"files must contain only non-empty strings"},{status:400});if(!(0,e.B9)(c,b))return d.NextResponse.json({error:"Invalid file path"},{status:400})}return a}let h=/[\x00-\x20\x7F~^:?*[\\]/;function i(a){return"string"!=typeof a||0===a.length||a.length>255||a.startsWith("-")||a.startsWith("/")||a.endsWith("/")||a.includes("//")||a.includes("..")||a.startsWith(".")||a.endsWith(".")||a.endsWith(".lock")||a.includes("@{")||h.test(a)?d.NextResponse.json({error:"Invalid branch name",reason:"invalid_branch_name"},{status:400}):a}let j=/^\d+$/;function k(a){let b,c=()=>d.NextResponse.json({error:"Invalid stash index",reason:"invalid_stash_index"},{status:400});if("number"==typeof a){if(!Number.isInteger(a))return c();b=a}else{if("string"!=typeof a||!j.test(a))return c();b=parseInt(a,10)}return b<0||b>f.Kq?c():b}}};
|
|
@@ -308,7 +308,7 @@
|
|
|
308
308
|
device_label = excluded.device_label,
|
|
309
309
|
locale = COALESCE(excluded.locale, push_subscriptions.locale),
|
|
310
310
|
updated_at = excluded.updated_at
|
|
311
|
-
`).run((0,d.randomUUID)(),b.endpoint,b.p256dh,b.auth,e,f,c,c);let g=h(a,b.endpoint);if(!g)throw Error("Failed to persist push subscription");return g}function h(a,b){let c=a.prepare(`SELECT ${f} FROM push_subscriptions WHERE endpoint = ?`).get(b);return c?e(c):null}function i(a,b){return a.prepare(`SELECT ${f} FROM push_subscriptions WHERE ${"prompt"===b?"enabled_prompt":"enabled_completion"} = 1 ORDER BY created_at ASC`).all().map(e)}function j(a,b,c){let d=["updated_at = ?"],e=[Date.now()];return void 0!==c.enabledPrompt&&(d.push("enabled_prompt = ?"),e.push(+!!c.enabledPrompt)),void 0!==c.enabledCompletion&&(d.push("enabled_completion = ?"),e.push(+!!c.enabledCompletion)),e.push(b),a.prepare(`UPDATE push_subscriptions SET ${d.join(", ")} WHERE endpoint = ?`).run(...e),h(a,b)}function k(a,b){return a.prepare("DELETE FROM push_subscriptions WHERE endpoint = ?").run(b).changes>0}},
|
|
311
|
+
`).run((0,d.randomUUID)(),b.endpoint,b.p256dh,b.auth,e,f,c,c);let g=h(a,b.endpoint);if(!g)throw Error("Failed to persist push subscription");return g}function h(a,b){let c=a.prepare(`SELECT ${f} FROM push_subscriptions WHERE endpoint = ?`).get(b);return c?e(c):null}function i(a,b){return a.prepare(`SELECT ${f} FROM push_subscriptions WHERE ${"prompt"===b?"enabled_prompt":"enabled_completion"} = 1 ORDER BY created_at ASC`).all().map(e)}function j(a,b,c){let d=["updated_at = ?"],e=[Date.now()];return void 0!==c.enabledPrompt&&(d.push("enabled_prompt = ?"),e.push(+!!c.enabledPrompt)),void 0!==c.enabledCompletion&&(d.push("enabled_completion = ?"),e.push(+!!c.enabledCompletion)),e.push(b),a.prepare(`UPDATE push_subscriptions SET ${d.join(", ")} WHERE endpoint = ?`).run(...e),h(a,b)}function k(a,b){return a.prepare("DELETE FROM push_subscriptions WHERE endpoint = ?").run(b).changes>0}},71634:(a,b,c)=>{c.d(b,{vI:()=>m});var d=c(33873),e=c.n(d);function f(a){try{let b=a.prepare("SELECT MAX(version) as version FROM schema_version").get();return b?.version??0}catch{return 0}}function g(a){let b=c(29021),d=a;for(;d!==e().dirname(d);){let a=e().join(d,".git");if(b.existsSync(a)){let c=b.statSync(a);if(c.isDirectory())return d;if(c.isFile()){let c=b.readFileSync(a,"utf-8").trim().match(/^gitdir:\s*(.+)$/);if(c)return c[1].split("/.git/")[0]}}d=e().dirname(d)}return a}var h=c(25537);let i=`
|
|
312
312
|
id, worktree_id, skill_id, version, install_root, receipt_sha256,
|
|
313
313
|
source_repository, source_ref, source_commit, artifact_sha256,
|
|
314
314
|
effective_risk, operation_id, installed_at, updated_at
|
|
@@ -1201,13 +1201,76 @@
|
|
|
1201
1201
|
`),a.exec(`
|
|
1202
1202
|
CREATE INDEX IF NOT EXISTS idx_skill_installations_skill
|
|
1203
1203
|
ON skill_installations(skill_id, version);
|
|
1204
|
+
`)}},{version:48,name:"add-skill-operations-audit-index",up:a=>{a.exec("ALTER TABLE skill_operations ADD COLUMN from_version TEXT;"),a.exec("ALTER TABLE skill_operations ADD COLUMN to_version TEXT;"),a.exec(`
|
|
1205
|
+
CREATE INDEX IF NOT EXISTS idx_skill_operations_recent
|
|
1206
|
+
ON skill_operations(recorded_at DESC, id DESC);
|
|
1207
|
+
`),a.exec(`
|
|
1208
|
+
CREATE INDEX IF NOT EXISTS idx_skill_operations_result
|
|
1209
|
+
ON skill_operations(result, recorded_at DESC);
|
|
1210
|
+
`)},down:a=>{a.exec("DROP INDEX IF EXISTS idx_skill_operations_result;"),a.exec("DROP INDEX IF EXISTS idx_skill_operations_recent;"),a.exec("DROP TRIGGER IF EXISTS skill_operations_no_delete;"),a.exec("DROP TRIGGER IF EXISTS skill_operations_no_update;"),a.exec(`
|
|
1211
|
+
CREATE TABLE skill_operations__v47 (
|
|
1212
|
+
id TEXT PRIMARY KEY,
|
|
1213
|
+
operation_id TEXT NOT NULL,
|
|
1214
|
+
idempotency_key TEXT NOT NULL,
|
|
1215
|
+
binding_hash TEXT NOT NULL,
|
|
1216
|
+
operation TEXT NOT NULL,
|
|
1217
|
+
state TEXT NOT NULL,
|
|
1218
|
+
result TEXT NOT NULL,
|
|
1219
|
+
actor_type TEXT NOT NULL,
|
|
1220
|
+
actor_id TEXT,
|
|
1221
|
+
worktree_id TEXT NOT NULL,
|
|
1222
|
+
skill_id TEXT NOT NULL,
|
|
1223
|
+
skill_version TEXT,
|
|
1224
|
+
source_origin TEXT,
|
|
1225
|
+
source_repository TEXT,
|
|
1226
|
+
source_ref TEXT,
|
|
1227
|
+
source_commit TEXT,
|
|
1228
|
+
artifact_sha256 TEXT,
|
|
1229
|
+
error_code TEXT,
|
|
1230
|
+
error_message TEXT,
|
|
1231
|
+
recorded_at INTEGER NOT NULL
|
|
1232
|
+
);
|
|
1233
|
+
`),a.exec(`
|
|
1234
|
+
INSERT INTO skill_operations__v47 (
|
|
1235
|
+
id, operation_id, idempotency_key, binding_hash, operation, state, result,
|
|
1236
|
+
actor_type, actor_id, worktree_id, skill_id, skill_version,
|
|
1237
|
+
source_origin, source_repository, source_ref, source_commit, artifact_sha256,
|
|
1238
|
+
error_code, error_message, recorded_at
|
|
1239
|
+
)
|
|
1240
|
+
SELECT
|
|
1241
|
+
id, operation_id, idempotency_key, binding_hash, operation, state, result,
|
|
1242
|
+
actor_type, actor_id, worktree_id, skill_id, skill_version,
|
|
1243
|
+
source_origin, source_repository, source_ref, source_commit, artifact_sha256,
|
|
1244
|
+
error_code, error_message, recorded_at
|
|
1245
|
+
FROM skill_operations;
|
|
1246
|
+
`),a.exec("DROP TABLE skill_operations;"),a.exec("ALTER TABLE skill_operations__v47 RENAME TO skill_operations;"),a.exec(`
|
|
1247
|
+
CREATE INDEX IF NOT EXISTS idx_skill_operations_operation_id
|
|
1248
|
+
ON skill_operations(operation_id);
|
|
1249
|
+
`),a.exec(`
|
|
1250
|
+
CREATE INDEX IF NOT EXISTS idx_skill_operations_idempotency_key
|
|
1251
|
+
ON skill_operations(idempotency_key);
|
|
1252
|
+
`),a.exec(`
|
|
1253
|
+
CREATE INDEX IF NOT EXISTS idx_skill_operations_target
|
|
1254
|
+
ON skill_operations(worktree_id, skill_id, recorded_at);
|
|
1255
|
+
`),a.exec(`
|
|
1256
|
+
CREATE TRIGGER IF NOT EXISTS skill_operations_no_update
|
|
1257
|
+
BEFORE UPDATE ON skill_operations
|
|
1258
|
+
BEGIN
|
|
1259
|
+
SELECT RAISE(ABORT, 'skill_operations is append-only');
|
|
1260
|
+
END;
|
|
1261
|
+
`),a.exec(`
|
|
1262
|
+
CREATE TRIGGER IF NOT EXISTS skill_operations_no_delete
|
|
1263
|
+
BEFORE DELETE ON skill_operations
|
|
1264
|
+
BEGIN
|
|
1265
|
+
SELECT RAISE(ABORT, 'skill_operations is append-only');
|
|
1266
|
+
END;
|
|
1204
1267
|
`)}}];function m(a){!function(a,b){a.exec(`
|
|
1205
1268
|
CREATE TABLE IF NOT EXISTS schema_version (
|
|
1206
1269
|
version INTEGER PRIMARY KEY,
|
|
1207
1270
|
name TEXT NOT NULL,
|
|
1208
1271
|
applied_at INTEGER NOT NULL
|
|
1209
1272
|
);
|
|
1210
|
-
`);let c=f(a);if(console.log(`Current schema version: ${c}`),c>
|
|
1273
|
+
`);let c=f(a);if(console.log(`Current schema version: ${c}`),c>48)throw Error(`This database (schema v${c}) was created by a newer version of CommandMate (this build supports up to v48). Please update: commandmate update`);let d=b.filter(a=>a.version>c);if(0===d.length)return console.log("Schema is up to date");for(let b of(console.log(`Found ${d.length} pending migration(s)`),d)){console.log(`Applying migration ${b.version}: ${b.name}...`);try{a.transaction(()=>{b.up(a),a.prepare(`
|
|
1211
1274
|
INSERT INTO schema_version (version, name, applied_at)
|
|
1212
1275
|
VALUES (?, ?, ?)
|
|
1213
|
-
`).run(b.version,b.name,Date.now())})(),console.log(`Migration ${b.version} applied successfully`)}catch(c){let a=c instanceof Error?c.message:String(c);throw console.error(`Migration ${b.version} failed:`,a),Error(`Migration ${b.version} (${b.name}) failed: ${a}`)}}console.log(`All migrations completed. Current version: ${f(a)}`)}(a,l)}},87374:(a,b,c)=>{c.d(b,{Dr:()=>i,HR:()=>h,Ky:()=>f,XS:()=>e,ms:()=>g,u8:()=>d}),Array.from({length:Math.floor(104)+1},(a,b)=>3e5+3e5*b);let d=5,e=50,f=100,g=1e4,h={PENDING:"pending",SENDING:"sending",SENT:"sent",FAILED:"failed",CANCELLED:"cancelled",NO_SESSION:"no_session"};function i(a){return"number"==typeof a&&a>=3e5&&a<=315e5&&a%3e5==0}},88807:(a,b,c)=>{c.r(b),c.d(b,{closeDbInstance:()=>p,getDbInstance:()=>o});var d=c(33873),e=c.n(d),f=c(
|
|
1276
|
+
`).run(b.version,b.name,Date.now())})(),console.log(`Migration ${b.version} applied successfully`)}catch(c){let a=c instanceof Error?c.message:String(c);throw console.error(`Migration ${b.version} failed:`,a),Error(`Migration ${b.version} (${b.name}) failed: ${a}`)}}console.log(`All migrations completed. Current version: ${f(a)}`)}(a,l)}},87374:(a,b,c)=>{c.d(b,{Dr:()=>i,HR:()=>h,Ky:()=>f,XS:()=>e,ms:()=>g,u8:()=>d}),Array.from({length:Math.floor(104)+1},(a,b)=>3e5+3e5*b);let d=5,e=50,f=100,g=1e4,h={PENDING:"pending",SENDING:"sending",SENT:"sent",FAILED:"failed",CANCELLED:"cancelled",NO_SESSION:"no_session"};function i(a){return"number"==typeof a&&a>=3e5&&a<=315e5&&a%3e5==0}},88807:(a,b,c)=>{c.r(b),c.d(b,{closeDbInstance:()=>p,getDbInstance:()=>o});var d=c(33873),e=c.n(d),f=c(71634),g=c(79646),h=c(87550),i=c.n(h);let j=!1;function k(a){return a instanceof Error&&"ERR_DLOPEN_FAILED"===a.code&&a.message.includes("NODE_MODULE_VERSION")}function l(a,b){let c=["better-sqlite3 could not be loaded: it was built for a different Node.js version.","This usually happens after switching Node.js versions (nvm, fnm, Homebrew, ...).","",`Automatic recovery failed: ${a}`,"","How to fix it manually:"];return b?c.push(" The install directory is not writable by the current user, so the addon"," cannot be rebuilt in place. Do not re-run this with sudo — root-owned"," files there will break future installs and updates.",""," Either switch back to the Node.js version CommandMate was installed with:",` node -v (currently ${process.version}, NODE_MODULE_VERSION ${process.versions.modules})`,""," Or reinstall CommandMate under a Node.js version manager, which keeps"," global packages in a user-owned directory:"," nvm use <version> && npm install -g commandmate"):c.push(` 1. cd ${process.cwd()}`," 2. npm rebuild better-sqlite3"," 3. Start CommandMate again",""," If that fails, reinstalling picks up the current Node.js version:"," npm install -g commandmate"),c.join("\n")}var m=c(87447);let n=null;function o(){if(!n){let a=(0,m._$)().CM_DB_PATH,b=c(29021),d=e().dirname(a);b.existsSync(d)||b.mkdirSync(d,{recursive:!0,mode:448});let h=function(a){try{return new(i())(a)}catch(c){if(!k(c))throw c;if(j)throw Error(l("a rebuild was already attempted in this process.",!1));j=!0,console.error("[commandmate] better-sqlite3 was built for a different Node.js version.\n[commandmate] Rebuilding it automatically — this can take a few minutes...");let b=function(){let a=(0,g.spawnSync)("npm",["rebuild","better-sqlite3"],{cwd:process.cwd(),encoding:"utf-8",timeout:3e5,env:{...process.env,PATH:`${e().dirname(process.execPath)}${e().delimiter}${process.env.PATH??""}`}}),b=`${a.stdout??""}${a.stderr??""}`;return a.error||0!==a.status?{success:!1,permissionDenied:/EACCES|permission denied/i.test(b),output:b}:{success:!0,permissionDenied:!1,output:b}}();if(!b.success)throw Error(l("npm rebuild better-sqlite3 failed.",b.permissionDenied));console.error("[commandmate] Rebuild succeeded. Continuing startup.");try{return new(i())(a)}catch(a){if(k(a))throw Error(l("the addon still reports a version mismatch after rebuilding.",!1));throw a}}}(a);h.pragma("foreign_keys = ON"),h.pragma("journal_mode = WAL"),h.pragma("busy_timeout = 5000");try{(0,f.vI)(h)}catch(a){throw h.close(),a}n=h}return n}function p(){n&&(n.close(),n=null)}}};
|