@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/cache.ts
CHANGED
|
@@ -8,17 +8,15 @@ import type { PromiseOrValue } from '../utils/promise.js';
|
|
|
8
8
|
import type { CacheController } from '../utils/promiseCache.js';
|
|
9
9
|
import { PromiseCache, PromiseMap, RepoPromiseCacheMap } from '../utils/promiseCache.js';
|
|
10
10
|
import type { Uri } from '../utils/uri.js';
|
|
11
|
-
import { getCommonRepositoryPath, getRepositoryOrWorktreePath } from './utils/repository.utils.js';
|
|
12
|
-
import type { GitResult } from './exec.types.js';
|
|
13
11
|
import type { ProgressiveGitBlame } from './models/blame.js';
|
|
14
|
-
import type { GitBranch } from './models/branch.js';
|
|
15
|
-
import type { GitStashCommit } from './models/commit.js';
|
|
12
|
+
import type { BranchMetadata, GitBranch } from './models/branch.js';
|
|
13
|
+
import type { GitCommit, GitStashCommit } from './models/commit.js';
|
|
16
14
|
import type { GitContributor, GitContributorsStats } from './models/contributor.js';
|
|
17
15
|
import type { ParsedGitDiffHunks } from './models/diff.js';
|
|
18
16
|
import type { GitLog } from './models/log.js';
|
|
19
17
|
import type { ConflictDetectionResult } from './models/mergeConflicts.js';
|
|
20
18
|
import type { GitPausedOperationStatus } from './models/pausedOperationStatus.js';
|
|
21
|
-
import type { GitBranchReference } from './models/reference.js';
|
|
19
|
+
import type { GitBranchReference, GitRefTip, RefRecord } from './models/reference.js';
|
|
22
20
|
import type { GitRemote } from './models/remote.js';
|
|
23
21
|
import type { RemoteProvider } from './models/remoteProvider.js';
|
|
24
22
|
import type { GitDir, RepositoryChange } from './models/repository.js';
|
|
@@ -26,9 +24,14 @@ import type { GitStash } from './models/stash.js';
|
|
|
26
24
|
import type { GitTag } from './models/tag.js';
|
|
27
25
|
import type { GitUser } from './models/user.js';
|
|
28
26
|
import type { GitWorktree } from './models/worktree.js';
|
|
27
|
+
import type { BranchContributionsOverview, GitBranchMergedStatus } from './providers/branches.js';
|
|
29
28
|
import type { GitCommitReachability, LeftRightCommitCountResult } from './providers/commits.js';
|
|
30
29
|
import type { GitContributorsResult } from './providers/contributors.js';
|
|
31
30
|
import type { ResolvedRevision } from './providers/revision.js';
|
|
31
|
+
import type { GitResult } from './run.types.js';
|
|
32
|
+
import { getBranchId } from './utils/branch.utils.js';
|
|
33
|
+
import { createReference } from './utils/reference.utils.js';
|
|
34
|
+
import { getCommonRepositoryPath, getRepositoryOrWorktreePath } from './utils/repository.utils.js';
|
|
32
35
|
import type { GitIgnoreFilter } from './watching/gitIgnoreFilter.js';
|
|
33
36
|
|
|
34
37
|
type RepoPath = string;
|
|
@@ -49,6 +52,7 @@ export type CachedGitTypes =
|
|
|
49
52
|
| 'contributors'
|
|
50
53
|
| 'gitignore'
|
|
51
54
|
| 'gkConfig'
|
|
55
|
+
| 'lastFetched'
|
|
52
56
|
| 'providers'
|
|
53
57
|
| 'remotes'
|
|
54
58
|
| 'stashes'
|
|
@@ -59,11 +63,27 @@ export type CachedGitTypes =
|
|
|
59
63
|
|
|
60
64
|
export type ConflictDetectionCacheKey = `apply:${string}:${string}:${string}` | `merge:${string}:${string}`;
|
|
61
65
|
|
|
66
|
+
/**
|
|
67
|
+
* gkConfig keys that participate in the `branchOverviews` cache's mergeTarget/mergeBase lineage.
|
|
68
|
+
* Capture group 1 is the ref name (which may itself contain `.`/`/`).
|
|
69
|
+
*/
|
|
70
|
+
const branchOverviewGkConfigKeysRegex = /^branch\.(.+)\.(?:gk-merge-(?:base|target(?:-user)?)|gk-target-base)$/;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Downstream caches that `deleteGkConfig` may invalidate when a `branch.<ref>.gk-...` key changes.
|
|
74
|
+
* Callers performing a "self-write" (where the value being written matches what they just resolved,
|
|
75
|
+
* so the about-to-be-evicted entry is exactly the entry they want to preserve) can opt out by
|
|
76
|
+
* naming the targets to skip via `skipInvalidation`.
|
|
77
|
+
*/
|
|
78
|
+
export type GkConfigInvalidationTarget = 'branchOverviews' | 'baseBranchName';
|
|
79
|
+
|
|
62
80
|
/** Per-worktree caches — cleared by repoPath directly */
|
|
63
81
|
interface Caches {
|
|
64
82
|
bestRemotes: PromiseMap<RepoPath, GitRemote<RemoteProvider>[]> | undefined;
|
|
65
83
|
blame: RepoPromiseCacheMap<string, ProgressiveGitBlame | undefined> | undefined;
|
|
66
84
|
branch: PromiseMap<RepoPath, GitBranch | undefined> | undefined;
|
|
85
|
+
commit: RepoPromiseCacheMap<string, GitCommit | undefined> | undefined;
|
|
86
|
+
commitCount: RepoPromiseCacheMap<string, number | undefined> | undefined;
|
|
67
87
|
conflictDetection: RepoPromiseCacheMap<ConflictDetectionCacheKey, ConflictDetectionResult> | undefined;
|
|
68
88
|
currentBranchReference: PromiseCache<RepoPath, GitBranchReference | undefined> | undefined;
|
|
69
89
|
currentUser: Map<RepoPath, GitUser | null> | undefined;
|
|
@@ -73,8 +93,8 @@ interface Caches {
|
|
|
73
93
|
gitDir: Map<RepoPath, GitDir> | undefined;
|
|
74
94
|
gitIgnore: Map<RepoPath, GitIgnoreFilter> | undefined;
|
|
75
95
|
ignoreRevsFile: PromiseCache<string, boolean> | undefined;
|
|
76
|
-
lastFetched: PromiseCache<RepoPath, number | undefined> | undefined;
|
|
77
96
|
leftRightCommitCount: RepoPromiseCacheMap<string, LeftRightCommitCountResult | undefined> | undefined;
|
|
97
|
+
mergeBase: RepoPromiseCacheMap<string, string | undefined> | undefined;
|
|
78
98
|
pausedOperationStatus: PromiseMap<RepoPath, GitPausedOperationStatus | undefined> | undefined;
|
|
79
99
|
reachability: RepoPromiseCacheMap<string, GitCommitReachability | undefined> | undefined;
|
|
80
100
|
resolvedRevisions: RepoPromiseCacheMap<string, ResolvedRevision> | undefined;
|
|
@@ -83,6 +103,10 @@ interface Caches {
|
|
|
83
103
|
|
|
84
104
|
/** Shared caches — cleared via commonPath + all worktree paths */
|
|
85
105
|
interface SharedCaches {
|
|
106
|
+
baseBranchName: RepoPromiseCacheMap<string, string | undefined> | undefined;
|
|
107
|
+
branchMergedStatus: RepoPromiseCacheMap<string, GitBranchMergedStatus> | undefined;
|
|
108
|
+
branchMetadataMap: PromiseMap<RepoPath, Map<string, BranchMetadata>> | undefined;
|
|
109
|
+
branchOverviews: RepoPromiseCacheMap<string, BranchContributionsOverview | undefined> | undefined;
|
|
86
110
|
branches: PromiseMap<RepoPath, PagedResult<GitBranch>> | undefined;
|
|
87
111
|
configKeys: RepoPromiseCacheMap<string, string | undefined> | undefined;
|
|
88
112
|
configPatterns: RepoPromiseCacheMap<string, Map<string, string>> | undefined;
|
|
@@ -94,10 +118,14 @@ interface SharedCaches {
|
|
|
94
118
|
gkConfigKeys: RepoPromiseCacheMap<string, string | undefined> | undefined;
|
|
95
119
|
gkConfigPatterns: RepoPromiseCacheMap<string, Map<string, string>> | undefined;
|
|
96
120
|
initialCommitSha: PromiseMap<RepoPath, string | undefined> | undefined;
|
|
121
|
+
/** Keyed by commonPath — `FETCH_HEAD` lives in the common git dir, shared across worktrees. */
|
|
122
|
+
lastFetched: PromiseCache<RepoPath, number | undefined> | undefined;
|
|
97
123
|
logShas: RepoPromiseCacheMap<string, string[]> | undefined;
|
|
124
|
+
refs: PromiseMap<RepoPath, RefRecord[]> | undefined;
|
|
125
|
+
refTips: PromiseMap<RepoPath, GitRefTip[]> | undefined;
|
|
98
126
|
remotes: PromiseMap<RepoPath, GitRemote[]> | undefined;
|
|
99
127
|
sharedBranches: PromiseMap<RepoPath, PagedResult<GitBranch>> | undefined;
|
|
100
|
-
stashes:
|
|
128
|
+
stashes: RepoPromiseCacheMap<string, GitStash> | undefined;
|
|
101
129
|
tags: PromiseMap<RepoPath, PagedResult<GitTag>> | undefined;
|
|
102
130
|
worktrees: PromiseMap<RepoPath, GitWorktree[]> | undefined;
|
|
103
131
|
}
|
|
@@ -107,6 +135,10 @@ type AllCaches = Caches & SharedCaches;
|
|
|
107
135
|
/** Compile-time enforced: adding a key to SharedCaches without listing it here is a type error */
|
|
108
136
|
const sharedCacheKeys: ReadonlySet<keyof AllCaches> = new Set(
|
|
109
137
|
exhaustiveArray<keyof SharedCaches>()([
|
|
138
|
+
'baseBranchName',
|
|
139
|
+
'branchMergedStatus',
|
|
140
|
+
'branchMetadataMap',
|
|
141
|
+
'branchOverviews',
|
|
110
142
|
'branches',
|
|
111
143
|
'configKeys',
|
|
112
144
|
'configPatterns',
|
|
@@ -118,7 +150,10 @@ const sharedCacheKeys: ReadonlySet<keyof AllCaches> = new Set(
|
|
|
118
150
|
'gkConfigKeys',
|
|
119
151
|
'gkConfigPatterns',
|
|
120
152
|
'initialCommitSha',
|
|
153
|
+
'lastFetched',
|
|
121
154
|
'logShas',
|
|
155
|
+
'refs',
|
|
156
|
+
'refTips',
|
|
122
157
|
'remotes',
|
|
123
158
|
'sharedBranches',
|
|
124
159
|
'stashes',
|
|
@@ -129,13 +164,20 @@ const sharedCacheKeys: ReadonlySet<keyof AllCaches> = new Set(
|
|
|
129
164
|
|
|
130
165
|
function createEmptyCaches(): AllCaches {
|
|
131
166
|
return {
|
|
167
|
+
baseBranchName: undefined,
|
|
132
168
|
bestRemotes: undefined,
|
|
133
169
|
blame: undefined,
|
|
134
170
|
branch: undefined,
|
|
171
|
+
branchMergedStatus: undefined,
|
|
172
|
+
branchMetadataMap: undefined,
|
|
173
|
+
branchOverviews: undefined,
|
|
135
174
|
branches: undefined,
|
|
175
|
+
commit: undefined,
|
|
176
|
+
commitCount: undefined,
|
|
136
177
|
fileExistence: undefined,
|
|
137
178
|
ignoreRevsFile: undefined,
|
|
138
179
|
leftRightCommitCount: undefined,
|
|
180
|
+
mergeBase: undefined,
|
|
139
181
|
configKeys: undefined,
|
|
140
182
|
configPatterns: undefined,
|
|
141
183
|
conflictDetection: undefined,
|
|
@@ -158,6 +200,8 @@ function createEmptyCaches(): AllCaches {
|
|
|
158
200
|
pausedOperationStatus: undefined,
|
|
159
201
|
resolvedRevisions: undefined,
|
|
160
202
|
reachability: undefined,
|
|
203
|
+
refs: undefined,
|
|
204
|
+
refTips: undefined,
|
|
161
205
|
remotes: undefined,
|
|
162
206
|
sharedBranches: undefined,
|
|
163
207
|
stashes: undefined,
|
|
@@ -206,10 +250,33 @@ export class Cache implements Disposable {
|
|
|
206
250
|
}));
|
|
207
251
|
}
|
|
208
252
|
|
|
253
|
+
private get baseBranchName(): RepoPromiseCacheMap<string, string | undefined> {
|
|
254
|
+
return (this._caches.baseBranchName ??= new RepoPromiseCacheMap<string, string | undefined>());
|
|
255
|
+
}
|
|
256
|
+
|
|
209
257
|
get branch(): PromiseMap<RepoPath, GitBranch | undefined> {
|
|
210
258
|
return (this._caches.branch ??= new PromiseMap<RepoPath, GitBranch | undefined>());
|
|
211
259
|
}
|
|
212
260
|
|
|
261
|
+
get branchMergedStatus(): RepoPromiseCacheMap<string, GitBranchMergedStatus> {
|
|
262
|
+
return (this._caches.branchMergedStatus ??= new RepoPromiseCacheMap<string, GitBranchMergedStatus>({
|
|
263
|
+
createTTL: 1000 * 60 * 5, // 5 minutes
|
|
264
|
+
}));
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
private get branchMetadataMap(): PromiseMap<RepoPath, Map<string, BranchMetadata>> {
|
|
268
|
+
return (this._caches.branchMetadataMap ??= new PromiseMap<RepoPath, Map<string, BranchMetadata>>());
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
private get branchOverviews(): RepoPromiseCacheMap<string, BranchContributionsOverview | undefined> {
|
|
272
|
+
return (this._caches.branchOverviews ??= new RepoPromiseCacheMap<
|
|
273
|
+
string,
|
|
274
|
+
BranchContributionsOverview | undefined
|
|
275
|
+
>(
|
|
276
|
+
{ accessTTL: 1000 * 60 * 60 }, // 60 minutes
|
|
277
|
+
));
|
|
278
|
+
}
|
|
279
|
+
|
|
213
280
|
get branches(): PromiseMap<RepoPath, PagedResult<GitBranch>> {
|
|
214
281
|
return (this._caches.branches ??= new PromiseMap<RepoPath, PagedResult<GitBranch>>());
|
|
215
282
|
}
|
|
@@ -319,17 +386,25 @@ export class Cache implements Disposable {
|
|
|
319
386
|
}));
|
|
320
387
|
}
|
|
321
388
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
if (cached != null) return cached;
|
|
389
|
+
get commit(): RepoPromiseCacheMap<string, GitCommit | undefined> {
|
|
390
|
+
return (this._caches.commit ??= new RepoPromiseCacheMap<string, GitCommit | undefined>({
|
|
391
|
+
accessTTL: 1000 * 60 * 60, // 60 minutes
|
|
392
|
+
capacity: 100, // Limit to 100 commits per repo
|
|
393
|
+
}));
|
|
394
|
+
}
|
|
329
395
|
|
|
330
|
-
|
|
331
|
-
this.
|
|
332
|
-
|
|
396
|
+
get commitCount(): RepoPromiseCacheMap<string, number | undefined> {
|
|
397
|
+
return (this._caches.commitCount ??= new RepoPromiseCacheMap<string, number | undefined>({
|
|
398
|
+
accessTTL: 1000 * 60 * 60, // 60 minutes
|
|
399
|
+
capacity: 50,
|
|
400
|
+
}));
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
get mergeBase(): RepoPromiseCacheMap<string, string | undefined> {
|
|
404
|
+
return (this._caches.mergeBase ??= new RepoPromiseCacheMap<string, string | undefined>({
|
|
405
|
+
accessTTL: 1000 * 60 * 60, // 60 minutes
|
|
406
|
+
capacity: 50,
|
|
407
|
+
}));
|
|
333
408
|
}
|
|
334
409
|
|
|
335
410
|
get logShas(): RepoPromiseCacheMap<string, string[]> {
|
|
@@ -353,6 +428,14 @@ export class Cache implements Disposable {
|
|
|
353
428
|
}));
|
|
354
429
|
}
|
|
355
430
|
|
|
431
|
+
get refs(): PromiseMap<RepoPath, RefRecord[]> {
|
|
432
|
+
return (this._caches.refs ??= new PromiseMap<RepoPath, RefRecord[]>());
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
get refTips(): PromiseMap<RepoPath, GitRefTip[]> {
|
|
436
|
+
return (this._caches.refTips ??= new PromiseMap<RepoPath, GitRefTip[]>());
|
|
437
|
+
}
|
|
438
|
+
|
|
356
439
|
get reachability(): RepoPromiseCacheMap<string, GitCommitReachability | undefined> {
|
|
357
440
|
return (this._caches.reachability ??= new RepoPromiseCacheMap<string, GitCommitReachability | undefined>({
|
|
358
441
|
accessTTL: 1000 * 60 * 60, // 60 minutes
|
|
@@ -364,8 +447,10 @@ export class Cache implements Disposable {
|
|
|
364
447
|
return (this._caches.remotes ??= new PromiseMap<RepoPath, GitRemote[]>());
|
|
365
448
|
}
|
|
366
449
|
|
|
367
|
-
get stashes():
|
|
368
|
-
return (this._caches.stashes ??= new
|
|
450
|
+
get stashes(): RepoPromiseCacheMap<string, GitStash> {
|
|
451
|
+
return (this._caches.stashes ??= new RepoPromiseCacheMap<string, GitStash>({
|
|
452
|
+
accessTTL: 1000 * 60 * 60, // 60 minutes
|
|
453
|
+
}));
|
|
369
454
|
}
|
|
370
455
|
|
|
371
456
|
get tags(): PromiseMap<RepoPath, PagedResult<GitTag>> {
|
|
@@ -424,23 +509,38 @@ export class Cache implements Disposable {
|
|
|
424
509
|
keysToClear.add('fileLog');
|
|
425
510
|
}
|
|
426
511
|
|
|
427
|
-
//
|
|
512
|
+
// Branch caches affected by HEAD/heads changes — `branchMergedStatus` is shared
|
|
513
|
+
// (the answer is invariant across worktrees of the same common repo) but is invalidated
|
|
514
|
+
// here because branch-tip movement in any worktree can change the merge status; the
|
|
515
|
+
// shared-clear logic below routes shared keys via commonPath.
|
|
428
516
|
if (types.includes('branch') || types.includes('branches')) {
|
|
429
517
|
keysToClear.add('branch');
|
|
518
|
+
keysToClear.add('branchMergedStatus');
|
|
519
|
+
keysToClear.add('branchOverviews');
|
|
520
|
+
// `commit`/`commitCount` are keyed by symbolic ref or SHA — symbolic-ref entries
|
|
521
|
+
// can drift when branches move; cascade-clear conservatively.
|
|
522
|
+
keysToClear.add('commit');
|
|
523
|
+
keysToClear.add('commitCount');
|
|
430
524
|
keysToClear.add('conflictDetection');
|
|
431
525
|
keysToClear.add('currentBranchReference');
|
|
432
526
|
keysToClear.add('leftRightCommitCount');
|
|
527
|
+
// `mergeBase` keyed by ref-pairs — symbolic refs can move; cascade-clear.
|
|
528
|
+
keysToClear.add('mergeBase');
|
|
433
529
|
keysToClear.add('reachability');
|
|
434
530
|
keysToClear.add('resolvedRevisions');
|
|
435
531
|
}
|
|
436
532
|
|
|
437
533
|
// Shared branch caches (branch list, metadata)
|
|
438
534
|
if (types.includes('branches')) {
|
|
535
|
+
keysToClear.add('baseBranchName');
|
|
536
|
+
keysToClear.add('branchMetadataMap');
|
|
439
537
|
keysToClear.add('branches');
|
|
440
538
|
keysToClear.add('sharedBranches');
|
|
441
539
|
keysToClear.add('defaultBranchName');
|
|
442
540
|
keysToClear.add('initialCommitSha');
|
|
443
541
|
keysToClear.add('logShas');
|
|
542
|
+
keysToClear.add('refs');
|
|
543
|
+
keysToClear.add('refTips');
|
|
444
544
|
}
|
|
445
545
|
|
|
446
546
|
if (types.includes('config')) {
|
|
@@ -452,6 +552,7 @@ export class Cache implements Disposable {
|
|
|
452
552
|
}
|
|
453
553
|
|
|
454
554
|
if (types.includes('contributors')) {
|
|
555
|
+
keysToClear.add('branchOverviews');
|
|
455
556
|
keysToClear.add('contributors');
|
|
456
557
|
keysToClear.add('contributorsLite');
|
|
457
558
|
keysToClear.add('contributorsStats');
|
|
@@ -464,6 +565,16 @@ export class Cache implements Disposable {
|
|
|
464
565
|
if (types.includes('gkConfig')) {
|
|
465
566
|
keysToClear.add('gkConfigKeys');
|
|
466
567
|
keysToClear.add('gkConfigPatterns');
|
|
568
|
+
// Derived from `branch.<ref>.gk-merge-base`/`vscode-merge-base`; clear so external
|
|
569
|
+
// gkConfig mutations don't leave stale base-branch resolutions cached.
|
|
570
|
+
keysToClear.add('baseBranchName');
|
|
571
|
+
// Cached overviews are keyed by `${ref}|${mergeTarget}`; bulk gkConfig changes can
|
|
572
|
+
// affect any of the merge-target sources (stored, base, default), so clear all.
|
|
573
|
+
keysToClear.add('branchOverviews');
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
if (types.includes('lastFetched')) {
|
|
577
|
+
keysToClear.add('lastFetched');
|
|
467
578
|
}
|
|
468
579
|
|
|
469
580
|
if (types.includes('providers')) {
|
|
@@ -486,6 +597,8 @@ export class Cache implements Disposable {
|
|
|
486
597
|
}
|
|
487
598
|
if (types.includes('tags')) {
|
|
488
599
|
keysToClear.add('tags');
|
|
600
|
+
keysToClear.add('refs');
|
|
601
|
+
keysToClear.add('refTips');
|
|
489
602
|
}
|
|
490
603
|
|
|
491
604
|
if (types.includes('tracking')) {
|
|
@@ -522,12 +635,14 @@ export class Cache implements Disposable {
|
|
|
522
635
|
invalidate.call(cache, commonPath);
|
|
523
636
|
for (const worktreePath of this.getWorktreePaths(commonPath)) {
|
|
524
637
|
if (worktreePath === commonPath) continue;
|
|
638
|
+
|
|
525
639
|
invalidate.call(cache, worktreePath);
|
|
526
640
|
}
|
|
527
641
|
} else {
|
|
528
642
|
cache.delete(commonPath);
|
|
529
643
|
for (const worktreePath of this.getWorktreePaths(commonPath)) {
|
|
530
644
|
if (worktreePath === commonPath) continue;
|
|
645
|
+
|
|
531
646
|
cache.delete(worktreePath);
|
|
532
647
|
}
|
|
533
648
|
}
|
|
@@ -700,6 +815,10 @@ export class Cache implements Disposable {
|
|
|
700
815
|
types.add('gkConfig');
|
|
701
816
|
}
|
|
702
817
|
|
|
818
|
+
if (hasAny('lastFetched')) {
|
|
819
|
+
types.add('lastFetched');
|
|
820
|
+
}
|
|
821
|
+
|
|
703
822
|
if (hasAny('remoteProviders')) {
|
|
704
823
|
types.add('providers');
|
|
705
824
|
}
|
|
@@ -855,10 +974,72 @@ export class Cache implements Disposable {
|
|
|
855
974
|
return factoryPromise;
|
|
856
975
|
}
|
|
857
976
|
|
|
858
|
-
|
|
977
|
+
/**
|
|
978
|
+
* @param options.skipInvalidation Downstream caches the caller wants preserved despite this
|
|
979
|
+
* write. Use when the value being written is exactly what was just resolved — e.g. the Tier 2
|
|
980
|
+
* `storeMergeTargetBranchName` self-write inside `getBranchContributionsOverview` (skip
|
|
981
|
+
* `'branchOverviews'`) or the Tier 3 `storeBaseBranchName` self-write inside `getBaseBranchName`
|
|
982
|
+
* (skip both `'baseBranchName'` and `'branchOverviews'`). The upstream caches (`gkConfigKeys`,
|
|
983
|
+
* `gkConfigPatterns`) always invalidate so subsequent reads of this key see the new value.
|
|
984
|
+
*/
|
|
985
|
+
deleteGkConfig(
|
|
986
|
+
repoPath: string,
|
|
987
|
+
key: string,
|
|
988
|
+
options?: { skipInvalidation?: readonly GkConfigInvalidationTarget[] },
|
|
989
|
+
): void {
|
|
859
990
|
const cacheKey = this.getCommonPath(repoPath);
|
|
860
991
|
this._caches.gkConfigKeys?.delete(cacheKey, key);
|
|
861
992
|
this._caches.gkConfigPatterns?.delete(cacheKey);
|
|
993
|
+
|
|
994
|
+
const refMatch = key.match(branchOverviewGkConfigKeysRegex);
|
|
995
|
+
if (refMatch == null) return;
|
|
996
|
+
|
|
997
|
+
const ref = refMatch[1];
|
|
998
|
+
const skip = options?.skipInvalidation;
|
|
999
|
+
|
|
1000
|
+
// `getBaseBranchName` reads `branch.<ref>.gk-merge-base` and caches the resolved value
|
|
1001
|
+
// per-ref. A write to that key must invalidate the cached base or Tier 3 of
|
|
1002
|
+
// `getBranchContributionsOverview` will resolve `mergeTarget` against the pre-write value.
|
|
1003
|
+
if (key.endsWith('.gk-merge-base') && !skip?.includes('baseBranchName')) {
|
|
1004
|
+
this._caches.baseBranchName?.delete(cacheKey, ref);
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
if (skip?.includes('branchOverviews')) return;
|
|
1008
|
+
|
|
1009
|
+
// When the change affects a branch's merge-target/base lineage, invalidate that branch's
|
|
1010
|
+
// cached overviews so subsequent reads pick up the new stored value rather than stale data.
|
|
1011
|
+
// `getBranchContributionsOverview` keys `branchOverviews` by `${ref}|${mergeTarget}`, so
|
|
1012
|
+
// invalidate every entry for the affected ref regardless of which target it resolved to.
|
|
1013
|
+
// Uses `invalidateByKeyPrefix` (not `deleteByKeyPrefix`) so an in-flight factory is still
|
|
1014
|
+
// shared with new callers instead of triggering a duplicate fetch.
|
|
1015
|
+
this._caches.branchOverviews?.invalidateByKeyPrefix(cacheKey, `${ref}|`);
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
async getBranchOverview(
|
|
1019
|
+
repoPath: string,
|
|
1020
|
+
cacheKey: string,
|
|
1021
|
+
factory: (
|
|
1022
|
+
commonPath: string,
|
|
1023
|
+
cacheable: CacheController,
|
|
1024
|
+
cancellation?: AbortSignal,
|
|
1025
|
+
) => PromiseOrValue<BranchContributionsOverview | undefined>,
|
|
1026
|
+
options?: { accessTTL?: number; cancellation?: AbortSignal },
|
|
1027
|
+
): Promise<BranchContributionsOverview | undefined> {
|
|
1028
|
+
return this.getSharedOrCreateWithKey(
|
|
1029
|
+
this.branchOverviews,
|
|
1030
|
+
repoPath,
|
|
1031
|
+
cacheKey,
|
|
1032
|
+
factory,
|
|
1033
|
+
(data, newRepoPath) =>
|
|
1034
|
+
data == null
|
|
1035
|
+
? data
|
|
1036
|
+
: {
|
|
1037
|
+
...data,
|
|
1038
|
+
repoPath: newRepoPath,
|
|
1039
|
+
contributors: data.contributors.map(c => c.withRepoPath(newRepoPath)),
|
|
1040
|
+
},
|
|
1041
|
+
options,
|
|
1042
|
+
);
|
|
862
1043
|
}
|
|
863
1044
|
|
|
864
1045
|
async getContributors(
|
|
@@ -907,12 +1088,66 @@ export class Cache implements Disposable {
|
|
|
907
1088
|
getContributorsStats(
|
|
908
1089
|
repoPath: string,
|
|
909
1090
|
cacheKey: string,
|
|
910
|
-
factory: (commonPath: string) => PromiseOrValue<GitContributorsStats | undefined>,
|
|
911
|
-
options?: { accessTTL?: number },
|
|
1091
|
+
factory: (commonPath: string, cancellation?: AbortSignal) => PromiseOrValue<GitContributorsStats | undefined>,
|
|
1092
|
+
options?: { accessTTL?: number; cancellation?: AbortSignal },
|
|
912
1093
|
): Promise<GitContributorsStats | undefined> {
|
|
913
1094
|
return this.getSharedSimpleWithKey(this.contributorsStats, repoPath, cacheKey, factory, options);
|
|
914
1095
|
}
|
|
915
1096
|
|
|
1097
|
+
getBaseBranchName(
|
|
1098
|
+
repoPath: string,
|
|
1099
|
+
ref: string,
|
|
1100
|
+
factory: (commonPath: string, cancellation?: AbortSignal) => PromiseOrValue<string | undefined>,
|
|
1101
|
+
cancellation?: AbortSignal,
|
|
1102
|
+
): Promise<string | undefined> {
|
|
1103
|
+
return this.getSharedSimpleWithKey(this.baseBranchName, repoPath, ref, factory, {
|
|
1104
|
+
cancellation: cancellation,
|
|
1105
|
+
});
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
getBranchMergedStatus(
|
|
1109
|
+
repoPath: string,
|
|
1110
|
+
cacheKey: string,
|
|
1111
|
+
factory: (
|
|
1112
|
+
commonPath: string,
|
|
1113
|
+
cacheable: CacheController,
|
|
1114
|
+
cancellation?: AbortSignal,
|
|
1115
|
+
) => PromiseOrValue<GitBranchMergedStatus>,
|
|
1116
|
+
cancellation?: AbortSignal,
|
|
1117
|
+
): Promise<GitBranchMergedStatus> {
|
|
1118
|
+
return this.getSharedOrCreateWithKey(
|
|
1119
|
+
this.branchMergedStatus,
|
|
1120
|
+
repoPath,
|
|
1121
|
+
cacheKey,
|
|
1122
|
+
factory,
|
|
1123
|
+
(data, newRepoPath) => {
|
|
1124
|
+
if (!data.merged) return data;
|
|
1125
|
+
if (data.localBranchOnly == null) return data;
|
|
1126
|
+
|
|
1127
|
+
const lbo = data.localBranchOnly;
|
|
1128
|
+
return {
|
|
1129
|
+
...data,
|
|
1130
|
+
localBranchOnly: createReference(lbo.ref, newRepoPath, {
|
|
1131
|
+
id: getBranchId(newRepoPath, lbo.remote, lbo.name),
|
|
1132
|
+
refType: 'branch',
|
|
1133
|
+
name: lbo.name,
|
|
1134
|
+
remote: lbo.remote,
|
|
1135
|
+
upstream: lbo.upstream,
|
|
1136
|
+
sha: lbo.sha,
|
|
1137
|
+
}),
|
|
1138
|
+
};
|
|
1139
|
+
},
|
|
1140
|
+
{ cancellation: cancellation },
|
|
1141
|
+
);
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
getBranchMetadataMap(
|
|
1145
|
+
repoPath: string,
|
|
1146
|
+
factory: (commonPath: string) => PromiseOrValue<Map<string, BranchMetadata>>,
|
|
1147
|
+
): Promise<Map<string, BranchMetadata>> {
|
|
1148
|
+
return this.getSharedSimple(this.branchMetadataMap, repoPath, factory);
|
|
1149
|
+
}
|
|
1150
|
+
|
|
916
1151
|
getDefaultBranchName(
|
|
917
1152
|
repoPath: string,
|
|
918
1153
|
remote: string,
|
|
@@ -935,6 +1170,42 @@ export class Cache implements Disposable {
|
|
|
935
1170
|
return this.getSharedSimple(this.lastFetched, repoPath, factory);
|
|
936
1171
|
}
|
|
937
1172
|
|
|
1173
|
+
getRefs(
|
|
1174
|
+
repoPath: string,
|
|
1175
|
+
factory: (
|
|
1176
|
+
commonPath: string,
|
|
1177
|
+
cacheable: CacheController,
|
|
1178
|
+
cancellation?: AbortSignal,
|
|
1179
|
+
) => PromiseOrValue<RefRecord[]>,
|
|
1180
|
+
cancellation?: AbortSignal,
|
|
1181
|
+
): Promise<RefRecord[]> {
|
|
1182
|
+
// Raw ref records are repoPath-agnostic (no per-worktree binding to remap), so we key only
|
|
1183
|
+
// by commonPath and skip the per-worktree mapper that `getBranches`/`getTags` need.
|
|
1184
|
+
const commonPath = this.getCommonPath(repoPath);
|
|
1185
|
+
return this.refs.getOrCreate(
|
|
1186
|
+
commonPath,
|
|
1187
|
+
(cacheable, signal) => Promise.resolve(factory(commonPath, cacheable, signal)),
|
|
1188
|
+
cancellation,
|
|
1189
|
+
);
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
getRefTips(
|
|
1193
|
+
repoPath: string,
|
|
1194
|
+
factory: (
|
|
1195
|
+
commonPath: string,
|
|
1196
|
+
cacheable: CacheController,
|
|
1197
|
+
cancellation?: AbortSignal,
|
|
1198
|
+
) => PromiseOrValue<GitRefTip[]>,
|
|
1199
|
+
cancellation?: AbortSignal,
|
|
1200
|
+
): Promise<GitRefTip[]> {
|
|
1201
|
+
const commonPath = this.getCommonPath(repoPath);
|
|
1202
|
+
return this.refTips.getOrCreate(
|
|
1203
|
+
commonPath,
|
|
1204
|
+
(cacheable, signal) => Promise.resolve(factory(commonPath, cacheable, signal)),
|
|
1205
|
+
cancellation,
|
|
1206
|
+
);
|
|
1207
|
+
}
|
|
1208
|
+
|
|
938
1209
|
async getRemotes(
|
|
939
1210
|
repoPath: string,
|
|
940
1211
|
factory: (
|
|
@@ -955,16 +1226,18 @@ export class Cache implements Disposable {
|
|
|
955
1226
|
|
|
956
1227
|
async getStash(
|
|
957
1228
|
repoPath: string,
|
|
1229
|
+
cacheKey: string,
|
|
958
1230
|
factory: (
|
|
959
1231
|
commonPath: string,
|
|
960
1232
|
cacheable: CacheController,
|
|
961
1233
|
cancellation?: AbortSignal,
|
|
962
1234
|
) => PromiseOrValue<GitStash>,
|
|
963
|
-
cancellation?: AbortSignal,
|
|
1235
|
+
options?: { accessTTL?: number; cancellation?: AbortSignal },
|
|
964
1236
|
): Promise<GitStash> {
|
|
965
|
-
return this.
|
|
1237
|
+
return this.getSharedOrCreateWithKey(
|
|
966
1238
|
this.stashes,
|
|
967
1239
|
repoPath,
|
|
1240
|
+
cacheKey,
|
|
968
1241
|
factory,
|
|
969
1242
|
(data, newRepoPath) => ({
|
|
970
1243
|
repoPath: newRepoPath,
|
|
@@ -975,7 +1248,7 @@ export class Cache implements Disposable {
|
|
|
975
1248
|
]),
|
|
976
1249
|
),
|
|
977
1250
|
}),
|
|
978
|
-
|
|
1251
|
+
options,
|
|
979
1252
|
);
|
|
980
1253
|
}
|
|
981
1254
|
|
|
@@ -1039,6 +1312,7 @@ export class Cache implements Disposable {
|
|
|
1039
1312
|
if (cacheable.invalidated) {
|
|
1040
1313
|
for (const worktreePath of this.getWorktreePaths(commonPath)) {
|
|
1041
1314
|
if (worktreePath === commonPath) continue;
|
|
1315
|
+
|
|
1042
1316
|
cache.invalidate(worktreePath);
|
|
1043
1317
|
}
|
|
1044
1318
|
}
|
|
@@ -1095,6 +1369,7 @@ export class Cache implements Disposable {
|
|
|
1095
1369
|
if (cacheable.invalidated) {
|
|
1096
1370
|
for (const worktreePath of this.getWorktreePaths(commonPath)) {
|
|
1097
1371
|
if (worktreePath === commonPath) continue;
|
|
1372
|
+
|
|
1098
1373
|
cache.invalidate(worktreePath, cacheKey);
|
|
1099
1374
|
}
|
|
1100
1375
|
}
|
|
@@ -1142,11 +1417,16 @@ export class Cache implements Disposable {
|
|
|
1142
1417
|
cache: RepoPromiseCacheMap<string, T>,
|
|
1143
1418
|
repoPath: string,
|
|
1144
1419
|
cacheKey: string,
|
|
1145
|
-
factory: (commonPath: string) => PromiseOrValue<T>,
|
|
1146
|
-
options?: { accessTTL?: number },
|
|
1420
|
+
factory: (commonPath: string, cancellation?: AbortSignal) => PromiseOrValue<T>,
|
|
1421
|
+
options?: { accessTTL?: number; cancellation?: AbortSignal },
|
|
1147
1422
|
): Promise<T> {
|
|
1148
1423
|
const commonPath = this.getCommonPath(repoPath);
|
|
1149
1424
|
|
|
1150
|
-
return cache.getOrCreate(
|
|
1425
|
+
return cache.getOrCreate(
|
|
1426
|
+
commonPath,
|
|
1427
|
+
cacheKey,
|
|
1428
|
+
(_cacheable, signal) => Promise.resolve(factory(commonPath, signal)),
|
|
1429
|
+
options,
|
|
1430
|
+
);
|
|
1151
1431
|
}
|
|
1152
1432
|
}
|
package/src/git/context.ts
CHANGED
|
@@ -113,9 +113,18 @@ export interface GitServiceHooks {
|
|
|
113
113
|
};
|
|
114
114
|
/** Commit lifecycle hooks */
|
|
115
115
|
readonly commits?: {
|
|
116
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* Called when a commit is signed successfully.
|
|
118
|
+
*
|
|
119
|
+
* Note: currently fired only from explicit-sign paths in the patch provider
|
|
120
|
+
* (where signing is requested via `-S` and confirmed up front). Operations
|
|
121
|
+
* that sign implicitly via `commit.gpgsign=true` (`commit`, `merge`, `pull`,
|
|
122
|
+
* `rebase`, `revert`, `cherryPick`) do not fire this hook because the
|
|
123
|
+
* library cannot cheaply confirm that signing actually occurred without an
|
|
124
|
+
* extra `git config`/`log --show-signature` call.
|
|
125
|
+
*/
|
|
117
126
|
onSigned?(format: SigningFormat, source?: unknown): void;
|
|
118
|
-
/** Called when commit signing fails */
|
|
127
|
+
/** Called when commit signing fails — fired from all signing-capable paths. */
|
|
119
128
|
onSigningFailed?(reason: SigningErrorReason, format: SigningFormat, source?: unknown): void;
|
|
120
129
|
};
|
|
121
130
|
/** Git operation hooks */
|
package/src/git/models/branch.ts
CHANGED