@gitkraken/core-gitlens 0.1.0 → 0.3.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/CHANGELOG.md +25 -1
- package/dist/git/cache.d.ts +49 -9
- package/dist/git/cache.d.ts.map +1 -1
- package/dist/git/cache.js +174 -14
- package/dist/git/cache.js.map +1 -1
- package/dist/git/context.d.ts +11 -2
- package/dist/git/context.d.ts.map +1 -1
- package/dist/git/context.js.map +1 -1
- package/dist/git/models/branch.d.ts +1 -0
- package/dist/git/models/branch.d.ts.map +1 -1
- package/dist/git/models/branch.js.map +1 -1
- package/dist/git/models/commit.d.ts +1 -9
- package/dist/git/models/commit.d.ts.map +1 -1
- package/dist/git/models/commit.js +4 -9
- package/dist/git/models/commit.js.map +1 -1
- package/dist/git/models/graph.d.ts +2 -4
- package/dist/git/models/graph.d.ts.map +1 -1
- package/dist/git/models/reference.d.ts +31 -0
- package/dist/git/models/reference.d.ts.map +1 -1
- package/dist/git/models/remote.d.ts.map +1 -1
- package/dist/git/models/remote.js.map +1 -1
- package/dist/git/models/repository.d.ts +20 -3
- package/dist/git/models/repository.d.ts.map +1 -1
- package/dist/git/models/repository.js +42 -5
- package/dist/git/models/repository.js.map +1 -1
- package/dist/git/models/search.d.ts +2 -2
- package/dist/git/models/search.d.ts.map +1 -1
- package/dist/git/models/worktree.d.ts +4 -1
- package/dist/git/models/worktree.d.ts.map +1 -1
- package/dist/git/models/worktree.js +2 -2
- package/dist/git/models/worktree.js.map +1 -1
- package/dist/git/parsers/diffParser.d.ts +0 -1
- package/dist/git/parsers/diffParser.d.ts.map +1 -1
- package/dist/git/parsers/diffParser.js +22 -61
- package/dist/git/parsers/diffParser.js.map +1 -1
- package/dist/git/providers/branches.d.ts +18 -4
- package/dist/git/providers/branches.d.ts.map +1 -1
- package/dist/git/providers/commits.d.ts +6 -0
- package/dist/git/providers/commits.d.ts.map +1 -1
- package/dist/git/providers/config.d.ts +6 -1
- package/dist/git/providers/config.d.ts.map +1 -1
- package/dist/git/providers/diff.d.ts +2 -0
- package/dist/git/providers/diff.d.ts.map +1 -1
- package/dist/git/providers/operations.d.ts +39 -10
- package/dist/git/providers/operations.d.ts.map +1 -1
- package/dist/git/providers/pausedOperations.d.ts +3 -1
- package/dist/git/providers/pausedOperations.d.ts.map +1 -1
- package/dist/git/providers/refs.d.ts +23 -2
- package/dist/git/providers/refs.d.ts.map +1 -1
- package/dist/git/providers/revision.d.ts +1 -1
- package/dist/git/providers/revision.d.ts.map +1 -1
- package/dist/git/providers/staging.d.ts +18 -0
- package/dist/git/providers/staging.d.ts.map +1 -1
- package/dist/git/providers/status.d.ts +4 -1
- package/dist/git/providers/status.d.ts.map +1 -1
- package/dist/git/remotes/azure-devops.d.ts.map +1 -1
- package/dist/git/remotes/azure-devops.js.map +1 -1
- package/dist/git/{exec.types.d.ts → run.types.d.ts} +22 -3
- package/dist/git/run.types.d.ts.map +1 -0
- package/dist/git/run.types.js +2 -0
- package/dist/git/run.types.js.map +1 -0
- package/dist/git/service.d.ts.map +1 -1
- package/dist/git/service.js.map +1 -1
- package/dist/git/utils/autolink.utils.d.ts.map +1 -1
- package/dist/git/utils/autolink.utils.js.map +1 -1
- package/dist/git/utils/blame.utils.d.ts.map +1 -1
- package/dist/git/utils/blame.utils.js.map +1 -1
- package/dist/git/utils/conflictResolution.utils.d.ts +6 -0
- package/dist/git/utils/conflictResolution.utils.d.ts.map +1 -0
- package/dist/git/utils/conflictResolution.utils.js +25 -0
- package/dist/git/utils/conflictResolution.utils.js.map +1 -0
- package/dist/git/utils/fileStatus.utils.d.ts +2 -1
- package/dist/git/utils/fileStatus.utils.d.ts.map +1 -1
- package/dist/git/utils/fileStatus.utils.js +4 -0
- package/dist/git/utils/fileStatus.utils.js.map +1 -1
- package/dist/git/utils/search.utils.d.ts.map +1 -1
- package/dist/git/utils/search.utils.js +3 -0
- package/dist/git/utils/search.utils.js.map +1 -1
- package/dist/git/utils/sorting.d.ts +14 -0
- package/dist/git/utils/sorting.d.ts.map +1 -1
- package/dist/git/utils/sorting.js +34 -0
- package/dist/git/utils/sorting.js.map +1 -1
- package/dist/git/utils/status.utils.d.ts.map +1 -1
- package/dist/git/utils/status.utils.js.map +1 -1
- package/dist/git/watching/classifyChange.d.ts.map +1 -1
- package/dist/git/watching/classifyChange.js +8 -0
- package/dist/git/watching/classifyChange.js.map +1 -1
- package/dist/git/watching/gitIgnoreFilter.js +1 -1
- package/dist/git/watching/gitIgnoreFilter.js.map +1 -1
- package/dist/git/watching/initWatcher.d.ts.map +1 -1
- package/dist/git/watching/initWatcher.js.map +1 -1
- package/dist/git/watching/watchGroup.d.ts.map +1 -1
- package/dist/git/watching/watchGroup.js.map +1 -1
- package/dist/git/watching/watchService.d.ts.map +1 -1
- package/dist/git/watching/watchService.js +24 -4
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git/watching/watchSession.d.ts.map +1 -1
- package/dist/git/watching/watchSession.js.map +1 -1
- package/dist/git-cli/cliGitProvider.js +1 -1
- package/dist/git-cli/cliGitProvider.js.map +1 -1
- package/dist/git-cli/exec/exec.types.d.ts +1 -1
- package/dist/git-cli/exec/exec.types.d.ts.map +1 -1
- package/dist/git-cli/exec/git.d.ts +31 -6
- package/dist/git-cli/exec/git.d.ts.map +1 -1
- package/dist/git-cli/exec/git.js +70 -9
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/exec/gitQueue.d.ts +22 -6
- package/dist/git-cli/exec/gitQueue.d.ts.map +1 -1
- package/dist/git-cli/exec/gitQueue.js +88 -24
- package/dist/git-cli/exec/gitQueue.js.map +1 -1
- package/dist/git-cli/parsers/blameParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/blameParser.js.map +1 -1
- package/dist/git-cli/parsers/logParser.d.ts +1 -0
- package/dist/git-cli/parsers/logParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/logParser.js +4 -0
- package/dist/git-cli/parsers/logParser.js.map +1 -1
- package/dist/git-cli/parsers/refParser.d.ts +3 -30
- package/dist/git-cli/parsers/refParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/refParser.js +30 -30
- package/dist/git-cli/parsers/refParser.js.map +1 -1
- package/dist/git-cli/providers/blame.d.ts.map +1 -1
- package/dist/git-cli/providers/blame.js +1 -1
- package/dist/git-cli/providers/blame.js.map +1 -1
- package/dist/git-cli/providers/branches.d.ts +17 -5
- package/dist/git-cli/providers/branches.d.ts.map +1 -1
- package/dist/git-cli/providers/branches.js +245 -162
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/commits.d.ts +4 -0
- package/dist/git-cli/providers/commits.d.ts.map +1 -1
- package/dist/git-cli/providers/commits.js +120 -35
- package/dist/git-cli/providers/commits.js.map +1 -1
- package/dist/git-cli/providers/config.d.ts +11 -2
- package/dist/git-cli/providers/config.d.ts.map +1 -1
- package/dist/git-cli/providers/config.js +36 -11
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/contributors.d.ts.map +1 -1
- package/dist/git-cli/providers/contributors.js +7 -4
- package/dist/git-cli/providers/contributors.js.map +1 -1
- package/dist/git-cli/providers/diff.d.ts +2 -0
- package/dist/git-cli/providers/diff.d.ts.map +1 -1
- package/dist/git-cli/providers/diff.js +92 -20
- package/dist/git-cli/providers/diff.js.map +1 -1
- package/dist/git-cli/providers/graph.d.ts.map +1 -1
- package/dist/git-cli/providers/graph.js +49 -28
- package/dist/git-cli/providers/graph.js.map +1 -1
- package/dist/git-cli/providers/operations.d.ts +30 -11
- package/dist/git-cli/providers/operations.d.ts.map +1 -1
- package/dist/git-cli/providers/operations.js +146 -43
- package/dist/git-cli/providers/operations.js.map +1 -1
- package/dist/git-cli/providers/patch.d.ts.map +1 -1
- package/dist/git-cli/providers/patch.js +15 -30
- package/dist/git-cli/providers/patch.js.map +1 -1
- package/dist/git-cli/providers/pausedOperations.d.ts +3 -1
- package/dist/git-cli/providers/pausedOperations.d.ts.map +1 -1
- package/dist/git-cli/providers/pausedOperations.js +13 -7
- package/dist/git-cli/providers/pausedOperations.js.map +1 -1
- package/dist/git-cli/providers/refs.d.ts +19 -2
- package/dist/git-cli/providers/refs.d.ts.map +1 -1
- package/dist/git-cli/providers/refs.js +312 -9
- package/dist/git-cli/providers/refs.js.map +1 -1
- package/dist/git-cli/providers/remotes.js +4 -4
- package/dist/git-cli/providers/remotes.js.map +1 -1
- package/dist/git-cli/providers/revision.d.ts +1 -1
- package/dist/git-cli/providers/revision.d.ts.map +1 -1
- package/dist/git-cli/providers/revision.js +15 -11
- package/dist/git-cli/providers/revision.js.map +1 -1
- package/dist/git-cli/providers/staging.d.ts +8 -0
- package/dist/git-cli/providers/staging.d.ts.map +1 -1
- package/dist/git-cli/providers/staging.js +52 -8
- package/dist/git-cli/providers/staging.js.map +1 -1
- package/dist/git-cli/providers/stash.d.ts +0 -8
- package/dist/git-cli/providers/stash.d.ts.map +1 -1
- package/dist/git-cli/providers/stash.js +63 -119
- package/dist/git-cli/providers/stash.js.map +1 -1
- package/dist/git-cli/providers/status.d.ts +4 -1
- package/dist/git-cli/providers/status.d.ts.map +1 -1
- package/dist/git-cli/providers/status.js +10 -9
- package/dist/git-cli/providers/status.js.map +1 -1
- package/dist/git-cli/providers/tags.d.ts.map +1 -1
- package/dist/git-cli/providers/tags.js +13 -9
- package/dist/git-cli/providers/tags.js.map +1 -1
- package/dist/git-cli/providers/worktrees.js +3 -3
- package/dist/git-cli/providers/worktrees.js.map +1 -1
- package/dist/ipc/discovery.d.ts +27 -0
- package/dist/ipc/discovery.d.ts.map +1 -0
- package/dist/ipc/discovery.js +38 -0
- package/dist/ipc/discovery.js.map +1 -0
- package/dist/ipc/ipcServer.d.ts +20 -0
- package/dist/ipc/ipcServer.d.ts.map +1 -0
- package/dist/ipc/ipcServer.js +162 -0
- package/dist/ipc/ipcServer.js.map +1 -0
- package/dist/plus/agents/providers/claudeCodeProvider.d.ts +114 -0
- package/dist/plus/agents/providers/claudeCodeProvider.d.ts.map +1 -0
- package/dist/plus/agents/providers/claudeCodeProvider.js +1480 -0
- package/dist/plus/agents/providers/claudeCodeProvider.js.map +1 -0
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts +36 -0
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts.map +1 -0
- package/dist/plus/agents/providers/claudeCodeTranscript.js +171 -0
- package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -0
- package/dist/plus/agents/sanitizePrompt.d.ts +15 -0
- package/dist/plus/agents/sanitizePrompt.d.ts.map +1 -0
- package/dist/plus/agents/sanitizePrompt.js +103 -0
- package/dist/plus/agents/sanitizePrompt.js.map +1 -0
- package/dist/plus/agents/stateMachine.d.ts +32 -0
- package/dist/plus/agents/stateMachine.d.ts.map +1 -0
- package/dist/plus/agents/stateMachine.js +180 -0
- package/dist/plus/agents/stateMachine.js.map +1 -0
- package/dist/plus/agents/types.d.ts +203 -0
- package/dist/plus/agents/types.d.ts.map +1 -0
- package/dist/plus/agents/types.js +49 -0
- package/dist/plus/agents/types.js.map +1 -0
- package/dist/plus/ai/constants.d.ts +2 -1
- package/dist/plus/ai/constants.d.ts.map +1 -1
- package/dist/plus/ai/constants.js +7 -0
- package/dist/plus/ai/constants.js.map +1 -1
- package/dist/plus/ai/errors.d.ts +4 -1
- package/dist/plus/ai/errors.d.ts.map +1 -1
- package/dist/plus/ai/errors.js +38 -0
- package/dist/plus/ai/errors.js.map +1 -1
- package/dist/plus/ai/models/model.d.ts +1 -1
- package/dist/plus/ai/models/model.d.ts.map +1 -1
- package/dist/plus/ai/models/model.js.map +1 -1
- package/dist/plus/ai/models/promptTemplates.d.ts +28 -2
- package/dist/plus/ai/models/promptTemplates.d.ts.map +1 -1
- package/dist/plus/ai/models/results.d.ts +28 -0
- package/dist/plus/ai/models/results.d.ts.map +1 -1
- package/dist/plus/ai/prompts.d.ts +4 -0
- package/dist/plus/ai/prompts.d.ts.map +1 -1
- package/dist/plus/ai/prompts.js +167 -1
- package/dist/plus/ai/prompts.js.map +1 -1
- package/dist/plus/ai/utils/ai.utils.d.ts.map +1 -1
- package/dist/plus/ai/utils/ai.utils.js +2 -0
- package/dist/plus/ai/utils/ai.utils.js.map +1 -1
- package/dist/plus/ai/utils/results.utils.d.ts +3 -0
- package/dist/plus/ai/utils/results.utils.d.ts.map +1 -1
- package/dist/plus/ai/utils/results.utils.js +75 -0
- package/dist/plus/ai/utils/results.utils.js.map +1 -1
- package/dist/plus/ai/utils/truncation.utils.d.ts +1 -1
- package/dist/plus/ai/utils/truncation.utils.d.ts.map +1 -1
- package/dist/plus/ai/utils/truncation.utils.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +10 -1
- package/dist/plus/git-github/api/github.d.ts.map +1 -1
- package/dist/plus/git-github/api/github.js +156 -49
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/api/types.d.ts +8 -0
- package/dist/plus/git-github/api/types.d.ts.map +1 -1
- package/dist/plus/git-github/models.d.ts +1 -1
- package/dist/plus/git-github/models.d.ts.map +1 -1
- package/dist/plus/git-github/models.js.map +1 -1
- package/dist/plus/git-github/providers/github/blame.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/blame.js.map +1 -1
- package/dist/plus/git-github/providers/github/branches.d.ts +5 -1
- package/dist/plus/git-github/providers/github/branches.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/branches.js +60 -22
- package/dist/plus/git-github/providers/github/branches.js.map +1 -1
- package/dist/plus/git-github/providers/github/commits.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/commits.js +144 -92
- package/dist/plus/git-github/providers/github/commits.js.map +1 -1
- package/dist/plus/git-github/providers/github/diff.d.ts +3 -1
- package/dist/plus/git-github/providers/github/diff.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/diff.js +23 -9
- package/dist/plus/git-github/providers/github/diff.js.map +1 -1
- package/dist/plus/git-github/providers/github/refs.d.ts +9 -1
- package/dist/plus/git-github/providers/github/refs.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/refs.js +38 -13
- package/dist/plus/git-github/providers/github/refs.js.map +1 -1
- package/dist/plus/git-github/providers/github/revision.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/revision.js +1 -2
- package/dist/plus/git-github/providers/github/revision.js.map +1 -1
- package/dist/plus/git-github/providers/github/status.d.ts +4 -1
- package/dist/plus/git-github/providers/github/status.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/status.js +1 -1
- package/dist/plus/git-github/providers/github/status.js.map +1 -1
- package/dist/plus/git-github/providers/github/tags.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/tags.js +35 -36
- package/dist/plus/git-github/providers/github/tags.js.map +1 -1
- package/dist/plus/git-github/providers/githubGitProvider.d.ts.map +1 -1
- package/dist/plus/git-github/providers/githubGitProvider.js.map +1 -1
- package/dist/utils/color.d.ts.map +1 -1
- package/dist/utils/color.js.map +1 -1
- package/dist/utils/decorators/log.js +1 -1
- package/dist/utils/decorators/log.js.map +1 -1
- package/dist/utils/decorators/sequentialize.d.ts.map +1 -1
- package/dist/utils/decorators/sequentialize.js +4 -2
- package/dist/utils/decorators/sequentialize.js.map +1 -1
- package/dist/utils/decorators/serializable.d.ts.map +1 -1
- package/dist/utils/decorators/serializable.js.map +1 -1
- package/dist/utils/dedupedAsyncCache.d.ts +37 -0
- package/dist/utils/dedupedAsyncCache.d.ts.map +1 -0
- package/dist/utils/dedupedAsyncCache.js +68 -0
- package/dist/utils/dedupedAsyncCache.js.map +1 -0
- package/dist/utils/diff.d.ts +2 -0
- package/dist/utils/diff.d.ts.map +1 -0
- package/dist/utils/diff.js +53 -0
- package/dist/utils/diff.js.map +1 -0
- package/dist/utils/disposable.d.ts.map +1 -1
- package/dist/utils/disposable.js.map +1 -1
- package/dist/utils/env/node/base64.js.map +1 -1
- package/dist/utils/env/node/exec.d.ts.map +1 -1
- package/dist/utils/env/node/exec.js.map +1 -1
- package/dist/utils/error.d.ts.map +1 -1
- package/dist/utils/error.js.map +1 -1
- package/dist/utils/formatter.d.ts.map +1 -1
- package/dist/utils/formatter.js +4 -10
- package/dist/utils/formatter.js.map +1 -1
- package/dist/utils/iterable.d.ts.map +1 -1
- package/dist/utils/iterable.js.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/lruMap.d.ts +49 -0
- package/dist/utils/lruMap.d.ts.map +1 -0
- package/dist/utils/lruMap.js +103 -0
- package/dist/utils/lruMap.js.map +1 -0
- package/dist/utils/markdown.d.ts.map +1 -1
- package/dist/utils/markdown.js.map +1 -1
- package/dist/utils/mru.d.ts.map +1 -1
- package/dist/utils/mru.js.map +1 -1
- package/dist/utils/path.d.ts.map +1 -1
- package/dist/utils/path.js.map +1 -1
- package/dist/utils/promise.d.ts +1 -0
- package/dist/utils/promise.d.ts.map +1 -1
- package/dist/utils/promise.js +17 -0
- package/dist/utils/promise.js.map +1 -1
- package/dist/utils/promiseCache.d.ts +10 -0
- package/dist/utils/promiseCache.d.ts.map +1 -1
- package/dist/utils/promiseCache.js +22 -0
- package/dist/utils/promiseCache.js.map +1 -1
- package/dist/utils/string.d.ts.map +1 -1
- package/dist/utils/string.js.map +1 -1
- package/dist/utils/uri.d.ts.map +1 -1
- package/dist/utils/uri.js.map +1 -1
- package/dist/utils/version.d.ts +14 -0
- package/dist/utils/version.d.ts.map +1 -1
- package/dist/utils/version.js +48 -0
- package/dist/utils/version.js.map +1 -1
- package/package.json +13 -1
- package/src/git/cache.ts +309 -29
- package/src/git/context.ts +11 -2
- package/src/git/models/branch.ts +1 -0
- package/src/git/models/commit.ts +2 -17
- package/src/git/models/graph.ts +2 -4
- package/src/git/models/reference.ts +33 -0
- package/src/git/models/remote.ts +1 -0
- package/src/git/models/repository.ts +44 -6
- package/src/git/models/search.ts +2 -2
- package/src/git/models/worktree.ts +10 -2
- package/src/git/parsers/diffParser.ts +9 -44
- package/src/git/providers/branches.ts +25 -4
- package/src/git/providers/commits.ts +7 -0
- package/src/git/providers/config.ts +4 -0
- package/src/git/providers/diff.ts +8 -2
- package/src/git/providers/operations.ts +54 -3
- package/src/git/providers/pausedOperations.ts +1 -0
- package/src/git/providers/refs.ts +32 -3
- package/src/git/providers/revision.ts +5 -1
- package/src/git/providers/staging.ts +14 -0
- package/src/git/providers/status.ts +6 -1
- package/src/git/remotes/azure-devops.ts +2 -0
- package/src/git/{exec.types.ts → run.types.ts} +22 -2
- package/src/git/service.ts +1 -0
- package/src/git/utils/autolink.utils.ts +1 -0
- package/src/git/utils/blame.utils.ts +2 -0
- package/src/git/utils/conflictResolution.utils.ts +31 -0
- package/src/git/utils/fileStatus.utils.ts +7 -1
- package/src/git/utils/search.utils.ts +2 -0
- package/src/git/utils/sorting.ts +38 -0
- package/src/git/utils/status.utils.ts +1 -0
- package/src/git/watching/classifyChange.ts +9 -0
- package/src/git/watching/gitIgnoreFilter.ts +2 -2
- package/src/git/watching/initWatcher.ts +2 -0
- package/src/git/watching/watchGroup.ts +3 -0
- package/src/git/watching/watchService.ts +38 -5
- package/src/git/watching/watchSession.ts +10 -0
- package/src/git-cli/cliGitProvider.ts +1 -1
- package/src/git-cli/exec/exec.types.ts +2 -2
- package/src/git-cli/exec/git.ts +76 -23
- package/src/git-cli/exec/gitQueue.ts +98 -25
- package/src/git-cli/parsers/blameParser.ts +1 -0
- package/src/git-cli/parsers/logParser.ts +6 -1
- package/src/git-cli/parsers/refParser.ts +33 -34
- package/src/git-cli/providers/blame.ts +2 -1
- package/src/git-cli/providers/branches.ts +341 -196
- package/src/git-cli/providers/commits.ts +145 -46
- package/src/git-cli/providers/config.ts +50 -16
- package/src/git-cli/providers/contributors.ts +7 -12
- package/src/git-cli/providers/diff.ts +107 -20
- package/src/git-cli/providers/graph.ts +58 -29
- package/src/git-cli/providers/operations.ts +253 -57
- package/src/git-cli/providers/patch.ts +16 -37
- package/src/git-cli/providers/pausedOperations.ts +14 -6
- package/src/git-cli/providers/refs.ts +274 -11
- package/src/git-cli/providers/remotes.ts +4 -4
- package/src/git-cli/providers/revision.ts +22 -15
- package/src/git-cli/providers/staging.ts +51 -8
- package/src/git-cli/providers/stash.ts +67 -134
- package/src/git-cli/providers/status.ts +21 -10
- package/src/git-cli/providers/tags.ts +18 -19
- package/src/git-cli/providers/worktrees.ts +3 -3
- package/src/ipc/discovery.ts +56 -0
- package/src/ipc/ipcServer.ts +171 -0
- package/src/plus/agents/providers/claudeCodeProvider.ts +1782 -0
- package/src/plus/agents/providers/claudeCodeTranscript.ts +214 -0
- package/src/plus/agents/sanitizePrompt.ts +109 -0
- package/src/plus/agents/stateMachine.ts +197 -0
- package/src/plus/agents/types.ts +277 -0
- package/src/plus/ai/constants.ts +8 -0
- package/src/plus/ai/errors.ts +40 -0
- package/src/plus/ai/models/model.ts +1 -0
- package/src/plus/ai/models/promptTemplates.ts +42 -0
- package/src/plus/ai/models/results.ts +30 -0
- package/src/plus/ai/prompts.ts +171 -1
- package/src/plus/ai/utils/ai.utils.ts +2 -0
- package/src/plus/ai/utils/results.utils.ts +101 -0
- package/src/plus/ai/utils/truncation.utils.ts +3 -1
- package/src/plus/git-github/api/github.ts +199 -53
- package/src/plus/git-github/api/types.ts +15 -0
- package/src/plus/git-github/models.ts +1 -1
- package/src/plus/git-github/providers/github/blame.ts +2 -0
- package/src/plus/git-github/providers/github/branches.ts +75 -33
- package/src/plus/git-github/providers/github/commits.ts +231 -160
- package/src/plus/git-github/providers/github/diff.ts +35 -21
- package/src/plus/git-github/providers/github/refs.ts +57 -22
- package/src/plus/git-github/providers/github/revision.ts +1 -2
- package/src/plus/git-github/providers/github/status.ts +6 -1
- package/src/plus/git-github/providers/github/tags.ts +61 -62
- package/src/plus/git-github/providers/githubGitProvider.ts +1 -0
- package/src/utils/color.ts +2 -0
- package/src/utils/decorators/log.ts +1 -1
- package/src/utils/decorators/sequentialize.ts +8 -6
- package/src/utils/decorators/serializable.ts +1 -0
- package/src/utils/dedupedAsyncCache.ts +74 -0
- package/src/utils/diff.ts +61 -0
- package/src/utils/disposable.ts +2 -0
- package/src/utils/env/node/base64.ts +1 -1
- package/src/utils/env/node/exec.ts +4 -2
- package/src/utils/error.ts +1 -0
- package/src/utils/formatter.ts +4 -11
- package/src/utils/iterable.ts +4 -1
- package/src/utils/logger.ts +1 -0
- package/src/utils/lruMap.ts +112 -0
- package/src/utils/markdown.ts +1 -0
- package/src/utils/mru.ts +2 -0
- package/src/utils/path.ts +1 -0
- package/src/utils/promise.ts +22 -0
- package/src/utils/promiseCache.ts +24 -0
- package/src/utils/string.ts +2 -0
- package/src/utils/uri.ts +1 -0
- package/src/utils/version.ts +49 -0
- package/dist/git/exec.types.d.ts.map +0 -1
- package/dist/git/exec.types.js +0 -2
- package/dist/git/exec.types.js.map +0 -1
package/src/git/models/commit.ts
CHANGED
|
@@ -177,10 +177,7 @@ export class GitCommit implements GitRevisionReference {
|
|
|
177
177
|
|
|
178
178
|
const stashFiles = getSettledValue(stashFilesResult);
|
|
179
179
|
if (stashFiles?.length) {
|
|
180
|
-
commit.applyFileset({
|
|
181
|
-
files: stashFiles as readonly GitFileChange[],
|
|
182
|
-
filtered: commit.fileset?.filtered,
|
|
183
|
-
});
|
|
180
|
+
commit.applyFileset({ files: stashFiles, filtered: commit.fileset?.filtered });
|
|
184
181
|
}
|
|
185
182
|
enrichCommit(commit, { stashUntrackedFilesLoaded: true });
|
|
186
183
|
} else {
|
|
@@ -218,7 +215,6 @@ export class GitCommit implements GitRevisionReference {
|
|
|
218
215
|
readonly stashNumber: string | undefined;
|
|
219
216
|
readonly stashOnRef: string | undefined;
|
|
220
217
|
readonly tips: string[] | undefined;
|
|
221
|
-
readonly parentTimestamps?: GitStashParentInfo[] | undefined;
|
|
222
218
|
|
|
223
219
|
constructor(
|
|
224
220
|
public readonly repoPath: string,
|
|
@@ -234,13 +230,11 @@ export class GitCommit implements GitRevisionReference {
|
|
|
234
230
|
tips?: string[],
|
|
235
231
|
stashName?: string | undefined,
|
|
236
232
|
stashOnRef?: string | undefined,
|
|
237
|
-
parentTimestamps?: GitStashParentInfo[] | undefined,
|
|
238
233
|
shaLength: number = getAbbreviatedShaLength(),
|
|
239
234
|
) {
|
|
240
235
|
this.ref = sha;
|
|
241
236
|
this.shortSha = sha.substring(0, shaLength);
|
|
242
237
|
this.tips = tips;
|
|
243
|
-
this.parentTimestamps = parentTimestamps;
|
|
244
238
|
|
|
245
239
|
if (stashName) {
|
|
246
240
|
this.refType = 'stash';
|
|
@@ -457,7 +451,6 @@ export class GitCommit implements GitRevisionReference {
|
|
|
457
451
|
stats?: GitCommitStats | null;
|
|
458
452
|
stashUntrackedFilesLoaded?: boolean;
|
|
459
453
|
resolvedPreviousSha?: string;
|
|
460
|
-
parentTimestamps?: GitStashParentInfo[] | null;
|
|
461
454
|
}): T {
|
|
462
455
|
const commit = new GitCommit(
|
|
463
456
|
this.repoPath,
|
|
@@ -473,7 +466,6 @@ export class GitCommit implements GitRevisionReference {
|
|
|
473
466
|
this.tips,
|
|
474
467
|
this.stashName,
|
|
475
468
|
this.stashOnRef,
|
|
476
|
-
this.getChangedValue(changes.parentTimestamps, this.parentTimestamps),
|
|
477
469
|
this.shortSha.length,
|
|
478
470
|
);
|
|
479
471
|
commit._etagWorkingTree = this._etagWorkingTree;
|
|
@@ -522,7 +514,6 @@ export class GitCommit implements GitRevisionReference {
|
|
|
522
514
|
this.tips,
|
|
523
515
|
this.stashName,
|
|
524
516
|
this.stashOnRef,
|
|
525
|
-
this.parentTimestamps,
|
|
526
517
|
);
|
|
527
518
|
commit._etagWorkingTree = this._etagWorkingTree;
|
|
528
519
|
return commit as T;
|
|
@@ -530,6 +521,7 @@ export class GitCommit implements GitRevisionReference {
|
|
|
530
521
|
|
|
531
522
|
protected computeFileStats(): void {
|
|
532
523
|
if (!this._recomputeStats || this._fileset == null) return;
|
|
524
|
+
|
|
533
525
|
this._recomputeStats = false;
|
|
534
526
|
|
|
535
527
|
const changedFiles = { added: 0, deleted: 0, changed: 0 };
|
|
@@ -672,17 +664,10 @@ export interface GitCommitStats<Files extends number | GitDiffFileStats = number
|
|
|
672
664
|
readonly deletions: number;
|
|
673
665
|
}
|
|
674
666
|
|
|
675
|
-
export interface GitStashParentInfo {
|
|
676
|
-
readonly sha: string;
|
|
677
|
-
readonly authorDate?: number;
|
|
678
|
-
readonly committerDate?: number;
|
|
679
|
-
}
|
|
680
|
-
|
|
681
667
|
export interface GitStashCommit extends GitCommit {
|
|
682
668
|
readonly refType: GitStashReference['refType'];
|
|
683
669
|
readonly stashName: string;
|
|
684
670
|
readonly stashNumber: string;
|
|
685
|
-
readonly parentTimestamps?: GitStashParentInfo[];
|
|
686
671
|
}
|
|
687
672
|
|
|
688
673
|
export type GitCommitWithFullDetails = GitCommit & { message: string; fileset: GitCommitFileset };
|
package/src/git/models/graph.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GitCommitReachability } from '../providers/commits.js';
|
|
1
2
|
import type { GitBranch } from './branch.js';
|
|
2
3
|
import type { GitStashCommit } from './commit.js';
|
|
3
4
|
import type { GitRemote } from './remote.js';
|
|
@@ -77,7 +78,7 @@ export interface GitGraphRow {
|
|
|
77
78
|
tags?: GitGraphRowTag[];
|
|
78
79
|
contexts?: GitGraphRowContexts;
|
|
79
80
|
stats?: GitGraphRowStats;
|
|
80
|
-
|
|
81
|
+
reachability?: GitCommitReachability;
|
|
81
82
|
isCurrentUser?: boolean;
|
|
82
83
|
}
|
|
83
84
|
|
|
@@ -97,8 +98,6 @@ export interface GitGraph {
|
|
|
97
98
|
|
|
98
99
|
/** SHAs reachable from HEAD (for enrichment: marking commits on the current branch) */
|
|
99
100
|
readonly reachableFromHEAD?: ReadonlySet<string>;
|
|
100
|
-
/** Map of SHA → set of branch names reachable from that SHA (for enrichment: branch context) */
|
|
101
|
-
readonly reachableFromBranches?: ReadonlyMap<string, ReadonlySet<string>>;
|
|
102
101
|
|
|
103
102
|
/** The rows for the set of commits requested */
|
|
104
103
|
readonly rows: GitGraphRow[];
|
|
@@ -179,6 +178,5 @@ export interface GraphContext {
|
|
|
179
178
|
readonly branchIdOfMainWorktree: string | undefined;
|
|
180
179
|
readonly stashes: ReadonlyMap<string, GitStashCommit> | undefined;
|
|
181
180
|
readonly reachableFromHEAD: ReadonlySet<string>;
|
|
182
|
-
readonly reachableFromBranches: ReadonlyMap<string, ReadonlySet<string>>;
|
|
183
181
|
readonly avatars: Map<string, string>;
|
|
184
182
|
}
|
|
@@ -45,3 +45,36 @@ export interface GitTagReference {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export type GitReference = GitBranchReference | GitRevisionReference | GitStashReference | GitTagReference;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Lightweight ref-tip tuple — the minimum needed to map a SHA back to the refs that point at it.
|
|
51
|
+
* No upstream tracking, ahead/behind, annotation, etc. — use `GitBranch`/`GitTag` for those.
|
|
52
|
+
*/
|
|
53
|
+
export interface GitRefTip {
|
|
54
|
+
readonly type: 'branch' | 'remote' | 'tag';
|
|
55
|
+
/** Short name: `main`, `origin/main`, `v1.2.0` */
|
|
56
|
+
readonly name: string;
|
|
57
|
+
/** Full refname: `refs/heads/main`, `refs/remotes/origin/main`, `refs/tags/v1.2.0` */
|
|
58
|
+
readonly fullName: string;
|
|
59
|
+
/** Tip object SHA. For annotated tags, the peeled commit SHA */
|
|
60
|
+
readonly sha: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Raw parsed `git for-each-ref` record covering every field the unified format emits.
|
|
65
|
+
* Inapplicable fields come back as empty strings from git (e.g. `upstream` on a tag,
|
|
66
|
+
* `peeledObjectname` on a branch).
|
|
67
|
+
*/
|
|
68
|
+
export interface RefRecord {
|
|
69
|
+
current: string;
|
|
70
|
+
name: string;
|
|
71
|
+
objectname: string;
|
|
72
|
+
peeledObjectname: string;
|
|
73
|
+
upstream: string;
|
|
74
|
+
upstreamTracking: string;
|
|
75
|
+
committerDate: string;
|
|
76
|
+
creatorDate: string;
|
|
77
|
+
authorDate: string;
|
|
78
|
+
subject: string;
|
|
79
|
+
worktreePath?: string;
|
|
80
|
+
}
|
package/src/git/models/remote.ts
CHANGED
|
@@ -71,6 +71,7 @@ export class GitRemote<TProvider extends RemoteProvider | undefined = RemoteProv
|
|
|
71
71
|
matches(urlOrDomain: string, path?: string): boolean {
|
|
72
72
|
if (path == null) {
|
|
73
73
|
if (equalsIgnoreCase(urlOrDomain, this.url)) return true;
|
|
74
|
+
|
|
74
75
|
[, urlOrDomain, path] = parseGitRemoteUrl(urlOrDomain);
|
|
75
76
|
}
|
|
76
77
|
|
|
@@ -48,7 +48,8 @@ export type RepositoryChange =
|
|
|
48
48
|
| 'remoteProviders'
|
|
49
49
|
| 'starred'
|
|
50
50
|
| 'opened'
|
|
51
|
-
| 'gkConfig'
|
|
51
|
+
| 'gkConfig'
|
|
52
|
+
| 'lastFetched';
|
|
52
53
|
|
|
53
54
|
export const repositoryChanges = exhaustiveArray<RepositoryChange>()([
|
|
54
55
|
'unknown',
|
|
@@ -71,6 +72,7 @@ export const repositoryChanges = exhaustiveArray<RepositoryChange>()([
|
|
|
71
72
|
'starred',
|
|
72
73
|
'opened',
|
|
73
74
|
'gkConfig',
|
|
75
|
+
'lastFetched',
|
|
74
76
|
]);
|
|
75
77
|
|
|
76
78
|
export interface RepositoryInit {
|
|
@@ -123,6 +125,7 @@ export class Repository {
|
|
|
123
125
|
protected readonly _watchService: RepositoryWatchService;
|
|
124
126
|
|
|
125
127
|
private _pendingWorkingTreeChange?: RepositoryWorkingTreeChangeEvent;
|
|
128
|
+
private _pendingWorkingTreeFlush = false;
|
|
126
129
|
private _repoChangeListener: UnifiedDisposable | undefined;
|
|
127
130
|
|
|
128
131
|
constructor(init: RepositoryInit) {
|
|
@@ -355,7 +358,27 @@ export class Repository {
|
|
|
355
358
|
|
|
356
359
|
/** Called when the watch service notifies of FETCH_HEAD changes. */
|
|
357
360
|
protected onFetchHeadChanged(): void {
|
|
358
|
-
|
|
361
|
+
// Don't reset `_lastFetched` here: the FS watcher can fire even when the on-disk mtime
|
|
362
|
+
// hasn't advanced (atomic-rename / lock-file activity emits `change` events without an
|
|
363
|
+
// mtime bump), and wiping would clobber a fresher value set by `markFetched()`.
|
|
364
|
+
// `getLastFetched()` reconciles in-memory vs FS via `Math.max`. Force-fire so consumers
|
|
365
|
+
// invalidate their caches and re-read.
|
|
366
|
+
this.fireChange('lastFetched', true);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Marks the repository as having just been fetched. Use after a GitLens-initiated fetch/pull
|
|
371
|
+
* completes so the "last fetched" UI tracks the attempt even when git skipped rewriting
|
|
372
|
+
* `.git/FETCH_HEAD` (modern git omits the rewrite when all refs are up-to-date). The
|
|
373
|
+
* in-memory timestamp is reconciled with the on-disk mtime by {@link getLastFetched} via
|
|
374
|
+
* `Math.max`, so this is monotonic.
|
|
375
|
+
*/
|
|
376
|
+
markFetched(timestamp: number = Date.now()): void {
|
|
377
|
+
const next = Math.max(this._lastFetched ?? 0, timestamp);
|
|
378
|
+
if (next === this._lastFetched) return;
|
|
379
|
+
|
|
380
|
+
this._lastFetched = next;
|
|
381
|
+
this.fireChange('lastFetched', true);
|
|
359
382
|
}
|
|
360
383
|
|
|
361
384
|
/** Called when .gitignore changes in the working tree. */
|
|
@@ -374,7 +397,15 @@ export class Repository {
|
|
|
374
397
|
this._onDidChange.fire(extEvent);
|
|
375
398
|
}
|
|
376
399
|
|
|
377
|
-
/**
|
|
400
|
+
/**
|
|
401
|
+
* Called by every {@link watchWorkingTree} subscription when its debounced batch arrives. Each
|
|
402
|
+
* call to {@link watchWorkingTree} adds a separate bridge listener on the underlying watch
|
|
403
|
+
* session, so a single fs change can invoke this method multiple times in the same microtask —
|
|
404
|
+
* once per active subscription. We accumulate paths into a single pending event and defer the
|
|
405
|
+
* actual fire to a microtask so back-to-back synchronous bridge calls collapse into ONE
|
|
406
|
+
* `_onDidChangeWorkingTree` emission. Without this coalescing, every WIP-dependent listener
|
|
407
|
+
* (graph, file history, compare branch, etc.) would fire N times for N active subscriptions.
|
|
408
|
+
*/
|
|
378
409
|
protected onWorkingTreeChanged(paths: ReadonlySet<string>): void {
|
|
379
410
|
this._updatedAt = Date.now();
|
|
380
411
|
|
|
@@ -384,10 +415,17 @@ export class Repository {
|
|
|
384
415
|
}
|
|
385
416
|
|
|
386
417
|
if (this._suspended) return;
|
|
418
|
+
if (this._pendingWorkingTreeFlush) return;
|
|
387
419
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
420
|
+
this._pendingWorkingTreeFlush = true;
|
|
421
|
+
queueMicrotask(() => {
|
|
422
|
+
this._pendingWorkingTreeFlush = false;
|
|
423
|
+
const e = this._pendingWorkingTreeChange;
|
|
424
|
+
if (e == null || this._suspended) return;
|
|
425
|
+
|
|
426
|
+
this._pendingWorkingTreeChange = undefined;
|
|
427
|
+
this._onDidChangeWorkingTree.fire(e);
|
|
428
|
+
});
|
|
391
429
|
}
|
|
392
430
|
|
|
393
431
|
@trace({ onlyExit: true })
|
package/src/git/models/search.ts
CHANGED
|
@@ -96,8 +96,8 @@ export interface ParsedSearchQuery {
|
|
|
96
96
|
export interface SearchQueryFilters {
|
|
97
97
|
/** Specifies whether the search results will be filtered to specific files */
|
|
98
98
|
files: boolean;
|
|
99
|
-
/** Specifies whether the search results will be filtered to a specific type, only `stash` and `
|
|
100
|
-
type?: 'stash' | 'tip';
|
|
99
|
+
/** Specifies whether the search results will be filtered to a specific type, only `stash`, `tip`, and `wip` are supported */
|
|
100
|
+
type?: 'stash' | 'tip' | 'wip';
|
|
101
101
|
/** Specifies whether the search results will be filtered to a specific ref or ref range */
|
|
102
102
|
refs: boolean;
|
|
103
103
|
}
|
|
@@ -6,6 +6,7 @@ import { basename, normalizePath, relative } from '../../utils/path.js';
|
|
|
6
6
|
import type { Shape } from '../../utils/types.js';
|
|
7
7
|
import type { Uri } from '../../utils/uri.js';
|
|
8
8
|
import { getRepositoryService } from '../repositoryService.js';
|
|
9
|
+
import type { GitCommandPriority } from '../run.types.js';
|
|
9
10
|
import { getRepositoryOrWorktreePath } from '../utils/repository.utils.js';
|
|
10
11
|
import { shortenRevision } from '../utils/revision.utils.js';
|
|
11
12
|
import type { GitBranch } from './branch.js';
|
|
@@ -73,6 +74,7 @@ export class GitWorktree {
|
|
|
73
74
|
const relativePath = normalizePath(relative(this.workspaceFolder.uri.fsPath, this.uri.fsPath));
|
|
74
75
|
return relativePath || this.workspaceFolder.name;
|
|
75
76
|
}
|
|
77
|
+
|
|
76
78
|
const relativePath = normalizePath(relative(this.repoPath, this.uri.fsPath));
|
|
77
79
|
return relativePath || normalizePath(this.uri.fsPath);
|
|
78
80
|
}
|
|
@@ -135,10 +137,15 @@ export class GitWorktree {
|
|
|
135
137
|
: GitWorktree.formatDateFromNow(worktree);
|
|
136
138
|
}
|
|
137
139
|
|
|
138
|
-
static async getStatus(
|
|
140
|
+
static async getStatus(
|
|
141
|
+
worktree: GitWorktree,
|
|
142
|
+
options?: { priority?: GitCommandPriority },
|
|
143
|
+
cancellation?: AbortSignal,
|
|
144
|
+
): Promise<GitStatus | undefined> {
|
|
139
145
|
if (worktree.type === 'bare') return undefined;
|
|
146
|
+
|
|
140
147
|
const repo = getRepositoryService(worktree.path);
|
|
141
|
-
return repo?.status.getStatus();
|
|
148
|
+
return repo?.status.getStatus(options, cancellation);
|
|
142
149
|
}
|
|
143
150
|
|
|
144
151
|
static async hasWorkingChanges(
|
|
@@ -146,6 +153,7 @@ export class GitWorktree {
|
|
|
146
153
|
options?: { staged?: boolean; unstaged?: boolean; untracked?: boolean },
|
|
147
154
|
): Promise<boolean | undefined> {
|
|
148
155
|
if (worktree.type === 'bare') return undefined;
|
|
156
|
+
|
|
149
157
|
const repo = getRepositoryService(worktree.path);
|
|
150
158
|
return repo?.status.hasWorkingChanges(options);
|
|
151
159
|
}
|
|
@@ -364,43 +364,6 @@ export function parseGitFileDiff(data: string, includeRawContent = false): Parse
|
|
|
364
364
|
};
|
|
365
365
|
}
|
|
366
366
|
|
|
367
|
-
export function parseGitDiffNameStatusFiles(data: string, repoPath: string): GitFile[] | undefined {
|
|
368
|
-
using sw = maybeStopWatch('Git.parseDiffNameStatusFiles', { log: { onlyExit: true, level: 'debug' } });
|
|
369
|
-
if (!data) {
|
|
370
|
-
sw?.stop({ suffix: ` no data` });
|
|
371
|
-
return undefined;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
const files: GitFile[] = [];
|
|
375
|
-
|
|
376
|
-
let status;
|
|
377
|
-
|
|
378
|
-
const fields = data.split('\0');
|
|
379
|
-
for (let i = 0; i < fields.length - 1; i++) {
|
|
380
|
-
status = fields[i][0];
|
|
381
|
-
if (status === '.') {
|
|
382
|
-
status = '?';
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
let originalPath;
|
|
386
|
-
// Renamed files are old followed by the new path
|
|
387
|
-
if (status === 'R' || status === 'C') {
|
|
388
|
-
if (i + 1 >= fields.length - 1) break;
|
|
389
|
-
|
|
390
|
-
originalPath = fields[++i];
|
|
391
|
-
}
|
|
392
|
-
if (i + 1 >= fields.length) break;
|
|
393
|
-
|
|
394
|
-
const path = fields[++i];
|
|
395
|
-
|
|
396
|
-
files.push({ status: status as GitFileStatus, path: path, originalPath: originalPath, repoPath: repoPath });
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
sw?.stop({ suffix: ` parsed ${files.length} files` });
|
|
400
|
-
|
|
401
|
-
return files;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
367
|
/**
|
|
405
368
|
* Parses the output of `git diff --numstat --summary -z`.
|
|
406
369
|
*
|
|
@@ -450,6 +413,7 @@ export function parseGitDiffNumStatFiles(data: string, repoPath: string): GitFil
|
|
|
450
413
|
i++;
|
|
451
414
|
continue;
|
|
452
415
|
}
|
|
416
|
+
|
|
453
417
|
const tabIndex2 = field.indexOf('\t', tabIndex1 + 1);
|
|
454
418
|
if (tabIndex2 === -1) {
|
|
455
419
|
i++;
|
|
@@ -464,6 +428,7 @@ export function parseGitDiffNumStatFiles(data: string, repoPath: string): GitFil
|
|
|
464
428
|
if (path === '') {
|
|
465
429
|
// Rename or copy: next two fields are oldPath and newPath (summary pass distinguishes R vs C)
|
|
466
430
|
if (i + 2 >= fields.length) break;
|
|
431
|
+
|
|
467
432
|
originalPath = fields[++i];
|
|
468
433
|
path = fields[++i];
|
|
469
434
|
}
|
|
@@ -477,7 +442,7 @@ export function parseGitDiffNumStatFiles(data: string, repoPath: string): GitFil
|
|
|
477
442
|
repoPath: repoPath,
|
|
478
443
|
path: path,
|
|
479
444
|
originalPath: originalPath,
|
|
480
|
-
status:
|
|
445
|
+
status: originalPath ? 'R' : 'M',
|
|
481
446
|
stats: { additions: additions, deletions: deletions, changes: additions + deletions },
|
|
482
447
|
});
|
|
483
448
|
|
|
@@ -514,14 +479,14 @@ export function parseGitDiffNumStatFiles(data: string, repoPath: string): GitFil
|
|
|
514
479
|
if (createOrDelete != null) {
|
|
515
480
|
const file = files.get(normalizePath(createOrDeletePath));
|
|
516
481
|
if (file != null) {
|
|
517
|
-
file.status =
|
|
482
|
+
file.status = createOrDelete === 'create' ? 'A' : 'D';
|
|
518
483
|
}
|
|
519
484
|
} else if (renameOrCopy === 'copy') {
|
|
520
485
|
// Numstat defaulted to R; promote to C. Reconstruct the full new-side path by
|
|
521
486
|
// concatenating prefix + new-leaf + suffix, covering all compact and non-compact forms.
|
|
522
487
|
const file = files.get(normalizePath(renameRoot + renameNewLeaf + renameSuffix));
|
|
523
488
|
if (file != null) {
|
|
524
|
-
file.status = 'C'
|
|
489
|
+
file.status = 'C';
|
|
525
490
|
}
|
|
526
491
|
} else if (modeChangePath != null) {
|
|
527
492
|
// File-type boundary: 100xxx = regular file, 120000 = symlink, 160000 = gitlink.
|
|
@@ -529,7 +494,7 @@ export function parseGitDiffNumStatFiles(data: string, repoPath: string): GitFil
|
|
|
529
494
|
if (oldMode.substring(0, 2) !== newMode.substring(0, 2)) {
|
|
530
495
|
const file = files.get(normalizePath(modeChangePath));
|
|
531
496
|
if (file != null) {
|
|
532
|
-
file.status = 'T'
|
|
497
|
+
file.status = 'T';
|
|
533
498
|
}
|
|
534
499
|
}
|
|
535
500
|
}
|
|
@@ -564,7 +529,7 @@ export function parseGitApplyFiles(data: string, repoPath: string): GitFileChang
|
|
|
564
529
|
const [insertions, deletions, path] = line.split('\t');
|
|
565
530
|
files.set(
|
|
566
531
|
normalizePath(path),
|
|
567
|
-
new GitFileChange(repoPath, path, 'M'
|
|
532
|
+
new GitFileChange(repoPath, path, 'M', getUri(path), undefined, undefined, undefined, {
|
|
568
533
|
changes: 0,
|
|
569
534
|
additions: parseInt(insertions, 10),
|
|
570
535
|
deletions: parseInt(deletions, 10),
|
|
@@ -603,7 +568,7 @@ export function parseGitApplyFiles(data: string, repoPath: string): GitFileChang
|
|
|
603
568
|
new GitFileChange(
|
|
604
569
|
repoPath,
|
|
605
570
|
newPath,
|
|
606
|
-
|
|
571
|
+
renameOrCopy === 'copy' ? 'C' : 'R',
|
|
607
572
|
getUri(newPath),
|
|
608
573
|
originalPath,
|
|
609
574
|
getUri(originalPath),
|
|
@@ -618,7 +583,7 @@ export function parseGitApplyFiles(data: string, repoPath: string): GitFileChang
|
|
|
618
583
|
new GitFileChange(
|
|
619
584
|
repoPath,
|
|
620
585
|
file.path,
|
|
621
|
-
|
|
586
|
+
createOrDelete === 'create' ? 'A' : 'D',
|
|
622
587
|
getUri(file.path),
|
|
623
588
|
undefined,
|
|
624
589
|
undefined,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { PagedResult, PagingOptions } from '../../utils/paging.js';
|
|
2
|
+
import type { GkConfigInvalidationTarget } from '../cache.js';
|
|
2
3
|
import type { BranchDisposition, GitBranch } from '../models/branch.js';
|
|
3
4
|
import type { GitCommitStats } from '../models/commit.js';
|
|
4
5
|
import type { GitContributor } from '../models/contributor.js';
|
|
5
6
|
import type { ConflictDetectionResult } from '../models/mergeConflicts.js';
|
|
6
7
|
import type { PullRequest } from '../models/pullRequest.js';
|
|
7
8
|
import type { GitBranchReference } from '../models/reference.js';
|
|
9
|
+
import type { GitCommandPriority } from '../run.types.js';
|
|
8
10
|
import type { BranchSortOptions } from '../utils/sorting.js';
|
|
9
11
|
|
|
10
12
|
export interface BranchContributionsOverview extends GitCommitStats<number> {
|
|
@@ -12,6 +14,8 @@ export interface BranchContributionsOverview extends GitCommitStats<number> {
|
|
|
12
14
|
readonly branch: string;
|
|
13
15
|
readonly mergeTarget: string;
|
|
14
16
|
readonly mergeBase: string;
|
|
17
|
+
/** Committer date of the merge-base commit. Lets consumers (e.g. the graph minimap scope window) anchor on the same date semantics as the minimap aggregation without a separate commit fetch. */
|
|
18
|
+
readonly mergeBaseDate: Date | undefined;
|
|
15
19
|
|
|
16
20
|
readonly commits: number;
|
|
17
21
|
readonly latestCommitDate: Date | undefined;
|
|
@@ -41,7 +45,7 @@ export interface GitBranchesSubProvider {
|
|
|
41
45
|
getBranchContributionsOverview(
|
|
42
46
|
repoPath: string,
|
|
43
47
|
ref: string,
|
|
44
|
-
options?: { associatedPullRequest?: Promise<PullRequest | undefined
|
|
48
|
+
options?: { associatedPullRequest?: Promise<PullRequest | undefined>; priority?: GitCommandPriority },
|
|
45
49
|
cancellation?: AbortSignal,
|
|
46
50
|
): Promise<BranchContributionsOverview | undefined>;
|
|
47
51
|
getBranchesWithCommits(
|
|
@@ -56,6 +60,7 @@ export interface GitBranchesSubProvider {
|
|
|
56
60
|
getDefaultBranchName(
|
|
57
61
|
repoPath: string | undefined,
|
|
58
62
|
remote?: string,
|
|
63
|
+
options?: { priority?: GitCommandPriority },
|
|
59
64
|
cancellation?: AbortSignal,
|
|
60
65
|
): Promise<string | undefined>;
|
|
61
66
|
|
|
@@ -92,12 +97,18 @@ export interface GitBranchesSubProvider {
|
|
|
92
97
|
targetBranch: string,
|
|
93
98
|
cancellation?: AbortSignal,
|
|
94
99
|
): Promise<ConflictDetectionResult>;
|
|
95
|
-
getBaseBranchName?(
|
|
100
|
+
getBaseBranchName?(
|
|
101
|
+
repoPath: string,
|
|
102
|
+
ref: string,
|
|
103
|
+
options?: { priority?: GitCommandPriority },
|
|
104
|
+
cancellation?: AbortSignal,
|
|
105
|
+
): Promise<string | undefined>;
|
|
96
106
|
getStoredMergeTargetBranchName?(repoPath: string, ref: string): Promise<string | undefined>;
|
|
97
107
|
getStoredDetectedMergeTargetBranchName?(repoPath: string, ref: string): Promise<string | undefined>;
|
|
98
108
|
getStoredUserMergeTargetBranchName?(repoPath: string, ref: string): Promise<string | undefined>;
|
|
99
109
|
onCurrentBranchAccessed?(repoPath: string): Promise<void>;
|
|
100
110
|
onCurrentBranchModified?(repoPath: string): Promise<void>;
|
|
111
|
+
onCurrentBranchAgentActivity?(repoPath: string): Promise<void>;
|
|
101
112
|
renameBranch?(repoPath: string, oldName: string, newName: string): Promise<void>;
|
|
102
113
|
setUpstreamBranch?(repoPath: string, name: string, upstream: string | undefined): Promise<void>;
|
|
103
114
|
setBranchDisposition?(
|
|
@@ -105,7 +116,17 @@ export interface GitBranchesSubProvider {
|
|
|
105
116
|
branchName: string,
|
|
106
117
|
disposition: BranchDisposition | undefined,
|
|
107
118
|
): Promise<void>;
|
|
108
|
-
storeBaseBranchName?(
|
|
109
|
-
|
|
119
|
+
storeBaseBranchName?(
|
|
120
|
+
repoPath: string,
|
|
121
|
+
ref: string,
|
|
122
|
+
base: string,
|
|
123
|
+
options?: { skipInvalidation?: readonly GkConfigInvalidationTarget[] },
|
|
124
|
+
): Promise<void>;
|
|
125
|
+
storeMergeTargetBranchName?(
|
|
126
|
+
repoPath: string,
|
|
127
|
+
ref: string,
|
|
128
|
+
target: string,
|
|
129
|
+
options?: { skipInvalidation?: readonly GkConfigInvalidationTarget[] },
|
|
130
|
+
): Promise<void>;
|
|
110
131
|
storeUserMergeTargetBranchName?(repoPath: string, ref: string, target: string | undefined): Promise<void>;
|
|
111
132
|
}
|
|
@@ -68,6 +68,7 @@ export interface IncomingActivityOptions extends GitLogOptionsBase {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
export interface GitCommitReachability {
|
|
71
|
+
readonly partial?: boolean;
|
|
71
72
|
readonly refs: (
|
|
72
73
|
| { readonly refType: 'branch'; readonly name: string; readonly remote: boolean; readonly current?: boolean }
|
|
73
74
|
| { readonly refType: 'tag'; readonly name: string; readonly current?: never }
|
|
@@ -77,6 +78,12 @@ export interface GitCommitReachability {
|
|
|
77
78
|
export interface GitCommitsSubProvider {
|
|
78
79
|
getCommit(repoPath: string, rev: string, cancellation?: AbortSignal): Promise<GitCommit | undefined>;
|
|
79
80
|
getCommitCount(repoPath: string, rev: string, cancellation?: AbortSignal): Promise<number | undefined>;
|
|
81
|
+
/** Cheap author/committer date lookup for a single revision. Skips the full commit parse (no files, parents, or message) — use when only the dates are needed. Pass a full SHA so caching stays correct (commits are immutable; refs are not). */
|
|
82
|
+
getCommitDates?(
|
|
83
|
+
repoPath: string,
|
|
84
|
+
rev: string,
|
|
85
|
+
cancellation?: AbortSignal,
|
|
86
|
+
): Promise<{ authorDate: Date; committerDate: Date } | undefined>;
|
|
80
87
|
getCommitFiles(repoPath: string, rev: string, cancellation?: AbortSignal): Promise<GitFileChange[]>;
|
|
81
88
|
getCommitForFile(
|
|
82
89
|
repoPath: string,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GkConfigInvalidationTarget } from '../cache.js';
|
|
1
2
|
import type { GitDir } from '../models/repository.js';
|
|
2
3
|
import type { SigningConfig, ValidationResult } from '../models/signature.js';
|
|
3
4
|
import type { GitUser } from '../models/user.js';
|
|
@@ -36,6 +37,8 @@ export type GkConfigKeys =
|
|
|
36
37
|
| `branch.${string}.gk-last-accessed`
|
|
37
38
|
/** `gk-last-modified` — ISO 8601 timestamp of when the branch last received a commit */
|
|
38
39
|
| `branch.${string}.gk-last-modified`
|
|
40
|
+
/** `gk-agent-last-activity` — ISO 8601 timestamp of when an AI agent was last active on this branch */
|
|
41
|
+
| `branch.${string}.gk-agent-last-activity`
|
|
39
42
|
/** `gk-disposition` — user-assigned branch disposition: 'starred' or 'archived' */
|
|
40
43
|
| `branch.${string}.gk-disposition`
|
|
41
44
|
/** `gk.defaultRemote` — the user-designated default remote for the repository */
|
|
@@ -95,6 +98,7 @@ export interface GitConfigSubProvider {
|
|
|
95
98
|
repoPath: string,
|
|
96
99
|
key: GkConfigKeys | DeprecatedGkConfigKeys,
|
|
97
100
|
value: string | undefined,
|
|
101
|
+
options?: { skipInvalidation?: readonly GkConfigInvalidationTarget[] },
|
|
98
102
|
): Promise<void>;
|
|
99
103
|
|
|
100
104
|
getSigningConfig?(repoPath: string): Promise<SigningConfig>;
|
|
@@ -32,7 +32,7 @@ export interface GitDiffSubProvider {
|
|
|
32
32
|
repoPath: string,
|
|
33
33
|
to?: string,
|
|
34
34
|
from?: string,
|
|
35
|
-
options?: { uris?: (string | Uri)[] },
|
|
35
|
+
options?: { uris?: (string | Uri)[]; includeUntracked?: boolean },
|
|
36
36
|
cancellation?: AbortSignal,
|
|
37
37
|
): Promise<GitDiffShortStat | undefined>;
|
|
38
38
|
getDiff?(
|
|
@@ -70,7 +70,13 @@ export interface GitDiffSubProvider {
|
|
|
70
70
|
repoPath: string,
|
|
71
71
|
ref1OrRange: string | GitRevisionRange,
|
|
72
72
|
ref2?: string,
|
|
73
|
-
options?: {
|
|
73
|
+
options?: {
|
|
74
|
+
filters?: GitDiffFilter[];
|
|
75
|
+
includeUntracked?: boolean;
|
|
76
|
+
path?: string;
|
|
77
|
+
renameLimit?: number;
|
|
78
|
+
similarityThreshold?: number;
|
|
79
|
+
},
|
|
74
80
|
): Promise<GitFile[] | undefined>;
|
|
75
81
|
getDiffTool?(repoPath?: string): Promise<string | undefined>;
|
|
76
82
|
getNextComparisonUris(
|