trident-git 0.2.0 → 0.2.2
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 -0
- package/.next/app-path-routes-manifest.json +23 -0
- package/.next/build-manifest.json +20 -0
- package/.next/export-marker.json +6 -0
- package/.next/images-manifest.json +73 -0
- package/.next/next-minimal-server.js.nft.json +1 -0
- package/.next/next-server.js.nft.json +1 -0
- package/.next/package.json +1 -0
- package/.next/prerender-manifest.json +282 -0
- package/.next/react-loadable-manifest.json +1 -0
- package/.next/required-server-files.js +330 -0
- package/.next/required-server-files.json +330 -0
- package/.next/routes-manifest.json +170 -0
- package/.next/server/app/_global-error/page.js +3 -0
- package/.next/server/app/_global-error/page.js.nft.json +1 -0
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -0
- package/.next/server/app/_global-error.html +2 -0
- package/.next/server/app/_global-error.meta +16 -0
- package/.next/server/app/_global-error.rsc +12 -0
- package/.next/server/app/_global-error.segments/_full.segment.rsc +12 -0
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +5 -0
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +4 -0
- package/.next/server/app/_global-error.segments/_head.segment.rsc +5 -0
- package/.next/server/app/_global-error.segments/_index.segment.rsc +4 -0
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
- package/.next/server/app/_not-found/page.js +2 -0
- package/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
- package/.next/server/app/_not-found.html +1 -0
- package/.next/server/app/_not-found.meta +16 -0
- package/.next/server/app/_not-found.rsc +19 -0
- package/.next/server/app/_not-found.segments/_full.segment.rsc +19 -0
- package/.next/server/app/_not-found.segments/_head.segment.rsc +6 -0
- package/.next/server/app/_not-found.segments/_index.segment.rsc +8 -0
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +4 -0
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +6 -0
- package/.next/server/app/api/credentials/route.js +1 -0
- package/.next/server/app/api/credentials/route.js.nft.json +1 -0
- package/.next/server/app/api/credentials/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/custom-scripts/route.js +3 -0
- package/.next/server/app/api/custom-scripts/route.js.nft.json +1 -0
- package/.next/server/app/api/custom-scripts/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/fs/route.js +1 -0
- package/.next/server/app/api/fs/route.js.nft.json +1 -0
- package/.next/server/app/api/fs/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/git/action/route.js +1 -0
- package/.next/server/app/api/git/action/route.js.nft.json +1 -0
- package/.next/server/app/api/git/action/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/git/branches/route.js +1 -0
- package/.next/server/app/api/git/branches/route.js.nft.json +1 -0
- package/.next/server/app/api/git/branches/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/git/diff/route.js +1 -0
- package/.next/server/app/api/git/diff/route.js.nft.json +1 -0
- package/.next/server/app/api/git/diff/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/git/log/route.js +1 -0
- package/.next/server/app/api/git/log/route.js.nft.json +1 -0
- package/.next/server/app/api/git/log/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/git/status/route.js +1 -0
- package/.next/server/app/api/git/status/route.js.nft.json +1 -0
- package/.next/server/app/api/git/status/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/repos/route.js +1 -0
- package/.next/server/app/api/repos/route.js.nft.json +1 -0
- package/.next/server/app/api/repos/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/settings/route.js +1 -0
- package/.next/server/app/api/settings/route.js.nft.json +1 -0
- package/.next/server/app/api/settings/route_client-reference-manifest.js +1 -0
- package/.next/server/app/credentials/page.js +4 -0
- package/.next/server/app/credentials/page.js.nft.json +1 -0
- package/.next/server/app/credentials/page_client-reference-manifest.js +1 -0
- package/.next/server/app/credentials.html +1 -0
- package/.next/server/app/credentials.meta +15 -0
- package/.next/server/app/credentials.rsc +23 -0
- package/.next/server/app/credentials.segments/_full.segment.rsc +23 -0
- package/.next/server/app/credentials.segments/_head.segment.rsc +6 -0
- package/.next/server/app/credentials.segments/_index.segment.rsc +8 -0
- package/.next/server/app/credentials.segments/_tree.segment.rsc +6 -0
- package/.next/server/app/credentials.segments/credentials/__PAGE__.segment.rsc +9 -0
- package/.next/server/app/credentials.segments/credentials.segment.rsc +4 -0
- package/.next/server/app/icon.png/route.js +1 -0
- package/.next/server/app/icon.png/route.js.nft.json +1 -0
- package/.next/server/app/icon.png.meta +1 -0
- package/.next/server/app/index.html +1 -0
- package/.next/server/app/index.meta +14 -0
- package/.next/server/app/index.rsc +20 -0
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +6 -0
- package/.next/server/app/index.segments/_full.segment.rsc +20 -0
- package/.next/server/app/index.segments/_head.segment.rsc +6 -0
- package/.next/server/app/index.segments/_index.segment.rsc +8 -0
- package/.next/server/app/index.segments/_tree.segment.rsc +6 -0
- package/.next/server/app/page.js +2 -0
- package/.next/server/app/page.js.nft.json +1 -0
- package/.next/server/app/page_client-reference-manifest.js +1 -0
- package/.next/server/app/workspace/changes/page.js +4 -0
- package/.next/server/app/workspace/changes/page.js.nft.json +1 -0
- package/.next/server/app/workspace/changes/page_client-reference-manifest.js +1 -0
- package/.next/server/app/workspace/changes.html +1 -0
- package/.next/server/app/workspace/changes.meta +16 -0
- package/.next/server/app/workspace/changes.rsc +26 -0
- package/.next/server/app/workspace/changes.segments/_full.segment.rsc +26 -0
- package/.next/server/app/workspace/changes.segments/_head.segment.rsc +6 -0
- package/.next/server/app/workspace/changes.segments/_index.segment.rsc +8 -0
- package/.next/server/app/workspace/changes.segments/_tree.segment.rsc +7 -0
- package/.next/server/app/workspace/changes.segments/workspace/changes/__PAGE__.segment.rsc +10 -0
- package/.next/server/app/workspace/changes.segments/workspace/changes.segment.rsc +4 -0
- package/.next/server/app/workspace/changes.segments/workspace.segment.rsc +7 -0
- package/.next/server/app/workspace/custom-scripts/page.js +2 -0
- package/.next/server/app/workspace/custom-scripts/page.js.nft.json +1 -0
- package/.next/server/app/workspace/custom-scripts/page_client-reference-manifest.js +1 -0
- package/.next/server/app/workspace/custom-scripts.html +1 -0
- package/.next/server/app/workspace/custom-scripts.meta +16 -0
- package/.next/server/app/workspace/custom-scripts.rsc +25 -0
- package/.next/server/app/workspace/custom-scripts.segments/_full.segment.rsc +25 -0
- package/.next/server/app/workspace/custom-scripts.segments/_head.segment.rsc +6 -0
- package/.next/server/app/workspace/custom-scripts.segments/_index.segment.rsc +8 -0
- package/.next/server/app/workspace/custom-scripts.segments/_tree.segment.rsc +6 -0
- package/.next/server/app/workspace/custom-scripts.segments/workspace/custom-scripts/__PAGE__.segment.rsc +9 -0
- package/.next/server/app/workspace/custom-scripts.segments/workspace/custom-scripts.segment.rsc +4 -0
- package/.next/server/app/workspace/custom-scripts.segments/workspace.segment.rsc +7 -0
- package/.next/server/app/workspace/history/page.js +2 -0
- package/.next/server/app/workspace/history/page.js.nft.json +1 -0
- package/.next/server/app/workspace/history/page_client-reference-manifest.js +1 -0
- package/.next/server/app/workspace/history.html +1 -0
- package/.next/server/app/workspace/history.meta +16 -0
- package/.next/server/app/workspace/history.rsc +26 -0
- package/.next/server/app/workspace/history.segments/_full.segment.rsc +26 -0
- package/.next/server/app/workspace/history.segments/_head.segment.rsc +6 -0
- package/.next/server/app/workspace/history.segments/_index.segment.rsc +8 -0
- package/.next/server/app/workspace/history.segments/_tree.segment.rsc +7 -0
- package/.next/server/app/workspace/history.segments/workspace/history/__PAGE__.segment.rsc +10 -0
- package/.next/server/app/workspace/history.segments/workspace/history.segment.rsc +4 -0
- package/.next/server/app/workspace/history.segments/workspace.segment.rsc +7 -0
- package/.next/server/app/workspace/page.js +2 -0
- package/.next/server/app/workspace/page.js.nft.json +1 -0
- package/.next/server/app/workspace/page_client-reference-manifest.js +1 -0
- package/.next/server/app/workspace/settings/page.js +2 -0
- package/.next/server/app/workspace/settings/page.js.nft.json +1 -0
- package/.next/server/app/workspace/settings/page_client-reference-manifest.js +1 -0
- package/.next/server/app/workspace/settings.html +1 -0
- package/.next/server/app/workspace/settings.meta +16 -0
- package/.next/server/app/workspace/settings.rsc +25 -0
- package/.next/server/app/workspace/settings.segments/_full.segment.rsc +25 -0
- package/.next/server/app/workspace/settings.segments/_head.segment.rsc +6 -0
- package/.next/server/app/workspace/settings.segments/_index.segment.rsc +8 -0
- package/.next/server/app/workspace/settings.segments/_tree.segment.rsc +6 -0
- package/.next/server/app/workspace/settings.segments/workspace/settings/__PAGE__.segment.rsc +9 -0
- package/.next/server/app/workspace/settings.segments/workspace/settings.segment.rsc +4 -0
- package/.next/server/app/workspace/settings.segments/workspace.segment.rsc +7 -0
- package/.next/server/app/workspace/stashes/page.js +2 -0
- package/.next/server/app/workspace/stashes/page.js.nft.json +1 -0
- package/.next/server/app/workspace/stashes/page_client-reference-manifest.js +1 -0
- package/.next/server/app/workspace/stashes.html +1 -0
- package/.next/server/app/workspace/stashes.meta +16 -0
- package/.next/server/app/workspace/stashes.rsc +26 -0
- package/.next/server/app/workspace/stashes.segments/_full.segment.rsc +26 -0
- package/.next/server/app/workspace/stashes.segments/_head.segment.rsc +6 -0
- package/.next/server/app/workspace/stashes.segments/_index.segment.rsc +8 -0
- package/.next/server/app/workspace/stashes.segments/_tree.segment.rsc +7 -0
- package/.next/server/app/workspace/stashes.segments/workspace/stashes/__PAGE__.segment.rsc +10 -0
- package/.next/server/app/workspace/stashes.segments/workspace/stashes.segment.rsc +4 -0
- package/.next/server/app/workspace/stashes.segments/workspace.segment.rsc +7 -0
- package/.next/server/app/workspace.html +1 -0
- package/.next/server/app/workspace.meta +15 -0
- package/.next/server/app/workspace.rsc +26 -0
- package/.next/server/app/workspace.segments/_full.segment.rsc +26 -0
- package/.next/server/app/workspace.segments/_head.segment.rsc +6 -0
- package/.next/server/app/workspace.segments/_index.segment.rsc +8 -0
- package/.next/server/app/workspace.segments/_tree.segment.rsc +7 -0
- package/.next/server/app/workspace.segments/workspace/__PAGE__.segment.rsc +10 -0
- package/.next/server/app/workspace.segments/workspace.segment.rsc +7 -0
- package/.next/server/app-paths-manifest.json +23 -0
- package/.next/server/chunks/116.js +1 -0
- package/.next/server/chunks/170.js +1 -0
- package/.next/server/chunks/309.js +6 -0
- package/.next/server/chunks/356.js +1 -0
- package/.next/server/chunks/392.js +1 -0
- package/.next/server/chunks/443.js +37 -0
- package/.next/server/chunks/445.js +22 -0
- package/.next/server/chunks/471.js +13 -0
- package/.next/server/chunks/557.js +5 -0
- package/.next/server/chunks/680.js +1 -0
- package/.next/server/chunks/739.js +5 -0
- package/.next/server/chunks/781.js +1 -0
- package/.next/server/chunks/813.js +1 -0
- package/.next/server/chunks/816.js +13 -0
- package/.next/server/functions-config-manifest.json +6 -0
- package/.next/server/interception-route-rewrite-manifest.js +1 -0
- package/.next/server/middleware-build-manifest.js +1 -0
- package/.next/server/middleware-manifest.json +6 -0
- package/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/.next/server/next-font-manifest.js +1 -0
- package/.next/server/next-font-manifest.json +1 -0
- package/.next/server/pages/404.html +1 -0
- package/.next/server/pages/500.html +2 -0
- package/.next/server/pages-manifest.json +4 -0
- package/.next/server/server-reference-manifest.js +1 -0
- package/.next/server/server-reference-manifest.json +1 -0
- package/.next/server/webpack-runtime.js +1 -0
- package/.next/static/VTWJwhFJd5VcC6GP5bbli/_buildManifest.js +1 -0
- package/.next/static/VTWJwhFJd5VcC6GP5bbli/_ssgManifest.js +1 -0
- package/.next/static/chunks/131-6237c77d708182b1.js +1 -0
- package/.next/static/chunks/147-d4cb3e03218d75df.js +6 -0
- package/.next/static/chunks/176-b068120641913226.js +1 -0
- package/.next/static/chunks/200-3664e65687e716a2.js +1 -0
- package/.next/static/chunks/26-d93e82c9c09ff972.js +1 -0
- package/.next/static/chunks/4bd1b696-096d35a2bd1da3af.js +1 -0
- package/.next/static/chunks/500-5d45efbf86b8d36e.js +1 -0
- package/.next/static/chunks/772-b39107b40c31b6b6.js +3 -0
- package/.next/static/chunks/785-e6d755147ff87934.js +1 -0
- package/.next/static/chunks/790-3e8fa6e595d97940.js +6 -0
- package/.next/static/chunks/794-37dad9bbc14b04b8.js +2 -0
- package/.next/static/chunks/841-4d865378216d36eb.js +13 -0
- package/.next/static/chunks/app/_global-error/page-9eb8a19109bbd711.js +1 -0
- package/.next/static/chunks/app/_not-found/page-5bea07380837254f.js +1 -0
- package/.next/static/chunks/app/api/credentials/route-9eb8a19109bbd711.js +1 -0
- package/.next/static/chunks/app/api/custom-scripts/route-9eb8a19109bbd711.js +1 -0
- package/.next/static/chunks/app/api/fs/route-9eb8a19109bbd711.js +1 -0
- package/.next/static/chunks/app/api/git/action/route-9eb8a19109bbd711.js +1 -0
- package/.next/static/chunks/app/api/git/branches/route-9eb8a19109bbd711.js +1 -0
- package/.next/static/chunks/app/api/git/diff/route-9eb8a19109bbd711.js +1 -0
- package/.next/static/chunks/app/api/git/log/route-9eb8a19109bbd711.js +1 -0
- package/.next/static/chunks/app/api/git/status/route-9eb8a19109bbd711.js +1 -0
- package/.next/static/chunks/app/api/repos/route-9eb8a19109bbd711.js +1 -0
- package/.next/static/chunks/app/api/settings/route-9eb8a19109bbd711.js +1 -0
- package/.next/static/chunks/app/credentials/page-23c1807ad9f68a40.js +1 -0
- package/.next/static/chunks/app/layout-a06241c385e50ae0.js +1 -0
- package/.next/static/chunks/app/page-c8404790f5191fd7.js +1 -0
- package/.next/static/chunks/app/workspace/changes/page-8cca17f80e66f534.js +3 -0
- package/.next/static/chunks/app/workspace/custom-scripts/page-ee24b9dd7779244f.js +1 -0
- package/.next/static/chunks/app/workspace/history/page-b7017fea285c804c.js +1 -0
- package/.next/static/chunks/app/workspace/layout-cb86c00fdcd8db08.js +1 -0
- package/.next/static/chunks/app/workspace/page-21211acc90c08509.js +1 -0
- package/.next/static/chunks/app/workspace/settings/page-7ccb58ece31492e9.js +1 -0
- package/.next/static/chunks/app/workspace/stashes/page-0e1b8304c4b0f4f3.js +1 -0
- package/.next/static/chunks/framework-75892d61b920805f.js +1 -0
- package/.next/static/chunks/main-app-221e1b945693a142.js +1 -0
- package/.next/static/chunks/main-f1d55fffd3cc9809.js +5 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-9eb8a19109bbd711.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-9eb8a19109bbd711.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-f2a2c324f3740ed8.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-9eb8a19109bbd711.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-9eb8a19109bbd711.js +1 -0
- package/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/.next/static/chunks/webpack-7dec27dc3bfe207a.js +1 -0
- package/.next/static/css/36968b90b2339533.css +1 -0
- package/.next/static/css/c56c0e57397a3a60.css +1 -0
- package/.next/static/css/de70bee13400563f.css +1 -0
- package/.next/static/media/4cf2300e9c8272f7-s.p.woff2 +0 -0
- package/.next/static/media/747892c23ea88013-s.woff2 +0 -0
- package/.next/static/media/8d697b304b401681-s.woff2 +0 -0
- package/.next/static/media/93f479601ee12b01-s.p.woff2 +0 -0
- package/.next/static/media/9610d9e46709d722-s.woff2 +0 -0
- package/.next/static/media/ba015fad6dcf6784-s.woff2 +0 -0
- package/README.md +2 -0
- package/bin/trident-git.mjs +9 -11
- package/{next.config.ts → next.config.mjs} +7 -8
- package/package.json +8 -6
- package/eslint.config.mjs +0 -18
- package/postcss.config.mjs +0 -7
- package/src/app/api/credentials/route.ts +0 -113
- package/src/app/api/custom-scripts/route.ts +0 -203
- package/src/app/api/fs/route.ts +0 -75
- package/src/app/api/git/action/route.ts +0 -383
- package/src/app/api/git/branches/route.ts +0 -20
- package/src/app/api/git/diff/route.ts +0 -104
- package/src/app/api/git/log/route.ts +0 -28
- package/src/app/api/git/status/route.ts +0 -28
- package/src/app/api/repos/route.ts +0 -84
- package/src/app/api/settings/route.ts +0 -37
- package/src/app/credentials/page.tsx +0 -408
- package/src/app/globals.css +0 -109
- package/src/app/layout.tsx +0 -38
- package/src/app/page.tsx +0 -10
- package/src/app/providers.tsx +0 -21
- package/src/app/workspace/changes/page.tsx +0 -27
- package/src/app/workspace/custom-scripts/page.tsx +0 -247
- package/src/app/workspace/history/page.tsx +0 -27
- package/src/app/workspace/layout.tsx +0 -26
- package/src/app/workspace/page.tsx +0 -27
- package/src/app/workspace/settings/page.tsx +0 -233
- package/src/app/workspace/stashes/page.tsx +0 -395
- package/src/components/command-palette.tsx +0 -178
- package/src/components/context-menu.tsx +0 -200
- package/src/components/fs-browser.tsx +0 -154
- package/src/components/git/diff-view.tsx +0 -137
- package/src/components/git/git-graph.tsx +0 -489
- package/src/components/git/grouped-diff-viewer.tsx +0 -332
- package/src/components/git/history-view.tsx +0 -4862
- package/src/components/git/image-diff-view.tsx +0 -342
- package/src/components/git/status-view.tsx +0 -597
- package/src/components/home-settings-modal.tsx +0 -192
- package/src/components/layout/sidebar.tsx +0 -256
- package/src/components/repo-list.tsx +0 -206
- package/src/components/theme-toggle.tsx +0 -37
- package/src/components/toaster.tsx +0 -36
- package/src/components/workspace-repo-open-tracker.tsx +0 -39
- package/src/hooks/use-credentials.ts +0 -123
- package/src/hooks/use-escape-dismiss.ts +0 -72
- package/src/hooks/use-git.ts +0 -448
- package/src/hooks/use-toast.ts +0 -280
- package/src/hooks/use-workspace-title.ts +0 -23
- package/src/lib/api-utils.ts +0 -24
- package/src/lib/branch-colors.ts +0 -98
- package/src/lib/credentials.ts +0 -404
- package/src/lib/git.ts +0 -1510
- package/src/lib/graph-utils.ts +0 -253
- package/src/lib/store.ts +0 -145
- package/src/lib/types.ts +0 -95
- package/src/lib/utils.ts +0 -266
- package/tsconfig.json +0 -34
- /package/{src/app/icon.png → .next/server/app/icon.png.body} +0 -0
package/src/lib/utils.ts
DELETED
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
import { clsx, type ClassValue } from "clsx"
|
|
2
|
-
import { twMerge } from "tailwind-merge"
|
|
3
|
-
import type { Repository } from './types';
|
|
4
|
-
|
|
5
|
-
export function cn(...inputs: ClassValue[]) {
|
|
6
|
-
return twMerge(clsx(inputs))
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function getRepoFolderName(repoPath: string): string {
|
|
10
|
-
const normalizedPath = repoPath.replace(/[\\/]+$/, '');
|
|
11
|
-
const segments = normalizedPath.split(/[/\\]/).filter(Boolean);
|
|
12
|
-
return segments[segments.length - 1] || repoPath;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function getRepositoryDisplayName(repo: Pick<Repository, 'path' | 'name' | 'displayName'>): string {
|
|
16
|
-
const customName = repo.displayName?.trim();
|
|
17
|
-
if (customName) {
|
|
18
|
-
return customName;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (repo.name?.trim()) {
|
|
22
|
-
return repo.name;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return getRepoFolderName(repo.path);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function getNormalizedExtension(filePath: string): string {
|
|
29
|
-
if (!filePath) return '';
|
|
30
|
-
|
|
31
|
-
const fileName = filePath.split('/').pop() || '';
|
|
32
|
-
const lastDotIndex = fileName.lastIndexOf('.');
|
|
33
|
-
|
|
34
|
-
if (lastDotIndex === -1 || lastDotIndex === 0) {
|
|
35
|
-
return fileName.toLowerCase();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return fileName.slice(lastDotIndex + 1).toLowerCase();
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Known text-based file extensions
|
|
42
|
-
const TEXT_EXTENSIONS = new Set([
|
|
43
|
-
// Programming languages
|
|
44
|
-
'js', 'jsx', 'ts', 'tsx', 'mjs', 'cjs', 'mts', 'cts',
|
|
45
|
-
'py', 'pyw', 'pyi', 'pyx',
|
|
46
|
-
'rb', 'rake', 'gemspec',
|
|
47
|
-
'java', 'kt', 'kts', 'scala', 'sc', 'groovy', 'gradle',
|
|
48
|
-
'c', 'h', 'cpp', 'cc', 'cxx', 'hpp', 'hh', 'hxx', 'c++', 'h++',
|
|
49
|
-
'cs', 'fs', 'fsx', 'fsi',
|
|
50
|
-
'go', 'rs', 'swift', 'dart', 'zig', 'nim', 'v', 'odin',
|
|
51
|
-
'php', 'phtml', 'php3', 'php4', 'php5', 'php7', 'phps',
|
|
52
|
-
'pl', 'pm', 'pod', 't', 'psgi',
|
|
53
|
-
'lua', 'tcl', 'r', 'R', 'jl', 'ex', 'exs', 'erl', 'hrl',
|
|
54
|
-
'clj', 'cljs', 'cljc', 'edn', 'lisp', 'lsp', 'el', 'scm', 'ss', 'rkt',
|
|
55
|
-
'hs', 'lhs', 'elm', 'purs', 'ml', 'mli', 'f90', 'f95', 'f03', 'f08', 'for',
|
|
56
|
-
'asm', 's', 'S', 'vhd', 'vhdl', 'v', 'sv', 'svh',
|
|
57
|
-
'bas', 'vb', 'vbs', 'vba',
|
|
58
|
-
'pas', 'pp', 'inc', 'dpr', 'dpk',
|
|
59
|
-
'sh', 'bash', 'zsh', 'fish', 'ksh', 'csh', 'tcsh', 'ps1', 'psm1', 'psd1', 'bat', 'cmd',
|
|
60
|
-
// Web
|
|
61
|
-
'html', 'htm', 'xhtml', 'shtml',
|
|
62
|
-
'css', 'scss', 'sass', 'less', 'styl', 'stylus', 'pcss', 'postcss',
|
|
63
|
-
'svg', 'xml', 'xsl', 'xslt', 'xsd', 'dtd', 'rss', 'atom', 'rdf', 'wsdl', 'soap',
|
|
64
|
-
'vue', 'svelte', 'astro', 'mdx',
|
|
65
|
-
'hbs', 'handlebars', 'mustache', 'ejs', 'pug', 'jade', 'haml', 'slim', 'erb',
|
|
66
|
-
'graphql', 'gql',
|
|
67
|
-
// Data & Config
|
|
68
|
-
'json', 'json5', 'jsonc', 'jsonl', 'ndjson', 'geojson',
|
|
69
|
-
'yaml', 'yml',
|
|
70
|
-
'toml', 'ini', 'cfg', 'conf', 'config', 'properties', 'env',
|
|
71
|
-
'csv', 'tsv', 'psv',
|
|
72
|
-
'txt', 'text', 'log', 'out',
|
|
73
|
-
'md', 'markdown', 'mdown', 'mkd', 'mkdn', 'mdwn', 'rst', 'rest', 'adoc', 'asciidoc', 'asc',
|
|
74
|
-
'org', 'tex', 'latex', 'ltx', 'bib', 'sty', 'cls',
|
|
75
|
-
'rtf', 'diff', 'patch',
|
|
76
|
-
// Version control & Build
|
|
77
|
-
'gitignore', 'gitattributes', 'gitmodules', 'gitconfig',
|
|
78
|
-
'dockerignore', 'dockerfile', 'containerfile',
|
|
79
|
-
'editorconfig', 'prettierrc', 'eslintrc', 'babelrc', 'stylelintrc', 'browserslistrc',
|
|
80
|
-
'npmrc', 'nvmrc', 'yarnrc', 'pnpmfile',
|
|
81
|
-
'makefile', 'mk', 'cmake', 'make', 'mak', 'rake', 'podfile', 'gemfile', 'fastfile',
|
|
82
|
-
// Other
|
|
83
|
-
'sql', 'plsql', 'pgsql', 'mysql', 'sqlite', 'hql', 'cql',
|
|
84
|
-
'proto', 'protobuf', 'thrift', 'avro', 'capnp', 'fbs', 'flatc',
|
|
85
|
-
'tf', 'tfvars', 'hcl', 'nomad', 'sentinel',
|
|
86
|
-
'prisma', 'graphqls',
|
|
87
|
-
'lock', // package-lock.json, yarn.lock, etc.
|
|
88
|
-
]);
|
|
89
|
-
|
|
90
|
-
// Known binary file extensions
|
|
91
|
-
const BINARY_EXTENSIONS = new Set([
|
|
92
|
-
// Images
|
|
93
|
-
'jpg', 'jpeg', 'png', 'gif', 'bmp', 'ico', 'icns', 'tiff', 'tif', 'webp', 'avif', 'heic', 'heif',
|
|
94
|
-
'psd', 'ai', 'eps', 'raw', 'cr2', 'nef', 'orf', 'sr2', 'dng',
|
|
95
|
-
// Video
|
|
96
|
-
'mp4', 'avi', 'mov', 'wmv', 'flv', 'mkv', 'webm', 'm4v', 'mpeg', 'mpg', '3gp', '3g2', 'ogv',
|
|
97
|
-
// Audio
|
|
98
|
-
'mp3', 'wav', 'ogg', 'oga', 'flac', 'aac', 'm4a', 'wma', 'aiff', 'aif', 'mid', 'midi', 'opus',
|
|
99
|
-
// Archives
|
|
100
|
-
'zip', 'rar', '7z', 'tar', 'gz', 'bz2', 'xz', 'lz', 'lzma', 'lz4', 'zst', 'cab', 'iso', 'dmg',
|
|
101
|
-
// Executables & Libraries
|
|
102
|
-
'exe', 'dll', 'so', 'dylib', 'a', 'lib', 'obj', 'o',
|
|
103
|
-
'app', 'msi', 'deb', 'rpm', 'apk', 'ipa', 'pkg', 'snap', 'flatpak', 'appimage',
|
|
104
|
-
'class', 'jar', 'war', 'ear', 'pyc', 'pyo', 'pyd', 'beam',
|
|
105
|
-
'wasm', 'wat',
|
|
106
|
-
// Documents
|
|
107
|
-
'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'odt', 'ods', 'odp', 'pages', 'numbers', 'key',
|
|
108
|
-
// Fonts
|
|
109
|
-
'ttf', 'otf', 'woff', 'woff2', 'eot', 'fon', 'fnt',
|
|
110
|
-
// Database
|
|
111
|
-
'db', 'sqlite', 'sqlite3', 'mdb', 'accdb', 'frm', 'myd', 'myi', 'ibd',
|
|
112
|
-
// Other binary formats
|
|
113
|
-
'bin', 'dat', 'data', 'sav', 'bak',
|
|
114
|
-
'swf', 'fla',
|
|
115
|
-
'blend', 'fbx', 'obj', 'stl', 'gltf', 'glb', '3ds', 'dae', 'ply',
|
|
116
|
-
'sketch', 'fig', 'xd',
|
|
117
|
-
'unity', 'unitypackage', 'asset', 'prefab', 'meta',
|
|
118
|
-
]);
|
|
119
|
-
|
|
120
|
-
const IMAGE_EXTENSIONS = new Set([
|
|
121
|
-
'png', 'jpg', 'jpeg', 'gif', 'bmp', 'ico', 'icns', 'tiff', 'tif', 'webp', 'avif', 'heic', 'heif', 'svg',
|
|
122
|
-
]);
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Determines file type based on extension.
|
|
126
|
-
* @returns 'text' | 'binary' | 'unknown'
|
|
127
|
-
*/
|
|
128
|
-
export function getFileTypeByExtension(filePath: string): 'text' | 'binary' | 'unknown' {
|
|
129
|
-
if (!filePath) return 'unknown';
|
|
130
|
-
|
|
131
|
-
const extension = getNormalizedExtension(filePath);
|
|
132
|
-
|
|
133
|
-
if (TEXT_EXTENSIONS.has(extension)) {
|
|
134
|
-
return 'text';
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
if (BINARY_EXTENSIONS.has(extension)) {
|
|
138
|
-
return 'binary';
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
return 'unknown';
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Check if content appears to be binary (contains null bytes or high ratio of non-printable chars).
|
|
146
|
-
* This is used as a fallback when extension-based detection is inconclusive.
|
|
147
|
-
*/
|
|
148
|
-
export function isBinaryContent(content: string): boolean {
|
|
149
|
-
if (!content) return false;
|
|
150
|
-
// Check for null bytes - strong indicator of binary content
|
|
151
|
-
if (content.includes('\0')) return true;
|
|
152
|
-
// Check first 8KB for non-printable characters
|
|
153
|
-
const sample = content.slice(0, 8192);
|
|
154
|
-
let nonPrintable = 0;
|
|
155
|
-
for (let i = 0; i < sample.length; i++) {
|
|
156
|
-
const code = sample.charCodeAt(i);
|
|
157
|
-
// Allow common whitespace (tab, newline, carriage return) and printable ASCII
|
|
158
|
-
if (code < 32 && code !== 9 && code !== 10 && code !== 13) {
|
|
159
|
-
nonPrintable++;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
// If more than 10% non-printable, likely binary
|
|
163
|
-
return sample.length > 0 && (nonPrintable / sample.length) > 0.1;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Determines if a file is binary, using extension-based detection first,
|
|
168
|
-
* then falling back to content analysis if extension is unknown.
|
|
169
|
-
*/
|
|
170
|
-
export function isFileBinary(filePath: string, leftContent?: string, rightContent?: string): boolean {
|
|
171
|
-
// First, try to determine from extension
|
|
172
|
-
const fileType = getFileTypeByExtension(filePath);
|
|
173
|
-
|
|
174
|
-
if (fileType === 'binary') {
|
|
175
|
-
return true;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
if (fileType === 'text') {
|
|
179
|
-
return false;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// Extension is unknown - fall back to content analysis
|
|
183
|
-
return isBinaryContent(leftContent || '') || isBinaryContent(rightContent || '');
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export function isImageFile(filePath: string): boolean {
|
|
187
|
-
return IMAGE_EXTENSIONS.has(getNormalizedExtension(filePath));
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export function getImageMimeType(filePath: string): string {
|
|
191
|
-
const extension = getNormalizedExtension(filePath);
|
|
192
|
-
|
|
193
|
-
switch (extension) {
|
|
194
|
-
case 'jpg':
|
|
195
|
-
case 'jpeg':
|
|
196
|
-
return 'image/jpeg';
|
|
197
|
-
case 'png':
|
|
198
|
-
return 'image/png';
|
|
199
|
-
case 'gif':
|
|
200
|
-
return 'image/gif';
|
|
201
|
-
case 'bmp':
|
|
202
|
-
return 'image/bmp';
|
|
203
|
-
case 'ico':
|
|
204
|
-
return 'image/x-icon';
|
|
205
|
-
case 'icns':
|
|
206
|
-
return 'image/icns';
|
|
207
|
-
case 'tiff':
|
|
208
|
-
case 'tif':
|
|
209
|
-
return 'image/tiff';
|
|
210
|
-
case 'webp':
|
|
211
|
-
return 'image/webp';
|
|
212
|
-
case 'avif':
|
|
213
|
-
return 'image/avif';
|
|
214
|
-
case 'heic':
|
|
215
|
-
return 'image/heic';
|
|
216
|
-
case 'heif':
|
|
217
|
-
return 'image/heif';
|
|
218
|
-
case 'svg':
|
|
219
|
-
return 'image/svg+xml';
|
|
220
|
-
default:
|
|
221
|
-
return 'application/octet-stream';
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Counts changed lines in a unified git patch.
|
|
227
|
-
* Includes added/removed lines and skips file header markers.
|
|
228
|
-
*/
|
|
229
|
-
export function getChangedLineCountFromDiff(diff: string | null | undefined): number {
|
|
230
|
-
if (!diff) return 0;
|
|
231
|
-
|
|
232
|
-
return diff.split('\n').reduce((count, line) => {
|
|
233
|
-
if (line.startsWith('+++ ') || line.startsWith('--- ')) {
|
|
234
|
-
return count;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
if (line.startsWith('+') || line.startsWith('-')) {
|
|
238
|
-
return count + 1;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
return count;
|
|
242
|
-
}, 0);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Sanitizes a branch name by replacing illegal Git branch name characters with "-".
|
|
247
|
-
* Git branch names cannot contain:
|
|
248
|
-
* - Space, ~, ^, :, ?, *, [, \, control characters
|
|
249
|
-
* - Double dots (..)
|
|
250
|
-
* - @{ sequence
|
|
251
|
-
* - Leading/trailing dots or slashes
|
|
252
|
-
* - Consecutive slashes
|
|
253
|
-
*/
|
|
254
|
-
export function sanitizeBranchName(name: string): string {
|
|
255
|
-
const sanitized = name
|
|
256
|
-
// Replace illegal characters with "-"
|
|
257
|
-
.replace(/[\s~^:?*\[\]\\@{}<>|"'`!#$%&()+=;,]/g, '-')
|
|
258
|
-
// Replace double dots with single dash
|
|
259
|
-
.replace(/\.{2,}/g, '-')
|
|
260
|
-
// Replace consecutive slashes with single slash
|
|
261
|
-
.replace(/\/{2,}/g, '/')
|
|
262
|
-
// Replace consecutive dashes with single dash
|
|
263
|
-
.replace(/-{2,}/g, '-');
|
|
264
|
-
|
|
265
|
-
return sanitized;
|
|
266
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2017",
|
|
4
|
-
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
-
"allowJs": true,
|
|
6
|
-
"skipLibCheck": true,
|
|
7
|
-
"strict": true,
|
|
8
|
-
"noEmit": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"module": "esnext",
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"isolatedModules": true,
|
|
14
|
-
"jsx": "react-jsx",
|
|
15
|
-
"incremental": true,
|
|
16
|
-
"plugins": [
|
|
17
|
-
{
|
|
18
|
-
"name": "next"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"paths": {
|
|
22
|
-
"@/*": ["./src/*"]
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"include": [
|
|
26
|
-
"next-env.d.ts",
|
|
27
|
-
"**/*.ts",
|
|
28
|
-
"**/*.tsx",
|
|
29
|
-
".next/types/**/*.ts",
|
|
30
|
-
".next/dev/types/**/*.ts",
|
|
31
|
-
"**/*.mts"
|
|
32
|
-
],
|
|
33
|
-
"exclude": ["node_modules"]
|
|
34
|
-
}
|
|
File without changes
|