viba-cli 0.39.0 → 0.41.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/build-manifest.json +2 -2
- package/.next/fallback-build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error/page.js +1 -1
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error.html +2 -2
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +2 -2
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/component-source/resolve/route.js +1 -1
- package/.next/server/app/api/component-source/resolve/route.js.nft.json +1 -1
- package/.next/server/app/api/credentials/github/repos/route.js +1 -1
- package/.next/server/app/api/credentials/github/repos/route.js.nft.json +1 -1
- package/.next/server/app/api/credentials/route.js +1 -1
- package/.next/server/app/api/credentials/route.js.nft.json +1 -1
- package/.next/server/app/api/custom-scripts/route.js +2 -2
- package/.next/server/app/api/custom-scripts/route.js.nft.json +1 -1
- package/.next/server/app/api/git/action/route.js +3 -3
- package/.next/server/app/api/git/action/route.js.nft.json +1 -1
- package/.next/server/app/api/git/branches/route.js +3 -3
- package/.next/server/app/api/git/branches/route.js.nft.json +1 -1
- package/.next/server/app/api/git/diff/route.js +2 -2
- package/.next/server/app/api/git/diff/route.js.nft.json +1 -1
- package/.next/server/app/api/git/log/route.js +2 -2
- package/.next/server/app/api/git/log/route.js.nft.json +1 -1
- package/.next/server/app/api/git/status/route.js +3 -3
- package/.next/server/app/api/git/status/route.js.nft.json +1 -1
- package/.next/server/app/api/preview-proxy/start/route.js +1 -1
- package/.next/server/app/api/preview-proxy/start/route.js.nft.json +1 -1
- package/.next/server/app/api/repos/clone/route.js +2 -2
- package/.next/server/app/api/repos/clone/route.js.nft.json +1 -1
- package/.next/server/app/api/repos/route.js +2 -2
- package/.next/server/app/api/repos/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/route.js +1 -1
- package/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/server/app/credentials/page/server-reference-manifest.json +7 -7
- package/.next/server/app/credentials/page.js +1 -1
- package/.next/server/app/credentials/page.js.nft.json +1 -1
- package/.next/server/app/credentials/page_client-reference-manifest.js +1 -1
- package/.next/server/app/credentials.html +2 -2
- package/.next/server/app/credentials.rsc +4 -4
- package/.next/server/app/credentials.segments/_full.segment.rsc +4 -4
- package/.next/server/app/credentials.segments/_head.segment.rsc +1 -1
- package/.next/server/app/credentials.segments/_index.segment.rsc +2 -2
- package/.next/server/app/credentials.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/credentials.segments/credentials/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/credentials.segments/credentials.segment.rsc +1 -1
- package/.next/server/app/git/changes/page.js +1 -1
- package/.next/server/app/git/changes/page.js.nft.json +1 -1
- package/.next/server/app/git/changes/page_client-reference-manifest.js +1 -1
- package/.next/server/app/git/changes.html +2 -2
- package/.next/server/app/git/changes.rsc +4 -4
- package/.next/server/app/git/changes.segments/_full.segment.rsc +4 -4
- package/.next/server/app/git/changes.segments/_head.segment.rsc +1 -1
- package/.next/server/app/git/changes.segments/_index.segment.rsc +2 -2
- package/.next/server/app/git/changes.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/git/changes.segments/git/changes/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/git/changes.segments/git/changes.segment.rsc +1 -1
- package/.next/server/app/git/changes.segments/git.segment.rsc +1 -1
- package/.next/server/app/git/custom-scripts/page.js +1 -1
- package/.next/server/app/git/custom-scripts/page.js.nft.json +1 -1
- package/.next/server/app/git/custom-scripts/page_client-reference-manifest.js +1 -1
- package/.next/server/app/git/custom-scripts.html +2 -2
- package/.next/server/app/git/custom-scripts.rsc +2 -2
- package/.next/server/app/git/custom-scripts.segments/_full.segment.rsc +2 -2
- package/.next/server/app/git/custom-scripts.segments/_head.segment.rsc +1 -1
- package/.next/server/app/git/custom-scripts.segments/_index.segment.rsc +2 -2
- package/.next/server/app/git/custom-scripts.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/git/custom-scripts.segments/git/custom-scripts/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/git/custom-scripts.segments/git/custom-scripts.segment.rsc +1 -1
- package/.next/server/app/git/custom-scripts.segments/git.segment.rsc +1 -1
- package/.next/server/app/git/history/page/server-reference-manifest.json +17 -1
- package/.next/server/app/git/history/page.js +3 -2
- package/.next/server/app/git/history/page.js.nft.json +1 -1
- package/.next/server/app/git/history/page_client-reference-manifest.js +1 -1
- package/.next/server/app/git/history.html +2 -2
- package/.next/server/app/git/history.rsc +4 -4
- package/.next/server/app/git/history.segments/_full.segment.rsc +4 -4
- package/.next/server/app/git/history.segments/_head.segment.rsc +1 -1
- package/.next/server/app/git/history.segments/_index.segment.rsc +2 -2
- package/.next/server/app/git/history.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/git/history.segments/git/history/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/git/history.segments/git/history.segment.rsc +1 -1
- package/.next/server/app/git/history.segments/git.segment.rsc +1 -1
- package/.next/server/app/git/page/server-reference-manifest.json +17 -1
- package/.next/server/app/git/page.js +3 -2
- package/.next/server/app/git/page.js.nft.json +1 -1
- package/.next/server/app/git/page_client-reference-manifest.js +1 -1
- package/.next/server/app/git/stashes/page.js +1 -1
- package/.next/server/app/git/stashes/page.js.nft.json +1 -1
- package/.next/server/app/git/stashes/page_client-reference-manifest.js +1 -1
- package/.next/server/app/git/stashes.html +2 -2
- package/.next/server/app/git/stashes.rsc +2 -2
- package/.next/server/app/git/stashes.segments/_full.segment.rsc +2 -2
- package/.next/server/app/git/stashes.segments/_head.segment.rsc +1 -1
- package/.next/server/app/git/stashes.segments/_index.segment.rsc +2 -2
- package/.next/server/app/git/stashes.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/git/stashes.segments/git/stashes/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/git/stashes.segments/git/stashes.segment.rsc +1 -1
- package/.next/server/app/git/stashes.segments/git.segment.rsc +1 -1
- package/.next/server/app/git.html +2 -2
- package/.next/server/app/git.rsc +4 -4
- package/.next/server/app/git.segments/_full.segment.rsc +4 -4
- package/.next/server/app/git.segments/_head.segment.rsc +1 -1
- package/.next/server/app/git.segments/_index.segment.rsc +2 -2
- package/.next/server/app/git.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/git.segments/git/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/git.segments/git.segment.rsc +1 -1
- package/.next/server/app/index.html +2 -2
- package/.next/server/app/index.rsc +4 -4
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/new/page/server-reference-manifest.json +29 -29
- package/.next/server/app/new/page.js +4 -4
- package/.next/server/app/new/page.js.nft.json +1 -1
- package/.next/server/app/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page/server-reference-manifest.json +29 -29
- package/.next/server/app/page.js +3 -3
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/session/[sessionId]/page/server-reference-manifest.json +34 -19
- package/.next/server/app/session/[sessionId]/page.js +2 -2
- package/.next/server/app/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/server/app/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/[externals]__4610b07e._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__093d29e3._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__7f2f8f49._.js.map → [root-of-the-server]__093d29e3._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__2bdd2171._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__8de57231._.js.map → [root-of-the-server]__2bdd2171._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__2ea0148f._.js +7 -0
- package/.next/server/chunks/{[root-of-the-server]__b17e6c62._.js.map → [root-of-the-server]__2ea0148f._.js.map} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__ceda8fbc._.js → [root-of-the-server]__34da758c._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__52f9b7e2._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__2dcb1454._.js.map → [root-of-the-server]__52f9b7e2._.js.map} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__9af2c9bf._.js → [root-of-the-server]__5ebd9b2a._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__3ffc9919._.js → [root-of-the-server]__6a2576a8._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__7147e7f8._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__7324fe0b._.js.map → [root-of-the-server]__7147e7f8._.js.map} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1bf60374._.js → [root-of-the-server]__93d494cc._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__952874bc._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__187f37c1._.js.map → [root-of-the-server]__952874bc._.js.map} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__05e6fb4c._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__2f5cb477._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__79a7a15d._.js.map → [root-of-the-server]__2f5cb477._.js.map} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__32cb19cb._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__05b3451a._.js.map → [root-of-the-server]__32cb19cb._.js.map} +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__5be652da._.js → [root-of-the-server]__35dc6469._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__46af1502._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__46af1502._.js.map +1 -1
- package/.next/server/chunks/ssr/{_476e86d1._.js → [root-of-the-server]__4928d640._.js} +3 -3
- package/.next/server/chunks/ssr/{_476e86d1._.js.map → [root-of-the-server]__4928d640._.js.map} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__6e6c1134._.js +4 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__6e6c1134._.js.map +1 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__e86a1b81._.js → [root-of-the-server]__79ab29ee._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__8d19726f._.js +4 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__8d19726f._.js.map +1 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__96a8b4aa._.js → [root-of-the-server]__905c5090._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__2798aa4d._.js → [root-of-the-server]__afccdb61._.js} +3 -3
- package/.next/server/chunks/ssr/{[root-of-the-server]__2798aa4d._.js.map → [root-of-the-server]__afccdb61._.js.map} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__d52659cf._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__d52659cf._.js.map +1 -0
- package/.next/server/chunks/ssr/_1232faca._.js +3 -0
- package/.next/server/chunks/ssr/_1232faca._.js.map +1 -0
- package/.next/server/chunks/ssr/_21376a5e._.js +3 -0
- package/.next/server/chunks/ssr/_21376a5e._.js.map +1 -0
- package/.next/server/chunks/ssr/_25f614f9._.js +3 -0
- package/.next/server/chunks/ssr/_25f614f9._.js.map +1 -0
- package/.next/server/chunks/ssr/{_5147763c._.js → _4e480580._.js} +2 -2
- package/.next/server/chunks/ssr/_4e480580._.js.map +1 -0
- package/.next/server/chunks/ssr/_707e5fab._.js +1 -1
- package/.next/server/chunks/ssr/_707e5fab._.js.map +1 -1
- package/.next/server/chunks/ssr/_7e1d1983._.js +3 -0
- package/.next/server/chunks/ssr/_7e1d1983._.js.map +1 -0
- package/.next/server/chunks/ssr/_9493de08._.js +1 -1
- package/.next/server/chunks/ssr/_9493de08._.js.map +1 -1
- package/.next/server/chunks/ssr/{_9a7bd3c8._.js → _979edf0c._.js} +2 -2
- package/.next/server/chunks/ssr/_979edf0c._.js.map +1 -0
- package/.next/server/chunks/ssr/_9db6d532._.js +3 -0
- package/.next/server/chunks/ssr/_9db6d532._.js.map +1 -0
- package/.next/server/chunks/ssr/{_439918bb._.js → _a30f8faf._.js} +2 -2
- package/.next/server/chunks/ssr/_a30f8faf._.js.map +1 -0
- package/.next/server/chunks/ssr/{node_modules_bf7b09f8._.js → node_modules_3aaf320c._.js} +2 -2
- package/.next/server/chunks/ssr/node_modules_3aaf320c._.js.map +1 -0
- package/.next/server/chunks/ssr/{node_modules_50fa454f._.js → node_modules_f0d9388d._.js} +2 -2
- package/.next/server/chunks/ssr/node_modules_f0d9388d._.js.map +1 -0
- package/.next/server/chunks/ssr/{node_modules_3e692bb2._.js → node_modules_fae6b458._.js} +2 -2
- package/.next/server/chunks/ssr/node_modules_fae6b458._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_35575f97._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_35575f97._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_b34e0340._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_b34e0340._.js.map +1 -0
- package/.next/server/chunks/ssr/src_app_credentials_page_tsx_63d8d34a._.js +1 -1
- package/.next/server/chunks/ssr/src_app_credentials_page_tsx_63d8d34a._.js.map +1 -1
- package/.next/server/chunks/ssr/src_app_git_changes_page_tsx_f6dc28dc._.js +1 -1
- package/.next/server/chunks/ssr/src_app_git_changes_page_tsx_f6dc28dc._.js.map +1 -1
- package/.next/server/chunks/ssr/src_app_session_[sessionId]_SessionPageClient_tsx_dab490d7._.js +1 -1
- package/.next/server/chunks/ssr/src_app_session_[sessionId]_SessionPageClient_tsx_dab490d7._.js.map +1 -1
- package/.next/server/chunks/ssr/src_components_GitRepoSelector_tsx_05c81afa._.js +3 -3
- package/.next/server/chunks/ssr/src_components_GitRepoSelector_tsx_05c81afa._.js.map +1 -1
- package/.next/server/chunks/ssr/src_components_git_history-view_tsx_fd62126a._.js +6 -6
- package/.next/server/chunks/ssr/src_components_git_history-view_tsx_fd62126a._.js.map +1 -1
- package/.next/server/pages/404.html +2 -2
- package/.next/server/pages/500.html +2 -2
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +77 -48
- package/.next/static/chunks/15bbad1a4cefc870.js +3 -0
- package/.next/static/chunks/1f428267926cd032.js +3 -0
- package/.next/static/chunks/{d09578ecf3b80b9d.js → 2ca45fcc772c4ea0.js} +2 -2
- package/.next/static/chunks/3df671a7fdd91e3e.js +1 -0
- package/.next/static/chunks/53f66f12a3d0dc7f.js +3 -0
- package/.next/static/chunks/6242d36c3f387ddb.js +1 -0
- package/.next/static/chunks/697655e0e9336655.js +1 -0
- package/.next/static/chunks/c08840e14b1e627c.css +1 -0
- package/.next/static/chunks/d6c7a0b35251160d.js +8 -0
- package/.next/static/chunks/dcba19c95b8bc155.js +1 -0
- package/.next/static/chunks/e45cecb04475a86a.js +9 -0
- package/.next/static/chunks/f31a3f4a435e3f86.js +3 -0
- package/README.md +4 -0
- package/bin/viba.mjs +124 -4
- package/package.json +1 -1
- package/.next/server/chunks/[externals]__7ece43c5._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__187f37c1._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__2dcb1454._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__7324fe0b._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__7f2f8f49._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__8de57231._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__afea2116._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__afea2116._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__b17e6c62._.js +0 -7
- package/.next/server/chunks/ssr/[root-of-the-server]__05b3451a._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__30652385._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__30652385._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__79a7a15d._.js +0 -3
- package/.next/server/chunks/ssr/_439918bb._.js.map +0 -1
- package/.next/server/chunks/ssr/_4a66db4a._.js +0 -3
- package/.next/server/chunks/ssr/_4a66db4a._.js.map +0 -1
- package/.next/server/chunks/ssr/_5147763c._.js.map +0 -1
- package/.next/server/chunks/ssr/_8d41d1fd._.js +0 -3
- package/.next/server/chunks/ssr/_8d41d1fd._.js.map +0 -1
- package/.next/server/chunks/ssr/_9a7bd3c8._.js.map +0 -1
- package/.next/server/chunks/ssr/_next-internal_server_app_git_history_page_actions_9e9b26bc.js +0 -3
- package/.next/server/chunks/ssr/_next-internal_server_app_git_history_page_actions_9e9b26bc.js.map +0 -1
- package/.next/server/chunks/ssr/_next-internal_server_app_git_page_actions_511f286b.js +0 -3
- package/.next/server/chunks/ssr/_next-internal_server_app_git_page_actions_511f286b.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_3e692bb2._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_50fa454f._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_8e38eac2._.js +0 -5
- package/.next/server/chunks/ssr/node_modules_8e38eac2._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_bf7b09f8._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_0ff44e32._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_next_dist_0ff44e32._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_f6fd30d1._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_next_dist_f6fd30d1._.js.map +0 -1
- package/.next/server/chunks/ssr/src_408d74ba._.js +0 -3
- package/.next/server/chunks/ssr/src_408d74ba._.js.map +0 -1
- package/.next/server/chunks/ssr/src_49325427._.js +0 -3
- package/.next/server/chunks/ssr/src_49325427._.js.map +0 -1
- package/.next/static/chunks/0ce2e7006253186a.js +0 -9
- package/.next/static/chunks/0f9834bd2f6f4c6e.js +0 -3
- package/.next/static/chunks/1958a10518af04a4.js +0 -1
- package/.next/static/chunks/3205a3bbc11c3146.css +0 -1
- package/.next/static/chunks/369aa92811a706db.js +0 -3
- package/.next/static/chunks/4aab1f3ea2ed1aef.js +0 -1
- package/.next/static/chunks/5e0dada5236f9065.js +0 -8
- package/.next/static/chunks/977137e155012c13.js +0 -1
- package/.next/static/chunks/b18cc1247b979318.js +0 -1
- package/.next/static/chunks/b926978a88c43bac.js +0 -3
- package/.next/static/chunks/f7914ab5db08b8dd.js +0 -3
- /package/.next/server/chunks/{[externals]__7ece43c5._.js.map → [externals]__4610b07e._.js.map} +0 -0
- /package/.next/server/chunks/{[root-of-the-server]__ceda8fbc._.js.map → [root-of-the-server]__34da758c._.js.map} +0 -0
- /package/.next/server/chunks/{[root-of-the-server]__9af2c9bf._.js.map → [root-of-the-server]__5ebd9b2a._.js.map} +0 -0
- /package/.next/server/chunks/{[root-of-the-server]__3ffc9919._.js.map → [root-of-the-server]__6a2576a8._.js.map} +0 -0
- /package/.next/server/chunks/{[root-of-the-server]__1bf60374._.js.map → [root-of-the-server]__93d494cc._.js.map} +0 -0
- /package/.next/server/chunks/ssr/{[root-of-the-server]__5be652da._.js.map → [root-of-the-server]__35dc6469._.js.map} +0 -0
- /package/.next/server/chunks/ssr/{[root-of-the-server]__e86a1b81._.js.map → [root-of-the-server]__79ab29ee._.js.map} +0 -0
- /package/.next/server/chunks/ssr/{[root-of-the-server]__96a8b4aa._.js.map → [root-of-the-server]__905c5090._.js.map} +0 -0
- /package/.next/static/{gMV0bFe8zKqVaStUpkI04 → f6hBCO8U8SWC5F77QTqGY}/_buildManifest.js +0 -0
- /package/.next/static/{gMV0bFe8zKqVaStUpkI04 → f6hBCO8U8SWC5F77QTqGY}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{gMV0bFe8zKqVaStUpkI04 → f6hBCO8U8SWC5F77QTqGY}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/api-utils.ts","../../../node_modules/ms/index.js","../../../node_modules/debug/src/common.js","../../../node_modules/has-flag/index.js","../../../node_modules/supports-color/index.js","../../../node_modules/debug/src/node.js","../../../node_modules/debug/src/browser.js","../../../node_modules/debug/src/index.js","../../../src/lib/store.ts","../../../src/lib/platform-utils.ts","../../../src/lib/credentials.ts","../../../node_modules/clsx/dist/clsx.mjs","../../../src/lib/utils.ts"],"sourcesContent":["import { NextResponse } from 'next/server';\nimport { z } from 'zod';\n\n/**\n * Handles errors in Git API routes.\n *\n * @param error The error object caught in the try-catch block.\n * @returns A NextResponse with the appropriate error message and status code.\n */\nexport function handleGitError(error: unknown) {\n console.error('Git API Error:', error);\n\n if (error instanceof z.ZodError) {\n return NextResponse.json({ error: error.issues }, { status: 400 });\n }\n\n const message = error instanceof Error ? error.message : String(error);\n\n if (message.includes('not a git repository')) {\n return NextResponse.json({ error: 'Not a git repository' }, { status: 400 });\n }\n\n return NextResponse.json({ error: message }, { status: 500 });\n}\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","'use strict';\n\nmodule.exports = (flag, argv = process.argv) => {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n};\n","'use strict';\nconst os = require('os');\nconst tty = require('tty');\nconst hasFlag = require('has-flag');\n\nconst {env} = process;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false') ||\n\thasFlag('color=never')) {\n\tforceColor = 0;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = 1;\n}\n\nif ('FORCE_COLOR' in env) {\n\tif (env.FORCE_COLOR === 'true') {\n\t\tforceColor = 1;\n\t} else if (env.FORCE_COLOR === 'false') {\n\t\tforceColor = 0;\n\t} else {\n\t\tforceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(haveStream, streamIsTTY) {\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream, stream && stream.isTTY);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: translateLevel(supportsColor(true, tty.isatty(1))),\n\tstderr: translateLevel(supportsColor(true, tty.isatty(2)))\n};\n","/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n","\nimport fs from 'fs';\nimport os from 'os';\nimport path from 'path';\nimport { Repository, AppSettings } from './types';\nimport { getAppDataDir } from './platform-utils';\n\n// Store the list of known repositories in a shared app data directory.\n// This allows all instances of the app to share the same repository list.\nconst DATA_DIR = getAppDataDir();\nconst DATA_FILE = path.join(DATA_DIR, 'repos.json');\n\n// Ensure data directory exists\nif (!fs.existsSync(DATA_DIR)) {\n fs.mkdirSync(DATA_DIR, { recursive: true });\n}\n\nexport function getRepositories(): Repository[] {\n if (!fs.existsSync(DATA_FILE)) {\n return [];\n }\n try {\n const data = fs.readFileSync(DATA_FILE, 'utf-8');\n return JSON.parse(data);\n } catch (error) {\n console.error('Failed to parse repos.json', error);\n return [];\n }\n}\n\nfunction normalizeDisplayName(displayName?: string | null): string | null | undefined {\n if (displayName === undefined) return undefined;\n if (displayName === null) return null;\n const normalized = displayName.trim();\n return normalized.length > 0 ? normalized : null;\n}\n\nexport function addRepository(repoPath: string, name?: string, displayName?: string | null): Repository {\n const repos = getRepositories();\n // Check if exists\n if (repos.find(r => r.path === repoPath)) {\n throw new Error('Repository already exists');\n }\n\n const normalizedDisplayName = normalizeDisplayName(displayName);\n const newRepo: Repository = {\n path: repoPath,\n name: name || path.basename(repoPath),\n ...(normalizedDisplayName ? { displayName: normalizedDisplayName } : {}),\n };\n\n repos.push(newRepo);\n fs.writeFileSync(DATA_FILE, JSON.stringify(repos, null, 2));\n return newRepo;\n}\n\nexport function updateRepository(repoPath: string, updates: Partial<Repository>): Repository {\n const repos = getRepositories();\n const repoIndex = repos.findIndex(r => r.path === repoPath);\n \n if (repoIndex === -1) {\n throw new Error('Repository not found');\n }\n\n const normalizedUpdates: Partial<Repository> = { ...updates };\n if ('displayName' in normalizedUpdates) {\n normalizedUpdates.displayName = normalizeDisplayName(normalizedUpdates.displayName);\n }\n\n const updatedRepo = { ...repos[repoIndex], ...normalizedUpdates };\n repos[repoIndex] = updatedRepo;\n \n fs.writeFileSync(DATA_FILE, JSON.stringify(repos, null, 2));\n return updatedRepo;\n}\n\nexport function removeRepository(repoPath: string, options?: { deleteLocalFolder?: boolean }): void {\n const { deleteLocalFolder = false } = options || {};\n\n if (deleteLocalFolder) {\n const resolvedRepoPath = path.resolve(repoPath);\n const rootPath = path.parse(resolvedRepoPath).root;\n if (resolvedRepoPath === rootPath) {\n throw new Error('Refusing to delete a filesystem root path');\n }\n fs.rmSync(resolvedRepoPath, { recursive: true, force: true });\n }\n\n let repos = getRepositories();\n repos = repos.filter(r => r.path !== repoPath);\n fs.writeFileSync(DATA_FILE, JSON.stringify(repos, null, 2));\n}\n\n// Settings management\nconst SETTINGS_FILE = path.join(DATA_DIR, 'settings.json');\n\nexport function getSettings(): AppSettings {\n const defaults: AppSettings = {\n defaultRootFolder: null, // null means use user's home directory\n sidebarCollapsed: false,\n };\n\n if (!fs.existsSync(SETTINGS_FILE)) {\n return defaults;\n }\n\n try {\n const data = fs.readFileSync(SETTINGS_FILE, 'utf-8');\n const saved = JSON.parse(data);\n return { ...defaults, ...saved };\n } catch (error) {\n console.error('Failed to parse settings.json', error);\n return defaults;\n }\n}\n\nexport function updateSettings(updates: Partial<AppSettings>): AppSettings {\n const current = getSettings();\n const updated = { ...current, ...updates };\n fs.writeFileSync(SETTINGS_FILE, JSON.stringify(updated, null, 2));\n return updated;\n}\n\nexport function getDefaultRootFolder(): string {\n const settings = getSettings();\n \n // If a default folder is set, check if it still exists\n if (settings.defaultRootFolder) {\n try {\n if (fs.existsSync(settings.defaultRootFolder) && fs.statSync(settings.defaultRootFolder).isDirectory()) {\n return settings.defaultRootFolder;\n }\n } catch {\n // Folder doesn't exist or can't be accessed, fall back to home\n }\n }\n \n // Fall back to user's home directory\n return os.homedir();\n}\n","import os from 'os';\nimport path from 'path';\n\n// Get cross-platform app data directory\nexport function getAppDataDir(): string {\n const platform = process.platform;\n const homeDir = os.homedir();\n\n if (platform === 'win32') {\n // Windows: %APPDATA%\\trident\n return path.join(process.env.APPDATA || path.join(homeDir, 'AppData', 'Roaming'), 'trident');\n } else if (platform === 'darwin') {\n // macOS: ~/Library/Application Support/trident\n return path.join(homeDir, 'Library', 'Application Support', 'trident');\n } else {\n // Linux/others: ~/.config/trident\n return path.join(process.env.XDG_CONFIG_HOME || path.join(homeDir, '.config'), 'trident');\n }\n}\n","import fs from 'fs/promises';\nimport os from 'os';\nimport path from 'path';\n\nconst SERVICE_NAME = 'viba-git-credentials';\nconst CREDENTIALS_FILE_NAME = 'credentials.json';\n\nexport type CredentialType = 'github' | 'gitlab';\n\nexport interface BaseCredential {\n id: string;\n type: CredentialType;\n username: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface GitHubCredential extends BaseCredential {\n type: 'github';\n}\n\nexport interface GitLabCredential extends BaseCredential {\n type: 'gitlab';\n serverUrl: string;\n}\n\nexport type Credential = GitHubCredential | GitLabCredential;\n\ntype CredentialMetadata = {\n id: string;\n type: CredentialType;\n username: string;\n serverUrl?: string;\n createdAt: string;\n updatedAt: string;\n keytarAccount?: string;\n};\n\ntype LegacyCredentialMetadata = {\n type: CredentialType;\n username: string;\n serverUrl?: string;\n createdAt: string;\n updatedAt: string;\n};\n\ntype KeytarModule = {\n getPassword(service: string, account: string): Promise<string | null>;\n setPassword(service: string, account: string, password: string): Promise<void>;\n deletePassword(service: string, account: string): Promise<boolean>;\n};\n\nlet keytarPromise: Promise<KeytarModule | null> | null = null;\nlet keytarUnavailableReason: string | null = null;\nlet didLogKeytarWarning = false;\n\nfunction keytarUnavailableMessage(): string {\n if (keytarUnavailableReason) {\n return `Secure credential storage is unavailable: ${keytarUnavailableReason}`;\n }\n return 'Secure credential storage is unavailable in this runtime.';\n}\n\nasync function loadKeytar(): Promise<KeytarModule | null> {\n if (!keytarPromise) {\n keytarPromise = import('keytar')\n .then((module) => (module.default ?? module) as KeytarModule)\n .catch((error: unknown) => {\n keytarUnavailableReason = error instanceof Error ? error.message : String(error);\n if (!didLogKeytarWarning) {\n didLogKeytarWarning = true;\n console.warn(`[credentials] ${keytarUnavailableMessage()}`);\n }\n return null;\n });\n }\n\n return keytarPromise;\n}\n\nasync function requireKeytar(): Promise<KeytarModule> {\n const keytar = await loadKeytar();\n if (!keytar) {\n throw new Error(keytarUnavailableMessage());\n }\n return keytar;\n}\n\nfunction generateId(): string {\n return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;\n}\n\nfunction normalizeGitLabServerUrl(serverUrl: string): string {\n return serverUrl.trim().replace(/\\/$/, '');\n}\n\nfunction getDefaultKeytarAccount(id: string): string {\n return `credential-${id}`;\n}\n\nfunction getLegacyKeytarAccount(type: CredentialType): string {\n return `credential-${type}`;\n}\n\nfunction getKeytarAccountForMetadata(metadata: CredentialMetadata): string {\n return metadata.keytarAccount || getDefaultKeytarAccount(metadata.id);\n}\n\nfunction toCredential(metadata: CredentialMetadata): Credential {\n if (metadata.type === 'gitlab') {\n return {\n id: metadata.id,\n type: 'gitlab',\n username: metadata.username,\n serverUrl: metadata.serverUrl || 'https://gitlab.com',\n createdAt: metadata.createdAt,\n updatedAt: metadata.updatedAt,\n };\n }\n\n return {\n id: metadata.id,\n type: 'github',\n username: metadata.username,\n createdAt: metadata.createdAt,\n updatedAt: metadata.updatedAt,\n };\n}\n\nasync function getCredentialsFilePath(): Promise<string> {\n const vibaDir = path.join(os.homedir(), '.viba');\n await fs.mkdir(vibaDir, { recursive: true });\n return path.join(vibaDir, CREDENTIALS_FILE_NAME);\n}\n\nfunction isLegacyCredentialMetadata(value: unknown, expectedType: CredentialType): value is LegacyCredentialMetadata {\n if (!value || typeof value !== 'object') return false;\n\n const candidate = value as Record<string, unknown>;\n if (candidate.type !== expectedType) return false;\n if (typeof candidate.username !== 'string') return false;\n if (typeof candidate.createdAt !== 'string') return false;\n if (typeof candidate.updatedAt !== 'string') return false;\n\n if (expectedType === 'gitlab') {\n return typeof candidate.serverUrl === 'string';\n }\n\n return true;\n}\n\nfunction isCredentialMetadata(value: unknown): value is CredentialMetadata {\n if (!value || typeof value !== 'object') return false;\n\n const candidate = value as Record<string, unknown>;\n if (typeof candidate.id !== 'string' || !candidate.id.trim()) return false;\n if (candidate.type !== 'github' && candidate.type !== 'gitlab') return false;\n if (typeof candidate.username !== 'string') return false;\n if (typeof candidate.createdAt !== 'string') return false;\n if (typeof candidate.updatedAt !== 'string') return false;\n if (candidate.keytarAccount !== undefined && typeof candidate.keytarAccount !== 'string') return false;\n\n if (candidate.type === 'gitlab') {\n return typeof candidate.serverUrl === 'string';\n }\n\n return true;\n}\n\nasync function writeCredentialsMetadata(metadata: CredentialMetadata[]): Promise<void> {\n const credentialsFilePath = await getCredentialsFilePath();\n await fs.writeFile(credentialsFilePath, JSON.stringify(metadata, null, 2), 'utf-8');\n}\n\nasync function readCredentialsMetadata(): Promise<CredentialMetadata[]> {\n const credentialsFilePath = await getCredentialsFilePath();\n\n try {\n const content = await fs.readFile(credentialsFilePath, 'utf-8');\n const parsed = JSON.parse(content) as unknown;\n\n if (Array.isArray(parsed)) {\n return parsed.filter(isCredentialMetadata);\n }\n\n if (!parsed || typeof parsed !== 'object') {\n return [];\n }\n\n const legacyMapped = parsed as Record<string, unknown>;\n const migrated: CredentialMetadata[] = [];\n\n if (isLegacyCredentialMetadata(legacyMapped.github, 'github')) {\n const metadata = legacyMapped.github;\n migrated.push({\n id: generateId(),\n type: 'github',\n username: metadata.username,\n createdAt: metadata.createdAt,\n updatedAt: metadata.updatedAt,\n keytarAccount: getLegacyKeytarAccount('github'),\n });\n }\n\n if (isLegacyCredentialMetadata(legacyMapped.gitlab, 'gitlab')) {\n const metadata = legacyMapped.gitlab;\n migrated.push({\n id: generateId(),\n type: 'gitlab',\n username: metadata.username,\n serverUrl: metadata.serverUrl,\n createdAt: metadata.createdAt,\n updatedAt: metadata.updatedAt,\n keytarAccount: getLegacyKeytarAccount('gitlab'),\n });\n }\n\n if (migrated.length > 0) {\n await writeCredentialsMetadata(migrated);\n }\n\n return migrated;\n } catch (error) {\n if ((error as NodeJS.ErrnoException)?.code === 'ENOENT') {\n return [];\n }\n\n console.error('Failed to parse credentials metadata:', error);\n return [];\n }\n}\n\nexport async function getAllCredentials(): Promise<Credential[]> {\n const metadata = await readCredentialsMetadata();\n\n return metadata\n .map(toCredential)\n .sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));\n}\n\nexport async function getCredentialById(id: string): Promise<Credential | null> {\n const metadata = await readCredentialsMetadata();\n const found = metadata.find((credential) => credential.id === id);\n return found ? toCredential(found) : null;\n}\n\nexport async function getCredentialToken(id: string): Promise<string | null> {\n const metadata = await readCredentialsMetadata();\n const found = metadata.find((credential) => credential.id === id);\n if (!found) {\n return null;\n }\n\n const keytar = await loadKeytar();\n if (!keytar) {\n return null;\n }\n\n return keytar.getPassword(SERVICE_NAME, getKeytarAccountForMetadata(found));\n}\n\nasync function verifyGitHubToken(token: string): Promise<{ valid: boolean; username?: string; error?: string }> {\n try {\n const response = await fetch('https://api.github.com/user', {\n headers: {\n Authorization: `Bearer ${token}`,\n Accept: 'application/vnd.github+json',\n 'X-GitHub-Api-Version': '2022-11-28',\n },\n });\n\n if (!response.ok) {\n if (response.status === 401) {\n return { valid: false, error: 'Invalid or expired GitHub token.' };\n }\n return { valid: false, error: `GitHub API returned ${response.status}.` };\n }\n\n const data = await response.json();\n const username = typeof data?.login === 'string' ? data.login : null;\n if (!username) {\n return { valid: false, error: 'GitHub API response did not include a username.' };\n }\n\n return { valid: true, username };\n } catch (error) {\n return { valid: false, error: `Failed to verify GitHub token: ${(error as Error).message}` };\n }\n}\n\nasync function verifyGitLabToken(serverUrl: string, token: string): Promise<{ valid: boolean; username?: string; error?: string }> {\n try {\n const normalizedUrl = normalizeGitLabServerUrl(serverUrl);\n const response = await fetch(`${normalizedUrl}/api/v4/user`, {\n headers: {\n 'PRIVATE-TOKEN': token,\n },\n });\n\n if (!response.ok) {\n if (response.status === 401) {\n return { valid: false, error: 'Invalid or expired GitLab token.' };\n }\n return { valid: false, error: `GitLab API returned ${response.status}.` };\n }\n\n const data = await response.json();\n const username = typeof data?.username === 'string' ? data.username : null;\n if (!username) {\n return { valid: false, error: 'GitLab API response did not include a username.' };\n }\n\n return { valid: true, username };\n } catch (error) {\n return { valid: false, error: `Failed to verify GitLab token: ${(error as Error).message}` };\n }\n}\n\nexport async function createGitHubCredential(token: string): Promise<{ success: boolean; credential?: GitHubCredential; error?: string }> {\n const trimmedToken = token.trim();\n if (!trimmedToken) {\n return { success: false, error: 'GitHub token is required.' };\n }\n\n let keytar: KeytarModule;\n try {\n keytar = await requireKeytar();\n } catch (error) {\n return { success: false, error: (error as Error).message };\n }\n\n const verification = await verifyGitHubToken(trimmedToken);\n if (!verification.valid || !verification.username) {\n return { success: false, error: verification.error || 'Failed to verify GitHub token.' };\n }\n\n const metadata = await readCredentialsMetadata();\n const duplicate = metadata.find((credential) => (\n credential.type === 'github'\n && credential.username === verification.username\n ));\n\n if (duplicate) {\n return { success: false, error: `A GitHub credential for ${verification.username} already exists.` };\n }\n\n const id = generateId();\n const now = new Date().toISOString();\n const keytarAccount = getDefaultKeytarAccount(id);\n\n await keytar.setPassword(SERVICE_NAME, keytarAccount, trimmedToken);\n\n const created: CredentialMetadata = {\n id,\n type: 'github',\n username: verification.username,\n createdAt: now,\n updatedAt: now,\n keytarAccount,\n };\n\n metadata.push(created);\n await writeCredentialsMetadata(metadata);\n\n return {\n success: true,\n credential: {\n id: created.id,\n type: 'github',\n username: created.username,\n createdAt: created.createdAt,\n updatedAt: created.updatedAt,\n },\n };\n}\n\nexport async function createGitLabCredential(\n serverUrl: string,\n token: string,\n): Promise<{ success: boolean; credential?: GitLabCredential; error?: string }> {\n const normalizedServerUrl = normalizeGitLabServerUrl(serverUrl);\n const trimmedToken = token.trim();\n\n if (!normalizedServerUrl) {\n return { success: false, error: 'GitLab server URL is required.' };\n }\n\n try {\n new URL(normalizedServerUrl);\n } catch {\n return { success: false, error: 'GitLab server URL must be a valid URL.' };\n }\n\n if (!trimmedToken) {\n return { success: false, error: 'GitLab token is required.' };\n }\n\n let keytar: KeytarModule;\n try {\n keytar = await requireKeytar();\n } catch (error) {\n return { success: false, error: (error as Error).message };\n }\n\n const verification = await verifyGitLabToken(normalizedServerUrl, trimmedToken);\n if (!verification.valid || !verification.username) {\n return { success: false, error: verification.error || 'Failed to verify GitLab token.' };\n }\n\n const metadata = await readCredentialsMetadata();\n const duplicate = metadata.find((credential) => (\n credential.type === 'gitlab'\n && credential.username === verification.username\n && credential.serverUrl === normalizedServerUrl\n ));\n\n if (duplicate) {\n return {\n success: false,\n error: `A GitLab credential for ${verification.username} on ${normalizedServerUrl} already exists.`,\n };\n }\n\n const id = generateId();\n const now = new Date().toISOString();\n const keytarAccount = getDefaultKeytarAccount(id);\n\n await keytar.setPassword(SERVICE_NAME, keytarAccount, trimmedToken);\n\n const created: CredentialMetadata = {\n id,\n type: 'gitlab',\n username: verification.username,\n serverUrl: normalizedServerUrl,\n createdAt: now,\n updatedAt: now,\n keytarAccount,\n };\n\n metadata.push(created);\n await writeCredentialsMetadata(metadata);\n\n return {\n success: true,\n credential: {\n id: created.id,\n type: 'gitlab',\n username: created.username,\n serverUrl: created.serverUrl || normalizedServerUrl,\n createdAt: created.createdAt,\n updatedAt: created.updatedAt,\n },\n };\n}\n\nexport async function deleteCredential(id: string): Promise<{ success: boolean; error?: string }> {\n const metadata = await readCredentialsMetadata();\n const index = metadata.findIndex((credential) => credential.id === id);\n\n if (index === -1) {\n return { success: false, error: 'Credential not found.' };\n }\n\n const credential = metadata[index];\n metadata.splice(index, 1);\n await writeCredentialsMetadata(metadata);\n\n const keytar = await loadKeytar();\n if (keytar) {\n await keytar.deletePassword(SERVICE_NAME, getKeytarAccountForMetadata(credential));\n }\n\n return { success: true };\n}\n\nexport async function updateCredential(id: string, token: string): Promise<{ success: boolean; credential?: Credential; error?: string }> {\n const trimmedToken = token.trim();\n if (!trimmedToken) {\n return { success: false, error: 'Token is required.' };\n }\n\n let keytar: KeytarModule;\n try {\n keytar = await requireKeytar();\n } catch (error) {\n return { success: false, error: (error as Error).message };\n }\n\n const metadata = await readCredentialsMetadata();\n const index = metadata.findIndex((c) => c.id === id);\n\n if (index === -1) {\n return { success: false, error: 'Credential not found' };\n }\n\n const existing = metadata[index];\n\n // Verify the new token\n let verification;\n if (existing.type === 'github') {\n verification = await verifyGitHubToken(trimmedToken);\n } else {\n verification = await verifyGitLabToken(existing.serverUrl || 'https://gitlab.com', trimmedToken);\n }\n\n if (!verification.valid || !verification.username) {\n return { success: false, error: verification.error || 'Failed to verify token' };\n }\n\n // Update token in keytar\n await keytar.setPassword(SERVICE_NAME, getKeytarAccountForMetadata(existing), trimmedToken);\n\n // Update metadata\n const now = new Date().toISOString();\n metadata[index] = {\n ...existing,\n username: verification.username,\n updatedAt: now,\n };\n await writeCredentialsMetadata(metadata);\n\n return {\n success: true,\n credential: toCredential(metadata[index]),\n };\n}\n\nexport async function findCredentialForRemote(remoteUrl: string): Promise<{ credential: Credential; token: string } | null> {\n const credentials = await getAllCredentials();\n\n // Check if it's a GitHub URL\n if (remoteUrl.includes('github.com')) {\n const githubCred = credentials.find((c) => c.type === 'github');\n if (githubCred) {\n const token = await getCredentialToken(githubCred.id);\n if (token) {\n return { credential: githubCred, token };\n }\n }\n }\n\n // Check GitLab servers\n for (const cred of credentials) {\n if (cred.type === 'gitlab') {\n // Extract host from remote URL\n let host: string;\n try {\n if (remoteUrl.startsWith('git@')) {\n // SSH URL: git@gitlab.com:user/repo.git\n host = remoteUrl.split('@')[1].split(':')[0];\n } else {\n // HTTP URL\n host = new URL(remoteUrl).host;\n }\n } catch {\n continue;\n }\n\n // Check if the credential's server URL matches\n const credHost = new URL(cred.serverUrl).host;\n if (host === credHost) {\n const token = await getCredentialToken(cred.id);\n if (token) {\n return { credential: cred, token };\n }\n }\n }\n }\n\n return null;\n}\n\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\nimport type { Repository } from './types';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n\nexport function getRepoFolderName(repoPath: string): string {\n const normalizedPath = repoPath.replace(/[\\\\/]+$/, '');\n const segments = normalizedPath.split(/[/\\\\]/).filter(Boolean);\n return segments[segments.length - 1] || repoPath;\n}\n\nexport function getRepositoryDisplayName(repo: Pick<Repository, 'path' | 'name' | 'displayName'>): string {\n const customName = repo.displayName?.trim();\n if (customName) {\n return customName;\n }\n\n if (repo.name?.trim()) {\n return repo.name;\n }\n\n return getRepoFolderName(repo.path);\n}\n\nfunction getNormalizedExtension(filePath: string): string {\n if (!filePath) return '';\n\n const fileName = filePath.split('/').pop() || '';\n const lastDotIndex = fileName.lastIndexOf('.');\n\n if (lastDotIndex === -1 || lastDotIndex === 0) {\n return fileName.toLowerCase();\n }\n\n return fileName.slice(lastDotIndex + 1).toLowerCase();\n}\n\n// Known text-based file extensions\nconst TEXT_EXTENSIONS = new Set([\n // Programming languages\n 'js', 'jsx', 'ts', 'tsx', 'mjs', 'cjs', 'mts', 'cts',\n 'py', 'pyw', 'pyi', 'pyx',\n 'rb', 'rake', 'gemspec',\n 'java', 'kt', 'kts', 'scala', 'sc', 'groovy', 'gradle',\n 'c', 'h', 'cpp', 'cc', 'cxx', 'hpp', 'hh', 'hxx', 'c++', 'h++',\n 'cs', 'fs', 'fsx', 'fsi',\n 'go', 'rs', 'swift', 'dart', 'zig', 'nim', 'v', 'odin',\n 'php', 'phtml', 'php3', 'php4', 'php5', 'php7', 'phps',\n 'pl', 'pm', 'pod', 't', 'psgi',\n 'lua', 'tcl', 'r', 'R', 'jl', 'ex', 'exs', 'erl', 'hrl',\n 'clj', 'cljs', 'cljc', 'edn', 'lisp', 'lsp', 'el', 'scm', 'ss', 'rkt',\n 'hs', 'lhs', 'elm', 'purs', 'ml', 'mli', 'f90', 'f95', 'f03', 'f08', 'for',\n 'asm', 's', 'S', 'vhd', 'vhdl', 'v', 'sv', 'svh',\n 'bas', 'vb', 'vbs', 'vba',\n 'pas', 'pp', 'inc', 'dpr', 'dpk',\n 'sh', 'bash', 'zsh', 'fish', 'ksh', 'csh', 'tcsh', 'ps1', 'psm1', 'psd1', 'bat', 'cmd',\n // Web\n 'html', 'htm', 'xhtml', 'shtml',\n 'css', 'scss', 'sass', 'less', 'styl', 'stylus', 'pcss', 'postcss',\n 'svg', 'xml', 'xsl', 'xslt', 'xsd', 'dtd', 'rss', 'atom', 'rdf', 'wsdl', 'soap',\n 'vue', 'svelte', 'astro', 'mdx',\n 'hbs', 'handlebars', 'mustache', 'ejs', 'pug', 'jade', 'haml', 'slim', 'erb',\n 'graphql', 'gql',\n // Data & Config\n 'json', 'json5', 'jsonc', 'jsonl', 'ndjson', 'geojson',\n 'yaml', 'yml',\n 'toml', 'ini', 'cfg', 'conf', 'config', 'properties', 'env',\n 'csv', 'tsv', 'psv',\n 'txt', 'text', 'log', 'out',\n 'md', 'markdown', 'mdown', 'mkd', 'mkdn', 'mdwn', 'rst', 'rest', 'adoc', 'asciidoc', 'asc',\n 'org', 'tex', 'latex', 'ltx', 'bib', 'sty', 'cls',\n 'rtf', 'diff', 'patch',\n // Version control & Build\n 'gitignore', 'gitattributes', 'gitmodules', 'gitconfig',\n 'dockerignore', 'dockerfile', 'containerfile',\n 'editorconfig', 'prettierrc', 'eslintrc', 'babelrc', 'stylelintrc', 'browserslistrc',\n 'npmrc', 'nvmrc', 'yarnrc', 'pnpmfile',\n 'makefile', 'mk', 'cmake', 'make', 'mak', 'rake', 'podfile', 'gemfile', 'fastfile',\n // Other\n 'sql', 'plsql', 'pgsql', 'mysql', 'sqlite', 'hql', 'cql',\n 'proto', 'protobuf', 'thrift', 'avro', 'capnp', 'fbs', 'flatc',\n 'tf', 'tfvars', 'hcl', 'nomad', 'sentinel',\n 'prisma', 'graphqls',\n 'lock', // package-lock.json, yarn.lock, etc.\n]);\n\n// Known binary file extensions\nconst BINARY_EXTENSIONS = new Set([\n // Images\n 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'ico', 'icns', 'tiff', 'tif', 'webp', 'avif', 'heic', 'heif',\n 'psd', 'ai', 'eps', 'raw', 'cr2', 'nef', 'orf', 'sr2', 'dng',\n // Video\n 'mp4', 'avi', 'mov', 'wmv', 'flv', 'mkv', 'webm', 'm4v', 'mpeg', 'mpg', '3gp', '3g2', 'ogv',\n // Audio\n 'mp3', 'wav', 'ogg', 'oga', 'flac', 'aac', 'm4a', 'wma', 'aiff', 'aif', 'mid', 'midi', 'opus',\n // Archives\n 'zip', 'rar', '7z', 'tar', 'gz', 'bz2', 'xz', 'lz', 'lzma', 'lz4', 'zst', 'cab', 'iso', 'dmg',\n // Executables & Libraries\n 'exe', 'dll', 'so', 'dylib', 'a', 'lib', 'obj', 'o',\n 'app', 'msi', 'deb', 'rpm', 'apk', 'ipa', 'pkg', 'snap', 'flatpak', 'appimage',\n 'class', 'jar', 'war', 'ear', 'pyc', 'pyo', 'pyd', 'beam',\n 'wasm', 'wat',\n // Documents\n 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'odt', 'ods', 'odp', 'pages', 'numbers', 'key',\n // Fonts\n 'ttf', 'otf', 'woff', 'woff2', 'eot', 'fon', 'fnt',\n // Database\n 'db', 'sqlite', 'sqlite3', 'mdb', 'accdb', 'frm', 'myd', 'myi', 'ibd',\n // Other binary formats\n 'bin', 'dat', 'data', 'sav', 'bak',\n 'swf', 'fla',\n 'blend', 'fbx', 'obj', 'stl', 'gltf', 'glb', '3ds', 'dae', 'ply',\n 'sketch', 'fig', 'xd',\n 'unity', 'unitypackage', 'asset', 'prefab', 'meta',\n]);\n\nconst IMAGE_EXTENSIONS = new Set([\n 'png', 'jpg', 'jpeg', 'gif', 'bmp', 'ico', 'icns', 'tiff', 'tif', 'webp', 'avif', 'heic', 'heif', 'svg',\n]);\n\n/**\n * Determines file type based on extension.\n * @returns 'text' | 'binary' | 'unknown'\n */\nexport function getFileTypeByExtension(filePath: string): 'text' | 'binary' | 'unknown' {\n if (!filePath) return 'unknown';\n\n const extension = getNormalizedExtension(filePath);\n \n if (TEXT_EXTENSIONS.has(extension)) {\n return 'text';\n }\n \n if (BINARY_EXTENSIONS.has(extension)) {\n return 'binary';\n }\n \n return 'unknown';\n}\n\n/**\n * Check if content appears to be binary (contains null bytes or high ratio of non-printable chars).\n * This is used as a fallback when extension-based detection is inconclusive.\n */\nexport function isBinaryContent(content: string): boolean {\n if (!content) return false;\n // Check for null bytes - strong indicator of binary content\n if (content.includes('\\0')) return true;\n // Check first 8KB for non-printable characters\n const sample = content.slice(0, 8192);\n let nonPrintable = 0;\n for (let i = 0; i < sample.length; i++) {\n const code = sample.charCodeAt(i);\n // Allow common whitespace (tab, newline, carriage return) and printable ASCII\n if (code < 32 && code !== 9 && code !== 10 && code !== 13) {\n nonPrintable++;\n }\n }\n // If more than 10% non-printable, likely binary\n return sample.length > 0 && (nonPrintable / sample.length) > 0.1;\n}\n\n/**\n * Determines if a file is binary, using extension-based detection first,\n * then falling back to content analysis if extension is unknown.\n */\nexport function isFileBinary(filePath: string, leftContent?: string, rightContent?: string): boolean {\n // First, try to determine from extension\n const fileType = getFileTypeByExtension(filePath);\n \n if (fileType === 'binary') {\n return true;\n }\n \n if (fileType === 'text') {\n return false;\n }\n \n // Extension is unknown - fall back to content analysis\n return isBinaryContent(leftContent || '') || isBinaryContent(rightContent || '');\n}\n\nexport function isImageFile(filePath: string): boolean {\n return IMAGE_EXTENSIONS.has(getNormalizedExtension(filePath));\n}\n\nexport function getImageMimeType(filePath: string): string {\n const extension = getNormalizedExtension(filePath);\n\n switch (extension) {\n case 'jpg':\n case 'jpeg':\n return 'image/jpeg';\n case 'png':\n return 'image/png';\n case 'gif':\n return 'image/gif';\n case 'bmp':\n return 'image/bmp';\n case 'ico':\n return 'image/x-icon';\n case 'icns':\n return 'image/icns';\n case 'tiff':\n case 'tif':\n return 'image/tiff';\n case 'webp':\n return 'image/webp';\n case 'avif':\n return 'image/avif';\n case 'heic':\n return 'image/heic';\n case 'heif':\n return 'image/heif';\n case 'svg':\n return 'image/svg+xml';\n default:\n return 'application/octet-stream';\n }\n}\n\n/**\n * Counts changed lines in a unified git patch.\n * Includes added/removed lines and skips file header markers.\n */\nexport function getChangedLineCountFromDiff(diff: string | null | undefined): number {\n if (!diff) return 0;\n\n return diff.split('\\n').reduce((count, line) => {\n if (line.startsWith('+++ ') || line.startsWith('--- ')) {\n return count;\n }\n\n if (line.startsWith('+') || line.startsWith('-')) {\n return count + 1;\n }\n\n return count;\n }, 0);\n}\n\n/**\n * Sanitizes a branch name by replacing illegal Git branch name characters with \"-\".\n * Git branch names cannot contain:\n * - Space, ~, ^, :, ?, *, [, \\, control characters\n * - Double dots (..)\n * - @{ sequence\n * - Leading/trailing dots or slashes\n * - Consecutive slashes\n */\nexport function sanitizeBranchName(name: string): string {\n const sanitized = name\n // Replace illegal characters with \"-\"\n .replace(/[\\s~^:?*\\[\\]\\\\@{}<>|\"'`!#$%&()+=;,]/g, '-')\n // Replace double dots with single dash\n .replace(/\\.{2,}/g, '-')\n // Replace consecutive slashes with single slash\n .replace(/\\/{2,}/g, '/')\n // Replace consecutive dashes with single dash\n .replace(/-{2,}/g, '-');\n \n return sanitized;\n}\n"],"names":[],"mappings":"krCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAQO,SAAS,EAAe,CAAc,EAG3C,GAFA,QAAQ,KAAK,CAAC,iBAAkB,GAE5B,aAAiB,EAAA,CAAC,CAAC,QAAQ,CAC7B,CAD+B,MACxB,EAAA,YAAY,CAAC,IAAI,CAA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K,OACH,MAAO,YACT,KAAK,OACH,MAAO,YACT,KAAK,OACH,MAAO,YACT,KAAK,OACH,MAAO,YACT,KAAK,MACH,MAAO,eACT,SACE,MAAO,0BACX,CACF","ignoreList":[1,2,3,4,5,6,7,11]}
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/api-utils.ts","../../../node_modules/ms/index.js","../../../node_modules/debug/src/common.js","../../../node_modules/has-flag/index.js","../../../node_modules/supports-color/index.js","../../../node_modules/debug/src/node.js","../../../node_modules/debug/src/browser.js","../../../node_modules/debug/src/index.js","../../../src/lib/store.ts","../../../src/lib/platform-utils.ts","../../../src/lib/credentials.ts","../../../node_modules/clsx/dist/clsx.mjs","../../../src/lib/utils.ts"],"sourcesContent":["import { NextResponse } from 'next/server';\nimport { z } from 'zod';\n\n/**\n * Handles errors in Git API routes.\n *\n * @param error The error object caught in the try-catch block.\n * @returns A NextResponse with the appropriate error message and status code.\n */\nexport function handleGitError(error: unknown) {\n console.error('Git API Error:', error);\n\n if (error instanceof z.ZodError) {\n return NextResponse.json({ error: error.issues }, { status: 400 });\n }\n\n const message = error instanceof Error ? error.message : String(error);\n\n if (message.includes('not a git repository')) {\n return NextResponse.json({ error: 'Not a git repository' }, { status: 400 });\n }\n\n return NextResponse.json({ error: message }, { status: 500 });\n}\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","'use strict';\n\nmodule.exports = (flag, argv = process.argv) => {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n};\n","'use strict';\nconst os = require('os');\nconst tty = require('tty');\nconst hasFlag = require('has-flag');\n\nconst {env} = process;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false') ||\n\thasFlag('color=never')) {\n\tforceColor = 0;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = 1;\n}\n\nif ('FORCE_COLOR' in env) {\n\tif (env.FORCE_COLOR === 'true') {\n\t\tforceColor = 1;\n\t} else if (env.FORCE_COLOR === 'false') {\n\t\tforceColor = 0;\n\t} else {\n\t\tforceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(haveStream, streamIsTTY) {\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream, stream && stream.isTTY);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: translateLevel(supportsColor(true, tty.isatty(1))),\n\tstderr: translateLevel(supportsColor(true, tty.isatty(2)))\n};\n","/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n","\nimport fs from 'fs';\nimport os from 'os';\nimport path from 'path';\nimport { Repository, AppSettings } from './types';\nimport { getAppDataDir } from './platform-utils';\n\n// Store the list of known repositories in a shared app data directory.\n// This allows all instances of the app to share the same repository list.\nconst DATA_DIR = getAppDataDir();\nconst DATA_FILE = path.join(DATA_DIR, 'repos.json');\n\n// Ensure data directory exists\nif (!fs.existsSync(DATA_DIR)) {\n fs.mkdirSync(DATA_DIR, { recursive: true });\n}\n\nexport function getRepositories(): Repository[] {\n if (!fs.existsSync(DATA_FILE)) {\n return [];\n }\n try {\n const data = fs.readFileSync(DATA_FILE, 'utf-8');\n return JSON.parse(data);\n } catch (error) {\n console.error('Failed to parse repos.json', error);\n return [];\n }\n}\n\nfunction normalizeDisplayName(displayName?: string | null): string | null | undefined {\n if (displayName === undefined) return undefined;\n if (displayName === null) return null;\n const normalized = displayName.trim();\n return normalized.length > 0 ? normalized : null;\n}\n\nexport function addRepository(repoPath: string, name?: string, displayName?: string | null): Repository {\n const repos = getRepositories();\n // Check if exists\n if (repos.find(r => r.path === repoPath)) {\n throw new Error('Repository already exists');\n }\n\n const normalizedDisplayName = normalizeDisplayName(displayName);\n const newRepo: Repository = {\n path: repoPath,\n name: name || path.basename(repoPath),\n ...(normalizedDisplayName ? { displayName: normalizedDisplayName } : {}),\n };\n\n repos.push(newRepo);\n fs.writeFileSync(DATA_FILE, JSON.stringify(repos, null, 2));\n return newRepo;\n}\n\nexport function updateRepository(repoPath: string, updates: Partial<Repository>): Repository {\n const repos = getRepositories();\n const repoIndex = repos.findIndex(r => r.path === repoPath);\n \n if (repoIndex === -1) {\n throw new Error('Repository not found');\n }\n\n const normalizedUpdates: Partial<Repository> = { ...updates };\n if ('displayName' in normalizedUpdates) {\n normalizedUpdates.displayName = normalizeDisplayName(normalizedUpdates.displayName);\n }\n\n const updatedRepo = { ...repos[repoIndex], ...normalizedUpdates };\n repos[repoIndex] = updatedRepo;\n \n fs.writeFileSync(DATA_FILE, JSON.stringify(repos, null, 2));\n return updatedRepo;\n}\n\nexport function removeRepository(repoPath: string, options?: { deleteLocalFolder?: boolean }): void {\n const { deleteLocalFolder = false } = options || {};\n\n if (deleteLocalFolder) {\n const resolvedRepoPath = path.resolve(repoPath);\n const rootPath = path.parse(resolvedRepoPath).root;\n if (resolvedRepoPath === rootPath) {\n throw new Error('Refusing to delete a filesystem root path');\n }\n fs.rmSync(resolvedRepoPath, { recursive: true, force: true });\n }\n\n let repos = getRepositories();\n repos = repos.filter(r => r.path !== repoPath);\n fs.writeFileSync(DATA_FILE, JSON.stringify(repos, null, 2));\n}\n\n// Settings management\nconst SETTINGS_FILE = path.join(DATA_DIR, 'settings.json');\n\nexport function getSettings(): AppSettings {\n const defaults: AppSettings = {\n defaultRootFolder: null, // null means use user's home directory\n sidebarCollapsed: false,\n };\n\n if (!fs.existsSync(SETTINGS_FILE)) {\n return defaults;\n }\n\n try {\n const data = fs.readFileSync(SETTINGS_FILE, 'utf-8');\n const saved = JSON.parse(data);\n return { ...defaults, ...saved };\n } catch (error) {\n console.error('Failed to parse settings.json', error);\n return defaults;\n }\n}\n\nexport function updateSettings(updates: Partial<AppSettings>): AppSettings {\n const current = getSettings();\n const updated = { ...current, ...updates };\n fs.writeFileSync(SETTINGS_FILE, JSON.stringify(updated, null, 2));\n return updated;\n}\n\nexport function getDefaultRootFolder(): string {\n const settings = getSettings();\n \n // If a default folder is set, check if it still exists\n if (settings.defaultRootFolder) {\n try {\n if (fs.existsSync(settings.defaultRootFolder) && fs.statSync(settings.defaultRootFolder).isDirectory()) {\n return settings.defaultRootFolder;\n }\n } catch {\n // Folder doesn't exist or can't be accessed, fall back to home\n }\n }\n \n // Fall back to user's home directory\n return os.homedir();\n}\n","import os from 'os';\nimport path from 'path';\n\n// Get cross-platform app data directory\nexport function getAppDataDir(): string {\n const platform = process.platform;\n const homeDir = os.homedir();\n\n if (platform === 'win32') {\n // Windows: %APPDATA%\\trident\n return path.join(process.env.APPDATA || path.join(homeDir, 'AppData', 'Roaming'), 'trident');\n } else if (platform === 'darwin') {\n // macOS: ~/Library/Application Support/trident\n return path.join(homeDir, 'Library', 'Application Support', 'trident');\n } else {\n // Linux/others: ~/.config/trident\n return path.join(process.env.XDG_CONFIG_HOME || path.join(homeDir, '.config'), 'trident');\n }\n}\n","import fs from 'fs/promises';\nimport os from 'os';\nimport path from 'path';\n\nconst SERVICE_NAME = 'viba-git-credentials';\nconst CREDENTIALS_FILE_NAME = 'credentials.json';\n\nexport type CredentialType = 'github' | 'gitlab';\n\nexport interface BaseCredential {\n id: string;\n type: CredentialType;\n username: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface GitHubCredential extends BaseCredential {\n type: 'github';\n}\n\nexport interface GitLabCredential extends BaseCredential {\n type: 'gitlab';\n serverUrl: string;\n}\n\nexport type Credential = GitHubCredential | GitLabCredential;\n\ntype CredentialMetadata = {\n id: string;\n type: CredentialType;\n username: string;\n serverUrl?: string;\n createdAt: string;\n updatedAt: string;\n keytarAccount?: string;\n};\n\ntype LegacyCredentialMetadata = {\n type: CredentialType;\n username: string;\n serverUrl?: string;\n createdAt: string;\n updatedAt: string;\n};\n\ntype KeytarModule = {\n getPassword(service: string, account: string): Promise<string | null>;\n setPassword(service: string, account: string, password: string): Promise<void>;\n deletePassword(service: string, account: string): Promise<boolean>;\n};\n\nlet keytarPromise: Promise<KeytarModule | null> | null = null;\nlet keytarUnavailableReason: string | null = null;\nlet didLogKeytarWarning = false;\n\nfunction keytarUnavailableMessage(): string {\n if (keytarUnavailableReason) {\n return `Secure credential storage is unavailable: ${keytarUnavailableReason}`;\n }\n return 'Secure credential storage is unavailable in this runtime.';\n}\n\nasync function loadKeytar(): Promise<KeytarModule | null> {\n if (!keytarPromise) {\n keytarPromise = import('keytar')\n .then((module) => (module.default ?? module) as KeytarModule)\n .catch((error: unknown) => {\n keytarUnavailableReason = error instanceof Error ? error.message : String(error);\n if (!didLogKeytarWarning) {\n didLogKeytarWarning = true;\n console.warn(`[credentials] ${keytarUnavailableMessage()}`);\n }\n return null;\n });\n }\n\n return keytarPromise;\n}\n\nasync function requireKeytar(): Promise<KeytarModule> {\n const keytar = await loadKeytar();\n if (!keytar) {\n throw new Error(keytarUnavailableMessage());\n }\n return keytar;\n}\n\nfunction generateId(): string {\n return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;\n}\n\nfunction normalizeGitLabServerUrl(serverUrl: string): string {\n return serverUrl.trim().replace(/\\/$/, '');\n}\n\nfunction getDefaultKeytarAccount(id: string): string {\n return `credential-${id}`;\n}\n\nfunction getLegacyKeytarAccount(type: CredentialType): string {\n return `credential-${type}`;\n}\n\nfunction getKeytarAccountForMetadata(metadata: CredentialMetadata): string {\n return metadata.keytarAccount || getDefaultKeytarAccount(metadata.id);\n}\n\nfunction toCredential(metadata: CredentialMetadata): Credential {\n if (metadata.type === 'gitlab') {\n return {\n id: metadata.id,\n type: 'gitlab',\n username: metadata.username,\n serverUrl: metadata.serverUrl || 'https://gitlab.com',\n createdAt: metadata.createdAt,\n updatedAt: metadata.updatedAt,\n };\n }\n\n return {\n id: metadata.id,\n type: 'github',\n username: metadata.username,\n createdAt: metadata.createdAt,\n updatedAt: metadata.updatedAt,\n };\n}\n\nasync function getCredentialsFilePath(): Promise<string> {\n const vibaDir = path.join(os.homedir(), '.viba');\n await fs.mkdir(vibaDir, { recursive: true });\n return path.join(vibaDir, CREDENTIALS_FILE_NAME);\n}\n\nfunction isLegacyCredentialMetadata(value: unknown, expectedType: CredentialType): value is LegacyCredentialMetadata {\n if (!value || typeof value !== 'object') return false;\n\n const candidate = value as Record<string, unknown>;\n if (candidate.type !== expectedType) return false;\n if (typeof candidate.username !== 'string') return false;\n if (typeof candidate.createdAt !== 'string') return false;\n if (typeof candidate.updatedAt !== 'string') return false;\n\n if (expectedType === 'gitlab') {\n return typeof candidate.serverUrl === 'string';\n }\n\n return true;\n}\n\nfunction isCredentialMetadata(value: unknown): value is CredentialMetadata {\n if (!value || typeof value !== 'object') return false;\n\n const candidate = value as Record<string, unknown>;\n if (typeof candidate.id !== 'string' || !candidate.id.trim()) return false;\n if (candidate.type !== 'github' && candidate.type !== 'gitlab') return false;\n if (typeof candidate.username !== 'string') return false;\n if (typeof candidate.createdAt !== 'string') return false;\n if (typeof candidate.updatedAt !== 'string') return false;\n if (candidate.keytarAccount !== undefined && typeof candidate.keytarAccount !== 'string') return false;\n\n if (candidate.type === 'gitlab') {\n return typeof candidate.serverUrl === 'string';\n }\n\n return true;\n}\n\nasync function writeCredentialsMetadata(metadata: CredentialMetadata[]): Promise<void> {\n const credentialsFilePath = await getCredentialsFilePath();\n await fs.writeFile(credentialsFilePath, JSON.stringify(metadata, null, 2), 'utf-8');\n}\n\nasync function readCredentialsMetadata(): Promise<CredentialMetadata[]> {\n const credentialsFilePath = await getCredentialsFilePath();\n\n try {\n const content = await fs.readFile(credentialsFilePath, 'utf-8');\n const parsed = JSON.parse(content) as unknown;\n\n if (Array.isArray(parsed)) {\n return parsed.filter(isCredentialMetadata);\n }\n\n if (!parsed || typeof parsed !== 'object') {\n return [];\n }\n\n const legacyMapped = parsed as Record<string, unknown>;\n const migrated: CredentialMetadata[] = [];\n\n if (isLegacyCredentialMetadata(legacyMapped.github, 'github')) {\n const metadata = legacyMapped.github;\n migrated.push({\n id: generateId(),\n type: 'github',\n username: metadata.username,\n createdAt: metadata.createdAt,\n updatedAt: metadata.updatedAt,\n keytarAccount: getLegacyKeytarAccount('github'),\n });\n }\n\n if (isLegacyCredentialMetadata(legacyMapped.gitlab, 'gitlab')) {\n const metadata = legacyMapped.gitlab;\n migrated.push({\n id: generateId(),\n type: 'gitlab',\n username: metadata.username,\n serverUrl: metadata.serverUrl,\n createdAt: metadata.createdAt,\n updatedAt: metadata.updatedAt,\n keytarAccount: getLegacyKeytarAccount('gitlab'),\n });\n }\n\n if (migrated.length > 0) {\n await writeCredentialsMetadata(migrated);\n }\n\n return migrated;\n } catch (error) {\n if ((error as NodeJS.ErrnoException)?.code === 'ENOENT') {\n return [];\n }\n\n console.error('Failed to parse credentials metadata:', error);\n return [];\n }\n}\n\nexport async function getAllCredentials(): Promise<Credential[]> {\n const metadata = await readCredentialsMetadata();\n\n return metadata\n .map(toCredential)\n .sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));\n}\n\nexport async function getCredentialById(id: string): Promise<Credential | null> {\n const metadata = await readCredentialsMetadata();\n const found = metadata.find((credential) => credential.id === id);\n return found ? toCredential(found) : null;\n}\n\nexport async function getCredentialToken(id: string): Promise<string | null> {\n const metadata = await readCredentialsMetadata();\n const found = metadata.find((credential) => credential.id === id);\n if (!found) {\n return null;\n }\n\n const keytar = await loadKeytar();\n if (!keytar) {\n return null;\n }\n\n return keytar.getPassword(SERVICE_NAME, getKeytarAccountForMetadata(found));\n}\n\nasync function verifyGitHubToken(token: string): Promise<{ valid: boolean; username?: string; error?: string }> {\n try {\n const response = await fetch('https://api.github.com/user', {\n headers: {\n Authorization: `Bearer ${token}`,\n Accept: 'application/vnd.github+json',\n 'X-GitHub-Api-Version': '2022-11-28',\n },\n });\n\n if (!response.ok) {\n if (response.status === 401) {\n return { valid: false, error: 'Invalid or expired GitHub token.' };\n }\n return { valid: false, error: `GitHub API returned ${response.status}.` };\n }\n\n const data = await response.json();\n const username = typeof data?.login === 'string' ? data.login : null;\n if (!username) {\n return { valid: false, error: 'GitHub API response did not include a username.' };\n }\n\n return { valid: true, username };\n } catch (error) {\n return { valid: false, error: `Failed to verify GitHub token: ${(error as Error).message}` };\n }\n}\n\nasync function verifyGitLabToken(serverUrl: string, token: string): Promise<{ valid: boolean; username?: string; error?: string }> {\n try {\n const normalizedUrl = normalizeGitLabServerUrl(serverUrl);\n const response = await fetch(`${normalizedUrl}/api/v4/user`, {\n headers: {\n 'PRIVATE-TOKEN': token,\n },\n });\n\n if (!response.ok) {\n if (response.status === 401) {\n return { valid: false, error: 'Invalid or expired GitLab token.' };\n }\n return { valid: false, error: `GitLab API returned ${response.status}.` };\n }\n\n const data = await response.json();\n const username = typeof data?.username === 'string' ? data.username : null;\n if (!username) {\n return { valid: false, error: 'GitLab API response did not include a username.' };\n }\n\n return { valid: true, username };\n } catch (error) {\n return { valid: false, error: `Failed to verify GitLab token: ${(error as Error).message}` };\n }\n}\n\nexport async function createGitHubCredential(token: string): Promise<{ success: boolean; credential?: GitHubCredential; error?: string }> {\n const trimmedToken = token.trim();\n if (!trimmedToken) {\n return { success: false, error: 'GitHub token is required.' };\n }\n\n let keytar: KeytarModule;\n try {\n keytar = await requireKeytar();\n } catch (error) {\n return { success: false, error: (error as Error).message };\n }\n\n const verification = await verifyGitHubToken(trimmedToken);\n if (!verification.valid || !verification.username) {\n return { success: false, error: verification.error || 'Failed to verify GitHub token.' };\n }\n\n const metadata = await readCredentialsMetadata();\n const duplicate = metadata.find((credential) => (\n credential.type === 'github'\n && credential.username === verification.username\n ));\n\n if (duplicate) {\n return { success: false, error: `A GitHub credential for ${verification.username} already exists.` };\n }\n\n const id = generateId();\n const now = new Date().toISOString();\n const keytarAccount = getDefaultKeytarAccount(id);\n\n await keytar.setPassword(SERVICE_NAME, keytarAccount, trimmedToken);\n\n const created: CredentialMetadata = {\n id,\n type: 'github',\n username: verification.username,\n createdAt: now,\n updatedAt: now,\n keytarAccount,\n };\n\n metadata.push(created);\n await writeCredentialsMetadata(metadata);\n\n return {\n success: true,\n credential: {\n id: created.id,\n type: 'github',\n username: created.username,\n createdAt: created.createdAt,\n updatedAt: created.updatedAt,\n },\n };\n}\n\nexport async function createGitLabCredential(\n serverUrl: string,\n token: string,\n): Promise<{ success: boolean; credential?: GitLabCredential; error?: string }> {\n const normalizedServerUrl = normalizeGitLabServerUrl(serverUrl);\n const trimmedToken = token.trim();\n\n if (!normalizedServerUrl) {\n return { success: false, error: 'GitLab server URL is required.' };\n }\n\n try {\n new URL(normalizedServerUrl);\n } catch {\n return { success: false, error: 'GitLab server URL must be a valid URL.' };\n }\n\n if (!trimmedToken) {\n return { success: false, error: 'GitLab token is required.' };\n }\n\n let keytar: KeytarModule;\n try {\n keytar = await requireKeytar();\n } catch (error) {\n return { success: false, error: (error as Error).message };\n }\n\n const verification = await verifyGitLabToken(normalizedServerUrl, trimmedToken);\n if (!verification.valid || !verification.username) {\n return { success: false, error: verification.error || 'Failed to verify GitLab token.' };\n }\n\n const metadata = await readCredentialsMetadata();\n const duplicate = metadata.find((credential) => (\n credential.type === 'gitlab'\n && credential.username === verification.username\n && credential.serverUrl === normalizedServerUrl\n ));\n\n if (duplicate) {\n return {\n success: false,\n error: `A GitLab credential for ${verification.username} on ${normalizedServerUrl} already exists.`,\n };\n }\n\n const id = generateId();\n const now = new Date().toISOString();\n const keytarAccount = getDefaultKeytarAccount(id);\n\n await keytar.setPassword(SERVICE_NAME, keytarAccount, trimmedToken);\n\n const created: CredentialMetadata = {\n id,\n type: 'gitlab',\n username: verification.username,\n serverUrl: normalizedServerUrl,\n createdAt: now,\n updatedAt: now,\n keytarAccount,\n };\n\n metadata.push(created);\n await writeCredentialsMetadata(metadata);\n\n return {\n success: true,\n credential: {\n id: created.id,\n type: 'gitlab',\n username: created.username,\n serverUrl: created.serverUrl || normalizedServerUrl,\n createdAt: created.createdAt,\n updatedAt: created.updatedAt,\n },\n };\n}\n\nexport async function deleteCredential(id: string): Promise<{ success: boolean; error?: string }> {\n const metadata = await readCredentialsMetadata();\n const index = metadata.findIndex((credential) => credential.id === id);\n\n if (index === -1) {\n return { success: false, error: 'Credential not found.' };\n }\n\n const credential = metadata[index];\n metadata.splice(index, 1);\n await writeCredentialsMetadata(metadata);\n\n const keytar = await loadKeytar();\n if (keytar) {\n await keytar.deletePassword(SERVICE_NAME, getKeytarAccountForMetadata(credential));\n }\n\n return { success: true };\n}\n\nexport async function updateCredential(id: string, token: string): Promise<{ success: boolean; credential?: Credential; error?: string }> {\n const trimmedToken = token.trim();\n if (!trimmedToken) {\n return { success: false, error: 'Token is required.' };\n }\n\n let keytar: KeytarModule;\n try {\n keytar = await requireKeytar();\n } catch (error) {\n return { success: false, error: (error as Error).message };\n }\n\n const metadata = await readCredentialsMetadata();\n const index = metadata.findIndex((c) => c.id === id);\n\n if (index === -1) {\n return { success: false, error: 'Credential not found' };\n }\n\n const existing = metadata[index];\n\n // Verify the new token\n let verification;\n if (existing.type === 'github') {\n verification = await verifyGitHubToken(trimmedToken);\n } else {\n verification = await verifyGitLabToken(existing.serverUrl || 'https://gitlab.com', trimmedToken);\n }\n\n if (!verification.valid || !verification.username) {\n return { success: false, error: verification.error || 'Failed to verify token' };\n }\n\n // Update token in keytar\n await keytar.setPassword(SERVICE_NAME, getKeytarAccountForMetadata(existing), trimmedToken);\n\n // Update metadata\n const now = new Date().toISOString();\n metadata[index] = {\n ...existing,\n username: verification.username,\n updatedAt: now,\n };\n await writeCredentialsMetadata(metadata);\n\n return {\n success: true,\n credential: toCredential(metadata[index]),\n };\n}\n\nexport async function findCredentialForRemote(remoteUrl: string): Promise<{ credential: Credential; token: string } | null> {\n const credentials = await getAllCredentials();\n\n // Check if it's a GitHub URL\n if (remoteUrl.includes('github.com')) {\n const githubCred = credentials.find((c) => c.type === 'github');\n if (githubCred) {\n const token = await getCredentialToken(githubCred.id);\n if (token) {\n return { credential: githubCred, token };\n }\n }\n }\n\n // Check GitLab servers\n for (const cred of credentials) {\n if (cred.type === 'gitlab') {\n // Extract host from remote URL\n let host: string;\n try {\n if (remoteUrl.startsWith('git@')) {\n // SSH URL: git@gitlab.com:user/repo.git\n host = remoteUrl.split('@')[1].split(':')[0];\n } else {\n // HTTP URL\n host = new URL(remoteUrl).host;\n }\n } catch {\n continue;\n }\n\n // Check if the credential's server URL matches\n const credHost = new URL(cred.serverUrl).host;\n if (host === credHost) {\n const token = await getCredentialToken(cred.id);\n if (token) {\n return { credential: cred, token };\n }\n }\n }\n }\n\n return null;\n}\n\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\nimport type { Repository } from './types';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n\nexport function getRepoFolderName(repoPath: string): string {\n const normalizedPath = repoPath.replace(/[\\\\/]+$/, '');\n const segments = normalizedPath.split(/[/\\\\]/).filter(Boolean);\n return segments[segments.length - 1] || repoPath;\n}\n\nexport function getRepositoryDisplayName(repo: Pick<Repository, 'path' | 'name' | 'displayName'>): string {\n const customName = repo.displayName?.trim();\n if (customName) {\n return customName;\n }\n\n if (repo.name?.trim()) {\n return repo.name;\n }\n\n return getRepoFolderName(repo.path);\n}\n\nfunction getNormalizedExtension(filePath: string): string {\n if (!filePath) return '';\n\n const fileName = filePath.split('/').pop() || '';\n const lastDotIndex = fileName.lastIndexOf('.');\n\n if (lastDotIndex === -1 || lastDotIndex === 0) {\n return fileName.toLowerCase();\n }\n\n return fileName.slice(lastDotIndex + 1).toLowerCase();\n}\n\n// Known text-based file extensions\nconst TEXT_EXTENSIONS = new Set([\n // Programming languages\n 'js', 'jsx', 'ts', 'tsx', 'mjs', 'cjs', 'mts', 'cts',\n 'py', 'pyw', 'pyi', 'pyx',\n 'rb', 'rake', 'gemspec',\n 'java', 'kt', 'kts', 'scala', 'sc', 'groovy', 'gradle',\n 'c', 'h', 'cpp', 'cc', 'cxx', 'hpp', 'hh', 'hxx', 'c++', 'h++',\n 'cs', 'fs', 'fsx', 'fsi',\n 'go', 'rs', 'swift', 'dart', 'zig', 'nim', 'v', 'odin',\n 'php', 'phtml', 'php3', 'php4', 'php5', 'php7', 'phps',\n 'pl', 'pm', 'pod', 't', 'psgi',\n 'lua', 'tcl', 'r', 'R', 'jl', 'ex', 'exs', 'erl', 'hrl',\n 'clj', 'cljs', 'cljc', 'edn', 'lisp', 'lsp', 'el', 'scm', 'ss', 'rkt',\n 'hs', 'lhs', 'elm', 'purs', 'ml', 'mli', 'f90', 'f95', 'f03', 'f08', 'for',\n 'asm', 's', 'S', 'vhd', 'vhdl', 'v', 'sv', 'svh',\n 'bas', 'vb', 'vbs', 'vba',\n 'pas', 'pp', 'inc', 'dpr', 'dpk',\n 'sh', 'bash', 'zsh', 'fish', 'ksh', 'csh', 'tcsh', 'ps1', 'psm1', 'psd1', 'bat', 'cmd',\n // Web\n 'html', 'htm', 'xhtml', 'shtml',\n 'css', 'scss', 'sass', 'less', 'styl', 'stylus', 'pcss', 'postcss',\n 'svg', 'xml', 'xsl', 'xslt', 'xsd', 'dtd', 'rss', 'atom', 'rdf', 'wsdl', 'soap',\n 'vue', 'svelte', 'astro', 'mdx',\n 'hbs', 'handlebars', 'mustache', 'ejs', 'pug', 'jade', 'haml', 'slim', 'erb',\n 'graphql', 'gql',\n // Data & Config\n 'json', 'json5', 'jsonc', 'jsonl', 'ndjson', 'geojson',\n 'yaml', 'yml',\n 'toml', 'ini', 'cfg', 'conf', 'config', 'properties', 'env',\n 'csv', 'tsv', 'psv',\n 'txt', 'text', 'log', 'out',\n 'md', 'markdown', 'mdown', 'mkd', 'mkdn', 'mdwn', 'rst', 'rest', 'adoc', 'asciidoc', 'asc',\n 'org', 'tex', 'latex', 'ltx', 'bib', 'sty', 'cls',\n 'rtf', 'diff', 'patch',\n // Version control & Build\n 'gitignore', 'gitattributes', 'gitmodules', 'gitconfig',\n 'dockerignore', 'dockerfile', 'containerfile',\n 'editorconfig', 'prettierrc', 'eslintrc', 'babelrc', 'stylelintrc', 'browserslistrc',\n 'npmrc', 'nvmrc', 'yarnrc', 'pnpmfile',\n 'makefile', 'mk', 'cmake', 'make', 'mak', 'rake', 'podfile', 'gemfile', 'fastfile',\n // Other\n 'sql', 'plsql', 'pgsql', 'mysql', 'sqlite', 'hql', 'cql',\n 'proto', 'protobuf', 'thrift', 'avro', 'capnp', 'fbs', 'flatc',\n 'tf', 'tfvars', 'hcl', 'nomad', 'sentinel',\n 'prisma', 'graphqls',\n 'lock', // package-lock.json, yarn.lock, etc.\n]);\n\n// Known binary file extensions\nconst BINARY_EXTENSIONS = new Set([\n // Images\n 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'ico', 'icns', 'tiff', 'tif', 'webp', 'avif', 'heic', 'heif',\n 'psd', 'ai', 'eps', 'raw', 'cr2', 'nef', 'orf', 'sr2', 'dng',\n // Video\n 'mp4', 'avi', 'mov', 'wmv', 'flv', 'mkv', 'webm', 'm4v', 'mpeg', 'mpg', '3gp', '3g2', 'ogv',\n // Audio\n 'mp3', 'wav', 'ogg', 'oga', 'flac', 'aac', 'm4a', 'wma', 'aiff', 'aif', 'mid', 'midi', 'opus',\n // Archives\n 'zip', 'rar', '7z', 'tar', 'gz', 'bz2', 'xz', 'lz', 'lzma', 'lz4', 'zst', 'cab', 'iso', 'dmg',\n // Executables & Libraries\n 'exe', 'dll', 'so', 'dylib', 'a', 'lib', 'obj', 'o',\n 'app', 'msi', 'deb', 'rpm', 'apk', 'ipa', 'pkg', 'snap', 'flatpak', 'appimage',\n 'class', 'jar', 'war', 'ear', 'pyc', 'pyo', 'pyd', 'beam',\n 'wasm', 'wat',\n // Documents\n 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'odt', 'ods', 'odp', 'pages', 'numbers', 'key',\n // Fonts\n 'ttf', 'otf', 'woff', 'woff2', 'eot', 'fon', 'fnt',\n // Database\n 'db', 'sqlite', 'sqlite3', 'mdb', 'accdb', 'frm', 'myd', 'myi', 'ibd',\n // Other binary formats\n 'bin', 'dat', 'data', 'sav', 'bak',\n 'swf', 'fla',\n 'blend', 'fbx', 'obj', 'stl', 'gltf', 'glb', '3ds', 'dae', 'ply',\n 'sketch', 'fig', 'xd',\n 'unity', 'unitypackage', 'asset', 'prefab', 'meta',\n]);\n\nconst IMAGE_EXTENSIONS = new Set([\n 'png', 'jpg', 'jpeg', 'gif', 'bmp', 'ico', 'icns', 'tiff', 'tif', 'webp', 'avif', 'heic', 'heif', 'svg',\n]);\n\n/**\n * Determines file type based on extension.\n * @returns 'text' | 'binary' | 'unknown'\n */\nexport function getFileTypeByExtension(filePath: string): 'text' | 'binary' | 'unknown' {\n if (!filePath) return 'unknown';\n\n const extension = getNormalizedExtension(filePath);\n \n if (TEXT_EXTENSIONS.has(extension)) {\n return 'text';\n }\n \n if (BINARY_EXTENSIONS.has(extension)) {\n return 'binary';\n }\n \n return 'unknown';\n}\n\n/**\n * Check if content appears to be binary (contains null bytes or high ratio of non-printable chars).\n * This is used as a fallback when extension-based detection is inconclusive.\n */\nexport function isBinaryContent(content: string): boolean {\n if (!content) return false;\n // Check for null bytes - strong indicator of binary content\n if (content.includes('\\0')) return true;\n // Check first 8KB for non-printable characters\n const sample = content.slice(0, 8192);\n let nonPrintable = 0;\n for (let i = 0; i < sample.length; i++) {\n const code = sample.charCodeAt(i);\n // Allow common whitespace (tab, newline, carriage return) and printable ASCII\n if (code < 32 && code !== 9 && code !== 10 && code !== 13) {\n nonPrintable++;\n }\n }\n // If more than 10% non-printable, likely binary\n return sample.length > 0 && (nonPrintable / sample.length) > 0.1;\n}\n\n/**\n * Determines if a file is binary, using extension-based detection first,\n * then falling back to content analysis if extension is unknown.\n */\nexport function isFileBinary(filePath: string, leftContent?: string, rightContent?: string): boolean {\n // First, try to determine from extension\n const fileType = getFileTypeByExtension(filePath);\n \n if (fileType === 'binary') {\n return true;\n }\n \n if (fileType === 'text') {\n return false;\n }\n \n // Extension is unknown - fall back to content analysis\n return isBinaryContent(leftContent || '') || isBinaryContent(rightContent || '');\n}\n\nexport function isImageFile(filePath: string): boolean {\n return IMAGE_EXTENSIONS.has(getNormalizedExtension(filePath));\n}\n\nexport function getImageMimeType(filePath: string): string {\n const extension = getNormalizedExtension(filePath);\n\n switch (extension) {\n case 'jpg':\n case 'jpeg':\n return 'image/jpeg';\n case 'png':\n return 'image/png';\n case 'gif':\n return 'image/gif';\n case 'bmp':\n return 'image/bmp';\n case 'ico':\n return 'image/x-icon';\n case 'icns':\n return 'image/icns';\n case 'tiff':\n case 'tif':\n return 'image/tiff';\n case 'webp':\n return 'image/webp';\n case 'avif':\n return 'image/avif';\n case 'heic':\n return 'image/heic';\n case 'heif':\n return 'image/heif';\n case 'svg':\n return 'image/svg+xml';\n default:\n return 'application/octet-stream';\n }\n}\n\n/**\n * Counts changed lines in a unified git patch.\n * Includes added/removed lines and skips file header markers.\n */\nexport function getChangedLineCountFromDiff(diff: string | null | undefined): number {\n if (!diff) return 0;\n\n return diff.split('\\n').reduce((count, line) => {\n if (line.startsWith('+++ ') || line.startsWith('--- ')) {\n return count;\n }\n\n if (line.startsWith('+') || line.startsWith('-')) {\n return count + 1;\n }\n\n return count;\n }, 0);\n}\n\n/**\n * Sanitizes a branch name by replacing illegal Git branch name characters with \"-\".\n * Git branch names cannot contain:\n * - Space, ~, ^, :, ?, *, [, \\, control characters\n * - Double dots (..)\n * - @{ sequence\n * - Leading/trailing dots or slashes\n * - Consecutive slashes\n */\nexport function sanitizeBranchName(name: string): string {\n const sanitized = name\n // Replace illegal characters with \"-\"\n .replace(/[\\s~^:?*\\[\\]\\\\@{}<>|\"'`!#$%&()+=;,]/g, '-')\n // Replace double dots with single dash\n .replace(/\\.{2,}/g, '-')\n // Replace consecutive slashes with single slash\n .replace(/\\/{2,}/g, '/')\n // Replace consecutive dashes with single dash\n .replace(/-{2,}/g, '-');\n \n return sanitized;\n}\n"],"names":[],"mappings":"krCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAQO,SAAS,EAAe,CAAc,EAG3C,GAFA,QAAQ,KAAK,CAAC,iBAAkB,GAE5B,aAAiB,EAAA,CAAC,CAAC,QAAQ,CAC7B,CAD+B,MACxB,EAAA,YAAY,CAAC,IAAI,CAAC,CAAE,MAAO,EAAM,MAAM,AAAC,EAAG,CAAE,OAAQ,GAAI,GAGlE,IAAM,EAAU,aAAiB,MAAQ,EAAM,OAAO,CAAG,OAAO,UAEhE,AAAI,EAAQ,QAAQ,CAAC,wBACZ,CADqC,CACrC,YAAY,CAAC,IAAI,CAAC,CAAE,MAAO,sBAAuB,EAAG,CAAE,OAAQ,GAAI,GAGrE,EAAA,YAAY,CAAC,IAAI,CAAC,CAAE,MAAO,CAAQ,EAAG,CAAE,OAAQ,GAAI,EAC7D,qqBCuIA,SAAS,EAAO,CAAE,CAAE,CAAK,CAAE,CAAC,CAAE,CAAI,EAEhC,OAAO,KAAK,KAAK,CAAC,EAAK,GAAK,IAAM,GADnB,AAC2B,GADlB,AAAI,CACa,KAAY,IAAM,EAAA,CAAE,AAC/D,CA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,OAAO,IACT,+PE/hBA,SAAS,EAAuB,CAAgB,EAC9C,GAAI,CAAC,EAAU,MAAO,GAEtB,IAAM,EAAW,EAAS,KAAK,CAAC,KAAK,GAAG,IAAM,GACxC,EAAe,EAAS,WAAW,CAAC,YAEtC,AAAiB,AAArB,CAAsB,OAAsB,GAAG,CAApB,EAClB,EAAS,WAAW,GAGtB,EAAS,KAAK,CAAC,EAAe,GAAG,WAAW,EACrD,CAiFA,IAAM,EAAmB,IAAI,IAAI,CAC/B,MAAO,MAAO,OAAQ,MAAO,MAAO,MAAO,OAAQ,OAAQ,MAAO,OAAQ,OAAQ,OAAQ,OAAQ,MACnG,EAgEM,SAAS,EAAY,CAAgB,EAC1C,OAAO,EAAiB,GAAG,CAAC,EAAuB,GACrD,CAEO,SAAS,EAAiB,CAAgB,EAG/C,OAFkB,AAEV,EAFiC,IAGvC,IAAK,MACL,IAAK,OACH,MAAO,YACT,KAAK,MACH,MAAO,WACT,KAAK,MACH,MAAO,WACT,KAAK,MACH,MAAO,WACT,KAAK,MACH,MAAO,cACT,KAAK,OACH,MAAO,YACT,KAAK,OACL,IAAK,MACH,MAAO,YACT,KAAK,OACH,MAAO,YACT,KAAK,OACH,MAAO,YACT,KAAK,OACH,MAAO,YACT,KAAK,OACH,MAAO,YACT,KAAK,MACH,MAAO,eACT,SACE,MAAO,0BACX,CACF","ignoreList":[1,2,3,4,5,6,7,11]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
module.exports=[46786,(a,b,c)=>{b.exports=a.x("os",()=>require("os"))},24868,(a,b,c)=>{b.exports=a.x("fs/promises",()=>require("fs/promises"))},37936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(11857)},70798,a=>{"use strict";var b=a.i(24868),c=a.i(46786),d=a.i(14747);let e="viba-git-credentials",f=null,g=null,h=!1;function i(){return g?`Secure credential storage is unavailable: ${g}`:"Secure credential storage is unavailable in this runtime."}async function j(){return f||(f=a.A(45581).then(a=>a.default??a).catch(a=>(g=a instanceof Error?a.message:String(a),h||(h=!0,console.warn(`[credentials] ${i()}`)),null))),f}async function k(){let a=await j();if(!a)throw Error(i());return a}function l(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function m(a){return a.trim().replace(/\/$/,"")}function n(a){return`credential-${a}`}function o(a){return`credential-${a}`}function p(a){return a.keytarAccount||n(a.id)}function q(a){return"gitlab"===a.type?{id:a.id,type:"gitlab",username:a.username,serverUrl:a.serverUrl||"https://gitlab.com",createdAt:a.createdAt,updatedAt:a.updatedAt}:{id:a.id,type:"github",username:a.username,createdAt:a.createdAt,updatedAt:a.updatedAt}}async function r(){let a=d.default.join(c.default.homedir(),".viba");return await b.default.mkdir(a,{recursive:!0}),d.default.join(a,"credentials.json")}function s(a,b){return!!a&&"object"==typeof a&&a.type===b&&"string"==typeof a.username&&"string"==typeof a.createdAt&&"string"==typeof a.updatedAt&&("gitlab"!==b||"string"==typeof a.serverUrl)}function t(a){return!!a&&"object"==typeof a&&"string"==typeof a.id&&!!a.id.trim()&&("github"===a.type||"gitlab"===a.type)&&"string"==typeof a.username&&"string"==typeof a.createdAt&&"string"==typeof a.updatedAt&&(void 0===a.keytarAccount||"string"==typeof a.keytarAccount)&&("gitlab"!==a.type||"string"==typeof a.serverUrl)}async function u(a){let c=await r();await b.default.writeFile(c,JSON.stringify(a,null,2),"utf-8")}async function v(){let a=await r();try{let c=await b.default.readFile(a,"utf-8"),d=JSON.parse(c);if(Array.isArray(d))return d.filter(t);if(!d||"object"!=typeof d)return[];let e=[];if(s(d.github,"github")){let a=d.github;e.push({id:l(),type:"github",username:a.username,createdAt:a.createdAt,updatedAt:a.updatedAt,keytarAccount:o("github")})}if(s(d.gitlab,"gitlab")){let a=d.gitlab;e.push({id:l(),type:"gitlab",username:a.username,serverUrl:a.serverUrl,createdAt:a.createdAt,updatedAt:a.updatedAt,keytarAccount:o("gitlab")})}return e.length>0&&await u(e),e}catch(a){if(a?.code==="ENOENT")return[];return console.error("Failed to parse credentials metadata:",a),[]}}async function w(){return(await v()).map(q).sort((a,b)=>b.updatedAt.localeCompare(a.updatedAt))}async function x(a){let b=(await v()).find(b=>b.id===a);return b?q(b):null}async function y(a){let b=(await v()).find(b=>b.id===a);if(!b)return null;let c=await j();return c?c.getPassword(e,p(b)):null}async function z(a){try{let b=await fetch("https://api.github.com/user",{headers:{Authorization:`Bearer ${a}`,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}});if(!b.ok){if(401===b.status)return{valid:!1,error:"Invalid or expired GitHub token."};return{valid:!1,error:`GitHub API returned ${b.status}.`}}let c=await b.json(),d="string"==typeof c?.login?c.login:null;if(!d)return{valid:!1,error:"GitHub API response did not include a username."};return{valid:!0,username:d}}catch(a){return{valid:!1,error:`Failed to verify GitHub token: ${a.message}`}}}async function A(a,b){try{let c=m(a),d=await fetch(`${c}/api/v4/user`,{headers:{"PRIVATE-TOKEN":b}});if(!d.ok){if(401===d.status)return{valid:!1,error:"Invalid or expired GitLab token."};return{valid:!1,error:`GitLab API returned ${d.status}.`}}let e=await d.json(),f="string"==typeof e?.username?e.username:null;if(!f)return{valid:!1,error:"GitLab API response did not include a username."};return{valid:!0,username:f}}catch(a){return{valid:!1,error:`Failed to verify GitLab token: ${a.message}`}}}async function B(a){let b,c=a.trim();if(!c)return{success:!1,error:"GitHub token is required."};try{b=await k()}catch(a){return{success:!1,error:a.message}}let d=await z(c);if(!d.valid||!d.username)return{success:!1,error:d.error||"Failed to verify GitHub token."};let f=await v();if(f.find(a=>"github"===a.type&&a.username===d.username))return{success:!1,error:`A GitHub credential for ${d.username} already exists.`};let g=l(),h=new Date().toISOString(),i=n(g);await b.setPassword(e,i,c);let j={id:g,type:"github",username:d.username,createdAt:h,updatedAt:h,keytarAccount:i};return f.push(j),await u(f),{success:!0,credential:{id:j.id,type:"github",username:j.username,createdAt:j.createdAt,updatedAt:j.updatedAt}}}async function C(a,b){let c,d=m(a),f=b.trim();if(!d)return{success:!1,error:"GitLab server URL is required."};try{new URL(d)}catch{return{success:!1,error:"GitLab server URL must be a valid URL."}}if(!f)return{success:!1,error:"GitLab token is required."};try{c=await k()}catch(a){return{success:!1,error:a.message}}let g=await A(d,f);if(!g.valid||!g.username)return{success:!1,error:g.error||"Failed to verify GitLab token."};let h=await v();if(h.find(a=>"gitlab"===a.type&&a.username===g.username&&a.serverUrl===d))return{success:!1,error:`A GitLab credential for ${g.username} on ${d} already exists.`};let i=l(),j=new Date().toISOString(),o=n(i);await c.setPassword(e,o,f);let p={id:i,type:"gitlab",username:g.username,serverUrl:d,createdAt:j,updatedAt:j,keytarAccount:o};return h.push(p),await u(h),{success:!0,credential:{id:p.id,type:"gitlab",username:p.username,serverUrl:p.serverUrl||d,createdAt:p.createdAt,updatedAt:p.updatedAt}}}async function D(a){let b=await v(),c=b.findIndex(b=>b.id===a);if(-1===c)return{success:!1,error:"Credential not found."};let d=b[c];b.splice(c,1),await u(b);let f=await j();return f&&await f.deletePassword(e,p(d)),{success:!0}}a.s(["createGitHubCredential",()=>B,"createGitLabCredential",()=>C,"deleteCredential",()=>D,"getAllCredentials",()=>w,"getCredentialById",()=>x,"getCredentialToken",()=>y])},66085,a=>{"use strict";var b=a.i(24868),c=a.i(46786),d=a.i(14747);let e="viba-agent-api-credentials",f=["codex"],g=null,h=null,i=!1;function j(a){return f.includes(a)}function k(){return h?`Secure credential storage is unavailable: ${h}`:"Secure credential storage is unavailable in this runtime."}async function l(){return g||(g=a.A(45581).then(a=>a.default??a).catch(a=>(h=a instanceof Error?a.message:String(a),i||(i=!0,console.warn(`[agent-api-credentials] ${k()}`)),null))),g}async function m(){let a=await l();if(!a)throw Error(k());return a}function n(a){return`agent-api-${a}`}function o(a){return a.keytarAccount||n(a.agent)}function p(a){return{agent:a.agent,apiProxy:a.apiProxy,createdAt:a.createdAt,updatedAt:a.updatedAt}}function q(a){return!!a&&"object"==typeof a&&"string"==typeof a.agent&&!!j(a.agent)&&"string"==typeof a.createdAt&&"string"==typeof a.updatedAt&&(void 0===a.apiProxy||"string"==typeof a.apiProxy)&&(void 0===a.keytarAccount||"string"==typeof a.keytarAccount)}async function r(){let a=d.default.join(c.default.homedir(),".viba");return await b.default.mkdir(a,{recursive:!0}),d.default.join(a,"agent-api-configs.json")}async function s(a){let c=await r();await b.default.writeFile(c,JSON.stringify(a,null,2),"utf-8")}async function t(){let a=await r();try{let c=await b.default.readFile(a,"utf-8"),d=JSON.parse(c);if(Array.isArray(d))return d.filter(q);if(!d||"object"!=typeof d)return[];let e=Object.entries(d).filter(([a])=>j(a)).map(([a,b])=>b&&"object"==typeof b?void 0===b.agent?{...b,agent:a}:b:null).filter(q);return e.length>0&&await s(e),e}catch(a){if(a?.code==="ENOENT")return[];return console.error("Failed to parse agent API credential metadata:",a),[]}}async function u(){return(await t()).map(p).sort((a,b)=>b.updatedAt.localeCompare(a.updatedAt))}async function v(a,b,c){let d,f;if(!j(a))return{success:!1,error:`Unsupported agent: ${a}`};let g=b.trim();if(!g)return{success:!1,error:"API key is required."};try{d=function(a){let b=a.trim();if(b){try{new URL(b)}catch{throw Error("API proxy must be a valid URL.")}return b}}(c)}catch(a){return{success:!1,error:a.message}}try{f=await m()}catch(a){return{success:!1,error:a.message}}let h=await t(),i=new Date().toISOString(),k=h.findIndex(b=>b.agent===a),l=k>=0?o(h[k]):n(a);if(await f.setPassword(e,l,g),k>=0){let a=h[k];h[k]={...a,apiProxy:d,updatedAt:i,keytarAccount:l}}else h.push({agent:a,apiProxy:d,createdAt:i,updatedAt:i,keytarAccount:l});await s(h);let q=h.find(b=>b.agent===a);return q?{success:!0,credential:p(q)}:{success:!1,error:"Failed to persist agent API credential."}}async function w(a){if(!j(a))return{success:!1,error:`Unsupported agent: ${a}`};let b=await t(),c=b.findIndex(b=>b.agent===a);if(-1===c)return{success:!1,error:"Agent API credential not found."};let[d]=b.splice(c,1);await s(b);let f=await l();return f&&await f.deletePassword(e,o(d)),{success:!0}}async function x(a){if(!j(a))return null;let b=(await t()).find(b=>b.agent===a);if(!b)return null;let c=await l();if(!c)return null;let d=await c.getPassword(e,o(b));return d?{agent:b.agent,apiKey:d,apiProxy:b.apiProxy}:null}a.s(["createOrUpdateAgentApiCredential",()=>v,"deleteAgentApiCredential",()=>w,"getAgentApiCredentialSecret",()=>x,"getAllAgentApiCredentials",()=>u])},13095,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
|
|
2
|
-
Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},37359,a=>{"use strict";var b=a.i(37936),c=a.i(70798),d=a.i(66085);async function e(){try{let a=await (0,c.getAllCredentials)();return{success:!0,credentials:a}}catch(a){return console.error("Failed to list credentials:",a),{success:!1,error:"Failed to load credentials."}}}async function f(a){let b=await (0,c.createGitHubCredential)(a);return b.success&&b.credential?{success:!0,credential:b.credential}:{success:!1,error:b.error||"Failed to save GitHub credential."}}async function g(a,b){let d=await (0,c.createGitLabCredential)(a,b);return d.success&&d.credential?{success:!0,credential:d.credential}:{success:!1,error:d.error||"Failed to save GitLab credential."}}async function h(){try{let a=await (0,d.getAllAgentApiCredentials)();return{success:!0,credentials:a}}catch(a){return console.error("Failed to list agent API credentials:",a),{success:!1,error:"Failed to load agent API credentials."}}}async function i(a,b,c){let e=await (0,d.createOrUpdateAgentApiCredential)(a,b,c);return e.success&&e.credential?{success:!0,credential:e.credential}:{success:!1,error:e.error||"Failed to save agent API credential."}}async function j(a){try{let b=await (0,c.deleteCredential)(a);if(!b.success)return{success:!1,error:b.error||"Failed to remove credential."};return{success:!0}}catch(a){return console.error("Failed to remove credential:",a),{success:!1,error:"Failed to remove credential."}}}async function k(a){try{let b=await (0,d.deleteAgentApiCredential)(a);if(!b.success)return{success:!1,error:b.error||"Failed to remove agent API credential."};return{success:!0}}catch(a){return console.error("Failed to remove agent API credential:",a),{success:!1,error:"Failed to remove agent API credential."}}}(0,a.i(13095).ensureServerEntryExports)([e,f,g,h,i,j,k]),(0,b.registerServerReference)(e,"
|
|
2
|
+
Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},37359,a=>{"use strict";var b=a.i(37936),c=a.i(70798),d=a.i(66085);async function e(){try{let a=await (0,c.getAllCredentials)();return{success:!0,credentials:a}}catch(a){return console.error("Failed to list credentials:",a),{success:!1,error:"Failed to load credentials."}}}async function f(a){let b=await (0,c.createGitHubCredential)(a);return b.success&&b.credential?{success:!0,credential:b.credential}:{success:!1,error:b.error||"Failed to save GitHub credential."}}async function g(a,b){let d=await (0,c.createGitLabCredential)(a,b);return d.success&&d.credential?{success:!0,credential:d.credential}:{success:!1,error:d.error||"Failed to save GitLab credential."}}async function h(){try{let a=await (0,d.getAllAgentApiCredentials)();return{success:!0,credentials:a}}catch(a){return console.error("Failed to list agent API credentials:",a),{success:!1,error:"Failed to load agent API credentials."}}}async function i(a,b,c){let e=await (0,d.createOrUpdateAgentApiCredential)(a,b,c);return e.success&&e.credential?{success:!0,credential:e.credential}:{success:!1,error:e.error||"Failed to save agent API credential."}}async function j(a){try{let b=await (0,c.deleteCredential)(a);if(!b.success)return{success:!1,error:b.error||"Failed to remove credential."};return{success:!0}}catch(a){return console.error("Failed to remove credential:",a),{success:!1,error:"Failed to remove credential."}}}async function k(a){try{let b=await (0,d.deleteAgentApiCredential)(a);if(!b.success)return{success:!1,error:b.error||"Failed to remove agent API credential."};return{success:!0}}catch(a){return console.error("Failed to remove agent API credential:",a),{success:!1,error:"Failed to remove agent API credential."}}}(0,a.i(13095).ensureServerEntryExports)([e,f,g,h,i,j,k]),(0,b.registerServerReference)(e,"002628302974b1d9d0c05eefc202ccbb2efcc2cbe0",null),(0,b.registerServerReference)(f,"400c4b96511a4d2c3511e7666d5ef557e65f4d7dee",null),(0,b.registerServerReference)(g,"6069a71e57100a15e5efc93b245c1b0a4e2c5e5df9",null),(0,b.registerServerReference)(h,"003561691afb672a539b4c94ff1a37b71e49c9afb7",null),(0,b.registerServerReference)(i,"705f45058d29a347e1fae0fe711c60a922bded3683",null),(0,b.registerServerReference)(j,"4058c5e187754f0abe1e61ffa924a1d03253df8797",null),(0,b.registerServerReference)(k,"4049bac91fd5c044e275d0eb097e55ba4b66b01242",null),a.s(["listAgentApiCredentials",()=>h,"listCredentials",()=>e,"removeAgentApiCredential",()=>k,"removeCredential",()=>j,"saveAgentApiCredential",()=>i,"saveGitHubCredential",()=>f,"saveGitLabCredential",()=>g])}];
|
|
3
3
|
|
|
4
4
|
//# sourceMappingURL=%5Broot-of-the-server%5D__05e6fb4c._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},46786,(a,b,c)=>{b.exports=a.x("os",()=>require("os"))},22734,(a,b,c)=>{b.exports=a.x("fs",()=>require("fs"))},33405,(a,b,c)=>{b.exports=a.x("child_process",()=>require("child_process"))},70722,(a,b,c)=>{b.exports=a.x("tty",()=>require("tty"))},51615,(a,b,c)=>{b.exports=a.x("node:buffer",()=>require("node:buffer"))},87769,(a,b,c)=>{b.exports=a.x("node:events",()=>require("node:events"))},98624,54569,a=>{"use strict";var b=a.i(37936),c=a.i(24868),d=a.i(46786),e=a.i(14747),f=a.i(4503),g=a.i(38642);let h=new Set([".git","node_modules",".next",".viba","dist","build","coverage"]);function i(){return global.repoResolutionCache||(global.repoResolutionCache=new Map),global.repoResolutionCache}function j(a,b){i().set(a.toLowerCase(),{repoPath:b,resolvedAt:Date.now()})}async function k(a){let b=i().get(a.toLowerCase());return b?Date.now()-b.resolvedAt>3e5?(i().delete(a.toLowerCase()),null):await l(b.repoPath)?b.repoPath:(i().delete(a.toLowerCase()),null):null}async function l(a){try{return await c.default.access(e.default.join(a,".git")),!0}catch{return!1}}async function m(a,b){let d=e.default.join(a,b);if(await l(d))return d;let f=[{dirPath:a,depth:0}],g=0,i=b.toLowerCase();for(let a=0;a<f.length;a+=1){let b,d=f[a];if((g+=1)>5e3)break;try{b=await c.default.readdir(d.dirPath,{withFileTypes:!0})}catch{continue}for(let a of b){if(!a.isDirectory()||function(a,b){let c=a.toLowerCase();return c!==b&&!!(h.has(c)||a.startsWith("."))}(a.name,i))continue;let b=e.default.join(d.dirPath,a.name);if(a.name.toLowerCase()===i&&await l(b))return b;d.depth+1<=5&&f.push({dirPath:b,depth:d.depth+1})}}return null}async function n(a){let b=a.trim();if(!b)return null;let c=await k(b);if(c)return c;let d=await (0,g.getConfig)();for(let a of d.recentRepos.filter(a=>e.default.basename(a).toLowerCase()===b.toLowerCase()))if(await l(a))return j(b,a),a;let f=[],h=new Set;for(let a of d.recentRepos){let b=e.default.dirname(a);h.has(b)||(h.add(b),f.push(b))}for(let a of(d.defaultRoot&&!h.has(d.defaultRoot)&&(h.add(d.defaultRoot),f.push(d.defaultRoot)),f)){let c=await m(a,b);if(c)return j(b,c),c}return null}var o=a.i(70798),p=a.i(46534),q=a.i(13095);async function r(a){try{let b=await n(a);return{success:!0,repoPath:b}}catch(a){return console.error("Failed to resolve repository by name:",a),{success:!1,repoPath:null,error:"Failed to search repositories. Please try again."}}}function s(a){if("gitlab"!==a.type)return null;try{return new URL(a.serverUrl).hostname.toLowerCase()}catch{return null}}async function t(a,b){let c=await (0,o.getAllCredentials)(),d=(0,p.detectGitRemoteProvider)(a,{gitlabHosts:c.flatMap(a=>{if("gitlab"!==a.type)return[];let b=s(a);return b?[b]:[]})}),e=(0,p.parseGitRemoteHost)(a);if(b){let a=await (0,o.getCredentialById)(b);if(!a)return{success:!1,error:"Selected credential was not found. Please choose another credential."};if("github"===d&&"github"!==a.type)return{success:!1,error:"Selected credential does not match this GitHub repository."};if("gitlab"===d&&"gitlab"!==a.type)return{success:!1,error:"Selected credential does not match this GitLab repository."};if("gitlab"===a.type&&e){let b=s(a);if(b&&b!==e)return{success:!1,error:`Selected GitLab credential targets ${b}, but this repository uses ${e}.`}}let c=await (0,o.getCredentialToken)(a.id);return c?{success:!0,credential:a,token:c}:{success:!1,error:"Could not load token for selected credential."}}if(!d)return{success:!0,credential:null,token:null};let f=function(a,b,c){if("github"===b)return a.find(a=>"github"===a.type)||null;if(c){let b=a.find(a=>"gitlab"===a.type&&s(a)===c);if(b)return b}return a.find(a=>"gitlab"===a.type)||null}(c,d,e);if(!f)return{success:!0,credential:null,token:null};let g=await (0,o.getCredentialToken)(f.id);return g?{success:!0,credential:f,token:g}:{success:!0,credential:null,token:null}}async function u(a,b){let g=a.trim();if(!g)return{success:!1,repoPath:null,error:"Please enter a remote repository URL."};let h=function(a){let b=a.trim();if(!b)return null;let c="";try{c=new URL(b).pathname}catch{let a=b.match(/^([^@]+@)?([^:]+):(.+)$/);c=a?a[3]:b}let d=c.replace(/\\/g,"/").replace(/\/+$/,"");if(!d)return null;let f=e.default.posix.basename(d);return f&&"."!==f&&".."!==f?(f.toLowerCase().endsWith(".git")&&(f=f.slice(0,-4)),f.replace(/[^a-zA-Z0-9._-]/g,"-").replace(/^-+/,"").replace(/-+$/,"")||null):null}(g);if(!h)return{success:!1,repoPath:null,error:"Could not determine repository name from URL."};let i=e.default.join(d.default.homedir(),".viba","repos");await c.default.mkdir(i,{recursive:!0});let j=e.default.join(i,h);try{return await c.default.access(j),{success:!1,repoPath:null,error:`Repository already exists at ${j}.`}}catch{}let k=await t(g,b);if(!k.success)return{success:!1,repoPath:null,error:k.error};let l=k.credential&&k.token?function(a,b,c){let d;try{d=new URL(a)}catch{return a}return"https:"!==d.protocol&&"http:"!==d.protocol?a:("github"===b.type?d.username="x-access-token":d.username="oauth2",d.password=c,d.toString())}(g,k.credential,k.token):g,m=(0,f.default)();try{if(await m.clone(l,j),l!==g){let a=(0,f.default)(j);await a.remote(["set-url","origin",g])}return{success:!0,repoPath:j}}catch(b){let a=function(a,b){let c=a;for(let a of b)a&&(c=c.replace(RegExp(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),"***"));return c.replace(/:\/\/[^/\s@]+@/g,"://***@")}(b instanceof Error?b.message:String(b),[l,k.token??""]);try{await c.default.rm(j,{recursive:!0,force:!0})}catch{}return{success:!1,repoPath:null,error:a||"Failed to clone repository."}}}async function v(){let a=d.default.homedir(),b=e.default.join(a,".viba","drafts");try{await c.default.mkdir(b,{recursive:!0})}catch{}return b}async function w(a){try{let b=await v(),d=e.default.basename(a.id),f=e.default.join(b,`${d}.json`);return await c.default.writeFile(f,JSON.stringify(a,null,2),"utf-8"),{success:!0}}catch(a){return console.error("Failed to save draft:",a),{success:!1,error:"Failed to save draft"}}}async function x(a){try{let b=await v(),d=(await c.default.readdir(b)).filter(a=>a.endsWith(".json")).map(async a=>{try{let d=e.default.join(b,a),f=await c.default.readFile(d,"utf-8");return JSON.parse(f)}catch(b){return console.error(`Failed to parse draft file ${a}:`,b),null}}),f=(await Promise.all(d)).filter(a=>null!==a);if(a)return f.filter(b=>b.repoPath===a).sort((a,b)=>b.timestamp.localeCompare(a.timestamp));return f.sort((a,b)=>b.timestamp.localeCompare(a.timestamp))}catch(a){if("ENOENT"===a.code)return[];return console.error("Failed to list drafts:",a),[]}}async function y(a){try{let b=await v(),d=e.default.basename(a),f=e.default.join(b,`${d}.json`);return await c.default.rm(f,{force:!0}),{success:!0}}catch(a){return console.error("Failed to delete draft:",a),{success:!1,error:"Failed to delete draft"}}}(0,q.ensureServerEntryExports)([r,u]),(0,b.registerServerReference)(r,"4041027bcd06f365363767978a14ebe8d79dc833bb",null),(0,b.registerServerReference)(u,"6034f4cb6f9c641315b0b93c4ad6d19cd435b40c2c",null),a.s(["cloneRemoteRepository",()=>u,"resolveRepositoryByName",()=>r],98624),(0,q.ensureServerEntryExports)([w,x,y]),(0,b.registerServerReference)(w,"40ab3155e870c7e311a3bfe4c18a6dc8c31ca04cee",null),(0,b.registerServerReference)(x,"401556bf39c72550b87c239401589366f61872b689",null),(0,b.registerServerReference)(y,"40d8dd2f28cb52127d582a5fd4b10a0efe2f938d8f",null),a.s(["deleteDraft",()=>y,"listDrafts",()=>x,"saveDraft",()=>w],54569)},273,a=>{"use strict";var b=a.i(15271),c=a.i(98624),d=a.i(51817),e=a.i(54569),f=a.i(38642),g=a.i(37359);a.s([],62514),a.i(62514),a.s(["000b08f887beb71637c519c04ba6aac330ab8dadc4",()=>b.getHomeDirectory,"002628302974b1d9d0c05eefc202ccbb2efcc2cbe0",()=>g.listCredentials,"003561691afb672a539b4c94ff1a37b71e49c9afb7",()=>g.listAgentApiCredentials,"004acab2eb117a3c8c7fba404ec67a5dfe26f40b82",()=>f.getConfig,"4012caea17b47eb1a3e66525da9f605ed00831eaa1",()=>b.checkIsGitRepo,"401556bf39c72550b87c239401589366f61872b689",()=>e.listDrafts,"401cefb9f2f0230875166691a524fe6a1c9457b10f",()=>b.checkAgentCliInstalled,"4020240f2dbe1fdeee222fde06319090eb0534b5d1",()=>d.deleteSession,"4024414bd5ce3f38f0cbd12e1805db9036135657fa",()=>b.listPathEntries,"402485c1b18b9d295d9618d8dadc71e24b1e8eb418",()=>d.listSessions,"4041027bcd06f365363767978a14ebe8d79dc833bb",()=>c.resolveRepositoryByName,"405739648f8e6d83ff3dd63c8065867bf798683868",()=>f.updateConfig,"408eeaba46545e12ea20d609bc4f1260ff905d33ad",()=>b.listDirectories,"40a380b3bfd1d08852776603d9b824ccca68aa3497",()=>b.installAgentCli,"40ab3155e870c7e311a3bfe4c18a6dc8c31ca04cee",()=>e.saveDraft,"40b67eda0795e9a0247fd06f52d2fdc28ce3f1ee53",()=>b.checkDirectoryAccessible,"40c6812f9b7117d479f53a38ff9c4d93ee2a36e441",()=>b.getBranches,"40d8dd2f28cb52127d582a5fd4b10a0efe2f938d8f",()=>e.deleteDraft,"40f34f53981ef162b3c211fe00853beb380e52eacb",()=>d.getSessionPrefillContext,"6034f4cb6f9c641315b0b93c4ad6d19cd435b40c2c",()=>c.cloneRemoteRepository,"60752430c56f23b5025818800618a799c078518f98",()=>f.updateRepoSettings,"60b2d1ea1848faa022602fefbf20f5e82112955f45",()=>d.saveSessionLaunchContext,"60e1900f3b162d274440b6e9dcda3bc04e456c4990",()=>b.checkoutBranch,"709d3e1159b28d903cbd543d10dd494a03b2de82fa",()=>d.createSession,"7f11884f46af44b93d51ab8916ae86d7e181a9c336",()=>b.saveAttachments,"7f31a55e7198df30c30fb1e5c4e4bce8cc4c850be3",()=>b.startTtydProcess,"7f426225d430b57a96d465f4956afee53ef35ce925",()=>b.getStartupScript,"7fb8cdef5fb143cc0be7e0888fcdae8e1214255963",()=>b.listRepoFiles,"7fe78908212d15cbd04c86a31bcc76c5c4e10a17bf",()=>b.getDefaultDevServerScript],273)},45581,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]_keytar_23140f5c._.js"].map(b=>a.l(b))).then(()=>b(83034)))},44264,a=>{a.v(a=>Promise.resolve().then(()=>a(33405)))},37706,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__edf0aa7a._.js"].map(b=>a.l(b))).then(()=>b(78775)))}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__2f5cb477._.js.map
|