@gitkraken/core-gitlens 0.2.0 → 0.3.1
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 +11 -1
- package/dist/git/cache.d.ts +38 -8
- package/dist/git/cache.d.ts.map +1 -1
- package/dist/git/cache.js +120 -55
- package/dist/git/cache.js.map +1 -1
- package/dist/git/context.d.ts +19 -0
- package/dist/git/context.d.ts.map +1 -1
- package/dist/git/context.js.map +1 -1
- package/dist/git/features.d.ts +1 -1
- package/dist/git/features.d.ts.map +1 -1
- package/dist/git/features.js +1 -0
- package/dist/git/features.js.map +1 -1
- package/dist/git/models/commit.d.ts.map +1 -1
- package/dist/git/models/commit.js.map +1 -1
- package/dist/git/models/graph.d.ts +96 -0
- package/dist/git/models/graph.d.ts.map +1 -1
- package/dist/git/models/graph.js +24 -1
- package/dist/git/models/graph.js.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/remoteProvider.d.ts +1 -0
- package/dist/git/models/remoteProvider.d.ts.map +1 -1
- package/dist/git/models/remoteProvider.js.map +1 -1
- package/dist/git/models/repository.d.ts +30 -13
- package/dist/git/models/repository.d.ts.map +1 -1
- package/dist/git/models/repository.js +89 -87
- 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/statusFile.d.ts +9 -0
- package/dist/git/models/statusFile.d.ts.map +1 -1
- package/dist/git/models/statusFile.js +11 -0
- package/dist/git/models/statusFile.js.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.map +1 -1
- package/dist/git/parsers/diffParser.js.map +1 -1
- package/dist/git/providers/branches.d.ts +15 -4
- package/dist/git/providers/branches.d.ts.map +1 -1
- package/dist/git/providers/commits.d.ts +4 -0
- package/dist/git/providers/commits.d.ts.map +1 -1
- package/dist/git/providers/config.d.ts +5 -4
- package/dist/git/providers/config.d.ts.map +1 -1
- package/dist/git/providers/operations.d.ts +61 -12
- 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/staging.d.ts +16 -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/remotes/custom.d.ts +2 -0
- package/dist/git/remotes/custom.d.ts.map +1 -1
- package/dist/git/remotes/custom.js +20 -0
- package/dist/git/remotes/custom.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/contributor.utils.d.ts +3 -0
- package/dist/git/utils/contributor.utils.d.ts.map +1 -1
- package/dist/git/utils/contributor.utils.js +22 -0
- package/dist/git/utils/contributor.utils.js.map +1 -1
- 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/reachability.utils.d.ts +37 -0
- package/dist/git/utils/reachability.utils.d.ts.map +1 -0
- package/dist/git/utils/reachability.utils.js +96 -0
- package/dist/git/utils/reachability.utils.js.map +1 -0
- 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 +8 -0
- package/dist/git/utils/sorting.d.ts.map +1 -1
- package/dist/git/utils/sorting.js +15 -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 +4 -2
- package/dist/git/watching/watchService.d.ts.map +1 -1
- package/dist/git/watching/watchService.js +31 -6
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git/watching/watchSession.d.ts +14 -12
- package/dist/git/watching/watchSession.d.ts.map +1 -1
- package/dist/git/watching/watchSession.js +56 -55
- package/dist/git/watching/watchSession.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 +3 -3
- package/dist/git-cli/exec/git.d.ts.map +1 -1
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/exec/gitQueue.d.ts +10 -2
- package/dist/git-cli/exec/gitQueue.d.ts.map +1 -1
- package/dist/git-cli/exec/gitQueue.js +39 -12
- 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.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.map +1 -1
- package/dist/git-cli/providers/branches.d.ts +15 -5
- package/dist/git-cli/providers/branches.d.ts.map +1 -1
- package/dist/git-cli/providers/branches.js +99 -68
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/commits.d.ts +1 -0
- package/dist/git-cli/providers/commits.d.ts.map +1 -1
- package/dist/git-cli/providers/commits.js +86 -30
- package/dist/git-cli/providers/commits.js.map +1 -1
- package/dist/git-cli/providers/config.d.ts +19 -6
- package/dist/git-cli/providers/config.d.ts.map +1 -1
- package/dist/git-cli/providers/config.js +86 -38
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/diff.d.ts.map +1 -1
- package/dist/git-cli/providers/diff.js +5 -3
- 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 +139 -16
- package/dist/git-cli/providers/graph.js.map +1 -1
- package/dist/git-cli/providers/operations.d.ts +17 -14
- package/dist/git-cli/providers/operations.d.ts.map +1 -1
- package/dist/git-cli/providers/operations.js +135 -63
- 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.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 +7 -1
- 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 +286 -2
- package/dist/git-cli/providers/refs.js.map +1 -1
- package/dist/git-cli/providers/revision.js.map +1 -1
- package/dist/git-cli/providers/staging.d.ts +6 -0
- package/dist/git-cli/providers/staging.d.ts.map +1 -1
- package/dist/git-cli/providers/staging.js +32 -0
- package/dist/git-cli/providers/staging.js.map +1 -1
- package/dist/git-cli/providers/stash.d.ts.map +1 -1
- package/dist/git-cli/providers/stash.js +20 -2
- 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 +8 -4
- 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 +10 -6
- package/dist/git-cli/providers/tags.js.map +1 -1
- package/dist/ipc/discovery.d.ts +49 -0
- package/dist/ipc/discovery.d.ts.map +1 -0
- package/dist/ipc/discovery.js +147 -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 +167 -0
- package/dist/plus/agents/providers/claudeCodeProvider.d.ts.map +1 -0
- package/dist/plus/agents/providers/claudeCodeProvider.js +1786 -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 +254 -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/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 +11 -2
- package/dist/plus/ai/models/promptTemplates.d.ts.map +1 -1
- package/dist/plus/ai/models/provider.d.ts +3 -0
- package/dist/plus/ai/models/provider.d.ts.map +1 -1
- package/dist/plus/ai/prompts.d.ts +1 -0
- package/dist/plus/ai/prompts.d.ts.map +1 -1
- package/dist/plus/ai/prompts.js +48 -8
- package/dist/plus/ai/prompts.js.map +1 -1
- package/dist/plus/ai/providers/gitkrakenProvider.d.ts +1 -1
- package/dist/plus/ai/providers/gitkrakenProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/gitkrakenProvider.js +4 -1
- package/dist/plus/ai/providers/gitkrakenProvider.js.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts +4 -3
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js +9 -6
- package/dist/plus/ai/providers/openAICompatibleProviderBase.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.map +1 -1
- package/dist/plus/ai/utils/results.utils.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +12 -1
- package/dist/plus/git-github/api/github.d.ts.map +1 -1
- package/dist/plus/git-github/api/github.js +245 -51
- 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 +47 -24
- 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 +1 -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 +39 -14
- 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/date.d.ts.map +1 -1
- package/dist/utils/date.js +6 -0
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/debounce.js +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/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/iterable.d.ts +7 -1
- package/dist/utils/iterable.d.ts.map +1 -1
- package/dist/utils/iterable.js +12 -4
- 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 +9 -0
- package/dist/utils/lruMap.d.ts.map +1 -1
- package/dist/utils/lruMap.js +26 -4
- package/dist/utils/lruMap.js.map +1 -1
- 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/object.d.ts +22 -1
- package/dist/utils/object.d.ts.map +1 -1
- package/dist/utils/object.js +56 -3
- package/dist/utils/object.js.map +1 -1
- package/dist/utils/paging.js +14 -15
- package/dist/utils/paging.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 +34 -4
- package/dist/utils/promiseCache.js.map +1 -1
- package/dist/utils/string.d.ts.map +1 -1
- package/dist/utils/string.js +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.map +1 -1
- package/dist/utils/version.js.map +1 -1
- package/package.json +13 -1
- package/src/git/cache.ts +192 -90
- package/src/git/context.ts +21 -0
- package/src/git/features.ts +2 -0
- package/src/git/models/commit.ts +1 -0
- package/src/git/models/graph.ts +97 -0
- package/src/git/models/reference.ts +33 -0
- package/src/git/models/remote.ts +1 -0
- package/src/git/models/remoteProvider.ts +1 -0
- package/src/git/models/repository.ts +105 -96
- package/src/git/models/search.ts +2 -2
- package/src/git/models/statusFile.ts +12 -0
- package/src/git/models/worktree.ts +10 -2
- package/src/git/parsers/diffParser.ts +2 -0
- package/src/git/providers/branches.ts +22 -4
- package/src/git/providers/commits.ts +4 -0
- package/src/git/providers/config.ts +3 -5
- package/src/git/providers/operations.ts +65 -1
- package/src/git/providers/pausedOperations.ts +1 -0
- package/src/git/providers/refs.ts +32 -3
- package/src/git/providers/staging.ts +12 -0
- package/src/git/providers/status.ts +6 -1
- package/src/git/remotes/azure-devops.ts +2 -0
- package/src/git/remotes/custom.ts +23 -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/contributor.utils.ts +24 -0
- package/src/git/utils/fileStatus.utils.ts +7 -1
- package/src/git/utils/reachability.utils.ts +109 -0
- package/src/git/utils/search.utils.ts +2 -0
- package/src/git/utils/sorting.ts +17 -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 +45 -7
- package/src/git/watching/watchSession.ts +71 -55
- package/src/git-cli/exec/exec.types.ts +2 -2
- package/src/git-cli/exec/git.ts +6 -5
- package/src/git-cli/exec/gitQueue.ts +41 -12
- package/src/git-cli/parsers/blameParser.ts +1 -0
- package/src/git-cli/parsers/logParser.ts +1 -0
- package/src/git-cli/parsers/refParser.ts +33 -34
- package/src/git-cli/providers/blame.ts +1 -0
- package/src/git-cli/providers/branches.ts +165 -93
- package/src/git-cli/providers/commits.ts +107 -37
- package/src/git-cli/providers/config.ts +101 -48
- package/src/git-cli/providers/diff.ts +10 -3
- package/src/git-cli/providers/graph.ts +156 -16
- package/src/git-cli/providers/operations.ts +208 -83
- package/src/git-cli/providers/patch.ts +1 -0
- package/src/git-cli/providers/pausedOperations.ts +8 -0
- package/src/git-cli/providers/refs.ts +247 -3
- package/src/git-cli/providers/revision.ts +2 -2
- package/src/git-cli/providers/staging.ts +33 -0
- package/src/git-cli/providers/stash.ts +20 -2
- package/src/git-cli/providers/status.ts +24 -5
- package/src/git-cli/providers/tags.ts +15 -16
- package/src/ipc/discovery.ts +186 -0
- package/src/ipc/ipcServer.ts +171 -0
- package/src/plus/agents/providers/claudeCodeProvider.ts +2122 -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 +325 -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 +13 -0
- package/src/plus/ai/models/provider.ts +7 -1
- package/src/plus/ai/prompts.ts +49 -8
- package/src/plus/ai/providers/gitkrakenProvider.ts +4 -0
- package/src/plus/ai/providers/openAICompatibleProviderBase.ts +21 -4
- package/src/plus/ai/utils/ai.utils.ts +2 -0
- package/src/plus/ai/utils/results.utils.ts +2 -0
- package/src/plus/git-github/api/github.ts +315 -57
- 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 +61 -31
- package/src/plus/git-github/providers/github/commits.ts +231 -160
- package/src/plus/git-github/providers/github/diff.ts +27 -19
- package/src/plus/git-github/providers/github/refs.ts +58 -23
- 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/date.ts +5 -0
- package/src/utils/debounce.ts +1 -1
- 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/exec.ts +2 -0
- package/src/utils/error.ts +1 -0
- package/src/utils/iterable.ts +17 -3
- package/src/utils/logger.ts +1 -0
- package/src/utils/lruMap.ts +29 -4
- package/src/utils/markdown.ts +1 -0
- package/src/utils/mru.ts +2 -0
- package/src/utils/object.ts +55 -4
- package/src/utils/paging.ts +14 -14
- package/src/utils/path.ts +1 -0
- package/src/utils/promise.ts +22 -0
- package/src/utils/promiseCache.ts +48 -16
- package/src/utils/string.ts +3 -1
- package/src/utils/uri.ts +1 -0
- package/src/utils/version.ts +1 -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
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { createServer } from 'http';
|
|
8
|
+
import { uuid } from '../utils/crypto.js';
|
|
9
|
+
import { debug } from '../utils/decorators/log.js';
|
|
10
|
+
import { createDisposable } from '../utils/disposable.js';
|
|
11
|
+
import { Logger } from '../utils/logger.js';
|
|
12
|
+
import { getScopedLogger } from '../utils/logger.scoped.js';
|
|
13
|
+
export async function createIpcServer() {
|
|
14
|
+
const server = createServer();
|
|
15
|
+
const token = uuid();
|
|
16
|
+
return new Promise((resolve, reject) => {
|
|
17
|
+
try {
|
|
18
|
+
server.on('error', ex => {
|
|
19
|
+
Logger.error(ex, 'IPC server error');
|
|
20
|
+
reject(ex);
|
|
21
|
+
});
|
|
22
|
+
// Let the OS assign an available port by listening on port 0
|
|
23
|
+
server.listen(0, '127.0.0.1', () => {
|
|
24
|
+
const address = server.address();
|
|
25
|
+
if (address == null || typeof address === 'string') {
|
|
26
|
+
reject(new Error('Failed to get server address'));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const port = address.port;
|
|
30
|
+
const serverUrl = `http://127.0.0.1:${port}`;
|
|
31
|
+
resolve(new IpcServer(serverUrl, port, token, server));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
catch (ex) {
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
36
|
+
reject(ex);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
export class IpcServer {
|
|
41
|
+
ipcAddress;
|
|
42
|
+
ipcPort;
|
|
43
|
+
ipcToken;
|
|
44
|
+
server;
|
|
45
|
+
handlers = new Map();
|
|
46
|
+
constructor(ipcAddress, ipcPort, ipcToken, server) {
|
|
47
|
+
this.ipcAddress = ipcAddress;
|
|
48
|
+
this.ipcPort = ipcPort;
|
|
49
|
+
this.ipcToken = ipcToken;
|
|
50
|
+
this.server = server;
|
|
51
|
+
server
|
|
52
|
+
.on('listening', () => {
|
|
53
|
+
Logger.trace(`IPC server listening on ${this.ipcAddress}`);
|
|
54
|
+
})
|
|
55
|
+
.on('request', this.onRequest.bind(this));
|
|
56
|
+
}
|
|
57
|
+
dispose() {
|
|
58
|
+
this.handlers.clear();
|
|
59
|
+
this.server.close();
|
|
60
|
+
}
|
|
61
|
+
[Symbol.dispose]() {
|
|
62
|
+
this.dispose();
|
|
63
|
+
}
|
|
64
|
+
// Awaits server close; use only when deterministic teardown is required (e.g., tests).
|
|
65
|
+
// Production callers should use dispose() — UnifiedDisposable contract is sync.
|
|
66
|
+
shutdown() {
|
|
67
|
+
this.handlers.clear();
|
|
68
|
+
return new Promise(resolve => {
|
|
69
|
+
this.server.close(() => resolve());
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
registerHandler(name, handler) {
|
|
73
|
+
const path = `/${name}`;
|
|
74
|
+
if (this.handlers.has(path)) {
|
|
75
|
+
throw new Error(`IPC handler '${name}' is already registered`);
|
|
76
|
+
}
|
|
77
|
+
this.handlers.set(path, handler);
|
|
78
|
+
return createDisposable(() => this.handlers.delete(path));
|
|
79
|
+
}
|
|
80
|
+
onRequest(req, res) {
|
|
81
|
+
const scope = getScopedLogger();
|
|
82
|
+
// Parse URL to extract pathname for routing and query parameters
|
|
83
|
+
let pathname;
|
|
84
|
+
let searchParams = new URLSearchParams();
|
|
85
|
+
try {
|
|
86
|
+
const url = new URL(req.url ?? '', this.ipcAddress);
|
|
87
|
+
pathname = url.pathname;
|
|
88
|
+
searchParams = url.searchParams;
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
pathname = req.url;
|
|
92
|
+
}
|
|
93
|
+
const handler = this.handlers.get(pathname);
|
|
94
|
+
if (handler == null) {
|
|
95
|
+
scope?.warn(`IPC handler for ${pathname} not found`);
|
|
96
|
+
res.writeHead(404);
|
|
97
|
+
res.end();
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
// Add bearer token authorization
|
|
101
|
+
const authHeader = req.headers['authorization'];
|
|
102
|
+
if (authHeader !== `Bearer ${this.ipcToken}`) {
|
|
103
|
+
Logger.warn(scope, `IPC handler for ${req.url} unauthorized`);
|
|
104
|
+
res.writeHead(401);
|
|
105
|
+
res.end();
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const maxBodySize = 10_485_760; // 10 MB
|
|
109
|
+
let bodySize = 0;
|
|
110
|
+
const chunks = [];
|
|
111
|
+
req.on('data', (d) => {
|
|
112
|
+
bodySize += d.length;
|
|
113
|
+
if (bodySize > maxBodySize) {
|
|
114
|
+
res.writeHead(413);
|
|
115
|
+
res.end();
|
|
116
|
+
req.destroy();
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
chunks.push(d);
|
|
120
|
+
});
|
|
121
|
+
req.on('end', async () => {
|
|
122
|
+
if (bodySize > maxBodySize)
|
|
123
|
+
return;
|
|
124
|
+
const body = Buffer.concat(chunks).toString('utf8');
|
|
125
|
+
let data;
|
|
126
|
+
try {
|
|
127
|
+
data = body ? JSON.parse(body) : undefined;
|
|
128
|
+
}
|
|
129
|
+
catch (ex) {
|
|
130
|
+
scope?.error(ex, 'Invalid JSON in IPC request body', { body: body });
|
|
131
|
+
res.writeHead(400);
|
|
132
|
+
res.end('Invalid JSON');
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
try {
|
|
136
|
+
const result = await handler(data, searchParams);
|
|
137
|
+
if (result == null) {
|
|
138
|
+
res.writeHead(200);
|
|
139
|
+
res.end();
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (typeof result === 'string') {
|
|
143
|
+
res.writeHead(200);
|
|
144
|
+
res.end(result);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
res.writeHead(200);
|
|
148
|
+
res.end(JSON.stringify(result));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
catch (ex) {
|
|
152
|
+
scope?.error(ex, 'IPC handler error', data);
|
|
153
|
+
res.writeHead(500);
|
|
154
|
+
res.end();
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
__decorate([
|
|
160
|
+
debug({ args: false })
|
|
161
|
+
], IpcServer.prototype, "onRequest", null);
|
|
162
|
+
//# sourceMappingURL=ipcServer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ipcServer.js","sourceRoot":"","sources":["../../src/ipc/ipcServer.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,C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AG,CAAC,GAAG,EAAE,CAAC;oBACV,OAAO;gBACR,CAAC;gBAED,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;oBAChC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;oBACnB,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACjB,CAAC;qBAAM,CAAC;oBACP,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;oBACnB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;gBACjC,CAAC;YACF,CAAC;YAAC,OAAO,EAAE,EAAE,CAAC;gBACb,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,mBAAmB,EAAE,IAAI,CAAC,CAAC;gBAC5C,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;gBACnB,GAAG,CAAC,GAAG,EAAE,CAAC;YACX,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AAlFQ;IADP,KAAK,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;0CAkFtB"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import type { AgentProviderCallbacks, AgentSession, AgentSessionProvider, PermissionDecision, PermissionSuggestion } from '../types.js';
|
|
2
|
+
import { ClaudeCodeTranscriptReader } from './claudeCodeTranscript.js';
|
|
3
|
+
export declare class ClaudeCodeProvider implements AgentSessionProvider {
|
|
4
|
+
private readonly callbacks;
|
|
5
|
+
readonly id = "claudeCode";
|
|
6
|
+
readonly name = "Claude Code";
|
|
7
|
+
readonly icon = "robot";
|
|
8
|
+
private readonly _onDidChangeSessions;
|
|
9
|
+
readonly onDidChangeSessions: import("../../../utils/event.js").Event<void>;
|
|
10
|
+
private _sessions;
|
|
11
|
+
private _ipcStarted;
|
|
12
|
+
private _disposed;
|
|
13
|
+
private _handlerDisposables;
|
|
14
|
+
private readonly _pendingPermissions;
|
|
15
|
+
private readonly _resolveGitInfoInFlight;
|
|
16
|
+
private readonly _sessionBookkeeping;
|
|
17
|
+
/** Per-session timers for the deferred `Stop → idle` commit. The handle is cleared (and the
|
|
18
|
+
* transition cancelled) by any non-idle status update arriving before the timer fires. */
|
|
19
|
+
private readonly _pendingIdleTimers;
|
|
20
|
+
private _workspacePaths;
|
|
21
|
+
private _staleCheckTimer;
|
|
22
|
+
/** Whether Claude hooks are installed, pushed by the host via {@link setClaudeHooksInstalled}.
|
|
23
|
+
* Fail-open (`true`) until the first push lands so a fresh window with real hooks isn't
|
|
24
|
+
* suppressed on its first ticks. Gates the reconciliation poll in {@link syncSessions}. */
|
|
25
|
+
private _claudeHooksInstalled;
|
|
26
|
+
protected _transcriptReader: ClaudeCodeTranscriptReader;
|
|
27
|
+
constructor(callbacks: AgentProviderCallbacks);
|
|
28
|
+
get sessions(): readonly AgentSession[];
|
|
29
|
+
start(workspacePaths: string[]): void;
|
|
30
|
+
stop(): void;
|
|
31
|
+
updateWorkspacePaths(workspacePaths: string[]): void;
|
|
32
|
+
setClaudeHooksInstalled(installed: boolean): void;
|
|
33
|
+
dispose(): void;
|
|
34
|
+
[Symbol.dispose](): void;
|
|
35
|
+
private ensureIpcServer;
|
|
36
|
+
private handleSessionEvent;
|
|
37
|
+
private sessionTag;
|
|
38
|
+
private getBookkeeping;
|
|
39
|
+
/** Returns the active decay window in milliseconds — the cooldown between PostToolUse and
|
|
40
|
+
* dropping the path from the bookkeeping. Reads through the host callback every time so a
|
|
41
|
+
* setting change takes effect on the next Pre/Post pair without re-wiring (existing timers
|
|
42
|
+
* keep their original timeout — acceptable since they're short-lived relative to the setting). */
|
|
43
|
+
private get activityDecayMs();
|
|
44
|
+
/** Locates the *parent* session id that owns the given session id — returns the id itself when
|
|
45
|
+
* it matches a top-level session, otherwise the `id` of the parent that holds it under
|
|
46
|
+
* `subagents[]`. Returns `undefined` when neither match (session no longer exists). Used to
|
|
47
|
+
* route per-session bookkeeping changes to the right top-level `syncSessionFileActivity` call.
|
|
48
|
+
* Tool events are parent-keyed (the CLI sends a sub-agent's tool events under the parent id),
|
|
49
|
+
* so the `subagents[]` branch is a defensive fallback for any other-keyed caller. */
|
|
50
|
+
private findOwningParentId;
|
|
51
|
+
private resetBookkeeping;
|
|
52
|
+
/** Turn-end settle (Stop): the agent finished its turn, so nothing is "live" anymore — but
|
|
53
|
+
* the per-operation decay tail must survive. Heat fades over {@link activityDecayMs} measured
|
|
54
|
+
* from when each *tool* finished (the PostToolUse cooldown), NOT from when the turn ends, so a
|
|
55
|
+
* Stop must not cancel those cooldowns or clear `lastTouchedAt`. We only reset turn-scoped
|
|
56
|
+
* state and force-finish any path whose PostToolUse never arrived before Stop: drop its
|
|
57
|
+
* refcount to 0 (flipping `editing`/`reading` off so the pulse stops) and schedule the same
|
|
58
|
+
* decay eviction a normal completion would. Contrast {@link resetBookkeeping}, which hard-
|
|
59
|
+
* wipes everything for SessionStart/SessionEnd (the agent is gone, not merely between turns). */
|
|
60
|
+
private settleBookkeeping;
|
|
61
|
+
private cancelPendingFileClears;
|
|
62
|
+
private cancelPendingReadClears;
|
|
63
|
+
/** Extracts the targeted file path from a PreToolUse/PostToolUse event. Tries the raw
|
|
64
|
+
* `hookInput.tool_input` passthrough first, falls back to the projected `event.toolInput`
|
|
65
|
+
* for older CLI versions that only fill the top-level fields. Treats an empty-object
|
|
66
|
+
* `hookInput.tool_input` as missing — `??` would have kept it (truthy) and shadowed a
|
|
67
|
+
* populated `event.toolInput`. */
|
|
68
|
+
private getEventFilePath;
|
|
69
|
+
/** Stamps the per-path/per-kind `lastTouchedAt[kind]` to the current epoch ms. Stamped on every
|
|
70
|
+
* PreToolUse for the matching kind so `serializeFileActivity` can emit `readAt`/`editedAt` as
|
|
71
|
+
* a relative `now - timestamp` delta. */
|
|
72
|
+
private stampLastTouched;
|
|
73
|
+
/** Drops the `lastTouchedAt[kind]` slot for `filePath`, and the whole entry when neither kind
|
|
74
|
+
* remains. Mirrors the cooldown-timer eviction in `scheduleClear*` — once the path is gone
|
|
75
|
+
* from the count map for that kind, its timestamp is no longer load-bearing. */
|
|
76
|
+
private clearLastTouched;
|
|
77
|
+
/** Records that a file-mutating tool call is in flight against `filePath` so consumers can
|
|
78
|
+
* highlight the path. Refcounts per path — keyed by path (not `tool_use_id`, which the GK CLI
|
|
79
|
+
* doesn't reliably surface) so parallel calls bump the count and Post/Pre order doesn't matter.
|
|
80
|
+
* Returns whether the parent's published `fileActivity` actually changed so callers can fire
|
|
81
|
+
* when the surrounding {@link updateSessionStatus} short-circuits. */
|
|
82
|
+
private trackToolUseFile;
|
|
83
|
+
/** Decrements the in-flight refcount for a finished tool call's file. While the count stays
|
|
84
|
+
* above zero (overlapping parallel calls) the path remains marked. When the count drops to
|
|
85
|
+
* zero, leaves the entry in place at count `0` and schedules a {@link activityDecayMs}
|
|
86
|
+
* cooldown before actually dropping it — so a recently-edited file lingers as a decay tail
|
|
87
|
+
* on the treemap. A Pre arriving during cooldown cancels the timer and bumps the count back
|
|
88
|
+
* above zero. Returns whether the parent's published `fileActivity` changed (i.e. `editing`
|
|
89
|
+
* flipped off) so the PostToolUse caller can fire when its `updateSessionStatus` short-
|
|
90
|
+
* circuits (a parallel tool still in flight keeps activeToolCount > 0). */
|
|
91
|
+
private scheduleClearToolUseFile;
|
|
92
|
+
/** Schedules (replacing any prior timer) the {@link activityDecayMs} cooldown that finally
|
|
93
|
+
* drops `filePath` from the edit bookkeeping once it has fully decayed. Shared by the
|
|
94
|
+
* PostToolUse cooldown path and the Stop settle ({@link settleBookkeeping}); the path stays
|
|
95
|
+
* in `currentFileCounts` at count 0 meanwhile so its `editedAt` keeps aging on the client. */
|
|
96
|
+
private scheduleFileDecayEviction;
|
|
97
|
+
/** Drops a tracked tool call's file immediately (no cooldown). Used for PermissionDenied,
|
|
98
|
+
* where the tool never ran — keeping the "live" badge would be misleading.
|
|
99
|
+
* Returns whether the published list changed. */
|
|
100
|
+
private untrackToolUseFile;
|
|
101
|
+
/** Mirror of {@link getEventFilePath} for read-only file tools. */
|
|
102
|
+
private getEventReadPath;
|
|
103
|
+
/** Refcount mirror of {@link trackToolUseFile} for read-only file tools. */
|
|
104
|
+
private trackToolUseRead;
|
|
105
|
+
/** Cooldown mirror of {@link scheduleClearToolUseFile} for read-only file tools. Returns
|
|
106
|
+
* whether the parent's published `fileActivity` changed (i.e. `reading` flipped off). */
|
|
107
|
+
private scheduleClearToolUseRead;
|
|
108
|
+
/** Read-class mirror of {@link scheduleFileDecayEviction}. */
|
|
109
|
+
private scheduleReadDecayEviction;
|
|
110
|
+
/** Immediate-drop mirror of {@link untrackToolUseFile} for read-only file tools. */
|
|
111
|
+
private untrackToolUseRead;
|
|
112
|
+
/** Convenience wrapper that resolves the parent for a possibly-sub-agent session id, then calls
|
|
113
|
+
* {@link syncSessionFileActivity}. Tool-call handlers call this without knowing whether the
|
|
114
|
+
* session is a top-level or sub-agent session. Returns `false` when the session isn't found
|
|
115
|
+
* (already pruned / unknown peer id). */
|
|
116
|
+
private syncSessionFileActivityForChild;
|
|
117
|
+
/** Rebuilds the parent session's `fileActivity` array from its bookkeeping and writes it onto
|
|
118
|
+
* the session in place. Returns whether the *structural* shape changed (paths/kinds/flags) —
|
|
119
|
+
* timestamps are always refreshed regardless, but a fire is gated on structural change so
|
|
120
|
+
* non-meaningful drift doesn't churn the wire.
|
|
121
|
+
*
|
|
122
|
+
* No separate sub-agent rollup is needed: the GK CLI keys a sub-agent's tool events under its
|
|
123
|
+
* PARENT session id (with `agentId` set), so they accumulate in the parent's own bookkeeping
|
|
124
|
+
* directly and are already reflected here. Sub-agent serialized objects carry no `fileActivity`. */
|
|
125
|
+
private syncSessionFileActivity;
|
|
126
|
+
/** Defer the `Stop → idle` commit. If the agent produces a non-idle event within
|
|
127
|
+
* `stopToIdleDebounceMs`, `cancelPendingIdleTransition` (called from `updateSessionStatus`)
|
|
128
|
+
* cancels this and the session stays in its prior phase — no working → idle → working flicker.
|
|
129
|
+
*
|
|
130
|
+
* Intentionally takes no context: the caller is expected to apply any event metadata
|
|
131
|
+
* synchronously before scheduling. Carrying Stop-time context into the timer would let
|
|
132
|
+
* in-window metadata mutations (e.g. `CwdChanged` updating `_sessions[i].cwd` directly)
|
|
133
|
+
* get reverted when the deferred commit replays the stale context through `ensureSession`. */
|
|
134
|
+
private scheduleIdleTransition;
|
|
135
|
+
private cancelPendingIdleTransition;
|
|
136
|
+
/** Stable phase-since: if we're oscillating back into the phase we were just in (within a
|
|
137
|
+
* short window), restore its original timestamp so the displayed elapsed time doesn't snap
|
|
138
|
+
* to 0. Otherwise records the current phase as the new "prior" and returns `now`. */
|
|
139
|
+
private resolvePhaseSince;
|
|
140
|
+
private clearStalePermission;
|
|
141
|
+
resolvePermission(sessionId: string, decision: PermissionDecision, updatedPermissions?: PermissionSuggestion[]): boolean;
|
|
142
|
+
private matchesWorkspace;
|
|
143
|
+
private resolveWorkspacePath;
|
|
144
|
+
private updateSessionWithPermission;
|
|
145
|
+
private updateSessionStatus;
|
|
146
|
+
private ensureSession;
|
|
147
|
+
private resolveGitInfo;
|
|
148
|
+
private resolveTranscriptTitles;
|
|
149
|
+
private pruneDeadSessions;
|
|
150
|
+
protected syncSessions(options?: {
|
|
151
|
+
gate?: boolean;
|
|
152
|
+
}): Promise<void>;
|
|
153
|
+
private querySiblingWindowSessions;
|
|
154
|
+
private fetchPeerSessions;
|
|
155
|
+
/** Find the peer GitLens window whose discovery file claims `workspacePath`, and POST to its
|
|
156
|
+
* `/agents/sessions/open` route to ask its Claude Code extension to open the session.
|
|
157
|
+
*
|
|
158
|
+
* Resolves to `true` when at least one peer claimed the workspace AND was reachable (the POST
|
|
159
|
+
* completed with any HTTP status). The peer's response shape (`{ opened: boolean }`) is logged
|
|
160
|
+
* for diagnostics but does NOT affect the return value — an `opened: false` peer is still the
|
|
161
|
+
* right window for the caller to focus, since it's the window that owns the session. Resolves
|
|
162
|
+
* to `false` when no peer claimed the workspace OR every claimer was unreachable; the caller
|
|
163
|
+
* treats that as "no peer to focus" and opens a new window instead of replacing the current
|
|
164
|
+
* one. Best-effort: swallows scan, JSON-parse errors. */
|
|
165
|
+
notifyPeerOpenSession(workspacePath: string, sessionId: string): Promise<boolean>;
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=claudeCodeProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claudeCodeProvider.d.ts","sourceRoot":"","sources":["../../src/providers/claudeCodeProvider.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACX,sBAAsB,EACtB,YAAY,EAEZ,oBAAoB,EAKpB,kBAAkB,EAClB,oBAAoB,EACpB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAwLvE,qBAAa,kBAAmB,YAAW,oBAAoB;IA0BlD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAzBtC,QAAQ,CAAC,EAAE,gBAAgB;IAC3B,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,IAAI,WAAW;IAExB,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAuB;IAC5D,QAAQ,CAAC,mBAAmB,gDAAmC;IAE/D,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,mBAAmB,CAA2B;IACtD,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAA6C;IACjF,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAqB;IAC7D,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAyC;IAC7E;+FAC2F;IAC3F,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAqC;IACxE,OAAO,CAAC,eAAe,CAAgB;IACvC,OAAO,CAAC,gBAAgB,CAAgC;IACxD;;gGAE4F;IAC5F,OAAO,CAAC,qBAAqB,CAAQ;IACrC,SAAS,CAAC,iBAAiB,EAAE,0BAA0B,CAAoC;gBAE9D,SAAS,EA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