@gitkraken/core-gitlens 0.5.113 → 0.5.115
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 +42 -1
- package/dist/git/cache.d.ts +4 -0
- package/dist/git/cache.d.ts.map +1 -1
- package/dist/git/cache.js +33 -0
- package/dist/git/cache.js.map +1 -1
- package/dist/git/context.d.ts +10 -0
- package/dist/git/context.d.ts.map +1 -1
- package/dist/git/context.js.map +1 -1
- package/dist/git/errors.d.ts +6 -3
- package/dist/git/errors.d.ts.map +1 -1
- package/dist/git/errors.js +9 -1
- package/dist/git/errors.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 +38 -0
- package/dist/git/features.js.map +1 -1
- package/dist/git/gitHealth.d.ts +153 -0
- package/dist/git/gitHealth.d.ts.map +1 -0
- package/dist/git/gitHealth.js +353 -0
- package/dist/git/gitHealth.js.map +1 -0
- package/dist/git/models/search.d.ts +6 -3
- package/dist/git/models/search.d.ts.map +1 -1
- package/dist/git/models/search.js +5 -1
- package/dist/git/models/search.js.map +1 -1
- package/dist/git/parsers/diffParser.d.ts +8 -2
- package/dist/git/parsers/diffParser.d.ts.map +1 -1
- package/dist/git/parsers/diffParser.js +27 -4
- package/dist/git/parsers/diffParser.js.map +1 -1
- package/dist/git/providers/config.d.ts +36 -3
- package/dist/git/providers/config.d.ts.map +1 -1
- package/dist/git/providers/graph.d.ts +9 -0
- package/dist/git/providers/graph.d.ts.map +1 -1
- package/dist/git/providers/maintenance.d.ts +222 -0
- package/dist/git/providers/maintenance.d.ts.map +1 -0
- package/dist/git/providers/maintenance.js +20 -0
- package/dist/git/providers/maintenance.js.map +1 -0
- package/dist/git/providers/operations.d.ts +10 -0
- package/dist/git/providers/operations.d.ts.map +1 -1
- package/dist/git/providers/pausedOperations.d.ts +3 -0
- package/dist/git/providers/pausedOperations.d.ts.map +1 -1
- package/dist/git/providers/provider.d.ts +2 -0
- package/dist/git/providers/provider.d.ts.map +1 -1
- package/dist/git/providers/tags.d.ts +3 -0
- package/dist/git/providers/tags.d.ts.map +1 -1
- package/dist/git/repositoryService.d.ts +1 -0
- package/dist/git/repositoryService.d.ts.map +1 -1
- package/dist/git/repositoryService.js.map +1 -1
- package/dist/git/run.types.d.ts +8 -0
- package/dist/git/run.types.d.ts.map +1 -1
- package/dist/git/service.js +3 -0
- package/dist/git/service.js.map +1 -1
- package/dist/git/utils/search.utils.d.ts.map +1 -1
- package/dist/git/utils/search.utils.js +112 -5
- package/dist/git/utils/search.utils.js.map +1 -1
- package/dist/git/watching/watchService.d.ts +3 -0
- package/dist/git/watching/watchService.d.ts.map +1 -1
- package/dist/git/watching/watchService.js +8 -0
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git-cli/cliGitProvider.d.ts +11 -0
- package/dist/git-cli/cliGitProvider.d.ts.map +1 -1
- package/dist/git-cli/cliGitProvider.js +12 -0
- package/dist/git-cli/cliGitProvider.js.map +1 -1
- package/dist/git-cli/exec/git.d.ts +23 -1
- package/dist/git-cli/exec/git.d.ts.map +1 -1
- package/dist/git-cli/exec/git.js +83 -8
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/exec/gitQueue.d.ts +2 -0
- package/dist/git-cli/exec/gitQueue.d.ts.map +1 -1
- package/dist/git-cli/exec/gitQueue.js +19 -17
- package/dist/git-cli/exec/gitQueue.js.map +1 -1
- package/dist/git-cli/parsers/logParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/logParser.js +4 -1
- package/dist/git-cli/parsers/logParser.js.map +1 -1
- package/dist/git-cli/providers/blame.d.ts.map +1 -1
- package/dist/git-cli/providers/blame.js +4 -7
- package/dist/git-cli/providers/blame.js.map +1 -1
- package/dist/git-cli/providers/branches.d.ts.map +1 -1
- package/dist/git-cli/providers/branches.js +13 -3
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/commits.d.ts.map +1 -1
- package/dist/git-cli/providers/commits.js +34 -3
- package/dist/git-cli/providers/commits.js.map +1 -1
- package/dist/git-cli/providers/config.d.ts +27 -0
- package/dist/git-cli/providers/config.d.ts.map +1 -1
- package/dist/git-cli/providers/config.js +31 -6
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/graph.d.ts +8 -0
- package/dist/git-cli/providers/graph.d.ts.map +1 -1
- package/dist/git-cli/providers/graph.js +85 -6
- package/dist/git-cli/providers/graph.js.map +1 -1
- package/dist/git-cli/providers/maintenance.d.ts +306 -0
- package/dist/git-cli/providers/maintenance.d.ts.map +1 -0
- package/dist/git-cli/providers/maintenance.js +2129 -0
- package/dist/git-cli/providers/maintenance.js.map +1 -0
- package/dist/git-cli/providers/operations.d.ts +1 -0
- package/dist/git-cli/providers/operations.d.ts.map +1 -1
- package/dist/git-cli/providers/operations.js +8 -0
- package/dist/git-cli/providers/operations.js.map +1 -1
- package/dist/git-cli/providers/pausedOperations.d.ts +1 -0
- package/dist/git-cli/providers/pausedOperations.d.ts.map +1 -1
- package/dist/git-cli/providers/pausedOperations.js +1 -1
- package/dist/git-cli/providers/pausedOperations.js.map +1 -1
- package/dist/git-cli/providers/tags.d.ts +3 -0
- package/dist/git-cli/providers/tags.d.ts.map +1 -1
- package/dist/git-cli/providers/tags.js +23 -1
- package/dist/git-cli/providers/tags.js.map +1 -1
- package/dist/plus/agents/agentCapabilities.d.ts +77 -0
- package/dist/plus/agents/agentCapabilities.d.ts.map +1 -0
- package/dist/plus/agents/agentCapabilities.js +197 -0
- package/dist/plus/agents/agentCapabilities.js.map +1 -0
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts +77 -13
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts.map +1 -1
- package/dist/plus/agents/providers/claudeCodeTranscript.js +263 -55
- package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
- package/dist/plus/agents/providers/{claudeCodeProvider.d.ts → gkAgentProvider.d.ts} +52 -19
- package/dist/plus/agents/providers/gkAgentProvider.d.ts.map +1 -0
- package/dist/plus/agents/providers/{claudeCodeProvider.js → gkAgentProvider.js} +935 -262
- package/dist/plus/agents/providers/gkAgentProvider.js.map +1 -0
- package/dist/plus/agents/types.d.ts +113 -35
- package/dist/plus/agents/types.d.ts.map +1 -1
- package/dist/plus/agents/types.js +7 -4
- package/dist/plus/agents/types.js.map +1 -1
- package/dist/plus/ai/models/promptTemplates.d.ts +1 -1
- package/dist/plus/ai/models/promptTemplates.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 +59 -4
- package/dist/plus/ai/prompts.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +44 -1
- package/dist/plus/git-github/api/github.d.ts.map +1 -1
- package/dist/plus/git-github/api/github.js +355 -62
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/api/issueSearchQuery.d.ts +13 -0
- package/dist/plus/git-github/api/issueSearchQuery.d.ts.map +1 -1
- package/dist/plus/git-github/api/issueSearchQuery.js +41 -0
- package/dist/plus/git-github/api/issueSearchQuery.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 +2 -1
- package/dist/plus/git-github/providers/github/blame.js.map +1 -1
- package/dist/plus/integrations/collectionMetadata.d.ts +2 -0
- package/dist/plus/integrations/collectionMetadata.d.ts.map +1 -1
- package/dist/plus/integrations/collectionMetadata.js +17 -1
- package/dist/plus/integrations/collectionMetadata.js.map +1 -1
- package/dist/plus/integrations/context.d.ts +4 -1
- package/dist/plus/integrations/context.d.ts.map +1 -1
- package/dist/plus/integrations/index.d.ts +1 -0
- package/dist/plus/integrations/index.d.ts.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +20 -1
- package/dist/plus/integrations/integrationService.d.ts.map +1 -1
- package/dist/plus/integrations/integrationService.js +12 -4
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/manager.d.ts +48 -0
- package/dist/plus/integrations/manager.d.ts.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +53 -26
- package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.js +123 -47
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/models/integration.d.ts +10 -1
- package/dist/plus/integrations/models/integration.d.ts.map +1 -1
- package/dist/plus/integrations/models/integration.js +52 -19
- package/dist/plus/integrations/models/integration.js.map +1 -1
- package/dist/plus/integrations/models/issueCache.d.ts +16 -0
- package/dist/plus/integrations/models/issueCache.d.ts.map +1 -0
- package/dist/plus/integrations/models/issueCache.js +9 -0
- package/dist/plus/integrations/models/issueCache.js.map +1 -0
- package/dist/plus/integrations/models/issueReads.d.ts +13 -0
- package/dist/plus/integrations/models/issueReads.d.ts.map +1 -1
- package/dist/plus/integrations/models/issuesIntegration.d.ts +11 -13
- package/dist/plus/integrations/models/issuesIntegration.d.ts.map +1 -1
- package/dist/plus/integrations/models/issuesIntegration.js +15 -1
- package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.d.ts +3 -5
- package/dist/plus/integrations/providers/azureDevOps.d.ts.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.js +9 -8
- package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server.d.ts +3 -5
- package/dist/plus/integrations/providers/bitbucket-server.d.ts.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server.js +2 -2
- package/dist/plus/integrations/providers/bitbucket-server.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket.d.ts +3 -5
- package/dist/plus/integrations/providers/bitbucket.d.ts.map +1 -1
- package/dist/plus/integrations/providers/bitbucket.js +2 -1
- package/dist/plus/integrations/providers/bitbucket.js.map +1 -1
- package/dist/plus/integrations/providers/github.d.ts +12 -5
- package/dist/plus/integrations/providers/github.d.ts.map +1 -1
- package/dist/plus/integrations/providers/github.js +10 -3
- package/dist/plus/integrations/providers/github.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab.d.ts +3 -5
- package/dist/plus/integrations/providers/gitlab.d.ts.map +1 -1
- package/dist/plus/integrations/providers/gitlab.js +2 -2
- package/dist/plus/integrations/providers/gitlab.js.map +1 -1
- package/dist/plus/integrations/providers/jira.d.ts +3 -7
- package/dist/plus/integrations/providers/jira.d.ts.map +1 -1
- package/dist/plus/integrations/providers/jira.js +35 -22
- package/dist/plus/integrations/providers/jira.js.map +1 -1
- package/dist/plus/integrations/providers/jiraIssueByKey.d.ts +7 -0
- package/dist/plus/integrations/providers/jiraIssueByKey.d.ts.map +1 -0
- package/dist/plus/integrations/providers/jiraIssueByKey.js +102 -0
- package/dist/plus/integrations/providers/jiraIssueByKey.js.map +1 -0
- package/dist/plus/integrations/providers/linear.d.ts +3 -7
- package/dist/plus/integrations/providers/linear.d.ts.map +1 -1
- package/dist/plus/integrations/providers/linear.js +23 -22
- package/dist/plus/integrations/providers/linear.js.map +1 -1
- package/dist/plus/integrations/providers/models.d.ts +3 -1
- package/dist/plus/integrations/providers/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/models.js +10 -4
- package/dist/plus/integrations/providers/models.js.map +1 -1
- package/dist/plus/integrations/providers/providerErrors.d.ts +7 -0
- package/dist/plus/integrations/providers/providerErrors.d.ts.map +1 -0
- package/dist/plus/integrations/providers/providerErrors.js +91 -0
- package/dist/plus/integrations/providers/providerErrors.js.map +1 -0
- package/dist/plus/integrations/providers/providersApi.d.ts +3 -2
- package/dist/plus/integrations/providers/providersApi.d.ts.map +1 -1
- package/dist/plus/integrations/providers/providersApi.js +18 -52
- package/dist/plus/integrations/providers/providersApi.js.map +1 -1
- package/dist/plus/integrations/providers/trello.d.ts +2 -7
- package/dist/plus/integrations/providers/trello.d.ts.map +1 -1
- package/dist/plus/integrations/providers/trello.js +3 -1
- package/dist/plus/integrations/providers/trello.js.map +1 -1
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts +2 -0
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts.map +1 -1
- package/dist/plus/integrations/providers/utils/providerPaging.js +12 -7
- package/dist/plus/integrations/providers/utils/providerPaging.js.map +1 -1
- package/dist/plus/integrations/reads/broaden.d.ts +47 -10
- package/dist/plus/integrations/reads/broaden.d.ts.map +1 -1
- package/dist/plus/integrations/reads/broaden.js +144 -33
- package/dist/plus/integrations/reads/broaden.js.map +1 -1
- package/dist/plus/integrations/reads/filters.d.ts +18 -0
- package/dist/plus/integrations/reads/filters.d.ts.map +1 -1
- package/dist/plus/integrations/reads/filters.js +37 -1
- package/dist/plus/integrations/reads/filters.js.map +1 -1
- package/dist/plus/integrations/reads/issueBatch.d.ts +51 -0
- package/dist/plus/integrations/reads/issueBatch.d.ts.map +1 -0
- package/dist/plus/integrations/reads/issueBatch.js +91 -0
- package/dist/plus/integrations/reads/issueBatch.js.map +1 -0
- package/dist/plus/integrations/reads/issueTracker.d.ts.map +1 -1
- package/dist/plus/integrations/reads/issueTracker.js +23 -17
- package/dist/plus/integrations/reads/issueTracker.js.map +1 -1
- package/dist/plus/integrations/reads/sweeps.d.ts.map +1 -1
- package/dist/plus/integrations/reads/sweeps.js +5 -3
- package/dist/plus/integrations/reads/sweeps.js.map +1 -1
- package/dist/plus/integrations/reads/trackerIssue.d.ts +21 -0
- package/dist/plus/integrations/reads/trackerIssue.d.ts.map +1 -0
- package/dist/plus/integrations/reads/trackerIssue.js +51 -0
- package/dist/plus/integrations/reads/trackerIssue.js.map +1 -0
- package/dist/plus/integrations/reads/warnings.d.ts +2 -15
- package/dist/plus/integrations/reads/warnings.d.ts.map +1 -1
- package/dist/plus/integrations/reads/warnings.js +19 -1
- package/dist/plus/integrations/reads/warnings.js.map +1 -1
- package/dist/plus/integrations/results.d.ts +4 -20
- package/dist/plus/integrations/results.d.ts.map +1 -1
- package/dist/plus/integrations/results.js.map +1 -1
- package/dist/utils/promise.d.ts +2 -0
- package/dist/utils/promise.d.ts.map +1 -1
- package/dist/utils/promise.js +11 -0
- package/dist/utils/promise.js.map +1 -1
- package/dist/utils/promiseCache.d.ts +19 -0
- package/dist/utils/promiseCache.d.ts.map +1 -1
- package/dist/utils/promiseCache.js +30 -0
- package/dist/utils/promiseCache.js.map +1 -1
- package/dist/utils/resourceUsage.d.ts +5 -0
- package/dist/utils/resourceUsage.d.ts.map +1 -0
- package/dist/utils/resourceUsage.js +2 -0
- package/dist/utils/resourceUsage.js.map +1 -0
- package/dist/utils/string.d.ts +12 -0
- package/dist/utils/string.d.ts.map +1 -1
- package/dist/utils/string.js +36 -1
- package/dist/utils/string.js.map +1 -1
- package/docs/integrations.md +48 -33
- package/docs/kepler-read-api-parity.md +25 -4
- package/package.json +12 -4
- package/src/git/cache.ts +36 -0
- package/src/git/context.ts +11 -0
- package/src/git/errors.ts +13 -1
- package/src/git/features.ts +51 -0
- package/src/git/gitHealth.ts +522 -0
- package/src/git/models/search.ts +19 -4
- package/src/git/parsers/diffParser.ts +27 -4
- package/src/git/providers/config.ts +42 -1
- package/src/git/providers/graph.ts +12 -0
- package/src/git/providers/maintenance.ts +224 -0
- package/src/git/providers/operations.ts +10 -0
- package/src/git/providers/pausedOperations.ts +3 -0
- package/src/git/providers/provider.ts +2 -0
- package/src/git/providers/tags.ts +1 -0
- package/src/git/repositoryService.ts +1 -0
- package/src/git/run.types.ts +8 -0
- package/src/git/service.ts +3 -0
- package/src/git/utils/search.utils.ts +129 -5
- package/src/git/watching/watchService.ts +10 -0
- package/src/git-cli/cliGitProvider.ts +25 -0
- package/src/git-cli/exec/git.ts +120 -6
- package/src/git-cli/exec/gitQueue.ts +19 -17
- package/src/git-cli/parsers/logParser.ts +4 -1
- package/src/git-cli/providers/blame.ts +3 -8
- package/src/git-cli/providers/branches.ts +28 -8
- package/src/git-cli/providers/commits.ts +34 -2
- package/src/git-cli/providers/config.ts +38 -6
- package/src/git-cli/providers/graph.ts +107 -7
- package/src/git-cli/providers/maintenance.ts +2599 -0
- package/src/git-cli/providers/operations.ts +11 -0
- package/src/git-cli/providers/pausedOperations.ts +7 -2
- package/src/git-cli/providers/tags.ts +36 -1
- package/src/plus/agents/agentCapabilities.ts +286 -0
- package/src/plus/agents/providers/claudeCodeTranscript.ts +313 -58
- package/src/plus/agents/providers/{claudeCodeProvider.ts → gkAgentProvider.ts} +1123 -277
- package/src/plus/agents/types.ts +137 -40
- package/src/plus/ai/models/promptTemplates.ts +1 -1
- package/src/plus/ai/prompts.ts +62 -4
- package/src/plus/git-github/api/github.ts +404 -82
- package/src/plus/git-github/api/issueSearchQuery.ts +49 -1
- package/src/plus/git-github/providers/github/blame.ts +2 -1
- package/src/plus/integrations/collectionMetadata.ts +23 -1
- package/src/plus/integrations/context.ts +1 -1
- package/src/plus/integrations/index.ts +1 -0
- package/src/plus/integrations/integrationService.ts +29 -4
- package/src/plus/integrations/manager.ts +48 -0
- package/src/plus/integrations/models/gitHostIntegration.ts +165 -129
- package/src/plus/integrations/models/integration.ts +57 -22
- package/src/plus/integrations/models/issueCache.ts +29 -0
- package/src/plus/integrations/models/issueReads.ts +15 -0
- package/src/plus/integrations/models/issuesIntegration.ts +38 -8
- package/src/plus/integrations/providers/azureDevOps.ts +16 -13
- package/src/plus/integrations/providers/bitbucket-server.ts +4 -6
- package/src/plus/integrations/providers/bitbucket.ts +3 -4
- package/src/plus/integrations/providers/github.ts +23 -7
- package/src/plus/integrations/providers/gitlab.ts +4 -6
- package/src/plus/integrations/providers/jira.ts +52 -26
- package/src/plus/integrations/providers/jiraIssueByKey.ts +155 -0
- package/src/plus/integrations/providers/linear.ts +38 -25
- package/src/plus/integrations/providers/models.ts +17 -5
- package/src/plus/integrations/providers/providerErrors.ts +115 -0
- package/src/plus/integrations/providers/providersApi.ts +26 -68
- package/src/plus/integrations/providers/trello.ts +5 -4
- package/src/plus/integrations/providers/utils/providerPaging.ts +14 -7
- package/src/plus/integrations/reads/broaden.ts +282 -70
- package/src/plus/integrations/reads/filters.ts +39 -1
- package/src/plus/integrations/reads/issueBatch.ts +197 -0
- package/src/plus/integrations/reads/issueTracker.ts +26 -24
- package/src/plus/integrations/reads/sweeps.ts +19 -12
- package/src/plus/integrations/reads/trackerIssue.ts +105 -0
- package/src/plus/integrations/reads/warnings.ts +23 -17
- package/src/plus/integrations/results.ts +4 -20
- package/src/utils/promise.ts +15 -0
- package/src/utils/promiseCache.ts +43 -0
- package/src/utils/resourceUsage.ts +5 -0
- package/src/utils/string.ts +38 -1
- package/dist/plus/agents/providers/claudeCodeProvider.d.ts.map +0 -1
- package/dist/plus/agents/providers/claudeCodeProvider.js.map +0 -1
package/src/plus/agents/types.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { IpcHandler } from '../../ipc/ipcServer.js';
|
|
2
2
|
import type { UnifiedDisposable } from '../../utils/disposable.js';
|
|
3
3
|
import type { Event } from '../../utils/event.js';
|
|
4
|
+
import type { EndedTranscriptDetails } from './providers/claudeCodeTranscript.js';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
/** Claude Code's native non-blocking hook event vocabulary, adopted as the canonical set for all
|
|
7
|
+
* agents because it is a superset of every other supported agent's. Other agents map their native
|
|
8
|
+
* event names onto these via `AgentCapabilities.eventMap` / `resolveEvent`. */
|
|
9
|
+
export const canonicalNonBlockingHookEvents = [
|
|
6
10
|
'SessionStart',
|
|
7
11
|
'SessionEnd',
|
|
8
12
|
'UserPromptSubmit',
|
|
@@ -28,11 +32,11 @@ export const claudeCodeNonBlockingHookEvents = [
|
|
|
28
32
|
'CwdChanged',
|
|
29
33
|
] as const;
|
|
30
34
|
|
|
31
|
-
export const
|
|
35
|
+
export const canonicalBlockingHookEvents = ['PermissionRequest'] as const;
|
|
32
36
|
|
|
33
|
-
export type
|
|
34
|
-
| (typeof
|
|
35
|
-
| (typeof
|
|
37
|
+
export type AgentHookEvent =
|
|
38
|
+
| (typeof canonicalNonBlockingHookEvents)[number]
|
|
39
|
+
| (typeof canonicalBlockingHookEvents)[number];
|
|
36
40
|
|
|
37
41
|
export type PermissionDecision = 'allow' | 'deny';
|
|
38
42
|
|
|
@@ -45,10 +49,14 @@ export type AgentSessionStatus =
|
|
|
45
49
|
| 'compacting'
|
|
46
50
|
| 'permission_requested'
|
|
47
51
|
// Terminal state: the session has ended (SessionEnd fired, or the CLI's durable store reports it
|
|
48
|
-
// `ended`). Kept in the list as a de-emphasized "
|
|
49
|
-
|
|
52
|
+
// `ended`). Kept in the list as a de-emphasized "ended" row (shown as "Past" in the UI) until
|
|
53
|
+
// archived or 30-day-purged.
|
|
54
|
+
| 'ended';
|
|
50
55
|
|
|
51
|
-
export type AgentSessionPhase = 'idle' | 'working' | 'waiting' | '
|
|
56
|
+
export type AgentSessionPhase = 'idle' | 'working' | 'waiting' | 'ended';
|
|
57
|
+
|
|
58
|
+
export type AgentSessionResumeTarget = 'default' | 'terminal';
|
|
59
|
+
export type AgentSessionResumeOutcome = 'extension' | 'terminal';
|
|
52
60
|
|
|
53
61
|
export function getPhaseForStatus(status: AgentSessionStatus): AgentSessionPhase {
|
|
54
62
|
switch (status) {
|
|
@@ -62,8 +70,8 @@ export function getPhaseForStatus(status: AgentSessionStatus): AgentSessionPhase
|
|
|
62
70
|
return 'waiting';
|
|
63
71
|
case 'idle':
|
|
64
72
|
return 'idle';
|
|
65
|
-
case '
|
|
66
|
-
return '
|
|
73
|
+
case 'ended':
|
|
74
|
+
return 'ended';
|
|
67
75
|
}
|
|
68
76
|
}
|
|
69
77
|
|
|
@@ -123,6 +131,11 @@ export interface AgentSession {
|
|
|
123
131
|
readonly phase: AgentSessionPhase;
|
|
124
132
|
readonly statusDetail?: string;
|
|
125
133
|
readonly worktreePath?: string;
|
|
134
|
+
/** Distinct worktree roots this session has been observed in (normalized), ordered by recency —
|
|
135
|
+
* most recently observed LAST (so the current `worktreePath` is normally the final entry).
|
|
136
|
+
* Accumulated from the CLI's `cwdTimeline` and the git probe; never pruned for the session's
|
|
137
|
+
* lifetime. */
|
|
138
|
+
readonly visitedWorktreePaths?: readonly string[];
|
|
126
139
|
/** Common (parent) repo path shared by every worktree in this session's repo. Set together
|
|
127
140
|
* with `worktreePath` by `resolveGitInfo` — equal to `worktreePath` for a default-worktree
|
|
128
141
|
* session, otherwise the parent repo's common path. Use this for "same repo" identity
|
|
@@ -167,7 +180,7 @@ export interface AgentSession {
|
|
|
167
180
|
* the CLI's durable session record. */
|
|
168
181
|
readonly model?: string;
|
|
169
182
|
/** Why the session ended: `session-end | rotated | stale | dead-pid | pid-zero-idle | archived`.
|
|
170
|
-
* Present only for `
|
|
183
|
+
* Present only for `ended` sessions. */
|
|
171
184
|
readonly endReason?: string;
|
|
172
185
|
/** Epoch ms the session ended — matches the RPC convention for dates crossing to a webview
|
|
173
186
|
* (see `PastAgentSessionState.lastActivity`), and keeps `SerializedAgentSession` free of
|
|
@@ -224,6 +237,14 @@ export interface AgentSessionProvider extends UnifiedDisposable {
|
|
|
224
237
|
readonly name: string;
|
|
225
238
|
readonly icon: string;
|
|
226
239
|
|
|
240
|
+
/** Every {@link AgentSession.providerId} this provider can host — a DIFFERENT namespace from
|
|
241
|
+
* {@link id}, which names the provider itself. A provider that fronts several agents needs this
|
|
242
|
+
* so the host can route an action for a session it isn't tracking (a historical row, or one
|
|
243
|
+
* optimistically removed), where ownership-by-session-id has no answer. Omit it when the
|
|
244
|
+
* provider hosts exactly one agent whose session provider id equals its own {@link id}.
|
|
245
|
+
*/
|
|
246
|
+
readonly agentProviderIds?: readonly string[];
|
|
247
|
+
|
|
227
248
|
readonly onDidChangeSessions: Event<void>;
|
|
228
249
|
readonly sessions: readonly AgentSession[];
|
|
229
250
|
|
|
@@ -238,7 +259,7 @@ export interface AgentSessionProvider extends UnifiedDisposable {
|
|
|
238
259
|
/** Pushed by the host from its cached agent detection. Lets the provider gate its reconciliation
|
|
239
260
|
* poll (the CLI `list-sessions` call) so an idle window with no sessions and no installed hooks
|
|
240
261
|
* doesn't spawn the CLI every interval. */
|
|
241
|
-
|
|
262
|
+
setHooksInstalled?(installed: boolean): void;
|
|
242
263
|
|
|
243
264
|
/** Resolves a pending permission. Returns `true` when the resolve was routed (the local IPC
|
|
244
265
|
* owns the session's pending entry); `false` when no local entry exists (typically a peer-
|
|
@@ -259,57 +280,99 @@ export interface AgentSessionProvider extends UnifiedDisposable {
|
|
|
259
280
|
* window (which works whether or not the peer runs GitLens). */
|
|
260
281
|
notifyPeerOpenSession?(workspacePath: string, sessionId: string): Promise<boolean>;
|
|
261
282
|
|
|
262
|
-
/** Lists
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
|
|
283
|
+
/** Lists historical sessions for `cwd`, most-recently-active first. Omitted by providers with no
|
|
284
|
+
* historical-session source. The provider owns reconciliation of its durable store, tracked
|
|
285
|
+
* terminal records, and archive state; callers only pass provider-local live ids to exclude.
|
|
286
|
+
* Each item advertises its supported actions independently, so an ended session can remain
|
|
287
|
+
* visible even when its transcript is missing or the harness cannot resume it. */
|
|
288
|
+
listSessionHistory?(cwd: string, options?: AgentSessionHistoryOptions): Promise<AgentSessionHistoryResult>;
|
|
268
289
|
|
|
269
|
-
/**
|
|
290
|
+
/** Resumes one historical session using this harness's launcher. Providers only advertise a
|
|
291
|
+
* history `resume` action when this operation is wired and can service it. */
|
|
292
|
+
resumeSession?(
|
|
293
|
+
sessionId: string,
|
|
294
|
+
cwd: string,
|
|
295
|
+
target: AgentSessionResumeTarget,
|
|
296
|
+
name?: string,
|
|
297
|
+
): Promise<AgentSessionResumeOutcome | false>;
|
|
298
|
+
|
|
299
|
+
/** Monotonic count of terminal transitions — bumped whenever a session ends, is removed on end
|
|
300
|
+
* (legacy path), or is pruned. The host snapshots it around a history query and retries when it
|
|
301
|
+
* moved: any terminal transition mid-query means the answer may be missing a session, however
|
|
302
|
+
* the provider represents the transition (retained `ended` row or outright removal). Required —
|
|
303
|
+
* the host's consistency check depends on it, and an omitted counter would silently restore the
|
|
304
|
+
* missing-session race. A provider whose sessions never transition terminally exposes a
|
|
305
|
+
* constant `0`. */
|
|
306
|
+
readonly terminalGeneration: number;
|
|
307
|
+
|
|
308
|
+
/** Archives an ended (non-live) session via the CLI, dismissing it from the list. Ends an
|
|
270
309
|
* active session first (the CLI broadcasts a synthetic SessionEnd) — but callers should only
|
|
271
|
-
* offer this on `
|
|
310
|
+
* offer this on `ended` sessions, and a provider refuses (returns `false`) any non-ended
|
|
272
311
|
* row that resumed since the click, so the CLI never terminates live work. Resolves to `true` when
|
|
273
312
|
* the session was archived (removed locally; the next reconciliation poll confirms it). */
|
|
274
313
|
archiveSession?(sessionId: string): Promise<boolean>;
|
|
275
314
|
|
|
276
|
-
/** Resolves git identity + the transcript title and first/last prompt for
|
|
277
|
-
* lazily — called by the host when the user *opens*
|
|
278
|
-
* not on mere display.
|
|
315
|
+
/** Resolves git identity + the transcript title and first/last prompt for an ended session
|
|
316
|
+
* lazily — called by the host when the user *opens* an ended row (the `Open Session` action),
|
|
317
|
+
* not on mere display. Ended sessions skip eager resolution during the poll so a 30-day
|
|
279
318
|
* cold-start doesn't fan out hundreds of git probes + transcript reads; the row shows its
|
|
280
|
-
* durable-store label until opened. No-op if the session isn't a tracked
|
|
281
|
-
|
|
319
|
+
* durable-store label until opened. No-op if the session isn't a tracked ended one. */
|
|
320
|
+
resolveEndedSessionDetails?(sessionId: string): void;
|
|
282
321
|
|
|
283
|
-
/**
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
|
|
322
|
+
/** Resolves the transcript-backed detail (titles + first/last prompt) for a session lazily —
|
|
323
|
+
* called by the host when the user opens the past-session sheet, not on mere listing. No
|
|
324
|
+
* `_sessions` gate: works for a transcript-only id that was never tracked live this window. */
|
|
325
|
+
resolveSessionDetails?(sessionId: string, cwd?: string): Promise<EndedTranscriptDetails | undefined>;
|
|
287
326
|
}
|
|
288
327
|
|
|
289
|
-
export
|
|
290
|
-
|
|
328
|
+
export type { EndedTranscriptDetails } from './providers/claudeCodeTranscript.js';
|
|
329
|
+
|
|
330
|
+
export type AgentSessionHistoryDisposition = 'ended' | 'archived';
|
|
331
|
+
|
|
332
|
+
export interface AgentSessionHistoryOptions {
|
|
333
|
+
/** How many sessions to detail. Discovery may cover the whole store while expensive summaries
|
|
334
|
+
* remain bounded. */
|
|
291
335
|
readonly limit?: number;
|
|
292
|
-
/**
|
|
293
|
-
* Excluded entries still count toward `total`. */
|
|
336
|
+
/** Provider-local session ids to skip before `limit` applies — typically the caller's live rows. */
|
|
294
337
|
readonly excludeSessionIds?: ReadonlySet<string>;
|
|
338
|
+
/** Restricts results to items that will advertise a resume action, and restricts `total` to
|
|
339
|
+
* counting only those — feeds the resume picker, whose "N of M" overflow header needs a
|
|
340
|
+
* resumable-only M. `total` stays a DISCOVERY count (an upper bound): a record whose transcript
|
|
341
|
+
* later proves empty or unreadable is dropped from `sessions` but still counted, since exact
|
|
342
|
+
* counting would mean summarizing every transcript in the store. */
|
|
343
|
+
readonly requireResume?: boolean;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/** Actions a provider can perform on one historical item. Action presence is the capability: a
|
|
347
|
+
* resume action carries its required directory, while archive is appropriate to the item's
|
|
348
|
+
* disposition. */
|
|
349
|
+
export interface AgentSessionHistoryActions {
|
|
350
|
+
readonly resume?: { readonly cwd: string };
|
|
351
|
+
readonly archive?: true;
|
|
295
352
|
}
|
|
296
353
|
|
|
297
|
-
/** A
|
|
298
|
-
export interface
|
|
354
|
+
/** A provider-local historical session. */
|
|
355
|
+
export interface AgentSessionHistoryItem {
|
|
299
356
|
readonly id: string;
|
|
357
|
+
/** The owning agent's {@link AgentSession.providerId}. Set by the provider, which is the only
|
|
358
|
+
* side that knows it once one provider fronts several agents — and it has to match the live
|
|
359
|
+
* namespace exactly, because consumers dedupe a past row against a live one by
|
|
360
|
+
* `getAgentSessionIdentityKey(providerId, id)`. */
|
|
300
361
|
readonly providerId: string;
|
|
301
|
-
|
|
302
|
-
readonly
|
|
362
|
+
readonly disposition: AgentSessionHistoryDisposition;
|
|
363
|
+
readonly actions: AgentSessionHistoryActions;
|
|
303
364
|
readonly lastActivity: Date;
|
|
365
|
+
readonly name?: string;
|
|
304
366
|
/** Mirrors {@link AgentSession.transcriptTitles} — kept unresolved so naming stays the display
|
|
305
367
|
* cascade's job rather than being decided here. */
|
|
306
368
|
readonly titles?: { readonly custom?: string; readonly ai?: string; readonly agent?: string };
|
|
369
|
+
readonly firstPrompt?: string;
|
|
307
370
|
readonly lastPrompt?: string;
|
|
308
371
|
}
|
|
309
372
|
|
|
310
|
-
export interface
|
|
311
|
-
readonly sessions:
|
|
312
|
-
/**
|
|
373
|
+
export interface AgentSessionHistoryResult {
|
|
374
|
+
readonly sessions: AgentSessionHistoryItem[];
|
|
375
|
+
/** Every matching historical record, not just the detailed slice — drives inline paging. */
|
|
313
376
|
readonly total: number;
|
|
314
377
|
}
|
|
315
378
|
|
|
@@ -334,6 +397,18 @@ export interface IpcRegistrar {
|
|
|
334
397
|
unpublishAgents(): Promise<void>;
|
|
335
398
|
}
|
|
336
399
|
|
|
400
|
+
/** One entry of the host's current-agent listing, independent of the CLI's durable store.
|
|
401
|
+
* `kind: 'background'` entries carry `state` and no `pid`, including terminal states the listing
|
|
402
|
+
* retains; interactive entries carry `pid` and `status`. */
|
|
403
|
+
export interface LiveAgentSession {
|
|
404
|
+
pid?: number;
|
|
405
|
+
cwd?: string;
|
|
406
|
+
kind?: string;
|
|
407
|
+
status?: string;
|
|
408
|
+
state?: string;
|
|
409
|
+
waitingFor?: string;
|
|
410
|
+
}
|
|
411
|
+
|
|
337
412
|
export interface AgentProviderCallbacks {
|
|
338
413
|
/** Host-supplied IPC service. Required for agents to receive hook events from the GK CLI. */
|
|
339
414
|
ipc: IpcRegistrar;
|
|
@@ -400,4 +475,26 @@ export interface AgentProviderCallbacks {
|
|
|
400
475
|
* this to `claude-vscode.editor.open`. Throws if the extension isn't installed/active.
|
|
401
476
|
*/
|
|
402
477
|
openSessionInClaudeExtension?(sessionId: string): Promise<void>;
|
|
478
|
+
|
|
479
|
+
/** Host-side launcher wired into providers that support resumable history. Kept generic at the
|
|
480
|
+
* provider boundary: each harness chooses whether and when to expose it as a capability. */
|
|
481
|
+
resumeSession?(
|
|
482
|
+
sessionId: string,
|
|
483
|
+
cwd: string,
|
|
484
|
+
target: AgentSessionResumeTarget,
|
|
485
|
+
name?: string,
|
|
486
|
+
): Promise<AgentSessionResumeOutcome | false>;
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Host-supplied lookup of Claude's current interactive/background session listing, keyed by
|
|
490
|
+
* session id. It revives stale durable `ended` records and narrowly corrects active records
|
|
491
|
+
* whose last event is stale: first discovery and synthesized, unresolvable permission asks.
|
|
492
|
+
* Terminal background states (`done`, `failed`, `stopped`) are listed but are not live; absence
|
|
493
|
+
* from the map is unknown and must preserve record-derived state. `status` is set for
|
|
494
|
+
* `kind: 'interactive'` entries (`'waiting'`, `'busy'`, …); `state` is set for
|
|
495
|
+
* `kind: 'background'` entries instead (no `pid`). Declared structurally (not imported from
|
|
496
|
+
* `@env/`) because this package cannot depend on the host's environment abstraction. Optional
|
|
497
|
+
* on hosts with no such lookup; without it, durable records are trusted as-is.
|
|
498
|
+
*/
|
|
499
|
+
getLiveAgentSessions?(): Promise<ReadonlyMap<string, LiveAgentSession>>;
|
|
403
500
|
}
|
|
@@ -133,7 +133,7 @@ export type PromptTemplateType =
|
|
|
133
133
|
| 'start-review-pullRequest'
|
|
134
134
|
| 'start-work-issue';
|
|
135
135
|
|
|
136
|
-
type PromptTemplateVersions = '' | '_v2' | '_v3';
|
|
136
|
+
type PromptTemplateVersions = '' | '_v2' | '_v3' | '_v4';
|
|
137
137
|
|
|
138
138
|
export type PromptTemplateId<T extends PromptTemplateType = PromptTemplateType> = `${T}${PromptTemplateVersions}`;
|
|
139
139
|
|
package/src/plus/ai/prompts.ts
CHANGED
|
@@ -292,23 +292,35 @@ Example output structure:
|
|
|
292
292
|
Based on the provided commit messages and associated issues, create a set of markdown changelog entries following the instructions above. Do not include any explanatory text or metadata`,
|
|
293
293
|
};
|
|
294
294
|
|
|
295
|
+
/** Example output block shared by the {@link generateSearchQuery} template and its structural-retry prompt */
|
|
296
|
+
export const generateSearchQueryExampleJson = `{
|
|
297
|
+
"query": "[search operators here]",
|
|
298
|
+
"explanation": "[one short sentence describing the interpretation]",
|
|
299
|
+
"mode": "highlight",
|
|
300
|
+
"alternates": []
|
|
301
|
+
}`;
|
|
302
|
+
|
|
295
303
|
export const generateSearchQuery: PromptTemplate<'generate-searchQuery'> = {
|
|
296
|
-
id: 'generate-
|
|
304
|
+
id: 'generate-searchQuery_v4',
|
|
297
305
|
variables: ['query', 'date', 'context', 'instructions'],
|
|
298
306
|
template: `You are an advanced AI assistant that converts natural language queries into structured Git search operators. Your task is to analyze a user's natural language query about their Git repository history and convert it into the appropriate search operators.
|
|
299
307
|
|
|
300
308
|
Available search operators:
|
|
301
309
|
- 'message:' - Search in commit messages (e.g. 'message:fix bug'); maps to \`git log --extended-regexp --grep=<value>\`
|
|
310
|
+
- '-message:' - Exclude commits whose message contains a term (e.g. '-message:wip'); maps to \`git log --invert-grep --grep=<value>\`. Never mix 'message:' and '-message:' in the same query -- git's --invert-grep applies to every --grep pattern in the command, so combining included and excluded message terms is invalid.
|
|
302
311
|
- 'author:' - Search by a specific author (e.g. 'author:eamodio' or use '@me' for current user); maps to \`git log --author=<value>\`
|
|
312
|
+
- 'committer:' - Search by a specific committer (e.g. 'committer:eamodio' or use '@me' for current user); maps to \`git log --committer=<value>\`. There is no way to exclude an author or committer -- only to include one; if the user asks to exclude one, explain that limitation in the explanation field and omit the filter rather than inventing syntax.
|
|
303
313
|
- 'commit:' - Search by a specific commit SHA (e.g. 'commit:4ce3a')
|
|
304
314
|
- 'file:' - Search by file path (e.g. 'file:"package.json"', 'file:"*.ts"'); maps to \`git log -- <value>\`
|
|
305
315
|
- 'change:' - Search by specific code changes using regular expressions (e.g. 'change:"function.*auth"', 'change:"import.*react"'); maps to \`git log -G<value>\`
|
|
306
|
-
- 'type:' - Search by type -- supports stash, tip, and wip (e.g. 'type:stash', 'type:tip', 'type:wip'). Use 'type:wip' for queries about work in progress, uncommitted changes, or pending changes across worktrees.
|
|
316
|
+
- 'type:' - Search by type -- supports stash, tip, merge, and wip (e.g. 'type:stash', 'type:tip', 'type:merge', 'type:wip'). Use 'type:merge' for merge commits only, and 'type:wip' for queries about work in progress, uncommitted changes, or pending changes across worktrees.
|
|
307
317
|
- 'ref:' - Search for commits reachable by a reference (branch, tag, commit) or reference range. Supports single refs (e.g. 'ref:main', 'ref:v1.0'), two-dot ranges (e.g. 'ref:main..feature' for commits in feature but not in main), three-dot ranges (e.g. 'ref:main...feature' for symmetric difference), and relative refs (e.g. 'ref:HEAD~5..HEAD'); maps to \`git log <ref>\`
|
|
308
318
|
- 'after:' - Search for commits after a certain date or range (e.g. 'after:2023-01-01', 'after:"6 months ago"', 'after:"last Tuesday"', 'after:"noon"', 'after:"1 month 2 days ago"'); maps to \`git log --since=<value>\`
|
|
309
319
|
- 'before:' - Search for commits before a certain date or range (e.g. 'before:2023-01-01', 'before:"6 months ago"', 'before:"yesterday"', 'before:"3PM GMT"'); maps to \`git log --until=<value>\`
|
|
310
320
|
|
|
311
|
-
File and change values should be double-quoted. You can use multiple message, author, file, change, and ref operators at the same time if needed.
|
|
321
|
+
File and change values should be double-quoted. You can use multiple message, author, committer, file, change, and ref operators at the same time if needed.
|
|
322
|
+
|
|
323
|
+
The values of 'message:', '-message:', 'author:', and 'committer:' are compiled as case-insensitive POSIX extended regular expressions (ERE). Any regex metacharacters in the user's intended literal text -- \`( ) [ ] { } . * + ? | ^ $ \\\` -- MUST be escaped with a backslash unless they are intentionally being used as regex.
|
|
312
324
|
|
|
313
325
|
Use 'ref:' when the query involves exploring commit history within or between specific references. Use temporal operators ('after:', 'before:') for date-based filtering. These operators can be combined when appropriate.
|
|
314
326
|
|
|
@@ -320,11 +332,57 @@ Temporal queries leverage Git's 'approxidate' parser, which understands relative
|
|
|
320
332
|
The current date is \${date}
|
|
321
333
|
\${context}
|
|
322
334
|
|
|
335
|
+
When repository refs (branches, worktrees) are listed in the context above, only use ref: values from that list — never invent a ref name.
|
|
336
|
+
If the context above includes a previously failed query and the error it produced, return a corrected query that fixes that error while preserving the original intent.
|
|
337
|
+
|
|
323
338
|
User Query: \${query}
|
|
324
339
|
|
|
325
340
|
\${instructions}
|
|
326
341
|
|
|
327
|
-
Convert the user's natural language query into the appropriate search operators.
|
|
342
|
+
Convert the user's natural language query into the appropriate search operators.
|
|
343
|
+
|
|
344
|
+
Respond ONLY with a JSON object in this exact shape:
|
|
345
|
+
- "query": the converted search query using the operators above, as a single string
|
|
346
|
+
- "explanation": one short sentence, in the user's own terms, describing how their query was interpreted
|
|
347
|
+
- "mode": one of "highlight", "filter", or "select" — "highlight" is the default (find and mark matches); use "filter" when the user asks to see ONLY matching commits (e.g. "only my commits", "just show", "filter to"); use "select" when the user asks to be taken to a specific commit or location (e.g. "take me to", "jump to", "what commit is X at", "where is")
|
|
348
|
+
- "alternates": an array of 0-2 alternative queries for the same intent — one broader, one narrower, whichever make sense; use an empty array if none do
|
|
349
|
+
|
|
350
|
+
If the query cannot be converted to search operators, put the original text in "query" as a message search with all regex metacharacters escaped, and explain that in "explanation".
|
|
351
|
+
|
|
352
|
+
For complex temporal expressions that might be ambiguous, prefer simpler, more reliable relative date formats.
|
|
353
|
+
|
|
354
|
+
Example output structure:
|
|
355
|
+
${generateSearchQueryExampleJson}
|
|
356
|
+
|
|
357
|
+
Return only the JSON object and no other text — no code fences, no explanatory text.`,
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
/** Schema counterpart of the {@link generateSearchQuery} template's described output shape */
|
|
361
|
+
export const generateSearchQuerySchema: AIResponseFormat = {
|
|
362
|
+
name: 'generate_search_query',
|
|
363
|
+
schema: {
|
|
364
|
+
type: 'object',
|
|
365
|
+
additionalProperties: false,
|
|
366
|
+
required: ['query', 'explanation', 'mode', 'alternates'],
|
|
367
|
+
properties: {
|
|
368
|
+
query: { type: 'string', description: 'The converted search query using the documented operators' },
|
|
369
|
+
explanation: {
|
|
370
|
+
type: 'string',
|
|
371
|
+
description: "One short sentence, in the user's own terms, describing how the query was interpreted",
|
|
372
|
+
},
|
|
373
|
+
mode: {
|
|
374
|
+
type: 'string',
|
|
375
|
+
enum: ['highlight', 'filter', 'select'],
|
|
376
|
+
description:
|
|
377
|
+
'How the query should be applied: highlight matches, filter to only matches, or select/jump to a specific commit',
|
|
378
|
+
},
|
|
379
|
+
alternates: {
|
|
380
|
+
type: 'array',
|
|
381
|
+
items: { type: 'string' },
|
|
382
|
+
description: 'Up to 2 alternative queries for the same intent; empty array if none make sense',
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
},
|
|
328
386
|
};
|
|
329
387
|
|
|
330
388
|
/** Example output block shared by the {@link generateCommits} template and its structural-retry prompt */
|