sync-worktrees 3.6.3 → 4.1.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/README.md +383 -261
- package/dist/components/App.d.ts +50 -0
- package/dist/components/App.d.ts.map +1 -0
- package/dist/components/BranchCreationWizard.d.ts +26 -0
- package/dist/components/BranchCreationWizard.d.ts.map +1 -0
- package/dist/components/HelpModal.d.ts +7 -0
- package/dist/components/HelpModal.d.ts.map +1 -0
- package/dist/components/LogPanel.d.ts +10 -0
- package/dist/components/LogPanel.d.ts.map +1 -0
- package/dist/components/LogViewer.d.ts +9 -0
- package/dist/components/LogViewer.d.ts.map +1 -0
- package/dist/components/OpenEditorWizard.d.ts +25 -0
- package/dist/components/OpenEditorWizard.d.ts.map +1 -0
- package/dist/components/StatusBar.d.ts +14 -0
- package/dist/components/StatusBar.d.ts.map +1 -0
- package/dist/components/WorktreeStatusView.d.ts +14 -0
- package/dist/components/WorktreeStatusView.d.ts.map +1 -0
- package/dist/constants.d.ts +112 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/errors/index.d.ts +59 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2523 -1106
- package/dist/index.js.map +4 -4
- package/dist/mcp/context.d.ts +143 -0
- package/dist/mcp/context.d.ts.map +1 -0
- package/dist/mcp/handlers.d.ts +46 -0
- package/dist/mcp/handlers.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/server.d.ts +9 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/utils.d.ts +14 -0
- package/dist/mcp/utils.d.ts.map +1 -0
- package/dist/mcp/worktree-summary.d.ts +14 -0
- package/dist/mcp/worktree-summary.d.ts.map +1 -0
- package/dist/mcp-server.js +2347 -640
- package/dist/mcp-server.js.map +4 -4
- package/dist/services/InteractiveUIService.d.ts +85 -0
- package/dist/services/InteractiveUIService.d.ts.map +1 -0
- package/dist/services/branch-created-actions.service.d.ts +27 -0
- package/dist/services/branch-created-actions.service.d.ts.map +1 -0
- package/dist/services/clone-sync.service.d.ts +93 -0
- package/dist/services/clone-sync.service.d.ts.map +1 -0
- package/dist/services/config-loader.service.d.ts +28 -0
- package/dist/services/config-loader.service.d.ts.map +1 -0
- package/dist/services/file-copy.service.d.ts +19 -0
- package/dist/services/file-copy.service.d.ts.map +1 -0
- package/dist/services/git.service.d.ts +94 -0
- package/dist/services/git.service.d.ts.map +1 -0
- package/dist/services/hook-execution.service.d.ts +20 -0
- package/dist/services/hook-execution.service.d.ts.map +1 -0
- package/dist/services/logger.service.d.ts +24 -0
- package/dist/services/logger.service.d.ts.map +1 -0
- package/dist/services/path-resolution.service.d.ts +10 -0
- package/dist/services/path-resolution.service.d.ts.map +1 -0
- package/dist/services/progress-emitter.d.ts +14 -0
- package/dist/services/progress-emitter.d.ts.map +1 -0
- package/dist/services/repo-operation-lock.d.ts +16 -0
- package/dist/services/repo-operation-lock.d.ts.map +1 -0
- package/dist/services/sparse-checkout.service.d.ts +45 -0
- package/dist/services/sparse-checkout.service.d.ts.map +1 -0
- package/dist/services/sync-outcome.d.ts +47 -0
- package/dist/services/sync-outcome.d.ts.map +1 -0
- package/dist/services/sync-retry-policy.d.ts +18 -0
- package/dist/services/sync-retry-policy.d.ts.map +1 -0
- package/dist/services/worktree-metadata.service.d.ts +25 -0
- package/dist/services/worktree-metadata.service.d.ts.map +1 -0
- package/dist/services/worktree-mode-sync-runner.d.ts +36 -0
- package/dist/services/worktree-mode-sync-runner.d.ts.map +1 -0
- package/dist/services/worktree-status.service.d.ts +60 -0
- package/dist/services/worktree-status.service.d.ts.map +1 -0
- package/dist/services/worktree-sync-planner.d.ts +62 -0
- package/dist/services/worktree-sync-planner.d.ts.map +1 -0
- package/dist/services/worktree-sync.service.d.ts +49 -0
- package/dist/services/worktree-sync.service.d.ts.map +1 -0
- package/dist/types/index.d.ts +303 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/sync-metadata.d.ts +16 -0
- package/dist/types/sync-metadata.d.ts.map +1 -0
- package/dist/utils/app-events.d.ts +31 -0
- package/dist/utils/app-events.d.ts.map +1 -0
- package/dist/utils/branch-filter.d.ts +3 -0
- package/dist/utils/branch-filter.d.ts.map +1 -0
- package/dist/utils/cli.d.ts +21 -0
- package/dist/utils/cli.d.ts.map +1 -0
- package/dist/utils/clone-skip-format.d.ts +3 -0
- package/dist/utils/clone-skip-format.d.ts.map +1 -0
- package/dist/utils/config-generator.d.ts +10 -0
- package/dist/utils/config-generator.d.ts.map +1 -0
- package/dist/utils/date-filter.d.ts +10 -0
- package/dist/utils/date-filter.d.ts.map +1 -0
- package/dist/utils/disk-space.d.ts +23 -0
- package/dist/utils/disk-space.d.ts.map +1 -0
- package/dist/utils/file-exists.d.ts +2 -0
- package/dist/utils/file-exists.d.ts.map +1 -0
- package/dist/utils/git-progress.d.ts +25 -0
- package/dist/utils/git-progress.d.ts.map +1 -0
- package/dist/utils/git-url.d.ts +23 -0
- package/dist/utils/git-url.d.ts.map +1 -0
- package/dist/utils/git-validation.d.ts +5 -0
- package/dist/utils/git-validation.d.ts.map +1 -0
- package/dist/utils/interactive.d.ts +3 -0
- package/dist/utils/interactive.d.ts.map +1 -0
- package/dist/utils/lfs-error.d.ts +35 -0
- package/dist/utils/lfs-error.d.ts.map +1 -0
- package/dist/utils/lock-path.d.ts +9 -0
- package/dist/utils/lock-path.d.ts.map +1 -0
- package/dist/utils/path-compare.d.ts +16 -0
- package/dist/utils/path-compare.d.ts.map +1 -0
- package/dist/utils/repo-mode.d.ts +8 -0
- package/dist/utils/repo-mode.d.ts.map +1 -0
- package/dist/utils/retry.d.ts +24 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/sanitize-name.d.ts +2 -0
- package/dist/utils/sanitize-name.d.ts.map +1 -0
- package/dist/utils/shell-escape.d.ts +5 -0
- package/dist/utils/shell-escape.d.ts.map +1 -0
- package/dist/utils/signal-handlers.d.ts +14 -0
- package/dist/utils/signal-handlers.d.ts.map +1 -0
- package/dist/utils/timing.d.ts +24 -0
- package/dist/utils/timing.d.ts.map +1 -0
- package/dist/utils/worktree-list-parser.d.ts +10 -0
- package/dist/utils/worktree-list-parser.d.ts.map +1 -0
- package/package.json +5 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const CLI_COMMANDS: {
|
|
2
|
+
readonly RUN: "run";
|
|
3
|
+
readonly INIT: "init";
|
|
4
|
+
readonly LIST: "list";
|
|
5
|
+
};
|
|
6
|
+
export type CliCommand = (typeof CLI_COMMANDS)[keyof typeof CLI_COMMANDS];
|
|
7
|
+
export type CliOptions = {
|
|
8
|
+
command: typeof CLI_COMMANDS.RUN;
|
|
9
|
+
config?: string;
|
|
10
|
+
runOnce: boolean;
|
|
11
|
+
} | {
|
|
12
|
+
command: typeof CLI_COMMANDS.INIT;
|
|
13
|
+
config?: string;
|
|
14
|
+
force: boolean;
|
|
15
|
+
} | {
|
|
16
|
+
command: typeof CLI_COMMANDS.LIST;
|
|
17
|
+
config?: string;
|
|
18
|
+
filter?: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function parseArguments(argv?: string[]): CliOptions;
|
|
21
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/utils/cli.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE1E,MAAM,MAAM,UAAU,GAClB;IAAE,OAAO,EAAE,OAAO,YAAY,CAAC,GAAG,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GACvE;IAAE,OAAO,EAAE,OAAO,YAAY,CAAC,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACtE;IAAE,OAAO,EAAE,OAAO,YAAY,CAAC,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5E,wBAAgB,cAAc,CAAC,IAAI,GAAE,MAAM,EAA0B,GAAG,UAAU,CAuFjF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clone-skip-format.d.ts","sourceRoot":"","sources":["../../src/utils/clone-skip-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CA6BrE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConfigFileExistsError } from "../errors";
|
|
2
|
+
import type { InitConfigInput } from "../types";
|
|
3
|
+
export { ConfigFileExistsError };
|
|
4
|
+
export interface GenerateConfigFileOptions {
|
|
5
|
+
overwrite?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function generateConfigFile(input: InitConfigInput, configPath: string, options?: GenerateConfigFileOptions): Promise<void>;
|
|
8
|
+
export declare function getDefaultConfigPath(): string;
|
|
9
|
+
export declare function findConfigInCwd(cwd?: string): Promise<string | null>;
|
|
10
|
+
//# sourceMappingURL=config-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-generator.d.ts","sourceRoot":"","sources":["../../src/utils/config-generator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAKlD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAwCjC,MAAM,WAAW,yBAAyB;IACxC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,eAAe,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,IAAI,CAAC,CAyDf;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,wBAAsB,eAAe,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQzF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function parseDuration(durationStr: string): number | null;
|
|
2
|
+
export declare function filterBranchesByAge(branches: {
|
|
3
|
+
branch: string;
|
|
4
|
+
lastActivity: Date;
|
|
5
|
+
}[], maxAge: string): {
|
|
6
|
+
branch: string;
|
|
7
|
+
lastActivity: Date;
|
|
8
|
+
}[];
|
|
9
|
+
export declare function formatDuration(durationStr: string): string;
|
|
10
|
+
//# sourceMappingURL=date-filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-filter.d.ts","sourceRoot":"","sources":["../../src/utils/date-filter.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAkBhE;AAED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,IAAI,CAAA;CAAE,EAAE,EAClD,MAAM,EAAE,MAAM,GACb;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,IAAI,CAAA;CAAE,EAAE,CAU1C;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAkB1D"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculates the total size of a directory in bytes using native OS utilities.
|
|
3
|
+
* Uses the `du` command on Unix systems for optimal performance (10-100x faster than pure Node.js).
|
|
4
|
+
* @param dirPath - The path to the directory
|
|
5
|
+
* @returns The total size in bytes
|
|
6
|
+
*/
|
|
7
|
+
export declare function calculateDirectorySize(dirPath: string): Promise<number>;
|
|
8
|
+
/**
|
|
9
|
+
* Formats bytes into a human-readable string.
|
|
10
|
+
* @param bytes - The number of bytes
|
|
11
|
+
* @returns Formatted string (e.g., "1.2 GB", "345 MB", "12 KB")
|
|
12
|
+
*/
|
|
13
|
+
export declare function formatBytes(bytes: number): string;
|
|
14
|
+
/**
|
|
15
|
+
* Calculates the total disk space used by sync-worktrees repositories.
|
|
16
|
+
* This includes bare repository directories and all worktree directories.
|
|
17
|
+
*
|
|
18
|
+
* @param repoPaths - Array of bare repository directory paths (e.g., from config.bareRepoDir)
|
|
19
|
+
* @param worktreeDirs - Array of worktree base directories
|
|
20
|
+
* @returns Formatted disk space string (e.g., "1.2 GB") or "N/A" if calculation fails
|
|
21
|
+
*/
|
|
22
|
+
export declare function calculateSyncDiskSpace(repoPaths: string[], worktreeDirs: string[]): Promise<string>;
|
|
23
|
+
//# sourceMappingURL=disk-space.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disk-space.d.ts","sourceRoot":"","sources":["../../src/utils/disk-space.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAc7E;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAWjD;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAyBzG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-exists.d.ts","sourceRoot":"","sources":["../../src/utils/file-exists.ts"],"names":[],"mappings":"AAEA,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO/D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Logger } from "../services/logger.service";
|
|
2
|
+
import type { SimpleGitProgressEvent } from "simple-git";
|
|
3
|
+
export interface GitProgressEvent {
|
|
4
|
+
phase: string;
|
|
5
|
+
message: string;
|
|
6
|
+
progress?: number;
|
|
7
|
+
processed?: number;
|
|
8
|
+
total?: number;
|
|
9
|
+
}
|
|
10
|
+
export type GitProgressEmitter = (event: GitProgressEvent) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Build a progress callback for simple-git's `progress` option that:
|
|
13
|
+
* - filters to clone/fetch/pull events only,
|
|
14
|
+
* - emits at most one progress event per (method,stage) bucket of PROGRESS_BUCKET_PERCENT,
|
|
15
|
+
* - always emits the 100% completion event,
|
|
16
|
+
* - detects stage restarts (bucket regression on the same cached SimpleGit
|
|
17
|
+
* instance, e.g. a second fetch) and resets the bucket so the new run
|
|
18
|
+
* emits from scratch.
|
|
19
|
+
*
|
|
20
|
+
* State (the bucket map) is closure-local — pass one handler per SimpleGit
|
|
21
|
+
* client. Keep progress logs at debug level so normal logs can stay readable
|
|
22
|
+
* while interactive surfaces and MCP notifications consume structured events.
|
|
23
|
+
*/
|
|
24
|
+
export declare function makeGitProgressHandler(logger: Logger, emitProgress?: GitProgressEmitter): (event: SimpleGitProgressEvent) => void;
|
|
25
|
+
//# sourceMappingURL=git-progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-progress.d.ts","sourceRoot":"","sources":["../../src/utils/git-progress.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAEnE;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,YAAY,CAAC,EAAE,kBAAkB,GAChC,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,CAqBzC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts the repository name from a Git URL
|
|
3
|
+
* @param gitUrl - The Git URL (HTTPS or SSH format)
|
|
4
|
+
* @returns The repository name without .git extension
|
|
5
|
+
* @throws Error if the URL format is invalid
|
|
6
|
+
*/
|
|
7
|
+
export declare function extractRepoNameFromUrl(gitUrl: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Generates the default bare repository directory path
|
|
10
|
+
* @param repoUrl - The Git repository URL
|
|
11
|
+
* @param baseDir - The base directory for bare repos (default: .bare)
|
|
12
|
+
* @returns The path to the bare repository
|
|
13
|
+
*/
|
|
14
|
+
export declare function getDefaultBareRepoDir(repoUrl: string, baseDir?: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Normalizes a Git remote URL for equivalence comparison only: trims, lowercases
|
|
17
|
+
* a leading `scheme://host`, and strips a trailing slash and a single trailing
|
|
18
|
+
* `.git`. Intentionally does NOT equate scp-style (git@host:path) with https://
|
|
19
|
+
* forms — those are left distinct. Use only to decide whether two URLs point at
|
|
20
|
+
* the same remote, never as a canonical URL for git operations.
|
|
21
|
+
*/
|
|
22
|
+
export declare function normalizeRepoUrlForComparison(url: string): string;
|
|
23
|
+
//# sourceMappingURL=git-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-url.d.ts","sourceRoot":"","sources":["../../src/utils/git-url.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CA6B7D;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,MAAgB,GAAG,MAAM,CAGxF;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAajE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-validation.d.ts","sourceRoot":"","sources":["../../src/utils/git-validation.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CA+CrF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactive.d.ts","sourceRoot":"","sources":["../../src/utils/interactive.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,eAAe,CAAC,CA8FpE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts error message from unknown error type
|
|
3
|
+
* @param error The error to extract message from
|
|
4
|
+
* @returns The error message string
|
|
5
|
+
*/
|
|
6
|
+
export declare function getErrorMessage(error: unknown): string;
|
|
7
|
+
/**
|
|
8
|
+
* Common LFS error patterns that indicate Git LFS-related failures
|
|
9
|
+
*/
|
|
10
|
+
export declare const LFS_ERROR_PATTERNS: readonly ["smudge filter lfs failed", "Object does not exist on the server", "external filter 'git-lfs filter-process' failed"];
|
|
11
|
+
/**
|
|
12
|
+
* Checks if an error message contains any known LFS error patterns
|
|
13
|
+
* @param errorMessage The error message to check
|
|
14
|
+
* @returns true if the error is related to Git LFS
|
|
15
|
+
*/
|
|
16
|
+
export declare function isLfsError(errorMessage: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Checks if an error object contains any known LFS error patterns
|
|
19
|
+
* @param error The error object to check
|
|
20
|
+
* @returns true if the error is related to Git LFS
|
|
21
|
+
*/
|
|
22
|
+
export declare function isLfsErrorFromError(error: unknown): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* git stderr fragments that indicate the requested remote ref does not exist
|
|
25
|
+
* (e.g. the tracked branch was deleted on the remote). Matched as substrings;
|
|
26
|
+
* callers force LC_ALL=C so these stay deterministic English.
|
|
27
|
+
*/
|
|
28
|
+
export declare const MISSING_REMOTE_REF_PATTERNS: readonly ["couldn't find remote ref", "Couldn't find remote ref", "not our ref"];
|
|
29
|
+
/**
|
|
30
|
+
* Checks if an error message indicates a missing remote ref.
|
|
31
|
+
* @param errorMessage The error message to check
|
|
32
|
+
* @returns true if the message indicates the remote ref is gone
|
|
33
|
+
*/
|
|
34
|
+
export declare function isMissingRemoteRefError(errorMessage: string): boolean;
|
|
35
|
+
//# sourceMappingURL=lfs-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lfs-error.d.ts","sourceRoot":"","sources":["../../src/utils/lfs-error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAQtD;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,iIAIpB,CAAC;AAEZ;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE3D;AAED;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,kFAI7B,CAAC;AAEZ;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAErE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Config } from "../types";
|
|
2
|
+
export interface RepoLockTarget {
|
|
3
|
+
/** Absolute path to the directory that should contain the lock file. */
|
|
4
|
+
dir: string;
|
|
5
|
+
/** Lock filename (created lazily by proper-lockfile). */
|
|
6
|
+
file: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function getCloneModeLockTarget(config: Config): RepoLockTarget;
|
|
9
|
+
//# sourceMappingURL=lock-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock-path.d.ts","sourceRoot":"","sources":["../../src/utils/lock-path.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAC;AAEzD,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,GAAG,EAAE,MAAM,CAAC;IACZ,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAmBrE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare function isCaseInsensitiveFs(platform?: NodeJS.Platform): boolean;
|
|
2
|
+
/**
|
|
3
|
+
* Normalizes a path for equality comparison.
|
|
4
|
+
*
|
|
5
|
+
* The `platform` argument is a case-sensitivity hint only: it controls whether
|
|
6
|
+
* the resolved path is lower-cased before comparison.
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizePathForCompare(p: string, platform?: NodeJS.Platform): string;
|
|
9
|
+
/**
|
|
10
|
+
* Compares two paths for equality after host-path resolution and platform-aware case folding.
|
|
11
|
+
*
|
|
12
|
+
* The `platform` argument is a case-sensitivity hint only. See
|
|
13
|
+
* {@link normalizePathForCompare} for the caveats about path.resolve semantics.
|
|
14
|
+
*/
|
|
15
|
+
export declare function pathsEqual(a: string, b: string, platform?: NodeJS.Platform): boolean;
|
|
16
|
+
//# sourceMappingURL=path-compare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-compare.d.ts","sourceRoot":"","sources":["../../src/utils/path-compare.ts"],"names":[],"mappings":"AAOA,wBAAgB,mBAAmB,CAAC,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,OAAO,CAEzF;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,MAAM,CAGvG;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,OAAO,CAEtG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Config, RepositoryMode } from "../types";
|
|
2
|
+
export declare const REPOSITORY_MODES: {
|
|
3
|
+
readonly CLONE: "clone";
|
|
4
|
+
readonly WORKTREE: "worktree";
|
|
5
|
+
};
|
|
6
|
+
export declare function isRepositoryMode(value: unknown): value is RepositoryMode;
|
|
7
|
+
export declare function resolveMode(cfg: Pick<Config, "mode">): RepositoryMode;
|
|
8
|
+
//# sourceMappingURL=repo-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo-mode.d.ts","sourceRoot":"","sources":["../../src/utils/repo-mode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEvD,eAAO,MAAM,gBAAgB;;;CAGsB,CAAC;AAEpD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,cAAc,CAErE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface LfsErrorContext {
|
|
2
|
+
isLfsError: boolean;
|
|
3
|
+
}
|
|
4
|
+
export interface RetryOptions {
|
|
5
|
+
maxAttempts?: number | "unlimited";
|
|
6
|
+
maxLfsRetries?: number;
|
|
7
|
+
initialDelayMs?: number;
|
|
8
|
+
maxDelayMs?: number;
|
|
9
|
+
backoffMultiplier?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Add random jitter to retry delays to prevent thundering herd problem
|
|
12
|
+
* in concurrent operations. Jitter is a random value between 0 and jitterMs
|
|
13
|
+
* added to the calculated delay.
|
|
14
|
+
*
|
|
15
|
+
* Recommended for parallel operations to spread out retries.
|
|
16
|
+
* Default: 0 (no jitter)
|
|
17
|
+
*/
|
|
18
|
+
jitterMs?: number;
|
|
19
|
+
shouldRetry?: (error: unknown, context?: LfsErrorContext) => boolean;
|
|
20
|
+
onRetry?: (error: unknown, attempt: number, context?: LfsErrorContext) => void;
|
|
21
|
+
lfsRetryHandler?: (context: LfsErrorContext) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare function retry<T>(fn: () => Promise<T>, options?: RetryOptions): Promise<T>;
|
|
24
|
+
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/utils/retry.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,KAAK,OAAO,CAAC;IACrE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,KAAK,IAAI,CAAC;IAC/E,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;CACtD;AA0CD,wBAAsB,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,CAAC,CAAC,CAwD3F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sanitize-name.d.ts","sourceRoot":"","sources":["../../src/utils/sanitize-name.ts"],"names":[],"mappings":"AAMA,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,SAAS,GAAG,MAAM,CAoB/E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-escape.d.ts","sourceRoot":"","sources":["../../src/utils/shell-escape.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type CleanupFn = (fast: boolean) => void | Promise<void>;
|
|
2
|
+
export interface SignalHandlerOptions {
|
|
3
|
+
forceExitMs?: number;
|
|
4
|
+
log?: (message: string) => void;
|
|
5
|
+
exit?: (code: number) => void;
|
|
6
|
+
process?: NodeJS.EventEmitter;
|
|
7
|
+
}
|
|
8
|
+
export interface SignalHandlerHandle {
|
|
9
|
+
register: (fn: CleanupFn) => void;
|
|
10
|
+
dispose: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const DEFAULT_FORCE_EXIT_MS = 3000;
|
|
13
|
+
export declare function setupSignalHandlers(options?: SignalHandlerOptions): SignalHandlerHandle;
|
|
14
|
+
//# sourceMappingURL=signal-handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signal-handlers.d.ts","sourceRoot":"","sources":["../../src/utils/signal-handlers.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEhE,MAAM,WAAW,oBAAoB;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;CAC/B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,CAAC,EAAE,EAAE,SAAS,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,oBAAyB,GAAG,mBAAmB,CA+C3F"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface TimingResult {
|
|
2
|
+
name: string;
|
|
3
|
+
duration: number;
|
|
4
|
+
count?: number;
|
|
5
|
+
efficiency?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class Timer {
|
|
8
|
+
private startTime;
|
|
9
|
+
private endTime?;
|
|
10
|
+
constructor();
|
|
11
|
+
stop(): number;
|
|
12
|
+
getDuration(): number;
|
|
13
|
+
}
|
|
14
|
+
export declare class PhaseTimer {
|
|
15
|
+
private phases;
|
|
16
|
+
private currentPhase?;
|
|
17
|
+
startPhase(name: string, parallelism?: number): void;
|
|
18
|
+
endPhase(): void;
|
|
19
|
+
setPhaseCount(name: string, count: number): void;
|
|
20
|
+
getResults(): TimingResult[];
|
|
21
|
+
}
|
|
22
|
+
export declare function formatDuration(ms: number): string;
|
|
23
|
+
export declare function formatTimingTable(totalDuration: number, phaseResults: TimingResult[], repoName?: string): string;
|
|
24
|
+
//# sourceMappingURL=timing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timing.d.ts","sourceRoot":"","sources":["../../src/utils/timing.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,KAAK;IAChB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAC,CAAS;;IAMzB,IAAI,IAAI,MAAM;IAKd,WAAW,IAAI,MAAM;CAItB;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAkF;IAChG,OAAO,CAAC,YAAY,CAAC,CAAS;IAE9B,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI;IAQpD,QAAQ,IAAI,IAAI;IAUhB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAOhD,UAAU,IAAI,YAAY,EAAE;CA4B7B;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAUjD;AAED,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CA4BhH"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ParsedWorktree {
|
|
2
|
+
path: string;
|
|
3
|
+
branch: string | null;
|
|
4
|
+
head: string | null;
|
|
5
|
+
detached: boolean;
|
|
6
|
+
prunable: boolean;
|
|
7
|
+
locked: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function parseWorktreeListPorcelain(output: string): ParsedWorktree[];
|
|
10
|
+
//# sourceMappingURL=worktree-list-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree-list-parser.d.ts","sourceRoot":"","sources":["../../src/utils/worktree-list-parser.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,EAAE,CAwC3E"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sync-worktrees",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Automatically synchronize Git worktrees with remote branches - perfect for multi-branch development workflows",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
7
8
|
"bin": {
|
|
8
9
|
"sync-worktrees": "dist/index.js",
|
|
9
10
|
"sync-worktrees-mcp": "dist/mcp-server.js"
|
|
@@ -86,13 +87,15 @@
|
|
|
86
87
|
"vitest": "^4.0.6"
|
|
87
88
|
},
|
|
88
89
|
"scripts": {
|
|
89
|
-
"build": "node esbuild.config.js",
|
|
90
|
+
"build": "node esbuild.config.js && tsc --emitDeclarationOnly",
|
|
90
91
|
"start": "node dist/index.js",
|
|
91
92
|
"watch": "tsc --watch",
|
|
92
93
|
"lint": "eslint .",
|
|
93
94
|
"lint:fix": "eslint . --fix",
|
|
94
95
|
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.spec.json",
|
|
95
96
|
"test": "vitest run",
|
|
97
|
+
"test:e2e:local": "npm run build && vitest run src/__tests__/e2e",
|
|
98
|
+
"test:e2e:network": "npm run build && RUN_NETWORK_E2E=true vitest run src/__tests__/e2e",
|
|
96
99
|
"test:watch": "vitest",
|
|
97
100
|
"test:coverage": "vitest run --coverage",
|
|
98
101
|
"test:ui": "vitest --ui",
|