@gitkraken/core-gitlens 0.7.0 → 0.7.2

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.
Files changed (125) hide show
  1. package/CHANGELOG.md +28 -2
  2. package/dist/git/remotes/azure-devops.js +3 -3
  3. package/dist/git/remotes/azure-devops.js.map +1 -1
  4. package/dist/plus/integrations/authentication/configuredIntegrationService.js +9 -2
  5. package/dist/plus/integrations/authentication/configuredIntegrationService.js.map +1 -1
  6. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js +1 -1
  7. package/dist/plus/integrations/collectionMetadata.d.ts +48 -3
  8. package/dist/plus/integrations/collectionMetadata.js +138 -8
  9. package/dist/plus/integrations/collectionMetadata.js.map +1 -1
  10. package/dist/plus/integrations/errors.d.ts +3 -1
  11. package/dist/plus/integrations/errors.js +7 -3
  12. package/dist/plus/integrations/errors.js.map +1 -1
  13. package/dist/plus/integrations/index.d.ts +3 -3
  14. package/dist/plus/integrations/index.js.map +1 -1
  15. package/dist/plus/integrations/integrationService.d.ts +35 -1
  16. package/dist/plus/integrations/integrationService.js +90 -43
  17. package/dist/plus/integrations/integrationService.js.map +1 -1
  18. package/dist/plus/integrations/lite.js +5 -4
  19. package/dist/plus/integrations/lite.js.map +1 -1
  20. package/dist/plus/integrations/manager.d.ts +68 -23
  21. package/dist/plus/integrations/models/gitHostIntegration.d.ts +31 -15
  22. package/dist/plus/integrations/models/gitHostIntegration.js +71 -22
  23. package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
  24. package/dist/plus/integrations/models/integration.d.ts +70 -12
  25. package/dist/plus/integrations/models/integration.js +56 -1
  26. package/dist/plus/integrations/models/integration.js.map +1 -1
  27. package/dist/plus/integrations/models/issueReads.d.ts +17 -0
  28. package/dist/plus/integrations/models/issuesIntegration.js +2 -0
  29. package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
  30. package/dist/plus/integrations/models/pullRequestReads.d.ts +26 -0
  31. package/dist/plus/integrations/providers/azure/azure.d.ts +66 -1
  32. package/dist/plus/integrations/providers/azure/azure.js +192 -12
  33. package/dist/plus/integrations/providers/azure/azure.js.map +1 -1
  34. package/dist/plus/integrations/providers/azure/search.d.ts +144 -0
  35. package/dist/plus/integrations/providers/azure/search.js +250 -0
  36. package/dist/plus/integrations/providers/azure/search.js.map +1 -0
  37. package/dist/plus/integrations/providers/azureDevOps.d.ts +73 -36
  38. package/dist/plus/integrations/providers/azureDevOps.js +191 -122
  39. package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
  40. package/dist/plus/integrations/providers/azureDevOpsServer.d.ts +176 -0
  41. package/dist/plus/integrations/providers/azureDevOpsServer.js +560 -0
  42. package/dist/plus/integrations/providers/azureDevOpsServer.js.map +1 -0
  43. package/dist/plus/integrations/providers/bitbucket-server/discovery.d.ts +12 -0
  44. package/dist/plus/integrations/providers/bitbucket-server/discovery.js +128 -0
  45. package/dist/plus/integrations/providers/bitbucket-server/discovery.js.map +1 -0
  46. package/dist/plus/integrations/providers/bitbucket-server/models.d.ts +10 -1
  47. package/dist/plus/integrations/providers/bitbucket-server/models.js +3 -2
  48. package/dist/plus/integrations/providers/bitbucket-server/models.js.map +1 -1
  49. package/dist/plus/integrations/providers/bitbucket-server/pullRequestSearch.d.ts +58 -0
  50. package/dist/plus/integrations/providers/bitbucket-server/pullRequestSearch.js +485 -0
  51. package/dist/plus/integrations/providers/bitbucket-server/pullRequestSearch.js.map +1 -0
  52. package/dist/plus/integrations/providers/bitbucket-server.d.ts +61 -3
  53. package/dist/plus/integrations/providers/bitbucket-server.js +114 -20
  54. package/dist/plus/integrations/providers/bitbucket-server.js.map +1 -1
  55. package/dist/plus/integrations/providers/bitbucket.d.ts +9 -1
  56. package/dist/plus/integrations/providers/bitbucket.js +13 -2
  57. package/dist/plus/integrations/providers/bitbucket.js.map +1 -1
  58. package/dist/plus/integrations/providers/github.d.ts +6 -6
  59. package/dist/plus/integrations/providers/github.js +35 -34
  60. package/dist/plus/integrations/providers/github.js.map +1 -1
  61. package/dist/plus/integrations/providers/gitlab.d.ts +6 -4
  62. package/dist/plus/integrations/providers/gitlab.js +32 -28
  63. package/dist/plus/integrations/providers/gitlab.js.map +1 -1
  64. package/dist/plus/integrations/providers/issueSorts.d.ts +1 -0
  65. package/dist/plus/integrations/providers/jira-server.d.ts +9 -0
  66. package/dist/plus/integrations/providers/jira-server.js +15 -7
  67. package/dist/plus/integrations/providers/jira-server.js.map +1 -1
  68. package/dist/plus/integrations/providers/jira.d.ts +9 -0
  69. package/dist/plus/integrations/providers/jira.js +14 -2
  70. package/dist/plus/integrations/providers/jira.js.map +1 -1
  71. package/dist/plus/integrations/providers/linear.js +2 -2
  72. package/dist/plus/integrations/providers/models.d.ts +10 -1
  73. package/dist/plus/integrations/providers/models.js +86 -0
  74. package/dist/plus/integrations/providers/models.js.map +1 -1
  75. package/dist/plus/integrations/providers/providersApi.d.ts +10 -0
  76. package/dist/plus/integrations/providers/providersApi.js +18 -3
  77. package/dist/plus/integrations/providers/providersApi.js.map +1 -1
  78. package/dist/plus/integrations/providers/utils.d.ts +12 -1
  79. package/dist/plus/integrations/providers/utils.js +36 -6
  80. package/dist/plus/integrations/providers/utils.js.map +1 -1
  81. package/dist/plus/integrations/reads/broaden.js +6 -6
  82. package/dist/plus/integrations/reads/broaden.js.map +1 -1
  83. package/dist/plus/integrations/reads/context.d.ts +1 -1
  84. package/dist/plus/integrations/reads/counts.d.ts +18 -4
  85. package/dist/plus/integrations/reads/counts.js +66 -15
  86. package/dist/plus/integrations/reads/counts.js.map +1 -1
  87. package/dist/plus/integrations/reads/cursors.js +1 -1
  88. package/dist/plus/integrations/reads/drains.d.ts +2 -1
  89. package/dist/plus/integrations/reads/drains.js +1 -1
  90. package/dist/plus/integrations/reads/filters.d.ts +1 -1
  91. package/dist/plus/integrations/reads/filters.js +17 -12
  92. package/dist/plus/integrations/reads/filters.js.map +1 -1
  93. package/dist/plus/integrations/reads/hierarchy.js +2 -2
  94. package/dist/plus/integrations/reads/hierarchy.js.map +1 -1
  95. package/dist/plus/integrations/reads/hierarchy.utils.js +1 -1
  96. package/dist/plus/integrations/reads/issueBatch.js +1 -1
  97. package/dist/plus/integrations/reads/issueTracker.js +2 -2
  98. package/dist/plus/integrations/reads/issues.js +2 -2
  99. package/dist/plus/integrations/reads/paging.js +1 -1
  100. package/dist/plus/integrations/reads/resolveRepository.d.ts +12 -11
  101. package/dist/plus/integrations/reads/resolveRepository.js +110 -19
  102. package/dist/plus/integrations/reads/resolveRepository.js.map +1 -1
  103. package/dist/plus/integrations/reads/searchIssues.js +4 -2
  104. package/dist/plus/integrations/reads/searchIssues.js.map +1 -1
  105. package/dist/plus/integrations/reads/searchPullRequests.js +9 -3
  106. package/dist/plus/integrations/reads/searchPullRequests.js.map +1 -1
  107. package/dist/plus/integrations/reads/sweeps.js +1 -1
  108. package/dist/plus/integrations/reads/trackerIssue.d.ts +9 -5
  109. package/dist/plus/integrations/reads/trackerIssue.js +15 -9
  110. package/dist/plus/integrations/reads/trackerIssue.js.map +1 -1
  111. package/dist/plus/integrations/reads/warnings.d.ts +6 -2
  112. package/dist/plus/integrations/reads/warnings.js +15 -19
  113. package/dist/plus/integrations/reads/warnings.js.map +1 -1
  114. package/dist/plus/integrations/results.d.ts +84 -6
  115. package/dist/plus/integrations/results.js +9 -2
  116. package/dist/plus/integrations/results.js.map +1 -1
  117. package/dist/plus/integrations/utils/domain.utils.d.ts +19 -0
  118. package/dist/plus/integrations/utils/domain.utils.js +36 -1
  119. package/dist/plus/integrations/utils/domain.utils.js.map +1 -1
  120. package/dist/plus/integrations/utils/integration.utils.d.ts +1 -0
  121. package/dist/plus/integrations/utils/integration.utils.js +12 -1
  122. package/dist/plus/integrations/utils/integration.utils.js.map +1 -1
  123. package/docs/integrations.md +263 -74
  124. package/docs/kepler-read-api-parity.md +19 -6
  125. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"gitHostIntegration.js","names":[],"sources":["../../../../../plus/integrations/src/models/gitHostIntegration.ts"],"sourcesContent":["import type { CollectionMetadata, CollectionScopeFailure, GitHubPullRequestFieldMap } from '@gitkraken/provider-apis';\nimport type { Account, UnidentifiedAuthor } from '@gitlens/git/models/author.js';\nimport type { DefaultBranch } from '@gitlens/git/models/defaultBranch.js';\nimport type { IssueSearchCriteria, IssueShape } from '@gitlens/git/models/issue.js';\nimport type { IssueOrPullRequestState as PullRequestState } from '@gitlens/git/models/issueOrPullRequest.js';\nimport type {\n\tPullRequest,\n\tPullRequestMergeMethod,\n\tPullRequestSearchCriteria,\n\tPullRequestStackInfo,\n\tPullRequestStateFilter,\n} from '@gitlens/git/models/pullRequest.js';\nimport type { RepositoryMetadata } from '@gitlens/git/models/repositoryMetadata.js';\nimport type { ResourceDescriptor } from '@gitlens/git/models/resourceDescriptor.js';\nimport type { PullRequestUrlIdentity } from '@gitlens/git/utils/pullRequest.utils.js';\nimport { ensureArray } from '@gitlens/utils/array.js';\nimport { isCancellationError } from '@gitlens/utils/cancellation.js';\nimport { gate } from '@gitlens/utils/decorators/gate.js';\nimport { trace } from '@gitlens/utils/decorators/log.js';\nimport { first } from '@gitlens/utils/iterable.js';\nimport { Logger } from '@gitlens/utils/logger.js';\nimport { getScopedLogger } from '@gitlens/utils/logger.scoped.js';\nimport type { PagedResult } from '@gitlens/utils/paging.js';\nimport type { ProviderAuthenticationSession } from '../authentication/models.js';\nimport { toTokenWithInfo } from '../authentication/models.js';\nimport {\n\tthrowIfCallerContractError,\n\ttoCollectionFailureError,\n\ttoCollectionScopeFailure,\n} from '../collectionMetadata.js';\nimport type { IntegrationIds } from '../constants.js';\nimport { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId } from '../constants.js';\nimport { toError } from '../errors.js';\nimport type {\n\tGetIssuesOptions,\n\tGetPullRequestsOptions,\n\tPagedProjectInput,\n\tPagedRepoInput,\n\tProviderAccount,\n\tProviderApiPagedResult,\n\tProviderHierarchyResult,\n\tProviderIssue,\n\tProviderOrganization,\n\tProviderPullRequest,\n\tProviderRepoInput,\n\tProviderReposInput,\n\tProviderRepository,\n} from '../providers/models.js';\nimport {\n\tIssueFilter,\n\tPagingMode,\n\tPullRequestFilter,\n\ttoIssueShape,\n\ttoProviderIssueStates,\n\ttoProviderPullRequestStates,\n} from '../providers/models.js';\nimport type { ProvidersApi } from '../providers/providersApi.js';\nimport { mergeCollectionMetadata, throwIfAllSettledFailed } from '../providers/utils/providerPaging.js';\nimport { baseUrlFromDomain } from '../utils/domain.utils.js';\nimport type {\n\tIntegrationResult,\n\tIntegrationType,\n\tProviderIssueSearchPage,\n\tProviderPullRequestSearchPage,\n} from './integration.js';\nimport { IntegrationBase } from './integration.js';\nimport type { MyIssuesForReposOptions } from './issueReads.js';\n\nfunction isAzureDevOpsProvider(\n\tproviderId: IntegrationIds,\n): providerId is GitCloudHostIntegrationId.AzureDevOps | GitSelfManagedHostIntegrationId.AzureDevOpsServer {\n\treturn (\n\t\tproviderId === GitCloudHostIntegrationId.AzureDevOps ||\n\t\tproviderId === GitSelfManagedHostIntegrationId.AzureDevOpsServer\n\t);\n}\n\nfunction getSelfManagedApiBaseUrl(\n\tproviderId: IntegrationIds,\n\tdomain: string | undefined,\n\tprotocol: string | undefined,\n): string | undefined {\n\tconst baseUrl = baseUrlFromDomain(domain, protocol);\n\tif (baseUrl == null) return undefined;\n\n\tswitch (providerId) {\n\t\tcase GitSelfManagedHostIntegrationId.CloudGitHubEnterprise:\n\t\t\treturn `${baseUrl.replace(/\\/api(?:\\/v\\d+)?$/, '')}/api/v3`;\n\t\tcase GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted:\n\t\t\treturn baseUrl.replace(/\\/api(?:\\/v\\d+)?$/, '');\n\t\tcase GitSelfManagedHostIntegrationId.BitbucketServer:\n\t\t\treturn `${baseUrl.replace(/\\/rest\\/api\\/1\\.0$/, '')}/rest/api/1.0`;\n\t\tcase GitSelfManagedHostIntegrationId.AzureDevOpsServer:\n\t\t\treturn baseUrl;\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\n/** Read options for {@link GitHostIntegration.searchMyPullRequests} and the provider hook behind it. */\nexport type SearchMyPullRequestsOptions = {\n\t/** Suppresses the user-facing notification when the read fails. */\n\tsilent?: boolean;\n\t/**\n\t * PR states to include (open/closed/merged/all). Providers that cannot express it in a single query\n\t * filter the normalized results; omitted preserves the historical open-only behavior.\n\t */\n\tstate?: PullRequestStateFilter;\n\tincludeReviewRequested?: boolean;\n};\n\n/** Read options for {@link GitHostIntegration.searchPullRequests} and the provider hook behind it. */\nexport type SearchPullRequestsOptions = {\n\t/** PR states to include; omitted preserves the provider's default. */\n\tinclude?: PullRequestState[];\n};\n\ntype MyPullRequestsForReposOptions = {\n\tfilters?: PullRequestFilter[];\n\tcursor?: string;\n\tcustomUrl?: string;\n\tpage?: number;\n\tpageSize?: number;\n\t/** PR states to include; when omitted the provider returns its default (open only). */\n\tstate?: PullRequestStateFilter | PullRequestStateFilter[];\n\t/** Requests the lightweight row shape without per-row build status or commit count. */\n\tsummary?: boolean;\n};\n\n/**\n * Rejects a read the provider can't serve as asked: logs the reason and returns it as the `{ error }` half of an\n * {@link IntegrationResult}, timed from `start`.\n *\n * A single builder because these refusals are a contract, not incidental returns — the read cores below reject on\n * unsupported input, an inexpressible filter set, or an unresolvable filter account, and each one must reach the\n * caller as an error it can surface as a warning rather than as an empty success. Writing the message once also\n * keeps the logged text and the thrown text from drifting apart, which is exactly what happened while each site\n * spelled its message out twice.\n */\nfunction unsupportedRead<T>(message: string, start: number, logContext?: string): IntegrationResult<T> {\n\tLogger.warn(message, logContext);\n\treturn { error: new Error(message), duration: performance.now() - start };\n}\n\n/**\n * Both fields gate the same GitHub `commits` subtree, so either truthy key retains the build-status rollup.\n * An absent map retains the full row; a summary read explicitly drops both optional fields.\n */\nconst summaryPullRequestFields: Required<GitHubPullRequestFieldMap> = {\n\theadCommit: false,\n\tcommitCount: false,\n};\n\nexport abstract class GitHostIntegration<\n\tID extends IntegrationIds = IntegrationIds,\n\tT extends ResourceDescriptor = ResourceDescriptor,\n> extends IntegrationBase<ID> {\n\treadonly type: IntegrationType = 'git';\n\n\t@gate()\n\t@trace()\n\tasync getAccountForEmail(repo: T, email: string, options?: { avatarSize?: number }): Promise<Account | undefined> {\n\t\tconst scope = getScopedLogger();\n\n\t\tconst connected = this.maybeConnected ?? (await this.isConnected());\n\t\tif (!connected) return undefined;\n\n\t\tawait this.refreshSessionIfExpired(scope);\n\n\t\ttry {\n\t\t\tconst author = await this.getProviderAccountForEmail(this._session!, repo, email, options);\n\t\t\tthis.resetRequestExceptionCount('getAccountForEmail');\n\t\t\treturn author;\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getAccountForEmail', ex, { scope: scope });\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprotected abstract getProviderAccountForEmail(\n\t\tsession: ProviderAuthenticationSession,\n\t\trepo: T,\n\t\temail: string,\n\t\toptions?: { avatarSize?: number },\n\t): Promise<Account | undefined>;\n\n\t/**\n\t * Returns the SSH signing keys (full OpenSSH-format `<type> <key> [comment]` strings) registered by the accounts\n\t * matching the given emails on this integration, for building an `allowed_signers` file. Keyed by lowercased email;\n\t * emails with no match (and unsupported integrations) are absent. Batching the lookups is left to the integration.\n\t */\n\t@gate()\n\t@trace()\n\tasync getSshSigningKeysForEmails(repo: T, emails: string[]): Promise<Map<string, string[]>> {\n\t\tconst scope = getScopedLogger();\n\n\t\tconst connected = this.maybeConnected ?? (await this.isConnected());\n\t\tif (!connected) return new Map();\n\n\t\tawait this.refreshSessionIfExpired(scope);\n\n\t\ttry {\n\t\t\tconst keys = await this.getProviderSshSigningKeysForEmails(this._session!, repo, emails);\n\t\t\tthis.resetRequestExceptionCount('getSshSigningKeysForEmails');\n\t\t\treturn keys;\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getSshSigningKeysForEmails', ex, { scope: scope });\n\t\t\treturn new Map();\n\t\t}\n\t}\n\n\t/** Override in integrations that expose users' SSH signing keys. Defaults to none. */\n\tprotected getProviderSshSigningKeysForEmails(\n\t\t_session: ProviderAuthenticationSession,\n\t\t_repo: T,\n\t\t_emails: string[],\n\t): Promise<Map<string, string[]>> {\n\t\treturn Promise.resolve(new Map<string, string[]>());\n\t}\n\n\t@gate()\n\t@trace()\n\tasync getAccountForCommit(\n\t\trepo: T,\n\t\trev: string,\n\t\toptions?: { avatarSize?: number },\n\t): Promise<Account | UnidentifiedAuthor | undefined> {\n\t\tconst scope = getScopedLogger();\n\n\t\tconst connected = this.maybeConnected ?? (await this.isConnected());\n\t\tif (!connected) return undefined;\n\n\t\tawait this.refreshSessionIfExpired(scope);\n\n\t\ttry {\n\t\t\tconst author = await this.getProviderAccountForCommit(this._session!, repo, rev, options);\n\t\t\tthis.resetRequestExceptionCount('getAccountForCommit');\n\t\t\treturn author;\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getAccountForCommit', ex, { scope: scope });\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprotected abstract getProviderAccountForCommit(\n\t\tsession: ProviderAuthenticationSession,\n\t\trepo: T,\n\t\trev: string,\n\t\toptions?: { avatarSize?: number },\n\t): Promise<Account | UnidentifiedAuthor | undefined>;\n\n\t@trace()\n\tasync getDefaultBranch(\n\t\trepo: T,\n\t\toptions?: { cancellation?: AbortSignal; expiryOverride?: boolean | number },\n\t): Promise<DefaultBranch | undefined> {\n\t\tconst scope = getScopedLogger();\n\n\t\tconst connected = this.maybeConnected ?? (await this.isConnected());\n\t\tif (!connected) return undefined;\n\n\t\tawait this.refreshSessionIfExpired(scope);\n\n\t\tconst defaultBranch = this.ctx.cache.getRepositoryDefaultBranch(\n\t\t\trepo,\n\t\t\tthis,\n\t\t\t() => ({\n\t\t\t\tvalue: (async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result = await this.getProviderDefaultBranch(this._session!, repo, options?.cancellation);\n\t\t\t\t\t\tthis.resetRequestExceptionCount('getDefaultBranch');\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\tthis.handleProviderException('getDefaultBranch', ex, { scope: scope });\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t})(),\n\t\t\t}),\n\t\t\t{ expiryOverride: options?.expiryOverride },\n\t\t);\n\t\treturn defaultBranch;\n\t}\n\n\tgetRepoInfo?(repo: {\n\t\towner: string;\n\t\tname: string;\n\t\tproject?: string;\n\t\tconnectionId?: string;\n\t}): Promise<ProviderRepository | undefined>;\n\n\t/** Stack membership for every stacked pull request in the repository, keyed by pull request number.\n\t * Only hosts with a stacks concept implement this (currently GitHub). */\n\tgetStacksByPullRequestNumber?(\n\t\towner: string,\n\t\trepo: string,\n\t\tcancellation?: AbortSignal,\n\t): Promise<Map<number, PullRequestStackInfo> | undefined>;\n\n\tprotected abstract getProviderDefaultBranch(\n\t\t{ accessToken }: ProviderAuthenticationSession,\n\t\trepo: T,\n\t\tcancellation?: AbortSignal,\n\t): Promise<DefaultBranch | undefined>;\n\n\t@trace()\n\tasync getRepositoryMetadata(\n\t\trepo: T,\n\t\toptions?: { cancellation?: AbortSignal; expiryOverride?: boolean | number },\n\t): Promise<RepositoryMetadata | undefined> {\n\t\tconst scope = getScopedLogger();\n\n\t\tconst connected = this.maybeConnected ?? (await this.isConnected());\n\t\tif (!connected) return undefined;\n\n\t\tawait this.refreshSessionIfExpired(scope);\n\n\t\tconst metadata = this.ctx.cache.getRepositoryMetadata(\n\t\t\trepo,\n\t\t\tthis,\n\t\t\t() => ({\n\t\t\t\tvalue: (async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result = await this.getProviderRepositoryMetadata(\n\t\t\t\t\t\t\tthis._session!,\n\t\t\t\t\t\t\trepo,\n\t\t\t\t\t\t\toptions?.cancellation,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.resetRequestExceptionCount('getRepositoryMetadata');\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\tthis.handleProviderException('getRepositoryMetadata', ex, { scope: scope });\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t})(),\n\t\t\t}),\n\t\t\t{ expiryOverride: options?.expiryOverride },\n\t\t);\n\t\treturn metadata;\n\t}\n\n\tprotected abstract getProviderRepositoryMetadata(\n\t\tsession: ProviderAuthenticationSession,\n\t\trepo: T,\n\t\tcancellation?: AbortSignal,\n\t): Promise<RepositoryMetadata | undefined>;\n\n\t/**\n\t * Whether this git host implements generic org discovery. False for providers that register no\n\t * {@link getProviderOrganizationsForUser} hook (e.g. Bitbucket Data Center) — the facade uses this to\n\t * report `unsupported` instead of a silent empty list, which is indistinguishable from \"has no orgs\".\n\t */\n\tget supportsOrganizationDiscovery(): boolean {\n\t\treturn this.getProviderOrganizationsForUser != null;\n\t}\n\n\t/** Whether this git host implements generic repository discovery ({@link getProviderRepositoriesForOrg}). */\n\tget supportsRepositoryDiscovery(): boolean {\n\t\treturn this.getProviderRepositoriesForOrg != null;\n\t}\n\n\t/**\n\t * Whether this git host has a project tier between org and repo ({@link getProviderProjectsForOrg}). Only\n\t * Azure DevOps does; the facade uses this to skip the read entirely rather than call a core that returns\n\t * `undefined` for a session-less reason and be misread as a broken connection.\n\t */\n\tget supportsProjectDiscovery(): boolean {\n\t\treturn this.getProviderProjectsForOrg != null;\n\t}\n\n\t/**\n\t * Whether this git host implements the account-wide user-affiliated repository read\n\t * ({@link getProviderRepositoriesForUser}) — the org-less `gk provider repos <provider>` equivalent.\n\t */\n\tget supportsUserRepositoryDiscovery(): boolean {\n\t\treturn this.getProviderRepositoriesForUser != null;\n\t}\n\n\t/**\n\t * Whether this git host exposes issues on the ProviderBackend surface. Most git hosts do; a host with no\n\t * usable issue tracker overrides this to false — Bitbucket Cloud (deprecated in favor of dedicated issue\n\t * integrations like Jira) and Bitbucket Data Center (never had one) — so the facade reports issues as\n\t * unsupported instead of serving a partial/deprecated source or failing inside a provider client that\n\t * registers no issue function at all.\n\t *\n\t * Keep this in sync with {@link ProviderMetadata.supportedIssueFilters}: a provider that declares no issue\n\t * filters and no issue read is answering the same capability question twice, and the two must agree.\n\t */\n\tget supportsIssues(): boolean {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Lists the organizations (orgs/workspaces/groups) the current user belongs to on this host.\n\t * `truncated === true` means the defensive page-drain backstop stopped before the upstream listing was\n\t * exhausted.\n\t *\n\t * Resolves the session for `connectionId` (or the primary connection when omitted, honoring multi-account\n\t * reads) and recovers a thrown error into `{ error }` so callers can surface it as a warning instead of\n\t * swallowing it to `undefined`.\n\t */\n\t@trace()\n\tasync getOrganizationsForUserResult(\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<ProviderHierarchyResult<ProviderOrganization> | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst result = await this.getProviderOrganizationsForUser?.(session);\n\t\t\tthis.resetRequestExceptionCount('getOrganizationsForUser');\n\t\t\treturn { value: result, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getOrganizationsForUser', ex, {\n\t\t\t\tscope: scope,\n\t\t\t\tconnectionId: connectionId,\n\t\t\t});\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\tprotected getProviderOrganizationsForUser?(\n\t\tsession: ProviderAuthenticationSession,\n\t): Promise<ProviderHierarchyResult<ProviderOrganization> | undefined>;\n\n\t/**\n\t * Result-returning list of the projects a git host exposes beneath its orgs, unified into the\n\t * {@link ProviderOrganization} shape. Only Azure DevOps has a project tier between org and repo; other\n\t * git hosts have none and leave {@link getProviderProjectsForOrg} undefined, so this returns `undefined`\n\t * for them (the ProviderBackend facade then treats them as having no projects). With `org`, scopes to\n\t * that org's projects; without, returns projects across every org the user can see.\n\t */\n\t@trace()\n\tasync getProjectsForOrgResult(\n\t\torg?: string,\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<ProviderHierarchyResult<ProviderOrganization> | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tif (this.getProviderProjectsForOrg == null) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst result = await this.getProviderProjectsForOrg(session, org);\n\t\t\tthis.resetRequestExceptionCount('getProjectsForOrg');\n\t\t\treturn { value: result, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getProjectsForOrg', ex, { scope: scope, connectionId: connectionId });\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\tprotected getProviderProjectsForOrg?(\n\t\tsession: ProviderAuthenticationSession,\n\t\torg?: string,\n\t): Promise<ProviderHierarchyResult<ProviderOrganization> | undefined>;\n\n\t/**\n\t * Lists repositories under the given organization (org/workspace/group) one page at a time — follow\n\t * `paging.cursor` to page, or drain with the integrations provider paging helper.\n\t * `options.project` is only meaningful for Azure DevOps, whose repos are scoped by `org` + `project`;\n\t * every other host ignores it. (Azure without a project can't page its cross-project merge, so it\n\t * returns all matches in a single page.) `truncated === true` means the defensive page-drain\n\t * backstop stopped before the upstream listing was exhausted.\n\t *\n\t * Resolves the session for `connectionId` (or the primary connection when omitted) and recovers a thrown\n\t * error into `{ error }`, so a caller surfaces it as a warning instead of a silent `undefined`.\n\t */\n\t@trace()\n\tasync getRepositoriesForOrgResult(\n\t\torg: string,\n\t\toptions?: { project?: string; cursor?: string; connectionId?: string },\n\t): Promise<IntegrationResult<ProviderHierarchyResult<ProviderRepository> | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(options?.connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst result = await this.getProviderRepositoriesForOrg?.(session, org, options);\n\t\t\tthis.resetRequestExceptionCount('getRepositoriesForOrg');\n\t\t\treturn { value: result, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getRepositoriesForOrg', ex, {\n\t\t\t\tscope: scope,\n\t\t\t\tconnectionId: options?.connectionId,\n\t\t\t});\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\tprotected getProviderRepositoriesForOrg?(\n\t\tsession: ProviderAuthenticationSession,\n\t\torg: string,\n\t\toptions?: { project?: string; cursor?: string },\n\t): Promise<ProviderHierarchyResult<ProviderRepository> | undefined>;\n\n\t/**\n\t * Result-returning account-wide, user-affiliated repository read (the org-less\n\t * `gk provider repos <provider>` equivalent): repositories the user owns, collaborates on, or can\n\t * access through org membership — NOT every repo of every org. Optional: providers without a native\n\t * user-affiliated listing (Bitbucket workspaces, Azure orgs, which require an org/workspace scope)\n\t * leave the hook undefined and the facade reports the read as unsupported so callers fan out per org.\n\t */\n\t@trace()\n\tasync getRepositoriesForUserResult(options?: {\n\t\tcursor?: string;\n\t\tconnectionId?: string;\n\t}): Promise<IntegrationResult<ProviderHierarchyResult<ProviderRepository> | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(options?.connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tif (this.getProviderRepositoriesForUser == null) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst result = await this.getProviderRepositoriesForUser(session, options);\n\t\t\tthis.resetRequestExceptionCount('getRepositoriesForUser');\n\t\t\treturn { value: result, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getRepositoriesForUser', ex, {\n\t\t\t\tscope: scope,\n\t\t\t\tconnectionId: options?.connectionId,\n\t\t\t});\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\tprotected getProviderRepositoriesForUser?(\n\t\tsession: ProviderAuthenticationSession,\n\t\toptions?: { cursor?: string },\n\t): Promise<ProviderHierarchyResult<ProviderRepository> | undefined>;\n\n\tasync mergePullRequest(\n\t\tpr: PullRequest,\n\t\toptions?: { mergeMethod?: PullRequestMergeMethod },\n\t\tcancellation?: AbortSignal,\n\t): Promise<boolean> {\n\t\tconst scope = getScopedLogger();\n\n\t\tconst connected = this.maybeConnected ?? (await this.isConnected());\n\t\tif (!connected) return false;\n\n\t\tawait this.refreshSessionIfExpired(scope);\n\n\t\ttry {\n\t\t\tconst result = await this.mergeProviderPullRequest(this._session!, pr, options, cancellation);\n\t\t\tthis.resetRequestExceptionCount('mergePullRequest');\n\t\t\treturn result;\n\t\t} catch (ex) {\n\t\t\tif (isCancellationError(ex)) return false;\n\n\t\t\tthis.handleProviderException('mergePullRequest', ex, { scope: scope });\n\t\t\treturn false;\n\t\t} finally {\n\t\t\t// A merge attempt just changed the state of more than this pull request on the server (a\n\t\t\t// stacked merge lands every layer below and retargets every layer above) whether it succeeded\n\t\t\t// or failed partway through — so cached pull requests can't be trusted either way. Without\n\t\t\t// this, ref pills and branch enrichment keep serving the pre-merge object until its expiry.\n\t\t\tthis.ctx.cache.deletePullRequests();\n\t\t}\n\t}\n\n\tprotected abstract mergeProviderPullRequest(\n\t\tsession: ProviderAuthenticationSession,\n\t\tpr: PullRequest,\n\t\toptions?: { mergeMethod?: PullRequestMergeMethod },\n\t\tcancellation?: AbortSignal,\n\t): Promise<boolean>;\n\n\t@trace()\n\tasync getPullRequestForBranch(\n\t\trepo: T,\n\t\tbranch: string,\n\t\toptions?: {\n\t\t\tavatarSize?: number;\n\t\t\texpiryOverride?: boolean | number;\n\t\t\tinclude?: PullRequestState[];\n\t\t\t/** Rethrow a failed lookup instead of folding it into `undefined`, for callers that must tell\n\t\t\t * \"no pull request\" apart from \"couldn't ask\". */\n\t\t\tthrowOnError?: boolean;\n\t\t},\n\t): Promise<PullRequest | undefined> {\n\t\tconst scope = getScopedLogger();\n\n\t\tconst connected = this.maybeConnected ?? (await this.isConnected());\n\t\tif (!connected) return undefined;\n\n\t\tawait this.refreshSessionIfExpired(scope);\n\n\t\tconst { expiryOverride, throwOnError, ...opts } = options ?? {};\n\n\t\tconst pr = this.ctx.cache.getPullRequestForBranch(\n\t\t\tbranch,\n\t\t\trepo,\n\t\t\tthis,\n\t\t\tcacheable => ({\n\t\t\t\tvalue: (async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result = await this.getProviderPullRequestForBranch(this._session!, repo, branch, opts);\n\t\t\t\t\t\tthis.resetRequestExceptionCount('getPullRequestForBranch');\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\t// A failed lookup is not an answer: left cached, the `undefined` below reads as \"no pull\n\t\t\t\t\t\t// request\" for the bucket's whole expiry (an hour by branch).\n\t\t\t\t\t\tcacheable.invalidate();\n\t\t\t\t\t\tthis.handleProviderException('getPullRequestForBranch', ex, { scope: scope });\n\t\t\t\t\t\tif (throwOnError) throw ex;\n\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t})(),\n\t\t\t}),\n\t\t\t{ expiryOverride: expiryOverride },\n\t\t);\n\t\treturn pr;\n\t}\n\n\tprotected abstract getProviderPullRequestForBranch(\n\t\tsession: ProviderAuthenticationSession,\n\t\trepo: T,\n\t\tbranch: string,\n\t\toptions?: { avatarSize?: number; include?: PullRequestState[] },\n\t): Promise<PullRequest | undefined>;\n\n\t@trace()\n\tasync getPullRequestForCommit(\n\t\trepo: T,\n\t\trev: string,\n\t\toptions?: { expiryOverride?: boolean | number; throwOnError?: boolean },\n\t): Promise<PullRequest | undefined> {\n\t\tconst scope = getScopedLogger();\n\n\t\tconst connected = this.maybeConnected ?? (await this.isConnected());\n\t\tif (!connected) return undefined;\n\n\t\tawait this.refreshSessionIfExpired(scope);\n\n\t\tconst { throwOnError, ...cacheOptions } = options ?? {};\n\n\t\tconst pr = this.ctx.cache.getPullRequestForSha(\n\t\t\trev,\n\t\t\trepo,\n\t\t\tthis,\n\t\t\tcacheable => ({\n\t\t\t\tvalue: (async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result = await this.getProviderPullRequestForCommit(this._session!, repo, rev);\n\t\t\t\t\t\tthis.resetRequestExceptionCount('getPullRequestForCommit');\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\t// A failed lookup is not an answer — and the by-sha bucket never expires a miss.\n\t\t\t\t\t\tcacheable.invalidate();\n\t\t\t\t\t\tthis.handleProviderException('getPullRequestForCommit', ex, { scope: scope });\n\t\t\t\t\t\tif (throwOnError) throw ex;\n\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t})(),\n\t\t\t}),\n\t\t\tcacheOptions,\n\t\t);\n\t\treturn pr;\n\t}\n\n\tprotected abstract getProviderPullRequestForCommit(\n\t\tsession: ProviderAuthenticationSession,\n\t\trepo: T,\n\t\trev: string,\n\t): Promise<PullRequest | undefined>;\n\n\t/**\n\t * Memoized identity lookups backing filter resolution. Keyed by the session's token fingerprint plus the\n\t * scope of the lookup (base URL, and the Azure organization for the per-instance variant), so a different\n\t * account, host, or org never reuses an entry and a rotated token simply misses.\n\t *\n\t * Not cleared when the token changes: one integration instance serves every connection of its provider\n\t * (multi-account), so clearing on a fingerprint change would make two accounts reading in alternation\n\t * evict each other and defeat the memo. Entries are bounded by tokens x hosts x orgs seen — a handful for\n\t * the life of the integration.\n\t */\n\tprivate readonly _filterAccounts = new Map<string, Promise<ProviderAccount | undefined>>();\n\n\t/**\n\t * Resolves the account a repo-scoped read turns `IssueFilter`/`PullRequestFilter` into a provider\n\t * login/id with, memoized per token+scope.\n\t *\n\t * Every FILTERED read needs this, and `ProvidersApi.getCurrentUser` is a bare round trip — unlike\n\t * {@link IntegrationBase.getCurrentAccount}, which the host caches. So a consumer that fans ONE page out\n\t * into several filtered reads paid one identity request PER read, all resolving the same account: a\n\t * per-user-facet fan-out (author + assignee + review-requested) doubled its request count, and paid it\n\t * again on every page turn.\n\t *\n\t * The promise is memoized rather than the value, so concurrent facets share one in-flight request instead\n\t * of racing. A rejection is evicted so the next read retries rather than caching a failure — matching how\n\t * `getCurrentAccount` invalidates on error.\n\t */\n\tprivate getFilterAccount(\n\t\tapi: ProvidersApi,\n\t\tsession: ProviderAuthenticationSession,\n\t\tcustomUrl: string | undefined,\n\t\torganization?: string,\n\t): Promise<ProviderAccount | undefined> {\n\t\tconst key = `${this.getSessionFingerprint(session)}:${customUrl ?? ''}:${organization ?? ''}`;\n\n\t\tlet pending = this._filterAccounts.get(key);\n\t\tif (pending == null) {\n\t\t\tconst tokenWithInfo = toTokenWithInfo(this.authProvider.id, session);\n\t\t\tpending = (\n\t\t\t\torganization != null\n\t\t\t\t\t? api.getCurrentUserForInstance(tokenWithInfo, organization, { baseUrl: customUrl })\n\t\t\t\t\t: api.getCurrentUser(tokenWithInfo, { baseUrl: customUrl })\n\t\t\t).catch((ex: unknown) => {\n\t\t\t\tthis._filterAccounts.delete(key);\n\t\t\t\tthrow ex;\n\t\t\t});\n\t\t\tthis._filterAccounts.set(key, pending);\n\t\t}\n\n\t\treturn pending;\n\t}\n\n\tasync getMyIssuesForRepos(\n\t\treposOrRepoIds: ProviderReposInput,\n\t\toptions?: MyIssuesForReposOptions,\n\t\tconnectionId?: string,\n\t): Promise<PagedResult<ProviderIssue> | undefined> {\n\t\treturn (await this.getMyIssuesForReposResult(reposOrRepoIds, options, connectionId))?.value;\n\t}\n\n\t/**\n\t * Result-returning core of {@link getMyIssuesForRepos}. Resolves the session for `connectionId`\n\t * (or the primary connection when omitted, so multi-account reads use the right token) and recovers\n\t * thrown errors and validation failures into `{ error }` so callers can surface them as warnings\n\t * rather than swallowing them to `undefined`.\n\t */\n\tasync getMyIssuesForReposResult(\n\t\treposOrRepoIds: ProviderReposInput,\n\t\toptions?: MyIssuesForReposOptions,\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<(PagedResult<ProviderIssue> & { metadata?: CollectionMetadata }) | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\tconst providerId = this.authProvider.id;\n\t\tconst states = toProviderIssueStates(options?.state);\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary. The session\n\t\t// is resolved here for connectivity/bail; the connection's token is applied per API call below.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\tconst customUrl =\n\t\t\toptions?.customUrl ?? getSelfManagedApiBaseUrl(providerId, session.domain || this.domain, session.protocol);\n\n\t\tlet api: ProvidersApi;\n\t\ttry {\n\t\t\tapi = await this.getProvidersApi();\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getIssuesForRepos', ex, { scope: scope, connectionId: connectionId });\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t\tconst repoIdsInput = api.isRepoIdsInput(reposOrRepoIds);\n\t\tif (\n\t\t\tproviderId !== GitCloudHostIntegrationId.GitLab &&\n\t\t\t(repoIdsInput ||\n\t\t\t\t(isAzureDevOpsProvider(providerId) &&\n\t\t\t\t\t!reposOrRepoIds.every(repo => repo.project != null && repo.namespace != null)))\n\t\t) {\n\t\t\treturn unsupportedRead(`Unsupported input for provider ${providerId}`, start, 'getIssuesForRepos');\n\t\t}\n\n\t\tlet getIssuesOptions: GetIssuesOptions | undefined;\n\t\tif (isAzureDevOpsProvider(providerId)) {\n\t\t\tconst organizations = new Set<string>();\n\t\t\tconst projects = new Set<string>();\n\t\t\tfor (const repo of reposOrRepoIds as ProviderRepoInput[]) {\n\t\t\t\torganizations.add(repo.namespace);\n\t\t\t\tprojects.add(repo.project!);\n\t\t\t}\n\n\t\t\tif (organizations.size > 1) {\n\t\t\t\treturn unsupportedRead(\n\t\t\t\t\t`Multiple organizations not supported for provider ${providerId}`,\n\t\t\t\t\tstart,\n\t\t\t\t\t'getIssuesForRepos',\n\t\t\t\t);\n\t\t\t} else if (organizations.size === 0) {\n\t\t\t\treturn unsupportedRead(`No organizations found for provider ${providerId}`, start, 'getIssuesForRepos');\n\t\t\t}\n\n\t\t\tconst organization: string = first(organizations.values())!;\n\n\t\t\tif (options?.filters != null) {\n\t\t\t\tif (!api.providerSupportsIssueFilters(providerId, options.filters)) {\n\t\t\t\t\treturn unsupportedRead(\n\t\t\t\t\t\t`Unsupported filters for provider ${providerId}`,\n\t\t\t\t\t\tstart,\n\t\t\t\t\t\t'getIssuesForRepos',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tlet userAccount: ProviderAccount | undefined;\n\t\t\t\ttry {\n\t\t\t\t\tuserAccount = await this.getFilterAccount(api, session, customUrl, organization);\n\t\t\t\t} catch (ex) {\n\t\t\t\t\tthis.handleProviderException('getIssuesForRepos', ex, {\n\t\t\t\t\t\tscope: scope,\n\t\t\t\t\t\tconnectionId: connectionId,\n\t\t\t\t\t});\n\t\t\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t\t\t}\n\n\t\t\t\tif (userAccount == null) {\n\t\t\t\t\treturn unsupportedRead(`Unable to get current user for ${providerId}`, start, 'getIssuesForRepos');\n\t\t\t\t}\n\n\t\t\t\tconst userFilterProperty = userAccount.name;\n\n\t\t\t\tif (userFilterProperty == null) {\n\t\t\t\t\treturn unsupportedRead(\n\t\t\t\t\t\t`Unable to get user property for filter for ${providerId}`,\n\t\t\t\t\t\tstart,\n\t\t\t\t\t\t'getIssuesForRepos',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tgetIssuesOptions = {\n\t\t\t\t\tauthorLogin: options.filters.includes(IssueFilter.Author) ? userFilterProperty : undefined,\n\t\t\t\t\tassigneeLogins:\n\t\t\t\t\t\t!options.includeAllAssignees && options.filters.includes(IssueFilter.Assignee)\n\t\t\t\t\t\t\t? [userFilterProperty]\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\tmentionLogin: options.filters.includes(IssueFilter.Mention) ? userFilterProperty : undefined,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst cursorInfo = this.parseCursorInfo<PagedProjectInput>(options?.cursor);\n\t\t\tconst cursors: PagedProjectInput[] = cursorInfo.cursors ?? [];\n\t\t\tlet projectInputs: PagedProjectInput[] = Array.from(projects.values(), project => ({\n\t\t\t\tnamespace: organization,\n\t\t\t\tproject: project,\n\t\t\t\tcursor: undefined,\n\t\t\t}));\n\t\t\tif (cursors.length > 0) {\n\t\t\t\tprojectInputs = cursors;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst cursor: { cursors: PagedProjectInput[]; page?: number } = { cursors: [] };\n\t\t\t\tlet hasMore = false;\n\t\t\t\tlet truncated = false;\n\t\t\t\tlet metadata: CollectionMetadata | undefined;\n\t\t\t\tconst data: ProviderIssue[] = [];\n\t\t\t\t// `allSettled`, not `Promise.all`: one project's read rejecting must not discard every sibling\n\t\t\t\t// project's already-fetched issues and cursors. A rejected project is recorded as a structured\n\t\t\t\t// failure so the facade can warn and set `fetchFailed` instead of reporting a partial project set\n\t\t\t\t// as complete.\n\t\t\t\tconst settled = await Promise.allSettled(\n\t\t\t\t\tprojectInputs.map(async projectInput => {\n\t\t\t\t\t\tconst results = await api.getIssuesForAzureProject(\n\t\t\t\t\t\t\ttoTokenWithInfo(providerId, session),\n\t\t\t\t\t\t\tprojectInput.namespace,\n\t\t\t\t\t\t\tprojectInput.project,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...getIssuesOptions,\n\t\t\t\t\t\t\t\tcursor: projectInput.cursor,\n\t\t\t\t\t\t\t\tbaseUrl: customUrl,\n\t\t\t\t\t\t\t\t// Continuation is driven by the per-project cursor; only apply an explicit page on the\n\t\t\t\t\t\t\t\t// first request so it can't clobber a continuation cursor on later pages.\n\t\t\t\t\t\t\t\tpage: projectInput.cursor == null ? options?.page : undefined,\n\t\t\t\t\t\t\t\tpageSize: options?.pageSize,\n\t\t\t\t\t\t\t\tstates: states,\n\t\t\t\t\t\t\t\tsort: options?.sort,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn { projectInput: projectInput, results: results };\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tthrowIfAllSettledFailed(settled);\n\n\t\t\t\tfor (let i = 0; i < settled.length; i++) {\n\t\t\t\t\tconst outcome = settled[i];\n\t\t\t\t\tconst projectInput = projectInputs[i];\n\t\t\t\t\tif (outcome.status !== 'fulfilled') {\n\t\t\t\t\t\t// Errors that really are per-scope (auth, rate limit, a missing project) degrade below; one\n\t\t\t\t\t\t// that is a fact about the call is re-thrown instead — see `throwIfCallerContractError`.\n\t\t\t\t\t\tthrowIfCallerContractError(outcome.reason);\n\n\t\t\t\t\t\ttruncated = true;\n\t\t\t\t\t\tconst failure = toCollectionScopeFailure(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tproviderId: providerId,\n\t\t\t\t\t\t\t\tresourceId: projectInput.namespace,\n\t\t\t\t\t\t\t\tprojectId: projectInput.project,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\toutcome.reason,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tmetadata = mergeCollectionMetadata(metadata, {\n\t\t\t\t\t\t\tcompleteness: 'partial',\n\t\t\t\t\t\t\tfailures: [failure],\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst { projectInput: _projectInput, results } = outcome.value;\n\t\t\t\t\tdata.push(...results.values);\n\t\t\t\t\tif (results.paging?.more) {\n\t\t\t\t\t\thasMore = true;\n\t\t\t\t\t\tcursor.cursors.push({\n\t\t\t\t\t\t\tnamespace: projectInput.namespace,\n\t\t\t\t\t\t\tproject: projectInput.project,\n\t\t\t\t\t\t\tcursor: results.paging.cursor,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Keep the requested page number in the composite cursor so the facade can report the real\n\t\t\t\t// currentPage when the consumer continues using only the cursor.\n\t\t\t\tif (options?.page != null) {\n\t\t\t\t\tcursor.page = options.page;\n\t\t\t\t}\n\n\t\t\t\tthis.resetRequestExceptionCount('getIssuesForRepos');\n\t\t\t\treturn {\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\tvalues: data,\n\t\t\t\t\t\tpaging: {\n\t\t\t\t\t\t\tmore: hasMore,\n\t\t\t\t\t\t\tcursor: JSON.stringify(cursor),\n\t\t\t\t\t\t\ttruncated: truncated || undefined,\n\t\t\t\t\t\t\t// Echo the requested numbered page so the facade reports the real currentPage for\n\t\t\t\t\t\t\t// numbered-page hosts (GitLab/Bitbucket/Azure), not a synthesized 1. Cursor-only hosts\n\t\t\t\t\t\t\t// leave `page` undefined via their own reads.\n\t\t\t\t\t\t\tpage: options?.page,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmetadata: metadata,\n\t\t\t\t\t},\n\t\t\t\t\tduration: performance.now() - start,\n\t\t\t\t};\n\t\t\t} catch (ex) {\n\t\t\t\tthis.handleProviderException('getIssuesForRepos', ex, {\n\t\t\t\t\tscope: scope,\n\t\t\t\t\tconnectionId: connectionId,\n\t\t\t\t});\n\t\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t\t}\n\t\t}\n\t\tif (options?.filters != null) {\n\t\t\t// Validate the requested filters against what this provider actually supports — same guard the Azure\n\t\t\t// branch above applies. Without it an unsupported filter (e.g. GitLab has no Mention endpoint) would\n\t\t\t// resolve to no filter property being set and silently degrade to an unfiltered, project-wide read.\n\t\t\tif (!api.providerSupportsIssueFilters(providerId, options.filters)) {\n\t\t\t\treturn unsupportedRead(`Unsupported filters for provider ${providerId}`, start, 'getIssuesForRepos');\n\t\t\t}\n\n\t\t\tlet userAccount: ProviderAccount | undefined;\n\t\t\ttry {\n\t\t\t\tuserAccount = await this.getFilterAccount(api, session, customUrl);\n\t\t\t} catch (ex) {\n\t\t\t\tthis.handleProviderException('getIssuesForRepos', ex, {\n\t\t\t\t\tscope: scope,\n\t\t\t\t\tconnectionId: connectionId,\n\t\t\t\t});\n\t\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t\t}\n\n\t\t\tif (userAccount == null) {\n\t\t\t\treturn unsupportedRead(`Unable to get current user for ${providerId}`, start, 'getIssuesForRepos');\n\t\t\t}\n\n\t\t\tconst userFilterProperty = userAccount.username;\n\t\t\tif (userFilterProperty == null) {\n\t\t\t\treturn unsupportedRead(\n\t\t\t\t\t`Unable to get user property for filter for ${providerId}`,\n\t\t\t\t\tstart,\n\t\t\t\t\t'getIssuesForRepos',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tgetIssuesOptions = {\n\t\t\t\tauthorLogin: options.filters.includes(IssueFilter.Author) ? userFilterProperty : undefined,\n\t\t\t\tassigneeLogins:\n\t\t\t\t\t!options.includeAllAssignees && options.filters.includes(IssueFilter.Assignee)\n\t\t\t\t\t\t? [userFilterProperty]\n\t\t\t\t\t\t: undefined,\n\t\t\t\tmentionLogin: options.filters.includes(IssueFilter.Mention) ? userFilterProperty : undefined,\n\t\t\t};\n\t\t}\n\n\t\tif (api.getProviderIssuesPagingMode(providerId) === PagingMode.Repo && !repoIdsInput) {\n\t\t\tconst cursorInfo = this.parseCursorInfo<PagedRepoInput>(options?.cursor);\n\t\t\tconst cursors: PagedRepoInput[] = cursorInfo.cursors ?? [];\n\t\t\tlet repoInputs: PagedRepoInput[] = reposOrRepoIds.map(repo => ({ repo: repo, cursor: undefined }));\n\t\t\tif (cursors.length > 0) {\n\t\t\t\trepoInputs = cursors;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst cursor: { cursors: PagedRepoInput[]; page?: number } = { cursors: [] };\n\t\t\t\tlet hasMore = false;\n\t\t\t\tlet truncated = false;\n\t\t\t\tlet metadata: CollectionMetadata | undefined;\n\t\t\t\tconst data: ProviderIssue[] = [];\n\t\t\t\t// `allSettled`, not `Promise.all`: one repo's read rejecting must not discard every sibling repo's\n\t\t\t\t// already-fetched issues and cursors. A rejected repo is recorded as a structured failure so the\n\t\t\t\t// facade can warn and set `fetchFailed` instead of reporting a partial repo set as complete.\n\t\t\t\tconst settled = await Promise.allSettled(\n\t\t\t\t\trepoInputs.map(async repoInput => {\n\t\t\t\t\t\tconst results = await api.getIssuesForRepo(\n\t\t\t\t\t\t\ttoTokenWithInfo(providerId, session),\n\t\t\t\t\t\t\trepoInput.repo,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...getIssuesOptions,\n\t\t\t\t\t\t\t\tcursor: repoInput.cursor,\n\t\t\t\t\t\t\t\tbaseUrl: customUrl,\n\t\t\t\t\t\t\t\t// Continuation is driven by the per-repo cursor; only apply an explicit page on the\n\t\t\t\t\t\t\t\t// first request so it can't clobber a continuation cursor on later pages.\n\t\t\t\t\t\t\t\tpage: repoInput.cursor == null ? options?.page : undefined,\n\t\t\t\t\t\t\t\tpageSize: options?.pageSize,\n\t\t\t\t\t\t\t\tstates: states,\n\t\t\t\t\t\t\t\tsort: options?.sort,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn { repoInput: repoInput, results: results };\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tthrowIfAllSettledFailed(settled);\n\n\t\t\t\tfor (let i = 0; i < settled.length; i++) {\n\t\t\t\t\tconst outcome = settled[i];\n\t\t\t\t\tconst repoInput = repoInputs[i];\n\t\t\t\t\tif (outcome.status !== 'fulfilled') {\n\t\t\t\t\t\t// See the project fan-out above. Reachable in practice even though the facade validates the\n\t\t\t\t\t\t// key first — a self-managed GitLab can reject an `IssueSort` member the SDK declares, which\n\t\t\t\t\t\t// is only discoverable from the response.\n\t\t\t\t\t\tthrowIfCallerContractError(outcome.reason);\n\n\t\t\t\t\t\ttruncated = true;\n\t\t\t\t\t\tconst failure = toCollectionScopeFailure(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tproviderId: providerId,\n\t\t\t\t\t\t\t\trepositoryId: `${repoInput.repo.namespace}/${repoInput.repo.name}`,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\toutcome.reason,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tmetadata = mergeCollectionMetadata(metadata, {\n\t\t\t\t\t\t\tcompleteness: 'partial',\n\t\t\t\t\t\t\tfailures: [failure],\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst { repoInput: _repoInput, results } = outcome.value;\n\t\t\t\t\tdata.push(...results.values);\n\t\t\t\t\tif (results.paging?.more) {\n\t\t\t\t\t\thasMore = true;\n\t\t\t\t\t\tcursor.cursors.push({ repo: repoInput.repo, cursor: results.paging.cursor });\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (options?.page != null) {\n\t\t\t\t\tcursor.page = options.page;\n\t\t\t\t}\n\n\t\t\t\tthis.resetRequestExceptionCount('getIssuesForRepos');\n\t\t\t\treturn {\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\tvalues: data,\n\t\t\t\t\t\tpaging: {\n\t\t\t\t\t\t\tmore: hasMore,\n\t\t\t\t\t\t\tcursor: JSON.stringify(cursor),\n\t\t\t\t\t\t\ttruncated: truncated || undefined,\n\t\t\t\t\t\t\t// Echo the requested numbered page so the facade reports the real currentPage for\n\t\t\t\t\t\t\t// numbered-page hosts (GitLab/Bitbucket/Azure), not a synthesized 1. Cursor-only hosts\n\t\t\t\t\t\t\t// leave `page` undefined via their own reads.\n\t\t\t\t\t\t\tpage: options?.page,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmetadata: metadata,\n\t\t\t\t\t},\n\t\t\t\t\tduration: performance.now() - start,\n\t\t\t\t};\n\t\t\t} catch (ex) {\n\t\t\t\tthis.handleProviderException('getIssuesForRepos', ex, {\n\t\t\t\t\tscope: scope,\n\t\t\t\t\tconnectionId: connectionId,\n\t\t\t\t});\n\t\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tconst tokenWithInfo = toTokenWithInfo(providerId, session);\n\t\t\tconst result = await api.getIssuesForRepos(tokenWithInfo, reposOrRepoIds, {\n\t\t\t\t...getIssuesOptions,\n\t\t\t\tcursor: options?.cursor,\n\t\t\t\tbaseUrl: customUrl,\n\t\t\t\tpage: options?.page,\n\t\t\t\tpageSize: options?.pageSize,\n\t\t\t\tstates: states,\n\t\t\t\tsort: options?.sort,\n\t\t\t});\n\t\t\tconst failures = result.metadata?.failures;\n\t\t\tif (\n\t\t\t\trepoIdsInput &&\n\t\t\t\treposOrRepoIds.length > 0 &&\n\t\t\t\tresult.values.length === 0 &&\n\t\t\t\tfailures?.length === reposOrRepoIds.length\n\t\t\t) {\n\t\t\t\tconst ex = toCollectionFailureError(failures[0], tokenWithInfo);\n\t\t\t\tthis.handleProviderException('getIssuesForRepos', ex, {\n\t\t\t\t\tscope: scope,\n\t\t\t\t\tconnectionId: connectionId,\n\t\t\t\t});\n\t\t\t\treturn { error: ex, duration: performance.now() - start };\n\t\t\t}\n\n\t\t\tthis.resetRequestExceptionCount('getIssuesForRepos');\n\t\t\treturn { value: result, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getIssuesForRepos', ex, {\n\t\t\t\tscope: scope,\n\t\t\t\tconnectionId: connectionId,\n\t\t\t});\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\t/**\n\t * Repo-scoped \"my issues\" read returning the normalized {@link IssueShape} the ProviderBackend facade\n\t * consumes (`listIssuesPage({ repos })`, `broadenIssues`). Maps {@link getMyIssuesForReposResult} — the raw\n\t * provider-apis path — to IssueShape.\n\t *\n\t * It's the seam rather than an inline map so a provider whose only issue client already yields normalized\n\t * shapes, and isn't wired into the raw path, can override it and serve these reads without a\n\t * `ProviderIssue` round-trip. No provider does today: the one candidate (Bitbucket Cloud's legacy\n\t * `getUsersIssuesForRepo`) reports `supportsIssues: false`, so the facade never reaches this for it.\n\t */\n\tasync getMyIssuesForReposAsShapesResult(\n\t\treposOrRepoIds: ProviderReposInput,\n\t\toptions?: MyIssuesForReposOptions,\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<(PagedResult<IssueShape> & { metadata?: CollectionMetadata }) | undefined>> {\n\t\tconst result = await this.getMyIssuesForReposResult(reposOrRepoIds, options, connectionId);\n\t\tif (result == null) return undefined;\n\t\tif (result.error != null) return { error: result.error, duration: result.duration };\n\t\tif (result.value == null) return { value: undefined, duration: result.duration };\n\n\t\tconst values = result.value.values\n\t\t\t.map(issue => toIssueShape(issue, this))\n\t\t\t.filter((issue): issue is IssueShape => issue != null);\n\t\treturn { value: { ...result.value, values: values }, duration: result.duration };\n\t}\n\n\tasync getMyPullRequestsForRepos(\n\t\treposOrRepoIds: ProviderReposInput,\n\t\toptions?: MyPullRequestsForReposOptions,\n\t\tconnectionId?: string,\n\t): Promise<ProviderApiPagedResult<ProviderPullRequest> | undefined> {\n\t\treturn (await this.getMyPullRequestsForReposResult(reposOrRepoIds, options, connectionId))?.value;\n\t}\n\n\t/**\n\t * Result-returning core of {@link getMyPullRequestsForRepos}. Resolves the session for `connectionId`\n\t * (or the primary connection when omitted, so multi-account reads use the right token) and recovers\n\t * thrown errors and validation failures into `{ error }` so callers can surface them as warnings\n\t * rather than swallowing them to `undefined`.\n\t */\n\tasync getMyPullRequestsForReposResult(\n\t\treposOrRepoIds: ProviderReposInput,\n\t\toptions?: MyPullRequestsForReposOptions,\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<ProviderApiPagedResult<ProviderPullRequest> | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\tconst providerId = this.authProvider.id;\n\t\tconst states = toProviderPullRequestStates(options?.state);\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary. The session\n\t\t// is resolved here for connectivity/bail; the connection's token is applied per API call below.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\tconst customUrl =\n\t\t\toptions?.customUrl ?? getSelfManagedApiBaseUrl(providerId, session.domain || this.domain, session.protocol);\n\n\t\tlet api: ProvidersApi;\n\t\ttry {\n\t\t\tapi = await this.getProvidersApi();\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getPullRequestsForRepos', ex, {\n\t\t\t\tscope: scope,\n\t\t\t\tconnectionId: connectionId,\n\t\t\t});\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t\tif (\n\t\t\tproviderId !== GitCloudHostIntegrationId.GitLab &&\n\t\t\t(api.isRepoIdsInput(reposOrRepoIds) ||\n\t\t\t\t(isAzureDevOpsProvider(providerId) &&\n\t\t\t\t\t!reposOrRepoIds.every(repo => repo.project != null && repo.namespace != null)))\n\t\t) {\n\t\t\treturn unsupportedRead(`Unsupported input for provider ${providerId}`, start);\n\t\t}\n\n\t\tlet getPullRequestsOptions: GetPullRequestsOptions | undefined;\n\t\tif (options?.filters != null) {\n\t\t\tif (!api.providerSupportsPullRequestFilters(providerId, options.filters)) {\n\t\t\t\treturn unsupportedRead(\n\t\t\t\t\t`Unsupported filters for provider ${providerId}`,\n\t\t\t\t\tstart,\n\t\t\t\t\t'getPullRequestsForRepos',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tlet userAccount: ProviderAccount | undefined;\n\t\t\tif (isAzureDevOpsProvider(providerId)) {\n\t\t\t\tconst organizations = new Set<string>();\n\t\t\t\tfor (const repo of reposOrRepoIds as ProviderRepoInput[]) {\n\t\t\t\t\torganizations.add(repo.namespace);\n\t\t\t\t}\n\n\t\t\t\tif (organizations.size > 1) {\n\t\t\t\t\tLogger.warn(\n\t\t\t\t\t\t`Multiple organizations not supported for provider ${providerId}`,\n\t\t\t\t\t\t'getPullRequestsForRepos',\n\t\t\t\t\t);\n\t\t\t\t\treturn {\n\t\t\t\t\t\terror: new Error(`Multiple organizations not supported for provider ${providerId}`),\n\t\t\t\t\t\tduration: performance.now() - start,\n\t\t\t\t\t};\n\t\t\t\t} else if (organizations.size === 0) {\n\t\t\t\t\treturn unsupportedRead(\n\t\t\t\t\t\t`No organizations found for provider ${providerId}`,\n\t\t\t\t\t\tstart,\n\t\t\t\t\t\t'getPullRequestsForRepos',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst organization: string = first(organizations.values())!;\n\t\t\t\ttry {\n\t\t\t\t\tuserAccount = await this.getFilterAccount(api, session, customUrl, organization);\n\t\t\t\t} catch (ex) {\n\t\t\t\t\tthis.handleProviderException('getPullRequestsForRepos', ex, {\n\t\t\t\t\t\tscope: scope,\n\t\t\t\t\t\tconnectionId: connectionId,\n\t\t\t\t\t});\n\t\t\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tuserAccount = await this.getFilterAccount(api, session, customUrl);\n\t\t\t\t} catch (ex) {\n\t\t\t\t\tthis.handleProviderException('getPullRequestsForRepos', ex, {\n\t\t\t\t\t\tscope: scope,\n\t\t\t\t\t\tconnectionId: connectionId,\n\t\t\t\t\t});\n\t\t\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (userAccount == null) {\n\t\t\t\treturn unsupportedRead(\n\t\t\t\t\t`Unable to get current user for ${providerId}`,\n\t\t\t\t\tstart,\n\t\t\t\t\t'getPullRequestsForRepos',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tlet userFilterProperty: string | null;\n\t\t\tswitch (providerId) {\n\t\t\t\tcase GitCloudHostIntegrationId.Bitbucket:\n\t\t\t\tcase GitCloudHostIntegrationId.AzureDevOps:\n\t\t\t\tcase GitSelfManagedHostIntegrationId.AzureDevOpsServer:\n\t\t\t\t\tuserFilterProperty = userAccount.id;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tuserFilterProperty = userAccount.username;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (userFilterProperty == null) {\n\t\t\t\treturn unsupportedRead(\n\t\t\t\t\t`Unable to get user property for filter for ${providerId}`,\n\t\t\t\t\tstart,\n\t\t\t\t\t'getPullRequestsForRepos',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Route the \"review requested from me\" filter to the field each provider actually reads:\n\t\t\t// GitHub/GitLab expect a login (reviewRequestedLogin), Bitbucket/Azure an account id (reviewerId),\n\t\t\t// and Bitbucket Server a login (reviewerLogin). `userFilterProperty` is already the account id for\n\t\t\t// Bitbucket/Azure and the username for the rest.\n\t\t\tlet reviewRequestedLogin: string | undefined;\n\t\t\tlet reviewerId: string | undefined;\n\t\t\tlet reviewerLogin: string | undefined;\n\t\t\tif (options.filters.includes(PullRequestFilter.ReviewRequested)) {\n\t\t\t\tswitch (providerId) {\n\t\t\t\t\tcase GitCloudHostIntegrationId.Bitbucket:\n\t\t\t\t\tcase GitCloudHostIntegrationId.AzureDevOps:\n\t\t\t\t\tcase GitSelfManagedHostIntegrationId.AzureDevOpsServer:\n\t\t\t\t\t\treviewerId = userFilterProperty;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase GitSelfManagedHostIntegrationId.BitbucketServer:\n\t\t\t\t\t\treviewerLogin = userFilterProperty;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treviewRequestedLogin = userFilterProperty;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgetPullRequestsOptions = {\n\t\t\t\tauthorLogin: options.filters.includes(PullRequestFilter.Author) ? userFilterProperty : undefined,\n\t\t\t\tassigneeLogins: options.filters.includes(PullRequestFilter.Assignee) ? [userFilterProperty] : undefined,\n\t\t\t\treviewRequestedLogin: reviewRequestedLogin,\n\t\t\t\treviewerId: reviewerId,\n\t\t\t\treviewerLogin: reviewerLogin,\n\t\t\t\tmentionLogin: options.filters.includes(PullRequestFilter.Mention) ? userFilterProperty : undefined,\n\t\t\t};\n\t\t}\n\n\t\tif (\n\t\t\tapi.getProviderPullRequestsPagingMode(providerId) === PagingMode.Repo &&\n\t\t\t!api.isRepoIdsInput(reposOrRepoIds)\n\t\t) {\n\t\t\tconst cursorInfo = this.parseCursorInfo<PagedRepoInput>(options?.cursor);\n\t\t\tconst cursors: PagedRepoInput[] = cursorInfo.cursors ?? [];\n\t\t\tlet repoInputs: PagedRepoInput[] = reposOrRepoIds.map(repo => ({ repo: repo, cursor: undefined }));\n\t\t\tif (cursors.length > 0) {\n\t\t\t\trepoInputs = cursors;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst cursor: { cursors: PagedRepoInput[]; page?: number } = { cursors: [] };\n\t\t\t\tlet hasMore = false;\n\t\t\t\tlet truncated = false;\n\t\t\t\tlet metadata: CollectionMetadata | undefined;\n\t\t\t\tconst failures: CollectionScopeFailure[] = [];\n\t\t\t\tconst data: ProviderPullRequest[] = [];\n\t\t\t\t// `allSettled`, not `Promise.all`: one repo's read rejecting must not discard every sibling repo's\n\t\t\t\t// already-fetched PRs and cursors. A rejected repo becomes a structured `CollectionScopeFailure`\n\t\t\t\t// (attributed to that repo) so the facade warns on it + sets `fetchFailed`, while the survivors and\n\t\t\t\t// their continuation cursors are still returned.\n\t\t\t\tconst settled = await Promise.allSettled(\n\t\t\t\t\trepoInputs.map(async repoInput => {\n\t\t\t\t\t\tconst results = await api.getPullRequestsForRepo(\n\t\t\t\t\t\t\ttoTokenWithInfo(providerId, session),\n\t\t\t\t\t\t\trepoInput.repo,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...getPullRequestsOptions,\n\t\t\t\t\t\t\t\tcursor: repoInput.cursor,\n\t\t\t\t\t\t\t\tbaseUrl: customUrl,\n\t\t\t\t\t\t\t\t// Continuation is driven by the per-repo cursor; only apply an explicit page on the\n\t\t\t\t\t\t\t\t// first request so it can't clobber a continuation cursor on later pages.\n\t\t\t\t\t\t\t\tpage: repoInput.cursor == null ? options?.page : undefined,\n\t\t\t\t\t\t\t\tpageSize: options?.pageSize,\n\t\t\t\t\t\t\t\tstates: states,\n\t\t\t\t\t\t\t\t// Azure DevOps only populates clone URLs on request (extra call); no-op elsewhere.\n\t\t\t\t\t\t\t\tincludeRemoteInfo: isAzureDevOpsProvider(providerId) ? true : undefined,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn { repoInput: repoInput, results: results };\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tthrowIfAllSettledFailed(settled);\n\n\t\t\t\t// `allSettled` preserves order, so `settled[i]` is `repoInputs[i]`.\n\t\t\t\tsettled.forEach((outcome, i) => {\n\t\t\t\t\tif (outcome.status !== 'fulfilled') {\n\t\t\t\t\t\tconst failedRepo = repoInputs[i].repo;\n\t\t\t\t\t\tfailures.push(\n\t\t\t\t\t\t\ttoCollectionScopeFailure(\n\t\t\t\t\t\t\t\t{ providerId: providerId, repositoryId: `${failedRepo.namespace}/${failedRepo.name}` },\n\t\t\t\t\t\t\t\toutcome.reason,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst { repoInput, results } = outcome.value;\n\t\t\t\t\tdata.push(...results.values);\n\t\t\t\t\t// Fan-out across repos: preserve each repo's SDK completeness/failures and its terminal\n\t\t\t\t\t// truncation so a single failed/incomplete repo isn't lost when merged with its siblings.\n\t\t\t\t\tmetadata = mergeCollectionMetadata(metadata, results.metadata);\n\t\t\t\t\tif (results.paging?.truncated) {\n\t\t\t\t\t\ttruncated = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (results.paging?.more) {\n\t\t\t\t\t\thasMore = true;\n\t\t\t\t\t\tcursor.cursors.push({ repo: repoInput.repo, cursor: results.paging.cursor });\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Merge the GitLens-side per-repo rejections into the SDK metadata so both flow through the same\n\t\t\t\t// warning/fetchFailed assessment downstream.\n\t\t\t\tif (failures.length > 0) {\n\t\t\t\t\tmetadata = mergeCollectionMetadata(metadata, { completeness: 'partial', failures: failures });\n\t\t\t\t}\n\n\t\t\t\t// Keep the requested page number in the composite cursor so the facade can report the real\n\t\t\t\t// currentPage when the consumer continues using only the cursor.\n\t\t\t\tif (options?.page != null) {\n\t\t\t\t\tcursor.page = options.page;\n\t\t\t\t}\n\n\t\t\t\tthis.resetRequestExceptionCount('getPullRequestsForRepos');\n\t\t\t\treturn {\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\tvalues: data,\n\t\t\t\t\t\tpaging: {\n\t\t\t\t\t\t\tmore: hasMore,\n\t\t\t\t\t\t\tcursor: JSON.stringify(cursor),\n\t\t\t\t\t\t\ttruncated: truncated || undefined,\n\t\t\t\t\t\t\t// Echo the requested numbered page so the facade reports the real currentPage for\n\t\t\t\t\t\t\t// numbered-page hosts (GitLab/Bitbucket/Azure), not a synthesized 1. Cursor-only hosts\n\t\t\t\t\t\t\t// leave `page` undefined via their own reads.\n\t\t\t\t\t\t\tpage: options?.page,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmetadata: metadata,\n\t\t\t\t\t},\n\t\t\t\t\tduration: performance.now() - start,\n\t\t\t\t};\n\t\t\t} catch (ex) {\n\t\t\t\tthis.handleProviderException('getPullRequestsForRepos', ex, {\n\t\t\t\t\tscope: scope,\n\t\t\t\t\tconnectionId: connectionId,\n\t\t\t\t});\n\t\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tconst result = await api.getPullRequestsForRepos(toTokenWithInfo(providerId, session), reposOrRepoIds, {\n\t\t\t\t...getPullRequestsOptions,\n\t\t\t\tcursor: options?.cursor,\n\t\t\t\tbaseUrl: customUrl,\n\t\t\t\tpage: options?.page,\n\t\t\t\tpageSize: options?.pageSize,\n\t\t\t\tstates: states,\n\t\t\t\t// Azure DevOps only populates clone URLs on request (extra call); no-op elsewhere.\n\t\t\t\tincludeRemoteInfo: isAzureDevOpsProvider(providerId) ? true : undefined,\n\t\t\t\tfields: options?.summary ? summaryPullRequestFields : undefined,\n\t\t\t});\n\t\t\tthis.resetRequestExceptionCount('getPullRequestsForRepos');\n\t\t\treturn { value: result, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getPullRequestsForRepos', ex, {\n\t\t\t\tscope: scope,\n\t\t\t\tconnectionId: connectionId,\n\t\t\t});\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\t/** Account-wide (or repo-scoped) search for the current user's pull requests. */\n\t@trace()\n\tasync searchMyPullRequests(\n\t\trepos?: T | T[],\n\t\tcancellation?: AbortSignal,\n\t\toptions?: SearchMyPullRequestsOptions & { connectionId?: string },\n\t): Promise<IntegrationResult<PullRequest[] | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\tconst { connectionId, ...searchOptions } = options ?? {};\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst prs = await this.searchProviderMyPullRequests(\n\t\t\t\tsession,\n\t\t\t\tensureArray(repos),\n\t\t\t\tcancellation,\n\t\t\t\tsearchOptions,\n\t\t\t);\n\t\t\tthis.resetRequestExceptionCount('searchMyPullRequests');\n\t\t\treturn { value: prs, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('searchMyPullRequests', ex, {\n\t\t\t\tscope: scope,\n\t\t\t\tsilent: true,\n\t\t\t\tconnectionId: connectionId,\n\t\t\t});\n\t\t\treturn {\n\t\t\t\terror: toError(ex),\n\t\t\t\tduration: performance.now() - start,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Account-wide, user-scoped counterpart of {@link getMyPullRequestsForReposResult} that returns the raw\n\t * `ProviderPullRequest` shape (not the normalized model). Unlike the repo-scoped core, this needs no\n\t * `repos` — it reads the current user's pull requests across the account, so the ProviderBackend sweep\n\t * can drive its Kanban \"done\" column even when no repositories are supplied (where the repo-scoped core\n\t * rejects an empty `repos` input). Recovers thrown errors into `{ error }` so callers surface warnings.\n\t */\n\tasync getMyPullRequestsForUserResult(\n\t\toptions?: {\n\t\t\tstate?: PullRequestStateFilter[];\n\t\t\tcursor?: string;\n\t\t\tincludeReviewRequested?: boolean;\n\t\t\t/** Exact OR union of account-wide relationships to include. */\n\t\t\tfilters?: PullRequestFilter[];\n\t\t\t/** Request only the stable list fields, omitting optional provider enrichments. */\n\t\t\tsummary?: boolean;\n\t\t},\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<ProviderApiPagedResult<ProviderPullRequest> | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tif (this.getProviderMyPullRequestsForUser == null) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst result = await this.getProviderMyPullRequestsForUser(session, options);\n\t\t\tthis.resetRequestExceptionCount('getMyPullRequestsForUser');\n\t\t\treturn { value: result, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getMyPullRequestsForUser', ex, {\n\t\t\t\tscope: scope,\n\t\t\t\tconnectionId: connectionId,\n\t\t\t});\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\t/**\n\t * Reads the current user's pull requests across the whole account using each provider's native \"my PRs\"\n\t * query, returning the raw provider shape. Without `filters`, the exact user scopes depend on provider-native\n\t * behavior and options like `includeReviewRequested`. With `filters`, each member is an exact account-wide OR\n\t * relationship validated by the facade before this provider hook is called. Optional: providers that can't\n\t * express an account-wide user query leave it undefined and the surface falls back to repo-scoped.\n\t *\n\t * These native user queries are cursor-based, so `cursor` (not a page number) drives continuation; there\n\t * is no jump-to-page-N and no per-call page size on this path.\n\t *\n\t * `includeReviewRequested` opts into the review-requested slice for providers whose account-wide read\n\t * only returns authored PRs natively and must fan out per-repo to add reviewer PRs (Bitbucket). It's off\n\t * by default so a sweep pays gkcli-parity cost (authored only) unless the caller deliberately opts in;\n\t * providers whose native query already covers review-requested PRs ignore it.\n\t */\n\tprotected getProviderMyPullRequestsForUser?(\n\t\tsession: ProviderAuthenticationSession,\n\t\toptions?: {\n\t\t\tstate?: PullRequestStateFilter[];\n\t\t\tcursor?: string;\n\t\t\tincludeReviewRequested?: boolean;\n\t\t\tfilters?: PullRequestFilter[];\n\t\t\tsummary?: boolean;\n\t\t},\n\t): Promise<ProviderApiPagedResult<ProviderPullRequest> | undefined>;\n\n\t/**\n\t * Parses a Repo/Project paging cursor into its `cursors` bundle. Guards against valid JSON whose\n\t * `cursors` is a truthy non-array (e.g. `{ \"cursors\": \"...\" }`), which would otherwise bypass the\n\t * `?? []` fallback at call sites and flow into `.map()` downstream, throwing instead of degrading to\n\t * the first page.\n\t */\n\tprivate parseCursorInfo<T>(cursor?: string): { cursors?: T[] } {\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(cursor ?? '{}') as { cursors?: T[] };\n\t\t\treturn Array.isArray(parsed?.cursors) ? parsed : {};\n\t\t} catch {\n\t\t\treturn {};\n\t\t}\n\t}\n\n\tprotected abstract searchProviderMyPullRequests(\n\t\tsession: ProviderAuthenticationSession,\n\t\trepos?: T[],\n\t\tcancellation?: AbortSignal,\n\t\toptions?: SearchMyPullRequestsOptions,\n\t): Promise<PullRequest[] | undefined>;\n\n\t/**\n\t * Result-returning wrapper for the filtered pull-request search. Errors become the soft\n\t * `{ error }` branch so the public facade can preserve an empty account and a failed request as distinct\n\t * outcomes.\n\t */\n\tasync searchPullRequestsPageResult(\n\t\toptions: {\n\t\t\trepos?: ProviderRepoInput[];\n\t\t\torg?: string;\n\t\t\tcriteria?: PullRequestSearchCriteria;\n\t\t\tcursor?: string;\n\t\t\tpageSize?: number;\n\t\t\t/** See {@link IntegrationManager.searchPullRequestsPage}. */\n\t\t\tsummary?: boolean;\n\t\t},\n\t\tcancellation?: AbortSignal,\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<ProviderPullRequestSearchPage | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst result = await this.searchProviderPullRequestsPage?.(session, options, cancellation);\n\t\t\tthis.resetRequestExceptionCount('searchPullRequestsPage');\n\t\t\treturn { value: result, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('searchPullRequestsPage', ex, { scope: scope, connectionId: connectionId });\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\t/** Must agree with `ProviderMetadata.supportedPullRequestSearch`. */\n\tprotected searchProviderPullRequestsPage?(\n\t\tsession: ProviderAuthenticationSession,\n\t\toptions: {\n\t\t\trepos?: ProviderRepoInput[];\n\t\t\torg?: string;\n\t\t\tcriteria?: PullRequestSearchCriteria;\n\t\t\tcursor?: string;\n\t\t\tpageSize?: number;\n\t\t\t/** See the caller's option of the same name on {@link searchPullRequestsPage}. */\n\t\t\tsummary?: boolean;\n\t\t},\n\t\tcancellation?: AbortSignal,\n\t): Promise<ProviderPullRequestSearchPage | undefined>;\n\n\t/** Free-text search across pull requests, optionally narrowed to `repos`. */\n\t@trace()\n\tasync searchPullRequests(\n\t\tsearchQuery: string,\n\t\trepos?: T | T[],\n\t\tcancellation?: AbortSignal,\n\t\toptions?: SearchPullRequestsOptions & { connectionId?: string },\n\t): Promise<PullRequest[] | undefined> {\n\t\tconst scope = getScopedLogger();\n\t\tconst { connectionId, ...searchOptions } = options ?? {};\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\ttry {\n\t\t\tconst prs = await this.searchProviderPullRequests?.(\n\t\t\t\tsession,\n\t\t\t\tsearchQuery,\n\t\t\t\tensureArray(repos),\n\t\t\t\tcancellation,\n\t\t\t\tsearchOptions,\n\t\t\t);\n\t\t\tthis.resetRequestExceptionCount('searchPullRequests');\n\t\t\treturn prs;\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('searchPullRequests', ex, { scope: scope, connectionId: connectionId });\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprotected searchProviderPullRequests?(\n\t\tsession: ProviderAuthenticationSession,\n\t\tsearchQuery: string,\n\t\trepos?: T[],\n\t\tcancellation?: AbortSignal,\n\t\toptions?: SearchPullRequestsOptions,\n\t): Promise<PullRequest[] | undefined>;\n\n\t/**\n\t * Result-returning wrapper for the FILTERED issue search — issues matching structured criteria over a\n\t * repository/org scope, with no forced relationship to the current user. Recovers thrown errors into\n\t * `{ error }` so the facade surfaces a warning instead of a silent empty page.\n\t *\n\t * Distinct from every other issue read on this class: {@link searchMyIssuesWithTruncationResult} is bound to\n\t * the current user by construction, and {@link getMyIssuesForReposAsShapesResult} goes through the SDK's\n\t * repo-scoped read (whose over-limit recovery walk can cost up to 128 requests). This one is one request per\n\t * page and carries no relationship it wasn't asked for.\n\t */\n\tasync searchIssuesPageResult(\n\t\toptions: {\n\t\t\t/**\n\t\t\t * Repositories to search, as namespace/name descriptors. NOT repository ids: a search query names\n\t\t\t * repositories by path, so an id-based input can't be expressed and the facade rejects it before here.\n\t\t\t */\n\t\t\trepos?: ProviderRepoInput[];\n\t\t\torg?: string;\n\t\t\tcriteria?: IssueSearchCriteria;\n\t\t\tcursor?: string;\n\t\t\tpageSize?: number;\n\t\t},\n\t\tcancellation?: AbortSignal,\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<ProviderIssueSearchPage | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst result = await this.searchProviderIssuesPage?.(session, options, cancellation);\n\t\t\tthis.resetRequestExceptionCount('searchIssuesPage');\n\t\t\treturn { value: result, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('searchIssuesPage', ex, { scope: scope, connectionId: connectionId });\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\t/**\n\t * OPTIONAL, like {@link searchProviderPullRequests}: a provider that can't express the criteria server-side\n\t * doesn't implement it, and the facade refuses the read (warning + `fetchFailed`) rather than serving a list\n\t * that was never narrowed. Whether a provider implements this must agree with what\n\t * `ProviderMetadata.supportedIssueSearch` declares.\n\t */\n\tprotected searchProviderIssuesPage?(\n\t\tsession: ProviderAuthenticationSession,\n\t\toptions: {\n\t\t\trepos?: ProviderRepoInput[];\n\t\t\torg?: string;\n\t\t\tcriteria?: IssueSearchCriteria;\n\t\t\tcursor?: string;\n\t\t\tpageSize?: number;\n\t\t},\n\t\tcancellation?: AbortSignal,\n\t): Promise<ProviderIssueSearchPage | undefined>;\n\n\t/**\n\t * Result-returning wrapper for the count-only probe: how many issues MATCH each scope, transferring no issues\n\t * at all. Recovers thrown errors into `{ error }` like the reads around it.\n\t *\n\t * Counts come back POSITIONALLY — one per input scope, in order — because a caller's key must never reach the\n\t * provider query. `undefined` in a slot means the provider didn't report a count for it, never zero matches.\n\t */\n\tasync countIssuesResult(\n\t\tscopes: readonly { repos?: ProviderRepoInput[]; org?: string; criteria?: IssueSearchCriteria }[],\n\t\tcancellation?: AbortSignal,\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<(number | undefined)[] | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst counts = await this.countProviderIssues?.(session, scopes, cancellation);\n\t\t\tthis.resetRequestExceptionCount('countIssues');\n\t\t\treturn { value: counts, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('countIssues', ex, { scope: scope, connectionId: connectionId });\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\t/**\n\t * OPTIONAL: only a provider that can answer \"how many match\" WITHOUT fetching the matches implements this.\n\t * GitHub's search reports `issueCount` on a zero-node selection; GitLab's REST exposes a total on some\n\t * endpoints but not for a search-shaped query, and Azure has no equivalent. A provider that can't answer\n\t * doesn't implement it and the facade refuses the probe, so a consumer hides its count rather than being shown\n\t * a fabricated one.\n\t */\n\tprotected countProviderIssues?(\n\t\tsession: ProviderAuthenticationSession,\n\t\tscopes: readonly { repos?: ProviderRepoInput[]; org?: string; criteria?: IssueSearchCriteria }[],\n\t\tcancellation?: AbortSignal,\n\t): Promise<(number | undefined)[] | undefined>;\n\n\t/**\n\t * Result-returning wrapper for the BATCH issue read: resolves several `(owner, repo, number)` coordinates in\n\t * one request. Recovers thrown errors into `{ error }` like the reads around it.\n\t *\n\t * Distinct from every search on this class, and deliberately so. A search answers \"what matches\"; this answers\n\t * \"does this exact issue exist\", which is the question a caller correlating a branch name to an issue is\n\t * actually asking. It has no result ceiling, no ordering and no cursor, and — the property that matters most —\n\t * an absent slot is a PROVEN ABSENCE rather than \"not found within a page budget\", so a caller can cache a\n\t * miss instead of re-walking for it forever.\n\t *\n\t * Results come back POSITIONALLY — one per input coordinate, in order — for the same reason\n\t * {@link countIssuesResult} does: a caller's key must never reach the provider query. `undefined` in a slot\n\t * means the issue does not exist or is not visible to this token, never that the read failed.\n\t */\n\tasync getIssuesBatchResult(\n\t\tcoordinates: readonly { owner: string; repo: string; number: number }[],\n\t\tcancellation?: AbortSignal,\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<(IssueShape | undefined)[] | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst issues = await this.getProviderIssuesBatch?.(session, coordinates, cancellation);\n\t\t\tthis.resetRequestExceptionCount('getIssuesBatch');\n\t\t\treturn { value: issues, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getIssuesBatch', ex, { scope: scope, connectionId: connectionId });\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\t/**\n\t * OPTIONAL: only a provider that can resolve SEVERAL issues by coordinate in one request implements this.\n\t * GitHub aliases its point read into one document; the SDK exposes only a singular `getIssue` for every other\n\t * provider, and there is no plural variant to build on. A provider that can't answer doesn't implement it and\n\t * the facade refuses the read, so a caller keeps its own per-issue path rather than being handed a batch that\n\t * silently degraded into N requests.\n\t */\n\tprotected getProviderIssuesBatch?(\n\t\tsession: ProviderAuthenticationSession,\n\t\tcoordinates: readonly { owner: string; repo: string; number: number }[],\n\t\tcancellation?: AbortSignal,\n\t): Promise<(IssueShape | undefined)[] | undefined>;\n\n\t/** The PR twin of {@link countIssuesResult}: counts each scope's pull requests, transferring none. */\n\tasync countPullRequestsResult(\n\t\tscopes: readonly { repos?: ProviderRepoInput[]; org?: string; criteria?: PullRequestSearchCriteria }[],\n\t\tcancellation?: AbortSignal,\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<(number | undefined)[] | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst counts = await this.countProviderPullRequests?.(session, scopes, cancellation);\n\t\t\tthis.resetRequestExceptionCount('countPullRequests');\n\t\t\treturn { value: counts, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('countPullRequests', ex, { scope: scope, connectionId: connectionId });\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\t/** OPTIONAL, like {@link countProviderIssues}: only a provider that can count without fetching implements it. */\n\tprotected countProviderPullRequests?(\n\t\tsession: ProviderAuthenticationSession,\n\t\tscopes: readonly { repos?: ProviderRepoInput[]; org?: string; criteria?: PullRequestSearchCriteria }[],\n\t\tcancellation?: AbortSignal,\n\t): Promise<(number | undefined)[] | undefined>;\n\n\tgetPullRequestIdentityFromMaybeUrl(search: string): PullRequestUrlIdentity | undefined {\n\t\treturn this.getProviderPullRequestIdentityFromMaybeUrl?.(search);\n\t}\n\n\tprotected getProviderPullRequestIdentityFromMaybeUrl?(search: string): PullRequestUrlIdentity | undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoEA,SAAS,sBACR,YAC0G;CAC1G,OACC,eAAA,iBACA,eAAA;AAEF;AAEA,SAAS,yBACR,YACA,QACA,UACqB;CACrB,MAAM,UAAU,kBAAkB,QAAQ,QAAQ;CAClD,IAAI,WAAW,MAAM,OAAO,KAAA;CAE5B,QAAQ,YAAR;EACC,KAAA,2BACC,OAAO,GAAG,QAAQ,QAAQ,qBAAqB,EAAE,EAAE;EACpD,KAAA,4BACC,OAAO,QAAQ,QAAQ,qBAAqB,EAAE;EAC/C,KAAA,oBACC,OAAO,GAAG,QAAQ,QAAQ,sBAAsB,EAAE,EAAE;EACrD,KAAA,uBACC,OAAO;EACR,SACC;CACF;AACD;;;;;;;;;;;AA0CA,SAAS,gBAAmB,SAAiB,OAAe,YAA2C;CACtG,QAAO,KAAK,SAAS,UAAU;CAC/B,OAAO;EAAE,OAAO,IAAI,MAAM,OAAO;EAAG,UAAU,YAAY,IAAI,IAAI;CAAM;AACzE;;;;;AAMA,MAAM,2BAAgE;CACrE,YAAY;CACZ,aAAa;AACd;AAEA,I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AAGD;AAnqDE,WAAA,CAAA,KAAK,GACL,MAAM,CAAA,GAAA,mBAAA,WAAA,sBAAA,IAAA;AA+BN,WAAA,CAAA,KAAK,GACL,MAAM,CAAA,GAAA,mBAAA,WAAA,8BAAA,IAAA;AA4BN,WAAA,CAAA,KAAK,GACL,MAAM,CAAA,GAAA,mBAAA,WAAA,uBAAA,IAAA;AA8BN,WAAA,CAAA,MAAM,CAAA,GAAA,mBAAA,WAAA,oBAAA,IAAA;AAqDN,WAAA,CAAA,MAAM,CAAA,GAAA,mBAAA,WAAA,yBAAA,IAAA;AAgGN,WAAA,CAAA,MAAM,CAAA,GAAA,mBAAA,WAAA,iCAAA,IAAA;AAkCN,WAAA,CAAA,MAAM,CAAA,GAAA,mBAAA,WAAA,2BAAA,IAAA;AAyCN,WAAA,CAAA,MAAM,CAAA,GAAA,mBAAA,WAAA,+BAAA,IAAA;AAqCN,WAAA,CAAA,MAAM,CAAA,GAAA,mBAAA,WAAA,gCAAA,IAAA;AAsEN,WAAA,CAAA,MAAM,CAAA,GAAA,mBAAA,WAAA,2BAAA,IAAA;AAuDN,WAAA,CAAA,MAAM,CAAA,GAAA,mBAAA,WAAA,2BAAA,IAAA;AA4zBN,WAAA,CAAA,MAAM,CAAA,GAAA,mBAAA,WAAA,wBAAA,IAAA;AA8KN,WAAA,CAAA,MAAM,CAAA,GAAA,mBAAA,WAAA,sBAAA,IAAA"}
1
+ {"version":3,"file":"gitHostIntegration.js","names":[],"sources":["../../../../../plus/integrations/src/models/gitHostIntegration.ts"],"sourcesContent":["import type { CollectionMetadata, CollectionScopeFailure, GitHubPullRequestFieldMap } from '@gitkraken/provider-apis';\nimport type { Account, UnidentifiedAuthor } from '@gitlens/git/models/author.js';\nimport type { DefaultBranch } from '@gitlens/git/models/defaultBranch.js';\nimport type { IssueSearchCriteria, IssueShape } from '@gitlens/git/models/issue.js';\nimport type { IssueOrPullRequestState as PullRequestState } from '@gitlens/git/models/issueOrPullRequest.js';\nimport type {\n\tPullRequest,\n\tPullRequestMergeMethod,\n\tPullRequestSearchCriteria,\n\tPullRequestStackInfo,\n\tPullRequestStateFilter,\n} from '@gitlens/git/models/pullRequest.js';\nimport type { RepositoryMetadata } from '@gitlens/git/models/repositoryMetadata.js';\nimport type { ResourceDescriptor } from '@gitlens/git/models/resourceDescriptor.js';\nimport type { PullRequestUrlIdentity } from '@gitlens/git/utils/pullRequest.utils.js';\nimport { ensureArray } from '@gitlens/utils/array.js';\nimport { isCancellationError } from '@gitlens/utils/cancellation.js';\nimport { gate } from '@gitlens/utils/decorators/gate.js';\nimport { trace } from '@gitlens/utils/decorators/log.js';\nimport { first } from '@gitlens/utils/iterable.js';\nimport { Logger } from '@gitlens/utils/logger.js';\nimport { getScopedLogger } from '@gitlens/utils/logger.scoped.js';\nimport type { PagedResult } from '@gitlens/utils/paging.js';\nimport type { ProviderAuthenticationSession } from '../authentication/models.js';\nimport { toTokenWithInfo } from '../authentication/models.js';\nimport {\n\tthrowIfCallerContractError,\n\ttoCollectionFailureError,\n\ttoCollectionScopeFailure,\n} from '../collectionMetadata.js';\nimport type { IntegrationIds } from '../constants.js';\nimport { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId } from '../constants.js';\nimport { toError } from '../errors.js';\nimport type {\n\tGetIssuesOptions,\n\tGetPullRequestsOptions,\n\tPagedProjectInput,\n\tPagedRepoInput,\n\tProviderAccount,\n\tProviderApiPagedResult,\n\tProviderHierarchyResult,\n\tProviderIssue,\n\tProviderOrganization,\n\tProviderPullRequest,\n\tProviderRepoInput,\n\tProviderReposInput,\n\tProviderRepository,\n} from '../providers/models.js';\nimport {\n\tIssueFilter,\n\tPagingMode,\n\tPullRequestFilter,\n\ttoIssueShape,\n\ttoProviderIssueStates,\n\ttoProviderPullRequestStates,\n} from '../providers/models.js';\nimport type { ProvidersApi } from '../providers/providersApi.js';\nimport { mergeCollectionMetadata, throwIfAllSettledFailed } from '../providers/utils/providerPaging.js';\nimport { areDomainsOnSameHost } from '../utils/domain.utils.js';\nimport { getSelfManagedBaseUrl, isGitSelfManagedHostIntegrationId } from '../utils/integration.utils.js';\nimport type {\n\tIntegrationResult,\n\tIntegrationType,\n\tProviderIssueSearchPage,\n\tProviderPullRequestCount,\n\tProviderPullRequestSearchPage,\n\tProviderSearchCount,\n} from './integration.js';\nimport { IntegrationBase } from './integration.js';\nimport type { MyIssuesForReposOptions } from './issueReads.js';\n\n/**\n * Whether an SDK read for `providerId` must send the session's secret as an HTTP Basic credential.\n *\n * Azure DevOps authenticates a PAT only as Basic — Azure DevOps Server refuses one sent as a bearer token outright —\n * and the Azure integration's own reads already pass it that way (`AzureDevOpsIntegrationBase.getApiOptions`). The\n * reads here are shared by every host, so they have to ask; every other provider keeps the SDK's default.\n */\nfunction sendsBasicCredential(providerId: IntegrationIds, session: ProviderAuthenticationSession): boolean | undefined {\n\treturn isAzureDevOpsProvider(providerId) ? session.type !== 'oauth' : undefined;\n}\n\nfunction isAzureDevOpsProvider(\n\tproviderId: IntegrationIds,\n): providerId is GitCloudHostIntegrationId.AzureDevOps | GitSelfManagedHostIntegrationId.AzureDevOpsServer {\n\treturn (\n\t\tproviderId === GitCloudHostIntegrationId.AzureDevOps ||\n\t\tproviderId === GitSelfManagedHostIntegrationId.AzureDevOpsServer\n\t);\n}\n\n/** Read options for {@link GitHostIntegration.searchMyPullRequests} and the provider hook behind it. */\nexport type SearchMyPullRequestsOptions = {\n\t/** Suppresses the user-facing notification when the read fails. */\n\tsilent?: boolean;\n\t/**\n\t * PR states to include (open/closed/merged/all). Providers that cannot express it in a single query\n\t * filter the normalized results; omitted preserves the historical open-only behavior.\n\t */\n\tstate?: PullRequestStateFilter;\n\tincludeReviewRequested?: boolean;\n};\n\n/** Read options for {@link GitHostIntegration.searchPullRequests} and the provider hook behind it. */\nexport type SearchPullRequestsOptions = {\n\t/** PR states to include; omitted preserves the provider's default. */\n\tinclude?: PullRequestState[];\n};\n\ntype MyPullRequestsForReposOptions = {\n\tfilters?: PullRequestFilter[];\n\tcursor?: string;\n\tcustomUrl?: string;\n\tpage?: number;\n\tpageSize?: number;\n\t/** PR states to include; when omitted the provider returns its default (open only). */\n\tstate?: PullRequestStateFilter | PullRequestStateFilter[];\n\t/** Requests the lightweight row shape without per-row build status or commit count. */\n\tsummary?: boolean;\n};\n\n/**\n * Rejects a read the provider can't serve as asked: logs the reason and returns it as the `{ error }` half of an\n * {@link IntegrationResult}, timed from `start`.\n *\n * A single builder because these refusals are a contract, not incidental returns — the read cores below reject on\n * unsupported input, an inexpressible filter set, or an unresolvable filter account, and each one must reach the\n * caller as an error it can surface as a warning rather than as an empty success. Writing the message once also\n * keeps the logged text and the thrown text from drifting apart, which is exactly what happened while each site\n * spelled its message out twice.\n */\nfunction unsupportedRead<T>(message: string, start: number, logContext?: string): IntegrationResult<T> {\n\tLogger.warn(message, logContext);\n\treturn { error: new Error(message), duration: performance.now() - start };\n}\n\n/**\n * Both fields gate the same GitHub `commits` subtree, so either truthy key retains the build-status rollup.\n * An absent map retains the full row; a summary read explicitly drops both optional fields.\n */\nconst summaryPullRequestFields: Required<GitHubPullRequestFieldMap> = {\n\theadCommit: false,\n\tcommitCount: false,\n};\n\nexport abstract class GitHostIntegration<\n\tID extends IntegrationIds = IntegrationIds,\n\tT extends ResourceDescriptor = ResourceDescriptor,\n> extends IntegrationBase<ID> {\n\treadonly type: IntegrationType = 'git';\n\n\t/** The self-managed installation `session` addresses, validated against this integration's host. */\n\tprotected getSelfManagedInstallationUrl(session: ProviderAuthenticationSession): string {\n\t\tconst baseUrl = getSelfManagedBaseUrl(\n\t\t\tthis.id,\n\t\t\tsession.baseUrl ?? (session.domain || this.domain),\n\t\t\tsession.protocol,\n\t\t);\n\t\tif (baseUrl == null || !areDomainsOnSameHost(baseUrl, this.domain)) {\n\t\t\tthrow new Error('Invalid self-managed integration base URL');\n\t\t}\n\n\t\treturn baseUrl;\n\t}\n\n\tprotected getSelfManagedApiBaseUrl(session: ProviderAuthenticationSession): string {\n\t\tconst baseUrl = this.getSelfManagedInstallationUrl(session);\n\t\tswitch (this.id) {\n\t\t\tcase GitSelfManagedHostIntegrationId.CloudGitHubEnterprise:\n\t\t\t\treturn `${baseUrl}/api/v3`;\n\t\t\tcase GitSelfManagedHostIntegrationId.BitbucketServer:\n\t\t\t\treturn `${baseUrl}/rest/api/1.0`;\n\t\t\tdefault:\n\t\t\t\treturn baseUrl;\n\t\t}\n\t}\n\n\t/** The base the repository-list reads hand the provider client for a self-managed host. */\n\tprotected getRepositoriesApiBaseUrl(session: ProviderAuthenticationSession, _repos: ProviderReposInput): string {\n\t\treturn this.getSelfManagedApiBaseUrl(session);\n\t}\n\n\t@gate()\n\t@trace()\n\tasync getAccountForEmail(repo: T, email: string, options?: { avatarSize?: number }): Promise<Account | undefined> {\n\t\tconst scope = getScopedLogger();\n\n\t\tconst connected = this.maybeConnected ?? (await this.isConnected());\n\t\tif (!connected) return undefined;\n\n\t\tawait this.refreshSessionIfExpired(scope);\n\n\t\ttry {\n\t\t\tconst author = await this.getProviderAccountForEmail(this._session!, repo, email, options);\n\t\t\tthis.resetRequestExceptionCount('getAccountForEmail');\n\t\t\treturn author;\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getAccountForEmail', ex, { scope: scope });\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprotected abstract getProviderAccountForEmail(\n\t\tsession: ProviderAuthenticationSession,\n\t\trepo: T,\n\t\temail: string,\n\t\toptions?: { avatarSize?: number },\n\t): Promise<Account | undefined>;\n\n\t/**\n\t * Returns the SSH signing keys (full OpenSSH-format `<type> <key> [comment]` strings) registered by the accounts\n\t * matching the given emails on this integration, for building an `allowed_signers` file. Keyed by lowercased email;\n\t * emails with no match (and unsupported integrations) are absent. Batching the lookups is left to the integration.\n\t */\n\t@gate()\n\t@trace()\n\tasync getSshSigningKeysForEmails(repo: T, emails: string[]): Promise<Map<string, string[]>> {\n\t\tconst scope = getScopedLogger();\n\n\t\tconst connected = this.maybeConnected ?? (await this.isConnected());\n\t\tif (!connected) return new Map();\n\n\t\tawait this.refreshSessionIfExpired(scope);\n\n\t\ttry {\n\t\t\tconst keys = await this.getProviderSshSigningKeysForEmails(this._session!, repo, emails);\n\t\t\tthis.resetRequestExceptionCount('getSshSigningKeysForEmails');\n\t\t\treturn keys;\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getSshSigningKeysForEmails', ex, { scope: scope });\n\t\t\treturn new Map();\n\t\t}\n\t}\n\n\t/** Override in integrations that expose users' SSH signing keys. Defaults to none. */\n\tprotected getProviderSshSigningKeysForEmails(\n\t\t_session: ProviderAuthenticationSession,\n\t\t_repo: T,\n\t\t_emails: string[],\n\t): Promise<Map<string, string[]>> {\n\t\treturn Promise.resolve(new Map<string, string[]>());\n\t}\n\n\t@gate()\n\t@trace()\n\tasync getAccountForCommit(\n\t\trepo: T,\n\t\trev: string,\n\t\toptions?: { avatarSize?: number },\n\t): Promise<Account | UnidentifiedAuthor | undefined> {\n\t\tconst scope = getScopedLogger();\n\n\t\tconst connected = this.maybeConnected ?? (await this.isConnected());\n\t\tif (!connected) return undefined;\n\n\t\tawait this.refreshSessionIfExpired(scope);\n\n\t\ttry {\n\t\t\tconst author = await this.getProviderAccountForCommit(this._session!, repo, rev, options);\n\t\t\tthis.resetRequestExceptionCount('getAccountForCommit');\n\t\t\treturn author;\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getAccountForCommit', ex, { scope: scope });\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprotected abstract getProviderAccountForCommit(\n\t\tsession: ProviderAuthenticationSession,\n\t\trepo: T,\n\t\trev: string,\n\t\toptions?: { avatarSize?: number },\n\t): Promise<Account | UnidentifiedAuthor | undefined>;\n\n\t@trace()\n\tasync getDefaultBranch(\n\t\trepo: T,\n\t\toptions?: { cancellation?: AbortSignal; expiryOverride?: boolean | number },\n\t): Promise<DefaultBranch | undefined> {\n\t\tconst scope = getScopedLogger();\n\n\t\tconst connected = this.maybeConnected ?? (await this.isConnected());\n\t\tif (!connected) return undefined;\n\n\t\tawait this.refreshSessionIfExpired(scope);\n\n\t\tconst defaultBranch = this.ctx.cache.getRepositoryDefaultBranch(\n\t\t\trepo,\n\t\t\tthis,\n\t\t\t() => ({\n\t\t\t\tvalue: (async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result = await this.getProviderDefaultBranch(this._session!, repo, options?.cancellation);\n\t\t\t\t\t\tthis.resetRequestExceptionCount('getDefaultBranch');\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\tthis.handleProviderException('getDefaultBranch', ex, { scope: scope });\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t})(),\n\t\t\t}),\n\t\t\t{ expiryOverride: options?.expiryOverride },\n\t\t);\n\t\treturn defaultBranch;\n\t}\n\n\tgetRepoInfo?(repo: {\n\t\towner: string;\n\t\tname: string;\n\t\tproject?: string;\n\t\tconnectionId?: string;\n\t}): Promise<ProviderRepository | undefined>;\n\n\t/** Stack membership for every stacked pull request in the repository, keyed by pull request number.\n\t * Only hosts with a stacks concept implement this (currently GitHub). */\n\tgetStacksByPullRequestNumber?(\n\t\towner: string,\n\t\trepo: string,\n\t\tcancellation?: AbortSignal,\n\t): Promise<Map<number, PullRequestStackInfo> | undefined>;\n\n\tprotected abstract getProviderDefaultBranch(\n\t\t{ accessToken }: ProviderAuthenticationSession,\n\t\trepo: T,\n\t\tcancellation?: AbortSignal,\n\t): Promise<DefaultBranch | undefined>;\n\n\t@trace()\n\tasync getRepositoryMetadata(\n\t\trepo: T,\n\t\toptions?: { cancellation?: AbortSignal; expiryOverride?: boolean | number },\n\t): Promise<RepositoryMetadata | undefined> {\n\t\tconst scope = getScopedLogger();\n\n\t\tconst connected = this.maybeConnected ?? (await this.isConnected());\n\t\tif (!connected) return undefined;\n\n\t\tawait this.refreshSessionIfExpired(scope);\n\n\t\tconst metadata = this.ctx.cache.getRepositoryMetadata(\n\t\t\trepo,\n\t\t\tthis,\n\t\t\t() => ({\n\t\t\t\tvalue: (async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result = await this.getProviderRepositoryMetadata(\n\t\t\t\t\t\t\tthis._session!,\n\t\t\t\t\t\t\trepo,\n\t\t\t\t\t\t\toptions?.cancellation,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.resetRequestExceptionCount('getRepositoryMetadata');\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\tthis.handleProviderException('getRepositoryMetadata', ex, { scope: scope });\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t})(),\n\t\t\t}),\n\t\t\t{ expiryOverride: options?.expiryOverride },\n\t\t);\n\t\treturn metadata;\n\t}\n\n\tprotected abstract getProviderRepositoryMetadata(\n\t\tsession: ProviderAuthenticationSession,\n\t\trepo: T,\n\t\tcancellation?: AbortSignal,\n\t): Promise<RepositoryMetadata | undefined>;\n\n\t/**\n\t * Whether this git host implements generic org discovery. False for providers that register no\n\t * {@link getProviderOrganizationsForUser} hook — the facade uses this to\n\t * report `unsupported` instead of a silent empty list, which is indistinguishable from \"has no orgs\".\n\t */\n\tget supportsOrganizationDiscovery(): boolean {\n\t\treturn this.getProviderOrganizationsForUser != null;\n\t}\n\n\t/** Whether this git host implements generic repository discovery ({@link getProviderRepositoriesForOrg}). */\n\tget supportsRepositoryDiscovery(): boolean {\n\t\treturn this.getProviderRepositoriesForOrg != null;\n\t}\n\n\t/**\n\t * Whether this git host has a project tier between org and repo ({@link getProviderProjectsForOrg}). Only\n\t * Azure DevOps does; the facade uses this to skip the read entirely rather than call a core that returns\n\t * `undefined` for a session-less reason and be misread as a broken connection.\n\t */\n\tget supportsProjectDiscovery(): boolean {\n\t\treturn this.getProviderProjectsForOrg != null;\n\t}\n\n\t/**\n\t * Whether this git host implements the account-wide user-affiliated repository read\n\t * ({@link getProviderRepositoriesForUser}) — the org-less `gk provider repos <provider>` equivalent.\n\t */\n\tget supportsUserRepositoryDiscovery(): boolean {\n\t\treturn this.getProviderRepositoriesForUser != null;\n\t}\n\n\t/**\n\t * Whether this git host exposes issues on the ProviderBackend surface. Most git hosts do; a host with no\n\t * usable issue tracker overrides this to false — Bitbucket Cloud (deprecated in favor of dedicated issue\n\t * integrations like Jira) and Bitbucket Data Center (never had one) — so the facade reports issues as\n\t * unsupported instead of serving a partial/deprecated source or failing inside a provider client that\n\t * registers no issue function at all.\n\t *\n\t * Keep this in sync with {@link ProviderMetadata.supportedIssueFilters}: a provider that declares no issue\n\t * filters and no issue read is answering the same capability question twice, and the two must agree.\n\t */\n\tget supportsIssues(): boolean {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Lists the organizations (orgs/workspaces/groups) the current user belongs to on this host.\n\t * `truncated === true` means the defensive page-drain backstop stopped before the upstream listing was\n\t * exhausted.\n\t *\n\t * Resolves the session for `connectionId` (or the primary connection when omitted, honoring multi-account\n\t * reads) and recovers a thrown error into `{ error }` so callers can surface it as a warning instead of\n\t * swallowing it to `undefined`.\n\t */\n\t@trace()\n\tasync getOrganizationsForUserResult(\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<ProviderHierarchyResult<ProviderOrganization> | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst result = await this.getProviderOrganizationsForUser?.(session);\n\t\t\tawait this.confirmScopedAuthFailures(session, result?.metadata);\n\t\t\tconst authFailure = result?.metadata?.failures?.find(\n\t\t\t\tfailure =>\n\t\t\t\t\tfailure.kind === 'authentication' &&\n\t\t\t\t\tfailure.scope != null &&\n\t\t\t\t\tfailure.scope.providerId === this.id &&\n\t\t\t\t\tObject.keys(failure.scope).length === 1,\n\t\t\t);\n\t\t\tif (authFailure != null) {\n\t\t\t\tthis.handleProviderException(\n\t\t\t\t\t'getOrganizationsForUser',\n\t\t\t\t\ttoCollectionFailureError(authFailure, toTokenWithInfo(this.id, session)),\n\t\t\t\t\t{ scope: scope, connectionId: connectionId },\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.resetRequestExceptionCount('getOrganizationsForUser');\n\t\t\t}\n\t\t\treturn { value: result, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getOrganizationsForUser', ex, {\n\t\t\t\tscope: scope,\n\t\t\t\tconnectionId: connectionId,\n\t\t\t});\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\tprotected getProviderOrganizationsForUser?(\n\t\tsession: ProviderAuthenticationSession,\n\t): Promise<ProviderHierarchyResult<ProviderOrganization> | undefined>;\n\n\t/**\n\t * Result-returning list of the projects a git host exposes beneath its orgs, unified into the\n\t * {@link ProviderOrganization} shape. Only Azure DevOps has a project tier between org and repo; other\n\t * git hosts have none and leave {@link getProviderProjectsForOrg} undefined, so this returns `undefined`\n\t * for them (the ProviderBackend facade then treats them as having no projects). With `org`, scopes to\n\t * that org's projects; without, returns projects across every org the user can see.\n\t */\n\t@trace()\n\tasync getProjectsForOrgResult(\n\t\torg?: string,\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<ProviderHierarchyResult<ProviderOrganization> | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tif (this.getProviderProjectsForOrg == null) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst result = await this.getProviderProjectsForOrg(session, org);\n\t\t\tawait this.confirmScopedAuthFailures(session, result?.metadata);\n\t\t\tthis.resetRequestExceptionCount('getProjectsForOrg');\n\t\t\treturn { value: result, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getProjectsForOrg', ex, { scope: scope, connectionId: connectionId });\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\tprotected getProviderProjectsForOrg?(\n\t\tsession: ProviderAuthenticationSession,\n\t\torg?: string,\n\t): Promise<ProviderHierarchyResult<ProviderOrganization> | undefined>;\n\n\t/**\n\t * Lists repositories under the given organization (org/workspace/group) one page at a time — follow\n\t * `paging.cursor` to page, or drain with the integrations provider paging helper.\n\t * `options.project` is only meaningful for Azure DevOps, whose repos are scoped by `org` + `project`;\n\t * every other host ignores it. (Azure without a project can't page its cross-project merge, so it\n\t * returns all matches in a single page.) `truncated === true` means the defensive page-drain\n\t * backstop stopped before the upstream listing was exhausted.\n\t *\n\t * Resolves the session for `connectionId` (or the primary connection when omitted) and recovers a thrown\n\t * error into `{ error }`, so a caller surfaces it as a warning instead of a silent `undefined`.\n\t */\n\t@trace()\n\tasync getRepositoriesForOrgResult(\n\t\torg: string,\n\t\toptions?: { project?: string; cursor?: string; connectionId?: string },\n\t): Promise<IntegrationResult<ProviderHierarchyResult<ProviderRepository> | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(options?.connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst result = await this.getProviderRepositoriesForOrg?.(session, org, options);\n\t\t\tawait this.confirmScopedAuthFailures(session, result?.metadata);\n\t\t\tthis.resetRequestExceptionCount('getRepositoriesForOrg');\n\t\t\treturn { value: result, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getRepositoriesForOrg', ex, {\n\t\t\t\tscope: scope,\n\t\t\t\tconnectionId: options?.connectionId,\n\t\t\t});\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\tprotected getProviderRepositoriesForOrg?(\n\t\tsession: ProviderAuthenticationSession,\n\t\torg: string,\n\t\toptions?: { project?: string; cursor?: string },\n\t): Promise<ProviderHierarchyResult<ProviderRepository> | undefined>;\n\n\t/**\n\t * Result-returning account-wide, user-affiliated repository read (the org-less\n\t * `gk provider repos <provider>` equivalent): repositories the user owns, collaborates on, or can\n\t * access through org membership — NOT every repo of every org. Optional: providers without a native\n\t * user-affiliated listing (Bitbucket workspaces, Azure orgs, which require an org/workspace scope)\n\t * leave the hook undefined and the facade reports the read as unsupported so callers fan out per org.\n\t */\n\t@trace()\n\tasync getRepositoriesForUserResult(options?: {\n\t\tcursor?: string;\n\t\tconnectionId?: string;\n\t}): Promise<IntegrationResult<ProviderHierarchyResult<ProviderRepository> | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(options?.connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tif (this.getProviderRepositoriesForUser == null) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst result = await this.getProviderRepositoriesForUser(session, options);\n\t\t\tawait this.confirmScopedAuthFailures(session, result?.metadata);\n\t\t\tthis.resetRequestExceptionCount('getRepositoriesForUser');\n\t\t\treturn { value: result, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getRepositoriesForUser', ex, {\n\t\t\t\tscope: scope,\n\t\t\t\tconnectionId: options?.connectionId,\n\t\t\t});\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\tprotected getProviderRepositoriesForUser?(\n\t\tsession: ProviderAuthenticationSession,\n\t\toptions?: { cursor?: string },\n\t): Promise<ProviderHierarchyResult<ProviderRepository> | undefined>;\n\n\tasync mergePullRequest(\n\t\tpr: PullRequest,\n\t\toptions?: { mergeMethod?: PullRequestMergeMethod },\n\t\tcancellation?: AbortSignal,\n\t): Promise<boolean> {\n\t\tconst scope = getScopedLogger();\n\n\t\tconst connected = this.maybeConnected ?? (await this.isConnected());\n\t\tif (!connected) return false;\n\n\t\tawait this.refreshSessionIfExpired(scope);\n\n\t\ttry {\n\t\t\tconst result = await this.mergeProviderPullRequest(this._session!, pr, options, cancellation);\n\t\t\tthis.resetRequestExceptionCount('mergePullRequest');\n\t\t\treturn result;\n\t\t} catch (ex) {\n\t\t\tif (isCancellationError(ex)) return false;\n\n\t\t\tthis.handleProviderException('mergePullRequest', ex, { scope: scope });\n\t\t\treturn false;\n\t\t} finally {\n\t\t\t// A merge attempt just changed the state of more than this pull request on the server (a\n\t\t\t// stacked merge lands every layer below and retargets every layer above) whether it succeeded\n\t\t\t// or failed partway through — so cached pull requests can't be trusted either way. Without\n\t\t\t// this, ref pills and branch enrichment keep serving the pre-merge object until its expiry.\n\t\t\tthis.ctx.cache.deletePullRequests();\n\t\t}\n\t}\n\n\tprotected abstract mergeProviderPullRequest(\n\t\tsession: ProviderAuthenticationSession,\n\t\tpr: PullRequest,\n\t\toptions?: { mergeMethod?: PullRequestMergeMethod },\n\t\tcancellation?: AbortSignal,\n\t): Promise<boolean>;\n\n\t@trace()\n\tasync getPullRequestForBranch(\n\t\trepo: T,\n\t\tbranch: string,\n\t\toptions?: {\n\t\t\tavatarSize?: number;\n\t\t\texpiryOverride?: boolean | number;\n\t\t\tinclude?: PullRequestState[];\n\t\t\t/** Rethrow a failed lookup instead of folding it into `undefined`, for callers that must tell\n\t\t\t * \"no pull request\" apart from \"couldn't ask\". */\n\t\t\tthrowOnError?: boolean;\n\t\t},\n\t): Promise<PullRequest | undefined> {\n\t\tconst scope = getScopedLogger();\n\n\t\tconst connected = this.maybeConnected ?? (await this.isConnected());\n\t\tif (!connected) return undefined;\n\n\t\tawait this.refreshSessionIfExpired(scope);\n\n\t\tconst { expiryOverride, throwOnError, ...opts } = options ?? {};\n\n\t\tconst pr = this.ctx.cache.getPullRequestForBranch(\n\t\t\tbranch,\n\t\t\trepo,\n\t\t\tthis,\n\t\t\tcacheable => ({\n\t\t\t\tvalue: (async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result = await this.getProviderPullRequestForBranch(this._session!, repo, branch, opts);\n\t\t\t\t\t\tthis.resetRequestExceptionCount('getPullRequestForBranch');\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\t// A failed lookup is not an answer: left cached, the `undefined` below reads as \"no pull\n\t\t\t\t\t\t// request\" for the bucket's whole expiry (an hour by branch).\n\t\t\t\t\t\tcacheable.invalidate();\n\t\t\t\t\t\tthis.handleProviderException('getPullRequestForBranch', ex, { scope: scope });\n\t\t\t\t\t\tif (throwOnError) throw ex;\n\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t})(),\n\t\t\t}),\n\t\t\t{ expiryOverride: expiryOverride },\n\t\t);\n\t\treturn pr;\n\t}\n\n\tprotected abstract getProviderPullRequestForBranch(\n\t\tsession: ProviderAuthenticationSession,\n\t\trepo: T,\n\t\tbranch: string,\n\t\toptions?: { avatarSize?: number; include?: PullRequestState[] },\n\t): Promise<PullRequest | undefined>;\n\n\t@trace()\n\tasync getPullRequestForCommit(\n\t\trepo: T,\n\t\trev: string,\n\t\toptions?: { expiryOverride?: boolean | number; throwOnError?: boolean },\n\t): Promise<PullRequest | undefined> {\n\t\tconst scope = getScopedLogger();\n\n\t\tconst connected = this.maybeConnected ?? (await this.isConnected());\n\t\tif (!connected) return undefined;\n\n\t\tawait this.refreshSessionIfExpired(scope);\n\n\t\tconst { throwOnError, ...cacheOptions } = options ?? {};\n\n\t\tconst pr = this.ctx.cache.getPullRequestForSha(\n\t\t\trev,\n\t\t\trepo,\n\t\t\tthis,\n\t\t\tcacheable => ({\n\t\t\t\tvalue: (async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result = await this.getProviderPullRequestForCommit(this._session!, repo, rev);\n\t\t\t\t\t\tthis.resetRequestExceptionCount('getPullRequestForCommit');\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\t// A failed lookup is not an answer — and the by-sha bucket never expires a miss.\n\t\t\t\t\t\tcacheable.invalidate();\n\t\t\t\t\t\tthis.handleProviderException('getPullRequestForCommit', ex, { scope: scope });\n\t\t\t\t\t\tif (throwOnError) throw ex;\n\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t})(),\n\t\t\t}),\n\t\t\tcacheOptions,\n\t\t);\n\t\treturn pr;\n\t}\n\n\tprotected abstract getProviderPullRequestForCommit(\n\t\tsession: ProviderAuthenticationSession,\n\t\trepo: T,\n\t\trev: string,\n\t): Promise<PullRequest | undefined>;\n\n\t/**\n\t * Memoized identity lookups backing filter resolution. Keyed by the session's token fingerprint plus the\n\t * scope of the lookup (base URL, and the Azure organization for the per-instance variant), so a different\n\t * account, host, or org never reuses an entry and a rotated token simply misses.\n\t *\n\t * Not cleared when the token changes: one integration instance serves every connection of its provider\n\t * (multi-account), so clearing on a fingerprint change would make two accounts reading in alternation\n\t * evict each other and defeat the memo. Entries are bounded by tokens x hosts x orgs seen — a handful for\n\t * the life of the integration.\n\t */\n\tprivate readonly _filterAccounts = new Map<string, Promise<ProviderAccount | undefined>>();\n\n\t/**\n\t * Resolves the account a repo-scoped read turns `IssueFilter`/`PullRequestFilter` into a provider\n\t * login/id with, memoized per token+scope.\n\t *\n\t * Every FILTERED read needs this, and `ProvidersApi.getCurrentUser` is a bare round trip — unlike\n\t * {@link IntegrationBase.getCurrentAccount}, which the host caches. So a consumer that fans ONE page out\n\t * into several filtered reads paid one identity request PER read, all resolving the same account: a\n\t * per-user-facet fan-out (author + assignee + review-requested) doubled its request count, and paid it\n\t * again on every page turn.\n\t *\n\t * The promise is memoized rather than the value, so concurrent facets share one in-flight request instead\n\t * of racing. A rejection is evicted so the next read retries rather than caching a failure — matching how\n\t * `getCurrentAccount` invalidates on error.\n\t */\n\tprivate getFilterAccount(\n\t\tapi: ProvidersApi,\n\t\tsession: ProviderAuthenticationSession,\n\t\tcustomUrl: string | undefined,\n\t\torganization?: string,\n\t): Promise<ProviderAccount | undefined> {\n\t\tconst key = `${this.getSessionFingerprint(session)}:${customUrl ?? ''}:${organization ?? ''}`;\n\n\t\tlet pending = this._filterAccounts.get(key);\n\t\tif (pending == null) {\n\t\t\tconst tokenWithInfo = toTokenWithInfo(this.authProvider.id, session);\n\t\t\tpending = (\n\t\t\t\torganization != null\n\t\t\t\t\t? api.getCurrentUserForInstance(tokenWithInfo, organization, {\n\t\t\t\t\t\t\tbaseUrl: customUrl,\n\t\t\t\t\t\t\tisPAT: sendsBasicCredential(this.id, session),\n\t\t\t\t\t\t})\n\t\t\t\t\t: api.getCurrentUser(tokenWithInfo, { baseUrl: customUrl })\n\t\t\t).catch((ex: unknown) => {\n\t\t\t\tthis._filterAccounts.delete(key);\n\t\t\t\tthrow ex;\n\t\t\t});\n\t\t\tthis._filterAccounts.set(key, pending);\n\t\t}\n\n\t\treturn pending;\n\t}\n\n\tasync getMyIssuesForRepos(\n\t\treposOrRepoIds: ProviderReposInput,\n\t\toptions?: MyIssuesForReposOptions,\n\t\tconnectionId?: string,\n\t): Promise<PagedResult<ProviderIssue> | undefined> {\n\t\treturn (await this.getMyIssuesForReposResult(reposOrRepoIds, options, connectionId))?.value;\n\t}\n\n\t/**\n\t * Result-returning core of {@link getMyIssuesForRepos}. Resolves the session for `connectionId`\n\t * (or the primary connection when omitted, so multi-account reads use the right token) and recovers\n\t * thrown errors and validation failures into `{ error }` so callers can surface them as warnings\n\t * rather than swallowing them to `undefined`.\n\t */\n\tasync getMyIssuesForReposResult(\n\t\treposOrRepoIds: ProviderReposInput,\n\t\toptions?: MyIssuesForReposOptions,\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<(PagedResult<ProviderIssue> & { metadata?: CollectionMetadata }) | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\tconst providerId = this.authProvider.id;\n\t\tconst states = toProviderIssueStates(options?.state);\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary. The session\n\t\t// is resolved here for connectivity/bail; the connection's token is applied per API call below.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\tlet customUrl: string | undefined;\n\t\tlet api: ProvidersApi;\n\t\ttry {\n\t\t\tcustomUrl =\n\t\t\t\toptions?.customUrl ??\n\t\t\t\t(isGitSelfManagedHostIntegrationId(providerId)\n\t\t\t\t\t? this.getRepositoriesApiBaseUrl(session, reposOrRepoIds)\n\t\t\t\t\t: undefined);\n\t\t\tapi = await this.getProvidersApi();\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getIssuesForRepos', ex, { scope: scope, connectionId: connectionId });\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t\tconst repoIdsInput = api.isRepoIdsInput(reposOrRepoIds);\n\t\tif (\n\t\t\tproviderId !== GitCloudHostIntegrationId.GitLab &&\n\t\t\t(repoIdsInput ||\n\t\t\t\t(isAzureDevOpsProvider(providerId) &&\n\t\t\t\t\t!reposOrRepoIds.every(repo => repo.project != null && repo.namespace != null)))\n\t\t) {\n\t\t\treturn unsupportedRead(`Unsupported input for provider ${providerId}`, start, 'getIssuesForRepos');\n\t\t}\n\n\t\tlet getIssuesOptions: GetIssuesOptions | undefined;\n\t\tif (isAzureDevOpsProvider(providerId)) {\n\t\t\tconst organizations = new Set<string>();\n\t\t\tconst projects = new Set<string>();\n\t\t\tfor (const repo of reposOrRepoIds as ProviderRepoInput[]) {\n\t\t\t\torganizations.add(repo.namespace);\n\t\t\t\tprojects.add(repo.project!);\n\t\t\t}\n\n\t\t\tif (organizations.size > 1) {\n\t\t\t\treturn unsupportedRead(\n\t\t\t\t\t`Multiple organizations not supported for provider ${providerId}`,\n\t\t\t\t\tstart,\n\t\t\t\t\t'getIssuesForRepos',\n\t\t\t\t);\n\t\t\t} else if (organizations.size === 0) {\n\t\t\t\treturn unsupportedRead(`No organizations found for provider ${providerId}`, start, 'getIssuesForRepos');\n\t\t\t}\n\n\t\t\tconst organization: string = first(organizations.values())!;\n\n\t\t\tif (options?.filters != null) {\n\t\t\t\tif (!api.providerSupportsIssueFilters(providerId, options.filters)) {\n\t\t\t\t\treturn unsupportedRead(\n\t\t\t\t\t\t`Unsupported filters for provider ${providerId}`,\n\t\t\t\t\t\tstart,\n\t\t\t\t\t\t'getIssuesForRepos',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tlet userAccount: ProviderAccount | undefined;\n\t\t\t\ttry {\n\t\t\t\t\tuserAccount = await this.getFilterAccount(api, session, customUrl, organization);\n\t\t\t\t} catch (ex) {\n\t\t\t\t\tthis.handleProviderException('getIssuesForRepos', ex, {\n\t\t\t\t\t\tscope: scope,\n\t\t\t\t\t\tconnectionId: connectionId,\n\t\t\t\t\t});\n\t\t\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t\t\t}\n\n\t\t\t\tif (userAccount == null) {\n\t\t\t\t\treturn unsupportedRead(`Unable to get current user for ${providerId}`, start, 'getIssuesForRepos');\n\t\t\t\t}\n\n\t\t\t\tconst userFilterProperty = userAccount.name;\n\n\t\t\t\tif (userFilterProperty == null) {\n\t\t\t\t\treturn unsupportedRead(\n\t\t\t\t\t\t`Unable to get user property for filter for ${providerId}`,\n\t\t\t\t\t\tstart,\n\t\t\t\t\t\t'getIssuesForRepos',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tgetIssuesOptions = {\n\t\t\t\t\tauthorLogin: options.filters.includes(IssueFilter.Author) ? userFilterProperty : undefined,\n\t\t\t\t\tassigneeLogins:\n\t\t\t\t\t\t!options.includeAllAssignees && options.filters.includes(IssueFilter.Assignee)\n\t\t\t\t\t\t\t? [userFilterProperty]\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\tmentionLogin: options.filters.includes(IssueFilter.Mention) ? userFilterProperty : undefined,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst cursorInfo = this.parseCursorInfo<PagedProjectInput>(options?.cursor);\n\t\t\tconst cursors: PagedProjectInput[] = cursorInfo.cursors ?? [];\n\t\t\tlet projectInputs: PagedProjectInput[] = Array.from(projects.values(), project => ({\n\t\t\t\tnamespace: organization,\n\t\t\t\tproject: project,\n\t\t\t\tcursor: undefined,\n\t\t\t}));\n\t\t\tif (cursors.length > 0) {\n\t\t\t\tprojectInputs = cursors;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst cursor: { cursors: PagedProjectInput[]; page?: number } = { cursors: [] };\n\t\t\t\tlet hasMore = false;\n\t\t\t\tlet truncated = false;\n\t\t\t\tlet metadata: CollectionMetadata | undefined;\n\t\t\t\tconst data: ProviderIssue[] = [];\n\t\t\t\t// `allSettled`, not `Promise.all`: one project's read rejecting must not discard every sibling\n\t\t\t\t// project's already-fetched issues and cursors. A rejected project is recorded as a structured\n\t\t\t\t// failure so the facade can warn and set `fetchFailed` instead of reporting a partial project set\n\t\t\t\t// as complete.\n\t\t\t\tconst settled = await Promise.allSettled(\n\t\t\t\t\tprojectInputs.map(async projectInput => {\n\t\t\t\t\t\tconst results = await api.getIssuesForAzureProject(\n\t\t\t\t\t\t\ttoTokenWithInfo(providerId, session),\n\t\t\t\t\t\t\tprojectInput.namespace,\n\t\t\t\t\t\t\tprojectInput.project,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...getIssuesOptions,\n\t\t\t\t\t\t\t\tcursor: projectInput.cursor,\n\t\t\t\t\t\t\t\tbaseUrl: customUrl,\n\t\t\t\t\t\t\t\tisPAT: sendsBasicCredential(providerId, session),\n\t\t\t\t\t\t\t\t// Continuation is driven by the per-project cursor; only apply an explicit page on the\n\t\t\t\t\t\t\t\t// first request so it can't clobber a continuation cursor on later pages.\n\t\t\t\t\t\t\t\tpage: projectInput.cursor == null ? options?.page : undefined,\n\t\t\t\t\t\t\t\tpageSize: options?.pageSize,\n\t\t\t\t\t\t\t\tstates: states,\n\t\t\t\t\t\t\t\tsort: options?.sort,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn { projectInput: projectInput, results: results };\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tthrowIfAllSettledFailed(settled);\n\n\t\t\t\tfor (let i = 0; i < settled.length; i++) {\n\t\t\t\t\tconst outcome = settled[i];\n\t\t\t\t\tconst projectInput = projectInputs[i];\n\t\t\t\t\tif (outcome.status !== 'fulfilled') {\n\t\t\t\t\t\t// Errors that really are per-scope (auth, rate limit, a missing project) degrade below; one\n\t\t\t\t\t\t// that is a fact about the call is re-thrown instead — see `throwIfCallerContractError`.\n\t\t\t\t\t\tthrowIfCallerContractError(outcome.reason);\n\n\t\t\t\t\t\ttruncated = true;\n\t\t\t\t\t\tconst failure = toCollectionScopeFailure(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tproviderId: providerId,\n\t\t\t\t\t\t\t\tresourceId: projectInput.namespace,\n\t\t\t\t\t\t\t\tprojectId: projectInput.project,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\toutcome.reason,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tmetadata = mergeCollectionMetadata(metadata, {\n\t\t\t\t\t\t\tcompleteness: 'partial',\n\t\t\t\t\t\t\tfailures: [failure],\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst { projectInput: _projectInput, results } = outcome.value;\n\t\t\t\t\tdata.push(...results.values);\n\t\t\t\t\tif (results.paging?.more) {\n\t\t\t\t\t\thasMore = true;\n\t\t\t\t\t\tcursor.cursors.push({\n\t\t\t\t\t\t\tnamespace: projectInput.namespace,\n\t\t\t\t\t\t\tproject: projectInput.project,\n\t\t\t\t\t\t\tcursor: results.paging.cursor,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Keep the requested page number in the composite cursor so the facade can report the real\n\t\t\t\t// currentPage when the consumer continues using only the cursor.\n\t\t\t\tif (options?.page != null) {\n\t\t\t\t\tcursor.page = options.page;\n\t\t\t\t}\n\n\t\t\t\tawait this.confirmScopedAuthFailures(session, metadata);\n\t\t\t\tthis.resetRequestExceptionCount('getIssuesForRepos');\n\t\t\t\treturn {\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\tvalues: data,\n\t\t\t\t\t\tpaging: {\n\t\t\t\t\t\t\tmore: hasMore,\n\t\t\t\t\t\t\tcursor: JSON.stringify(cursor),\n\t\t\t\t\t\t\ttruncated: truncated || undefined,\n\t\t\t\t\t\t\t// Echo the requested numbered page so the facade reports the real currentPage for\n\t\t\t\t\t\t\t// numbered-page hosts (GitLab/Bitbucket/Azure), not a synthesized 1. Cursor-only hosts\n\t\t\t\t\t\t\t// leave `page` undefined via their own reads.\n\t\t\t\t\t\t\tpage: options?.page,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmetadata: metadata,\n\t\t\t\t\t},\n\t\t\t\t\tduration: performance.now() - start,\n\t\t\t\t};\n\t\t\t} catch (ex) {\n\t\t\t\tthis.handleProviderException('getIssuesForRepos', ex, {\n\t\t\t\t\tscope: scope,\n\t\t\t\t\tconnectionId: connectionId,\n\t\t\t\t});\n\t\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t\t}\n\t\t}\n\t\tif (options?.filters != null) {\n\t\t\t// Validate the requested filters against what this provider actually supports — same guard the Azure\n\t\t\t// branch above applies. Without it an unsupported filter (e.g. GitLab has no Mention endpoint) would\n\t\t\t// resolve to no filter property being set and silently degrade to an unfiltered, project-wide read.\n\t\t\tif (!api.providerSupportsIssueFilters(providerId, options.filters)) {\n\t\t\t\treturn unsupportedRead(`Unsupported filters for provider ${providerId}`, start, 'getIssuesForRepos');\n\t\t\t}\n\n\t\t\tlet userAccount: ProviderAccount | undefined;\n\t\t\ttry {\n\t\t\t\tuserAccount = await this.getFilterAccount(api, session, customUrl);\n\t\t\t} catch (ex) {\n\t\t\t\tthis.handleProviderException('getIssuesForRepos', ex, {\n\t\t\t\t\tscope: scope,\n\t\t\t\t\tconnectionId: connectionId,\n\t\t\t\t});\n\t\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t\t}\n\n\t\t\tif (userAccount == null) {\n\t\t\t\treturn unsupportedRead(`Unable to get current user for ${providerId}`, start, 'getIssuesForRepos');\n\t\t\t}\n\n\t\t\tconst userFilterProperty = userAccount.username;\n\t\t\tif (userFilterProperty == null) {\n\t\t\t\treturn unsupportedRead(\n\t\t\t\t\t`Unable to get user property for filter for ${providerId}`,\n\t\t\t\t\tstart,\n\t\t\t\t\t'getIssuesForRepos',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tgetIssuesOptions = {\n\t\t\t\tauthorLogin: options.filters.includes(IssueFilter.Author) ? userFilterProperty : undefined,\n\t\t\t\tassigneeLogins:\n\t\t\t\t\t!options.includeAllAssignees && options.filters.includes(IssueFilter.Assignee)\n\t\t\t\t\t\t? [userFilterProperty]\n\t\t\t\t\t\t: undefined,\n\t\t\t\tmentionLogin: options.filters.includes(IssueFilter.Mention) ? userFilterProperty : undefined,\n\t\t\t};\n\t\t}\n\n\t\tif (api.getProviderIssuesPagingMode(providerId) === PagingMode.Repo && !repoIdsInput) {\n\t\t\tconst cursorInfo = this.parseCursorInfo<PagedRepoInput>(options?.cursor);\n\t\t\tconst cursors: PagedRepoInput[] = cursorInfo.cursors ?? [];\n\t\t\tlet repoInputs: PagedRepoInput[] = reposOrRepoIds.map(repo => ({ repo: repo, cursor: undefined }));\n\t\t\tif (cursors.length > 0) {\n\t\t\t\trepoInputs = cursors;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst cursor: { cursors: PagedRepoInput[]; page?: number } = { cursors: [] };\n\t\t\t\tlet hasMore = false;\n\t\t\t\tlet truncated = false;\n\t\t\t\tlet metadata: CollectionMetadata | undefined;\n\t\t\t\tconst data: ProviderIssue[] = [];\n\t\t\t\t// `allSettled`, not `Promise.all`: one repo's read rejecting must not discard every sibling repo's\n\t\t\t\t// already-fetched issues and cursors. A rejected repo is recorded as a structured failure so the\n\t\t\t\t// facade can warn and set `fetchFailed` instead of reporting a partial repo set as complete.\n\t\t\t\tconst settled = await Promise.allSettled(\n\t\t\t\t\trepoInputs.map(async repoInput => {\n\t\t\t\t\t\tconst results = await api.getIssuesForRepo(\n\t\t\t\t\t\t\ttoTokenWithInfo(providerId, session),\n\t\t\t\t\t\t\trepoInput.repo,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...getIssuesOptions,\n\t\t\t\t\t\t\t\tcursor: repoInput.cursor,\n\t\t\t\t\t\t\t\tbaseUrl: customUrl,\n\t\t\t\t\t\t\t\t// Continuation is driven by the per-repo cursor; only apply an explicit page on the\n\t\t\t\t\t\t\t\t// first request so it can't clobber a continuation cursor on later pages.\n\t\t\t\t\t\t\t\tpage: repoInput.cursor == null ? options?.page : undefined,\n\t\t\t\t\t\t\t\tpageSize: options?.pageSize,\n\t\t\t\t\t\t\t\tstates: states,\n\t\t\t\t\t\t\t\tsort: options?.sort,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn { repoInput: repoInput, results: results };\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tthrowIfAllSettledFailed(settled);\n\n\t\t\t\tfor (let i = 0; i < settled.length; i++) {\n\t\t\t\t\tconst outcome = settled[i];\n\t\t\t\t\tconst repoInput = repoInputs[i];\n\t\t\t\t\tif (outcome.status !== 'fulfilled') {\n\t\t\t\t\t\t// See the project fan-out above. Reachable in practice even though the facade validates the\n\t\t\t\t\t\t// key first — a self-managed GitLab can reject an `IssueSort` member the SDK declares, which\n\t\t\t\t\t\t// is only discoverable from the response.\n\t\t\t\t\t\tthrowIfCallerContractError(outcome.reason);\n\n\t\t\t\t\t\ttruncated = true;\n\t\t\t\t\t\tconst failure = toCollectionScopeFailure(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tproviderId: providerId,\n\t\t\t\t\t\t\t\trepositoryId: `${repoInput.repo.namespace}/${repoInput.repo.name}`,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\toutcome.reason,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tmetadata = mergeCollectionMetadata(metadata, {\n\t\t\t\t\t\t\tcompleteness: 'partial',\n\t\t\t\t\t\t\tfailures: [failure],\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst { repoInput: _repoInput, results } = outcome.value;\n\t\t\t\t\tdata.push(...results.values);\n\t\t\t\t\tif (results.paging?.more) {\n\t\t\t\t\t\thasMore = true;\n\t\t\t\t\t\tcursor.cursors.push({ repo: repoInput.repo, cursor: results.paging.cursor });\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (options?.page != null) {\n\t\t\t\t\tcursor.page = options.page;\n\t\t\t\t}\n\n\t\t\t\tawait this.confirmScopedAuthFailures(session, metadata);\n\t\t\t\tthis.resetRequestExceptionCount('getIssuesForRepos');\n\t\t\t\treturn {\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\tvalues: data,\n\t\t\t\t\t\tpaging: {\n\t\t\t\t\t\t\tmore: hasMore,\n\t\t\t\t\t\t\tcursor: JSON.stringify(cursor),\n\t\t\t\t\t\t\ttruncated: truncated || undefined,\n\t\t\t\t\t\t\t// Echo the requested numbered page so the facade reports the real currentPage for\n\t\t\t\t\t\t\t// numbered-page hosts (GitLab/Bitbucket/Azure), not a synthesized 1. Cursor-only hosts\n\t\t\t\t\t\t\t// leave `page` undefined via their own reads.\n\t\t\t\t\t\t\tpage: options?.page,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmetadata: metadata,\n\t\t\t\t\t},\n\t\t\t\t\tduration: performance.now() - start,\n\t\t\t\t};\n\t\t\t} catch (ex) {\n\t\t\t\tthis.handleProviderException('getIssuesForRepos', ex, {\n\t\t\t\t\tscope: scope,\n\t\t\t\t\tconnectionId: connectionId,\n\t\t\t\t});\n\t\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tconst tokenWithInfo = toTokenWithInfo(providerId, session);\n\t\t\tconst result = await api.getIssuesForRepos(tokenWithInfo, reposOrRepoIds, {\n\t\t\t\t...getIssuesOptions,\n\t\t\t\tcursor: options?.cursor,\n\t\t\t\tbaseUrl: customUrl,\n\t\t\t\tisPAT: sendsBasicCredential(providerId, session),\n\t\t\t\tpage: options?.page,\n\t\t\t\tpageSize: options?.pageSize,\n\t\t\t\tstates: states,\n\t\t\t\tsort: options?.sort,\n\t\t\t});\n\t\t\tconst failures = result.metadata?.failures;\n\t\t\tif (\n\t\t\t\trepoIdsInput &&\n\t\t\t\treposOrRepoIds.length > 0 &&\n\t\t\t\tresult.values.length === 0 &&\n\t\t\t\tfailures?.length === reposOrRepoIds.length\n\t\t\t) {\n\t\t\t\tconst ex = toCollectionFailureError(failures[0], tokenWithInfo);\n\t\t\t\tthis.handleProviderException('getIssuesForRepos', ex, {\n\t\t\t\t\tscope: scope,\n\t\t\t\t\tconnectionId: connectionId,\n\t\t\t\t});\n\t\t\t\treturn { error: ex, duration: performance.now() - start };\n\t\t\t}\n\n\t\t\tawait this.confirmScopedAuthFailures(session, result.metadata);\n\t\t\tthis.resetRequestExceptionCount('getIssuesForRepos');\n\t\t\treturn { value: result, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getIssuesForRepos', ex, {\n\t\t\t\tscope: scope,\n\t\t\t\tconnectionId: connectionId,\n\t\t\t});\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\t/**\n\t * Repo-scoped \"my issues\" read returning the normalized {@link IssueShape} the ProviderBackend facade\n\t * consumes (`listIssuesPage({ repos })`, `broadenIssues`). Maps {@link getMyIssuesForReposResult} — the raw\n\t * provider-apis path — to IssueShape.\n\t *\n\t * It's the seam rather than an inline map so a provider whose only issue client already yields normalized\n\t * shapes, and isn't wired into the raw path, can override it and serve these reads without a\n\t * `ProviderIssue` round-trip. No provider does today: the one candidate (Bitbucket Cloud's legacy\n\t * `getUsersIssuesForRepo`) reports `supportsIssues: false`, so the facade never reaches this for it.\n\t */\n\tasync getMyIssuesForReposAsShapesResult(\n\t\treposOrRepoIds: ProviderReposInput,\n\t\toptions?: MyIssuesForReposOptions,\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<(PagedResult<IssueShape> & { metadata?: CollectionMetadata }) | undefined>> {\n\t\tconst result = await this.getMyIssuesForReposResult(reposOrRepoIds, options, connectionId);\n\t\tif (result == null) return undefined;\n\t\tif (result.error != null) return { error: result.error, duration: result.duration };\n\t\tif (result.value == null) return { value: undefined, duration: result.duration };\n\n\t\tconst values = result.value.values\n\t\t\t.map(issue => toIssueShape(issue, this))\n\t\t\t.filter((issue): issue is IssueShape => issue != null);\n\t\treturn { value: { ...result.value, values: values }, duration: result.duration };\n\t}\n\n\tasync getMyPullRequestsForRepos(\n\t\treposOrRepoIds: ProviderReposInput,\n\t\toptions?: MyPullRequestsForReposOptions,\n\t\tconnectionId?: string,\n\t): Promise<ProviderApiPagedResult<ProviderPullRequest> | undefined> {\n\t\treturn (await this.getMyPullRequestsForReposResult(reposOrRepoIds, options, connectionId))?.value;\n\t}\n\n\t/**\n\t * Result-returning core of {@link getMyPullRequestsForRepos}. Resolves the session for `connectionId`\n\t * (or the primary connection when omitted, so multi-account reads use the right token) and recovers\n\t * thrown errors and validation failures into `{ error }` so callers can surface them as warnings\n\t * rather than swallowing them to `undefined`.\n\t */\n\tasync getMyPullRequestsForReposResult(\n\t\treposOrRepoIds: ProviderReposInput,\n\t\toptions?: MyPullRequestsForReposOptions,\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<ProviderApiPagedResult<ProviderPullRequest> | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\tconst providerId = this.authProvider.id;\n\t\tconst states = toProviderPullRequestStates(options?.state);\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary. The session\n\t\t// is resolved here for connectivity/bail; the connection's token is applied per API call below.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\tlet customUrl: string | undefined;\n\t\tlet api: ProvidersApi;\n\t\ttry {\n\t\t\tcustomUrl =\n\t\t\t\toptions?.customUrl ??\n\t\t\t\t(isGitSelfManagedHostIntegrationId(providerId)\n\t\t\t\t\t? this.getRepositoriesApiBaseUrl(session, reposOrRepoIds)\n\t\t\t\t\t: undefined);\n\t\t\tapi = await this.getProvidersApi();\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getPullRequestsForRepos', ex, {\n\t\t\t\tscope: scope,\n\t\t\t\tconnectionId: connectionId,\n\t\t\t});\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t\tif (\n\t\t\tproviderId !== GitCloudHostIntegrationId.GitLab &&\n\t\t\t(api.isRepoIdsInput(reposOrRepoIds) ||\n\t\t\t\t(isAzureDevOpsProvider(providerId) &&\n\t\t\t\t\t!reposOrRepoIds.every(repo => repo.project != null && repo.namespace != null)))\n\t\t) {\n\t\t\treturn unsupportedRead(`Unsupported input for provider ${providerId}`, start);\n\t\t}\n\n\t\tlet getPullRequestsOptions: GetPullRequestsOptions | undefined;\n\t\tif (options?.filters != null) {\n\t\t\tif (!api.providerSupportsPullRequestFilters(providerId, options.filters)) {\n\t\t\t\treturn unsupportedRead(\n\t\t\t\t\t`Unsupported filters for provider ${providerId}`,\n\t\t\t\t\tstart,\n\t\t\t\t\t'getPullRequestsForRepos',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tlet userAccount: ProviderAccount | undefined;\n\t\t\tif (isAzureDevOpsProvider(providerId)) {\n\t\t\t\tconst organizations = new Set<string>();\n\t\t\t\tfor (const repo of reposOrRepoIds as ProviderRepoInput[]) {\n\t\t\t\t\torganizations.add(repo.namespace);\n\t\t\t\t}\n\n\t\t\t\tif (organizations.size > 1) {\n\t\t\t\t\tLogger.warn(\n\t\t\t\t\t\t`Multiple organizations not supported for provider ${providerId}`,\n\t\t\t\t\t\t'getPullRequestsForRepos',\n\t\t\t\t\t);\n\t\t\t\t\treturn {\n\t\t\t\t\t\terror: new Error(`Multiple organizations not supported for provider ${providerId}`),\n\t\t\t\t\t\tduration: performance.now() - start,\n\t\t\t\t\t};\n\t\t\t\t} else if (organizations.size === 0) {\n\t\t\t\t\treturn unsupportedRead(\n\t\t\t\t\t\t`No organizations found for provider ${providerId}`,\n\t\t\t\t\t\tstart,\n\t\t\t\t\t\t'getPullRequestsForRepos',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst organization: string = first(organizations.values())!;\n\t\t\t\ttry {\n\t\t\t\t\tuserAccount = await this.getFilterAccount(api, session, customUrl, organization);\n\t\t\t\t} catch (ex) {\n\t\t\t\t\tthis.handleProviderException('getPullRequestsForRepos', ex, {\n\t\t\t\t\t\tscope: scope,\n\t\t\t\t\t\tconnectionId: connectionId,\n\t\t\t\t\t});\n\t\t\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tuserAccount = await this.getFilterAccount(api, session, customUrl);\n\t\t\t\t} catch (ex) {\n\t\t\t\t\tthis.handleProviderException('getPullRequestsForRepos', ex, {\n\t\t\t\t\t\tscope: scope,\n\t\t\t\t\t\tconnectionId: connectionId,\n\t\t\t\t\t});\n\t\t\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (userAccount == null) {\n\t\t\t\treturn unsupportedRead(\n\t\t\t\t\t`Unable to get current user for ${providerId}`,\n\t\t\t\t\tstart,\n\t\t\t\t\t'getPullRequestsForRepos',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tlet userFilterProperty: string | null;\n\t\t\tswitch (providerId) {\n\t\t\t\tcase GitCloudHostIntegrationId.Bitbucket:\n\t\t\t\tcase GitCloudHostIntegrationId.AzureDevOps:\n\t\t\t\tcase GitSelfManagedHostIntegrationId.AzureDevOpsServer:\n\t\t\t\t\tuserFilterProperty = userAccount.id;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tuserFilterProperty = userAccount.username;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (userFilterProperty == null) {\n\t\t\t\treturn unsupportedRead(\n\t\t\t\t\t`Unable to get user property for filter for ${providerId}`,\n\t\t\t\t\tstart,\n\t\t\t\t\t'getPullRequestsForRepos',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Route the \"review requested from me\" filter to the field each provider actually reads:\n\t\t\t// GitHub/GitLab expect a login (reviewRequestedLogin), Bitbucket/Azure an account id (reviewerId),\n\t\t\t// and Bitbucket Server a login (reviewerLogin). `userFilterProperty` is already the account id for\n\t\t\t// Bitbucket/Azure and the username for the rest.\n\t\t\tlet reviewRequestedLogin: string | undefined;\n\t\t\tlet reviewerId: string | undefined;\n\t\t\tlet reviewerLogin: string | undefined;\n\t\t\tif (options.filters.includes(PullRequestFilter.ReviewRequested)) {\n\t\t\t\tswitch (providerId) {\n\t\t\t\t\tcase GitCloudHostIntegrationId.Bitbucket:\n\t\t\t\t\tcase GitCloudHostIntegrationId.AzureDevOps:\n\t\t\t\t\tcase GitSelfManagedHostIntegrationId.AzureDevOpsServer:\n\t\t\t\t\t\treviewerId = userFilterProperty;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase GitSelfManagedHostIntegrationId.BitbucketServer:\n\t\t\t\t\t\treviewerLogin = userFilterProperty;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treviewRequestedLogin = userFilterProperty;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgetPullRequestsOptions = {\n\t\t\t\tauthorLogin: options.filters.includes(PullRequestFilter.Author) ? userFilterProperty : undefined,\n\t\t\t\tassigneeLogins: options.filters.includes(PullRequestFilter.Assignee) ? [userFilterProperty] : undefined,\n\t\t\t\treviewRequestedLogin: reviewRequestedLogin,\n\t\t\t\treviewerId: reviewerId,\n\t\t\t\treviewerLogin: reviewerLogin,\n\t\t\t\tmentionLogin: options.filters.includes(PullRequestFilter.Mention) ? userFilterProperty : undefined,\n\t\t\t};\n\t\t}\n\n\t\tif (\n\t\t\tapi.getProviderPullRequestsPagingMode(providerId) === PagingMode.Repo &&\n\t\t\t!api.isRepoIdsInput(reposOrRepoIds)\n\t\t) {\n\t\t\tconst cursorInfo = this.parseCursorInfo<PagedRepoInput>(options?.cursor);\n\t\t\tconst cursors: PagedRepoInput[] = cursorInfo.cursors ?? [];\n\t\t\tlet repoInputs: PagedRepoInput[] = reposOrRepoIds.map(repo => ({ repo: repo, cursor: undefined }));\n\t\t\tif (cursors.length > 0) {\n\t\t\t\trepoInputs = cursors;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst cursor: { cursors: PagedRepoInput[]; page?: number } = { cursors: [] };\n\t\t\t\tlet hasMore = false;\n\t\t\t\tlet truncated = false;\n\t\t\t\tlet metadata: CollectionMetadata | undefined;\n\t\t\t\tconst failures: CollectionScopeFailure[] = [];\n\t\t\t\tconst data: ProviderPullRequest[] = [];\n\t\t\t\t// `allSettled`, not `Promise.all`: one repo's read rejecting must not discard every sibling repo's\n\t\t\t\t// already-fetched PRs and cursors. A rejected repo becomes a structured `CollectionScopeFailure`\n\t\t\t\t// (attributed to that repo) so the facade warns on it + sets `fetchFailed`, while the survivors and\n\t\t\t\t// their continuation cursors are still returned.\n\t\t\t\tconst settled = await Promise.allSettled(\n\t\t\t\t\trepoInputs.map(async repoInput => {\n\t\t\t\t\t\tconst results = await api.getPullRequestsForRepo(\n\t\t\t\t\t\t\ttoTokenWithInfo(providerId, session),\n\t\t\t\t\t\t\trepoInput.repo,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...getPullRequestsOptions,\n\t\t\t\t\t\t\t\tcursor: repoInput.cursor,\n\t\t\t\t\t\t\t\tisPAT: sendsBasicCredential(providerId, session),\n\t\t\t\t\t\t\t\t// Per repository: an unfiltered read may span organizations, and a host can narrow the base\n\t\t\t\t\t\t\t\t// to each repository's own.\n\t\t\t\t\t\t\t\tbaseUrl:\n\t\t\t\t\t\t\t\t\toptions?.customUrl == null && isGitSelfManagedHostIntegrationId(providerId)\n\t\t\t\t\t\t\t\t\t\t? this.getRepositoriesApiBaseUrl(session, [repoInput.repo])\n\t\t\t\t\t\t\t\t\t\t: customUrl,\n\t\t\t\t\t\t\t\t// Continuation is driven by the per-repo cursor; only apply an explicit page on the\n\t\t\t\t\t\t\t\t// first request so it can't clobber a continuation cursor on later pages.\n\t\t\t\t\t\t\t\tpage: repoInput.cursor == null ? options?.page : undefined,\n\t\t\t\t\t\t\t\tpageSize: options?.pageSize,\n\t\t\t\t\t\t\t\tstates: states,\n\t\t\t\t\t\t\t\t// Azure DevOps only populates clone URLs on request (extra call); no-op elsewhere.\n\t\t\t\t\t\t\t\tincludeRemoteInfo: isAzureDevOpsProvider(providerId) ? true : undefined,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn { repoInput: repoInput, results: results };\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tthrowIfAllSettledFailed(settled);\n\n\t\t\t\t// `allSettled` preserves order, so `settled[i]` is `repoInputs[i]`.\n\t\t\t\tsettled.forEach((outcome, i) => {\n\t\t\t\t\tif (outcome.status !== 'fulfilled') {\n\t\t\t\t\t\tconst failedRepo = repoInputs[i].repo;\n\t\t\t\t\t\tfailures.push(\n\t\t\t\t\t\t\ttoCollectionScopeFailure(\n\t\t\t\t\t\t\t\t{ providerId: providerId, repositoryId: `${failedRepo.namespace}/${failedRepo.name}` },\n\t\t\t\t\t\t\t\toutcome.reason,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst { repoInput, results } = outcome.value;\n\t\t\t\t\tdata.push(...results.values);\n\t\t\t\t\t// Fan-out across repos: preserve each repo's SDK completeness/failures and its terminal\n\t\t\t\t\t// truncation so a single failed/incomplete repo isn't lost when merged with its siblings.\n\t\t\t\t\tmetadata = mergeCollectionMetadata(metadata, results.metadata);\n\t\t\t\t\tif (results.paging?.truncated) {\n\t\t\t\t\t\ttruncated = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (results.paging?.more) {\n\t\t\t\t\t\thasMore = true;\n\t\t\t\t\t\tcursor.cursors.push({ repo: repoInput.repo, cursor: results.paging.cursor });\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Merge the GitLens-side per-repo rejections into the SDK metadata so both flow through the same\n\t\t\t\t// warning/fetchFailed assessment downstream.\n\t\t\t\tif (failures.length > 0) {\n\t\t\t\t\tmetadata = mergeCollectionMetadata(metadata, { completeness: 'partial', failures: failures });\n\t\t\t\t}\n\n\t\t\t\t// Keep the requested page number in the composite cursor so the facade can report the real\n\t\t\t\t// currentPage when the consumer continues using only the cursor.\n\t\t\t\tif (options?.page != null) {\n\t\t\t\t\tcursor.page = options.page;\n\t\t\t\t}\n\n\t\t\t\tawait this.confirmScopedAuthFailures(session, metadata);\n\t\t\t\tthis.resetRequestExceptionCount('getPullRequestsForRepos');\n\t\t\t\treturn {\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\tvalues: data,\n\t\t\t\t\t\tpaging: {\n\t\t\t\t\t\t\tmore: hasMore,\n\t\t\t\t\t\t\tcursor: JSON.stringify(cursor),\n\t\t\t\t\t\t\ttruncated: truncated || undefined,\n\t\t\t\t\t\t\t// Echo the requested numbered page so the facade reports the real currentPage for\n\t\t\t\t\t\t\t// numbered-page hosts (GitLab/Bitbucket/Azure), not a synthesized 1. Cursor-only hosts\n\t\t\t\t\t\t\t// leave `page` undefined via their own reads.\n\t\t\t\t\t\t\tpage: options?.page,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmetadata: metadata,\n\t\t\t\t\t},\n\t\t\t\t\tduration: performance.now() - start,\n\t\t\t\t};\n\t\t\t} catch (ex) {\n\t\t\t\tthis.handleProviderException('getPullRequestsForRepos', ex, {\n\t\t\t\t\tscope: scope,\n\t\t\t\t\tconnectionId: connectionId,\n\t\t\t\t});\n\t\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tconst result = await api.getPullRequestsForRepos(toTokenWithInfo(providerId, session), reposOrRepoIds, {\n\t\t\t\t...getPullRequestsOptions,\n\t\t\t\tcursor: options?.cursor,\n\t\t\t\tisPAT: sendsBasicCredential(providerId, session),\n\t\t\t\tbaseUrl: customUrl,\n\t\t\t\tpage: options?.page,\n\t\t\t\tpageSize: options?.pageSize,\n\t\t\t\tstates: states,\n\t\t\t\t// Azure DevOps only populates clone URLs on request (extra call); no-op elsewhere.\n\t\t\t\tincludeRemoteInfo: isAzureDevOpsProvider(providerId) ? true : undefined,\n\t\t\t\tfields: options?.summary ? summaryPullRequestFields : undefined,\n\t\t\t});\n\t\t\tawait this.confirmScopedAuthFailures(session, result.metadata);\n\t\t\tthis.resetRequestExceptionCount('getPullRequestsForRepos');\n\t\t\treturn { value: result, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getPullRequestsForRepos', ex, {\n\t\t\t\tscope: scope,\n\t\t\t\tconnectionId: connectionId,\n\t\t\t});\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\t/** Account-wide (or repo-scoped) search for the current user's pull requests. */\n\t@trace()\n\tasync searchMyPullRequests(\n\t\trepos?: T | T[],\n\t\tcancellation?: AbortSignal,\n\t\toptions?: SearchMyPullRequestsOptions & { connectionId?: string },\n\t): Promise<IntegrationResult<PullRequest[] | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\tconst { connectionId, ...searchOptions } = options ?? {};\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst prs = await this.searchProviderMyPullRequests(\n\t\t\t\tsession,\n\t\t\t\tensureArray(repos),\n\t\t\t\tcancellation,\n\t\t\t\tsearchOptions,\n\t\t\t);\n\t\t\tthis.resetRequestExceptionCount('searchMyPullRequests');\n\t\t\treturn { value: prs, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('searchMyPullRequests', ex, {\n\t\t\t\tscope: scope,\n\t\t\t\tsilent: true,\n\t\t\t\tconnectionId: connectionId,\n\t\t\t});\n\t\t\treturn {\n\t\t\t\terror: toError(ex),\n\t\t\t\tduration: performance.now() - start,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Account-wide, user-scoped counterpart of {@link getMyPullRequestsForReposResult} that returns the raw\n\t * `ProviderPullRequest` shape (not the normalized model). Unlike the repo-scoped core, this needs no\n\t * `repos` — it reads the current user's pull requests across the account, so the ProviderBackend sweep\n\t * can drive its Kanban \"done\" column even when no repositories are supplied (where the repo-scoped core\n\t * rejects an empty `repos` input). Recovers thrown errors into `{ error }` so callers surface warnings.\n\t */\n\tasync getMyPullRequestsForUserResult(\n\t\toptions?: {\n\t\t\tstate?: PullRequestStateFilter[];\n\t\t\tcursor?: string;\n\t\t\tincludeReviewRequested?: boolean;\n\t\t\t/** Exact OR union of account-wide relationships to include. */\n\t\t\tfilters?: PullRequestFilter[];\n\t\t\t/** Request only the stable list fields, omitting optional provider enrichments. */\n\t\t\tsummary?: boolean;\n\t\t},\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<ProviderApiPagedResult<ProviderPullRequest> | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tif (this.getProviderMyPullRequestsForUser == null) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst result = await this.getProviderMyPullRequestsForUser(session, options);\n\t\t\tawait this.confirmScopedAuthFailures(session, result?.metadata);\n\t\t\tthis.resetRequestExceptionCount('getMyPullRequestsForUser');\n\t\t\treturn { value: result, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getMyPullRequestsForUser', ex, {\n\t\t\t\tscope: scope,\n\t\t\t\tconnectionId: connectionId,\n\t\t\t});\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\t/**\n\t * Reads the current user's pull requests across the whole account using each provider's native \"my PRs\"\n\t * query, returning the raw provider shape. Without `filters`, the exact user scopes depend on provider-native\n\t * behavior and options like `includeReviewRequested`. With `filters`, each member is an exact account-wide OR\n\t * relationship validated by the facade before this provider hook is called. Optional: providers that can't\n\t * express an account-wide user query leave it undefined and the surface falls back to repo-scoped.\n\t *\n\t * These native user queries are cursor-based, so `cursor` (not a page number) drives continuation; there\n\t * is no jump-to-page-N and no per-call page size on this path.\n\t *\n\t * `includeReviewRequested` opts into the review-requested slice for providers whose account-wide read\n\t * only returns authored PRs natively and must fan out per-repo to add reviewer PRs (Bitbucket). It's off\n\t * by default so a sweep pays gkcli-parity cost (authored only) unless the caller deliberately opts in;\n\t * providers whose native query already covers review-requested PRs ignore it.\n\t */\n\tprotected getProviderMyPullRequestsForUser?(\n\t\tsession: ProviderAuthenticationSession,\n\t\toptions?: {\n\t\t\tstate?: PullRequestStateFilter[];\n\t\t\tcursor?: string;\n\t\t\tincludeReviewRequested?: boolean;\n\t\t\tfilters?: PullRequestFilter[];\n\t\t\tsummary?: boolean;\n\t\t},\n\t): Promise<ProviderApiPagedResult<ProviderPullRequest> | undefined>;\n\n\t/**\n\t * Parses a Repo/Project paging cursor into its `cursors` bundle. Guards against valid JSON whose\n\t * `cursors` is a truthy non-array (e.g. `{ \"cursors\": \"...\" }`), which would otherwise bypass the\n\t * `?? []` fallback at call sites and flow into `.map()` downstream, throwing instead of degrading to\n\t * the first page.\n\t */\n\tprivate parseCursorInfo<T>(cursor?: string): { cursors?: T[] } {\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(cursor ?? '{}') as { cursors?: T[] };\n\t\t\treturn Array.isArray(parsed?.cursors) ? parsed : {};\n\t\t} catch {\n\t\t\treturn {};\n\t\t}\n\t}\n\n\tprotected abstract searchProviderMyPullRequests(\n\t\tsession: ProviderAuthenticationSession,\n\t\trepos?: T[],\n\t\tcancellation?: AbortSignal,\n\t\toptions?: SearchMyPullRequestsOptions,\n\t): Promise<PullRequest[] | undefined>;\n\n\t/**\n\t * Result-returning wrapper for the filtered pull-request search. Errors become the soft\n\t * `{ error }` branch so the public facade can preserve an empty account and a failed request as distinct\n\t * outcomes.\n\t */\n\tasync searchPullRequestsPageResult(\n\t\toptions: {\n\t\t\trepos?: ProviderRepoInput[];\n\t\t\torg?: string;\n\t\t\tcriteria?: PullRequestSearchCriteria;\n\t\t\tcursor?: string;\n\t\t\tpageSize?: number;\n\t\t\t/** See {@link IntegrationManager.searchPullRequestsPage}. */\n\t\t\tsummary?: boolean;\n\t\t},\n\t\tcancellation?: AbortSignal,\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<ProviderPullRequestSearchPage | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst result = await this.searchProviderPullRequestsPage?.(session, options, cancellation);\n\t\t\tawait this.confirmScopedAuthFailures(session, result?.metadata);\n\t\t\tthis.resetRequestExceptionCount('searchPullRequestsPage');\n\t\t\treturn { value: result, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('searchPullRequestsPage', ex, { scope: scope, connectionId: connectionId });\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\t/** Must agree with `ProviderMetadata.supportedPullRequestSearch`. */\n\tprotected searchProviderPullRequestsPage?(\n\t\tsession: ProviderAuthenticationSession,\n\t\toptions: {\n\t\t\trepos?: ProviderRepoInput[];\n\t\t\torg?: string;\n\t\t\tcriteria?: PullRequestSearchCriteria;\n\t\t\tcursor?: string;\n\t\t\tpageSize?: number;\n\t\t\t/** See the caller's option of the same name on {@link searchPullRequestsPage}. */\n\t\t\tsummary?: boolean;\n\t\t},\n\t\tcancellation?: AbortSignal,\n\t): Promise<ProviderPullRequestSearchPage | undefined>;\n\n\t/** Free-text search across pull requests, optionally narrowed to `repos`. */\n\t@trace()\n\tasync searchPullRequests(\n\t\tsearchQuery: string,\n\t\trepos?: T | T[],\n\t\tcancellation?: AbortSignal,\n\t\toptions?: SearchPullRequestsOptions & { connectionId?: string },\n\t): Promise<PullRequest[] | undefined> {\n\t\tconst scope = getScopedLogger();\n\t\tconst { connectionId, ...searchOptions } = options ?? {};\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\ttry {\n\t\t\tconst prs = await this.searchProviderPullRequests?.(\n\t\t\t\tsession,\n\t\t\t\tsearchQuery,\n\t\t\t\tensureArray(repos),\n\t\t\t\tcancellation,\n\t\t\t\tsearchOptions,\n\t\t\t);\n\t\t\tthis.resetRequestExceptionCount('searchPullRequests');\n\t\t\treturn prs;\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('searchPullRequests', ex, { scope: scope, connectionId: connectionId });\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprotected searchProviderPullRequests?(\n\t\tsession: ProviderAuthenticationSession,\n\t\tsearchQuery: string,\n\t\trepos?: T[],\n\t\tcancellation?: AbortSignal,\n\t\toptions?: SearchPullRequestsOptions,\n\t): Promise<PullRequest[] | undefined>;\n\n\t/**\n\t * Result-returning wrapper for the FILTERED issue search — issues matching structured criteria over a\n\t * repository/org scope, with no forced relationship to the current user. Recovers thrown errors into\n\t * `{ error }` so the facade surfaces a warning instead of a silent empty page.\n\t *\n\t * Distinct from every other issue read on this class: {@link searchMyIssuesWithTruncationResult} is bound to\n\t * the current user by construction, and {@link getMyIssuesForReposAsShapesResult} goes through the SDK's\n\t * repo-scoped read (whose over-limit recovery walk can cost up to 128 requests). This one is one request per\n\t * page and carries no relationship it wasn't asked for.\n\t */\n\tasync searchIssuesPageResult(\n\t\toptions: {\n\t\t\t/**\n\t\t\t * Repositories to search, as namespace/name descriptors. NOT repository ids: a search query names\n\t\t\t * repositories by path, so an id-based input can't be expressed and the facade rejects it before here.\n\t\t\t */\n\t\t\trepos?: ProviderRepoInput[];\n\t\t\torg?: string;\n\t\t\tcriteria?: IssueSearchCriteria;\n\t\t\tcursor?: string;\n\t\t\tpageSize?: number;\n\t\t},\n\t\tcancellation?: AbortSignal,\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<ProviderIssueSearchPage | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst result = await this.searchProviderIssuesPage?.(session, options, cancellation);\n\t\t\tthis.resetRequestExceptionCount('searchIssuesPage');\n\t\t\treturn { value: result, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('searchIssuesPage', ex, { scope: scope, connectionId: connectionId });\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\t/**\n\t * OPTIONAL, like {@link searchProviderPullRequests}: a provider that can't express the criteria server-side\n\t * doesn't implement it, and the facade refuses the read (warning + `fetchFailed`) rather than serving a list\n\t * that was never narrowed. Whether a provider implements this must agree with what\n\t * `ProviderMetadata.supportedIssueSearch` declares.\n\t */\n\tprotected searchProviderIssuesPage?(\n\t\tsession: ProviderAuthenticationSession,\n\t\toptions: {\n\t\t\trepos?: ProviderRepoInput[];\n\t\t\torg?: string;\n\t\t\tcriteria?: IssueSearchCriteria;\n\t\t\tcursor?: string;\n\t\t\tpageSize?: number;\n\t\t},\n\t\tcancellation?: AbortSignal,\n\t): Promise<ProviderIssueSearchPage | undefined>;\n\n\t/**\n\t * Result-returning wrapper for the count-only probe: how many issues MATCH each scope, transferring no issues\n\t * at all. Recovers thrown errors into `{ error }` like the reads around it.\n\t *\n\t * Counts come back POSITIONALLY — one per input scope, in order — because a caller's key must never reach the\n\t * provider query. See {@link ProviderSearchCount} for what each slot can hold; `undefined` means the provider\n\t * didn't report a count for it, never zero matches.\n\t */\n\tasync countIssuesResult(\n\t\tscopes: readonly { repos?: ProviderRepoInput[]; org?: string; criteria?: IssueSearchCriteria }[],\n\t\tcancellation?: AbortSignal,\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<ProviderSearchCount[] | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst counts = await this.countProviderIssues?.(session, scopes, cancellation);\n\t\t\tthis.resetRequestExceptionCount('countIssues');\n\t\t\treturn { value: counts, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('countIssues', ex, { scope: scope, connectionId: connectionId });\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\t/**\n\t * OPTIONAL: only a provider that can answer \"how many match\" WITHOUT fetching the matches implements this.\n\t * GitHub's search reports `issueCount` on a zero-node selection, and Azure DevOps Server's WIQL returns the\n\t * matching ids without their details; GitLab's REST exposes a total on some endpoints but not for a\n\t * search-shaped query. A provider that can't answer doesn't implement it and the facade refuses the probe, so a\n\t * consumer hides its count rather than being shown a fabricated one.\n\t */\n\tprotected countProviderIssues?(\n\t\tsession: ProviderAuthenticationSession,\n\t\tscopes: readonly { repos?: ProviderRepoInput[]; org?: string; criteria?: IssueSearchCriteria }[],\n\t\tcancellation?: AbortSignal,\n\t): Promise<ProviderSearchCount[] | undefined>;\n\n\t/**\n\t * Result-returning wrapper for the BATCH issue read: resolves several `(owner, repo, number)` coordinates in\n\t * one request. Recovers thrown errors into `{ error }` like the reads around it.\n\t *\n\t * Distinct from every search on this class, and deliberately so. A search answers \"what matches\"; this answers\n\t * \"does this exact issue exist\", which is the question a caller correlating a branch name to an issue is\n\t * actually asking. It has no result ceiling, no ordering and no cursor, and — the property that matters most —\n\t * an absent slot is a PROVEN ABSENCE rather than \"not found within a page budget\", so a caller can cache a\n\t * miss instead of re-walking for it forever.\n\t *\n\t * Results come back POSITIONALLY — one per input coordinate, in order — for the same reason\n\t * {@link countIssuesResult} does: a caller's key must never reach the provider query. `undefined` in a slot\n\t * means the issue does not exist or is not visible to this token, never that the read failed.\n\t */\n\tasync getIssuesBatchResult(\n\t\tcoordinates: readonly { owner: string; repo: string; number: number }[],\n\t\tcancellation?: AbortSignal,\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<(IssueShape | undefined)[] | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst issues = await this.getProviderIssuesBatch?.(session, coordinates, cancellation);\n\t\t\tthis.resetRequestExceptionCount('getIssuesBatch');\n\t\t\treturn { value: issues, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('getIssuesBatch', ex, { scope: scope, connectionId: connectionId });\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\t/**\n\t * OPTIONAL: only a provider that can resolve SEVERAL issues by coordinate in one request implements this.\n\t * GitHub aliases its point read into one document; the SDK exposes only a singular `getIssue` for every other\n\t * provider, and there is no plural variant to build on. A provider that can't answer doesn't implement it and\n\t * the facade refuses the read, so a caller keeps its own per-issue path rather than being handed a batch that\n\t * silently degraded into N requests.\n\t */\n\tprotected getProviderIssuesBatch?(\n\t\tsession: ProviderAuthenticationSession,\n\t\tcoordinates: readonly { owner: string; repo: string; number: number }[],\n\t\tcancellation?: AbortSignal,\n\t): Promise<(IssueShape | undefined)[] | undefined>;\n\n\t/**\n\t * The PR twin of {@link countIssuesResult}: counts each scope's pull requests, transferring none where the\n\t * provider has a count query. Each slot is a {@link ProviderPullRequestCount}, so a provider that can only count\n\t * by reading (Bitbucket Data Center) can mark a figure it stopped short of as a floor, or an `Error` refusing only\n\t * that scope (Azure DevOps Server).\n\t */\n\tasync countPullRequestsResult(\n\t\tscopes: readonly { repos?: ProviderRepoInput[]; org?: string; criteria?: PullRequestSearchCriteria }[],\n\t\tcancellation?: AbortSignal,\n\t\tconnectionId?: string,\n\t): Promise<IntegrationResult<(ProviderPullRequestCount | Error)[] | undefined>> {\n\t\tconst scope = getScopedLogger();\n\t\t// `connectionId` targets a specific account (multi-account); omitted reads the primary.\n\t\tconst session = await this.resolveReadSession(connectionId, scope);\n\t\tif (session == null) return undefined;\n\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tconst counts = await this.countProviderPullRequests?.(session, scopes, cancellation);\n\t\t\tthis.resetRequestExceptionCount('countPullRequests');\n\t\t\treturn { value: counts, duration: performance.now() - start };\n\t\t} catch (ex) {\n\t\t\tthis.handleProviderException('countPullRequests', ex, { scope: scope, connectionId: connectionId });\n\t\t\treturn { error: toError(ex), duration: performance.now() - start };\n\t\t}\n\t}\n\n\t/**\n\t * OPTIONAL, like {@link countProviderIssues}: only a provider that can answer \"how many match\" implements it —\n\t * GitHub/GHE with a zero-node search, Bitbucket Data Center by reading within a budget and reporting a floor\n\t * past it, Azure DevOps Server from the drain its search reads. Must agree with\n\t * `ProviderMetadata.supportedPullRequestSearch`, which the facade validates against.\n\t */\n\tprotected countProviderPullRequests?(\n\t\tsession: ProviderAuthenticationSession,\n\t\tscopes: readonly { repos?: ProviderRepoInput[]; org?: string; criteria?: PullRequestSearchCriteria }[],\n\t\tcancellation?: AbortSignal,\n\t): Promise<(ProviderPullRequestCount | Error)[] | undefined>;\n\n\tgetPullRequestIdentityFromMaybeUrl(search: string): PullRequestUrlIdentity | undefined {\n\t\treturn this.getProviderPullRequestIdentityFromMaybeUrl?.(search);\n\t}\n\n\tprotected getProviderPullRequestIdentityFromMaybeUrl?(search: string): PullRequestUrlIdentity | undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EA,SAAS,qBAAqB,YAA4B,SAA6D;CACtH,OAAO,sBAAsB,UAAU,IAAI,QAAQ,SAAS,UAAU,KAAA;AACvE;AAEA,SAAS,sBACR,YAC0G;CAC1G,OACC,eAAA,iBACA,eAAA;AAEF;;;;;;;;;;;AA0CA,SAAS,gBAAmB,SAAiB,OAAe,YAA2C;CACtG,QAAO,KAAK,SAAS,UAAU;CAC/B,OAAO;EAAE,OAAO,IAAI,MAAM,OAAO;EAAG,UAAU,YAAY,IAAI,IAAI;CAAM;AACzE;;;;;AAMA,MAAM,2BAAgE;CACrE,YAAY;CACZ,aAAa;AACd;AAEA,IAAsB,qBAAtB,cAGU,gBAAoB;CAC7B,OAAiC;;CAGjC,8BAAwC,SAAgD;EACvF,MAAM,UAAU,sBACf,KAAK,IACL,QAAQ,YAAY,QAAQ,UAAU,KAAK,SAC3C,QAAQ,QACT;EACA,IAAI,WAAW,QAAQ,CAAC,qBAAqB,SAAS,KAAK,MAAM,GAChE,MAAM,IAAI,MAAM,2CAA2C;EAG5D,OAAO;CACR;CAEA,yBAAmC,SAAgD;EAClF,MAAM,UAAU,KAAK,8BAA8B,OAAO;EAC1D,QAAQ,KAAK,IAAb;GACC,KAAA,2BACC,OAAO,GAAG,QAAQ;GACnB,KAAA,oBACC,OAAO,GAAG,QAAQ;GACnB,SACC,OAAO;EACT;CACD;;CAGA,0BAAoC,SAAwC,QAAoC;EAC/G,OAAO,KAAK,yBAAyB,OAAO;CAC7C;CAEA,MAEM,mB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