@gitkraken/core-gitlens 0.54.0 → 0.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/dist/git/models/pullRequest.d.ts +14 -0
  3. package/dist/git/models/pullRequest.js.map +1 -1
  4. package/dist/git/utils/pullRequest.utils.d.ts +3 -1
  5. package/dist/git/utils/pullRequest.utils.js +9 -1
  6. package/dist/git/utils/pullRequest.utils.js.map +1 -1
  7. package/dist/git-cli/providers/config.js +2 -2
  8. package/dist/git-cli/providers/pausedOperations.js +2 -2
  9. package/dist/git-cli/providers/pausedOperations.js.map +1 -1
  10. package/dist/git-cli/providers/staging.js +1 -1
  11. package/dist/ipc/discovery.js +1 -1
  12. package/dist/plus/agents/providers/claudeCodeTranscript.js +6 -6
  13. package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
  14. package/dist/plus/ai/providers/openAICompatibleProviderBase.js +1 -1
  15. package/dist/plus/git-github/api/github.d.ts +2 -0
  16. package/dist/plus/git-github/api/github.js +16 -6
  17. package/dist/plus/git-github/api/github.js.map +1 -1
  18. package/dist/plus/git-github/api/pullRequestSearchQuery.d.ts +1 -0
  19. package/dist/plus/git-github/api/pullRequestSearchQuery.js +29 -5
  20. package/dist/plus/git-github/api/pullRequestSearchQuery.js.map +1 -1
  21. package/dist/plus/integrations/fieldPresence.d.ts +3 -0
  22. package/dist/plus/integrations/fieldPresence.js +7 -1
  23. package/dist/plus/integrations/fieldPresence.js.map +1 -1
  24. package/dist/plus/integrations/index.d.ts +2 -2
  25. package/dist/plus/integrations/index.js.map +1 -1
  26. package/dist/plus/integrations/integrationService.d.ts +2 -2
  27. package/dist/plus/integrations/integrationService.js.map +1 -1
  28. package/dist/plus/integrations/manager.d.ts +7 -2
  29. package/dist/plus/integrations/models/publicIntegration.d.ts +1 -0
  30. package/dist/plus/integrations/models/pullRequestReads.d.ts +2 -0
  31. package/dist/plus/integrations/providers/azure/azure.js +1 -1
  32. package/dist/plus/integrations/providers/github.js +1 -1
  33. package/dist/plus/integrations/providers/issueSorts.d.ts +1 -0
  34. package/dist/plus/integrations/providers/metadata.js +6 -3
  35. package/dist/plus/integrations/providers/metadata.js.map +1 -1
  36. package/dist/plus/integrations/reads/drains.d.ts +1 -0
  37. package/dist/plus/integrations/reads/filters.js +13 -1
  38. package/dist/plus/integrations/reads/filters.js.map +1 -1
  39. package/dist/plus/integrations/reads/pullRequestBatch.js +3 -3
  40. package/dist/plus/integrations/reads/pullRequestBatch.js.map +1 -1
  41. package/dist/plus/integrations/reads/searchPullRequests.d.ts +3 -3
  42. package/dist/plus/integrations/reads/searchPullRequests.js +4 -3
  43. package/dist/plus/integrations/reads/searchPullRequests.js.map +1 -1
  44. package/dist/plus/integrations/reads/sweeps.js +20 -6
  45. package/dist/plus/integrations/reads/sweeps.js.map +1 -1
  46. package/dist/plus/integrations/reads/warnings.d.ts +1 -0
  47. package/dist/plus/integrations/reads/warnings.js +7 -2
  48. package/dist/plus/integrations/reads/warnings.js.map +1 -1
  49. package/dist/plus/integrations/results.d.ts +7 -0
  50. package/dist/plus/integrations/results.js.map +1 -1
  51. package/dist/utils/env/node/exec.js +2 -2
  52. package/docs/integrations.md +33 -1
  53. package/package.json +1 -1
@@ -14,7 +14,7 @@ import { AzurePullRequestCreateCapabilityOptions, AzurePullRequestCreateCapabili
14
14
  import { CaptureRelationshipCurrency, IssueRelationshipWriteOptions, IssueRelationshipWriteResult, IssueRelationshipsOptions, IssueRelationshipsResult } from "./models/issueRelationships.js";
15
15
  import { IssueFilter, SupportedFilters } from "./providerFilters.js";
16
16
  import { IssueEtagInclude, PullRequestEtagInclude } from "./reads/etag.js";
17
- import { ConnectionStateChangeEvent, CurrentAccountResult, IssueBatchResult, IssueBatchTarget, IssueCountResult, IssueCountScope, ProviderBroadenResult, ProviderLinearProjectShape, ProviderOrganization, ProviderPagedResult, ProviderRepositoryShape, ProviderResult, ProviderSweepResult, PullRequestActivityResult, PullRequestActivityTarget, PullRequestBatchResult, PullRequestBatchTarget, PullRequestBranchResult, PullRequestBranchTarget, PullRequestCheckLogResult, PullRequestCheckLogTarget, PullRequestCountResult, PullRequestCountScope, PullRequestForCommitResult, ResolveRepositoryResult } from "./results.js";
17
+ import { ConnectionStateChangeEvent, CurrentAccountResult, IssueBatchResult, IssueBatchTarget, IssueCountResult, IssueCountScope, ProviderBroadenResult, ProviderLinearProjectShape, ProviderOrganization, ProviderPagedResult, ProviderPullRequestSearchResult, ProviderRepositoryShape, ProviderResult, ProviderSweepResult, PullRequestActivityResult, PullRequestActivityTarget, PullRequestBatchResult, PullRequestBatchTarget, PullRequestBranchResult, PullRequestBranchTarget, PullRequestCheckLogResult, PullRequestCheckLogTarget, PullRequestCountResult, PullRequestCountScope, PullRequestForCommitResult, ResolveRepositoryResult } from "./results.js";
18
18
  import { GitHostIntegration, IntegrationById, IntegrationResult, IssuesIntegration, SearchMyPullRequestsOptions } from "./models/publicIntegration.js";
19
19
  import { ConfiguredIntegrationsChangeEvent } from "./authentication/configuredIntegrationService.js";
20
20
  //#region ../plus/integrations/src/manager.d.ts
@@ -234,6 +234,11 @@ type PullRequestSweepCommonOptions = {
234
234
  * provider ignores it. Selecting it costs a rate-limit request per row.
235
235
  */
236
236
  mergeQueue?: boolean;
237
+ /**
238
+ * GitHub/GHE only: gives each row as complete as a `getPullRequestsBatch` row the `etag` that read, with these
239
+ * includes, would give it. An unknown value refuses every target the sweep reaches.
240
+ */
241
+ etagIncludes?: readonly PullRequestEtagInclude[];
237
242
  /**
238
243
  * Page budget per provider. A stop at this budget with a resumable cursor is reported as
239
244
  * `pagination-incomplete` with `recovery: 'page-budget'`. A part no budget reaches is reported beside it
@@ -590,7 +595,7 @@ export interface IntegrationManager {
590
595
  * never mistaken for a failed or an empty one.
591
596
  */
592
597
  cancellation?: AbortSignal;
593
- }): Promise<ProviderPagedResult<PullRequestShape>>;
598
+ }): Promise<ProviderPullRequestSearchResult>;
594
599
  listIssuesPage(options: {
595
600
  state?: IssueStateFilter;
596
601
  providerId: IntegrationIds;
@@ -10,6 +10,7 @@ import { RepositoryMetadata } from "../../../git/models/repositoryMetadata.js";
10
10
  import { PullRequestUrlIdentity } from "../../../git/utils/pullRequest.utils.js";
11
11
  import { GitCloudHostIntegrationId, IntegrationIds, IssuesCloudHostIntegrationId, IssuesHostIntegrationIds } from "../constants.js";
12
12
  import { Sources } from "../telemetry.js";
13
+ import "../providerFilters.js";
13
14
  import { ProviderRepositoryShape } from "../results.js";
14
15
  import { ProviderRepositoriesInput } from "../manager.js";
15
16
  //#region ../plus/integrations/src/models/publicIntegration.d.ts
@@ -27,6 +27,8 @@ export type ProviderPullRequestSearchPage = {
27
27
  metadata?: CollectionMetadata;
28
28
  /** See `ProviderIssueSearchPage.limitReached`. */
29
29
  limitReached?: boolean;
30
+ /** See {@link ProviderPullRequestSearchResult.openCount}. */
31
+ openCount?: number;
30
32
  };
31
33
  /**
32
34
  * One scope's pull-request count, as the provider reports it.
@@ -7,9 +7,9 @@ import { trace } from "../../../../utils/decorators/log.js";
7
7
  import { PromiseCache } from "../../../../utils/promiseCache.js";
8
8
  import __decorate from "../../../../_virtual/@oxc-project+runtime/helpers/esm/decorate.js";
9
9
  import { AuthenticationError, RequestClientError, RequestNotFoundError, RequestRateLimitError, getDeferredRequestFailure, reportRequestFailure } from "../../../../git/errors.js";
10
- import { sha256, uuid } from "../../../../utils/crypto.js";
11
10
  import { maybeStopWatch } from "../../../../utils/stopwatch.js";
12
11
  import { base64 } from "../../../../utils/base64.js";
12
+ import { sha256, uuid } from "../../../../utils/crypto.js";
13
13
  import { effectiveIssueSort } from "../../../../git/utils/issue.utils.js";
14
14
  import { ProviderFetchError, isRateLimitResponse, toRateLimitError } from "../../errors.js";
15
15
  import { CommitReadRefusedError, isCommitReadRefusal, isNotFoundResponse, throwProviderError } from "../providerErrors.js";
@@ -2,9 +2,9 @@ import { chunk } from "../../../utils/array.js";
2
2
  import { isCancellationError } from "../../../utils/cancellation.js";
3
3
  import { batch, mapBounded, mapSettledBounded } from "../../../utils/promise.js";
4
4
  import { AuthenticationError, RequestNotFoundError } from "../../../git/errors.js";
5
- import { uuid } from "../../../utils/crypto.js";
6
5
  import { parseGitRemoteUrl } from "../../../git/utils/remote.utils.js";
7
6
  import { getGitHubNoReplyAddressParts } from "../../../git/remotes/github.js";
7
+ import { uuid } from "../../../utils/crypto.js";
8
8
  import "../../../git/models/pullRequest.js";
9
9
  import { decodeGitHubCheckRunId, fromGitHubCheckContextState, fromGitHubIssueOrPullRequestState, fromGitHubMergeQueueEntryState, fromGitHubMergeQueueRemoval, fromGitHubPullRequestMergeableState, fromGitHubPullRequestReviewDecision, fromGitHubPullRequestStatusCheckRollupState, toGitHubCheckRunId } from "../../git-github/models.js";
10
10
  import { IntegrationReadUnavailableError } from "../errors.js";
@@ -1,4 +1,5 @@
1
1
  import { IssueSorting } from "../../../git/models/issue.js";
2
+ import "../providerFilters.js";
2
3
  //#region ../plus/integrations/src/providers/issueSorts.d.ts
3
4
  /** GitHub and GHE: one `search` channel serves all three issue reads, so all three order the same way. */
4
5
  export declare const githubIssueSorts: IssueSorting[];
@@ -64,7 +64,8 @@ const githubPullRequestSearchCapabilities = {
64
64
  "updated:asc",
65
65
  "created:desc",
66
66
  "created:asc"
67
- ]
67
+ ],
68
+ changedSince: true
68
69
  };
69
70
  /**
70
71
  * Bitbucket Data Center's filtered pull-request search (`bitbucket-server/pullRequestSearch.ts`), declared from what
@@ -96,7 +97,8 @@ const bitbucketServerPullRequestSearchCapabilities = {
96
97
  draft: true,
97
98
  repositoryScope: true,
98
99
  organizationScope: false,
99
- sorts: ["updated:desc", "updated:asc"]
100
+ sorts: ["updated:desc", "updated:asc"],
101
+ changedSince: false
100
102
  };
101
103
  /**
102
104
  * Azure DevOps Server's filtered pull-request search. Azure's pull request query narrows only by creator, reviewer,
@@ -128,7 +130,8 @@ const azureServerPullRequestSearchCapabilities = {
128
130
  draft: true,
129
131
  repositoryScope: true,
130
132
  organizationScope: true,
131
- sorts: azurePullRequestSearchSorts
133
+ sorts: azurePullRequestSearchSorts,
134
+ changedSince: false
132
135
  };
133
136
  /**
134
137
  * Azure DevOps Server's filtered work-item search: one WIQL query per collection, every criterion a clause of it.
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.js","names":[],"sources":["../../../../../plus/integrations/src/providers/metadata.ts"],"sourcesContent":["import { githubSearchResultLimit } from '@gitlens/git-github/api/config.js';\nimport type { ProviderReference } from '@gitlens/git/models/remoteProvider.js';\nimport { equalsIgnoreCase } from '@gitlens/utils/string.js';\nimport type { IntegrationIds } from '../constants.js';\nimport {\n\tGitCloudHostIntegrationId,\n\tGitSelfManagedHostIntegrationId,\n\tIssuesCloudHostIntegrationId,\n\tIssuesSelfManagedHostIntegrationId,\n} from '../constants.js';\nimport type { IntegrationType } from '../models/publicIntegration.js';\nimport type {\n\tIssueSearchCapabilities,\n\tIssueSorting,\n\tPullRequestSearchCapabilities,\n\tPullRequestSorting,\n} from '../providerFilters.js';\nimport { IssueFilter, PullRequestFilter } from '../providerFilters.js';\nimport {\n\tazurePullRequestSearchSorts,\n\tazureWorkItemSearchRelationships,\n\tazureWorkItemSearchResultLimit,\n\tazureWorkItemSearchSorts,\n} from './azure/search.js';\nimport {\n\tasanaIssueSorts,\n\tazureAccountWideIssueSorts,\n\tazureIssueSorts,\n\tgithubAccountWideIssueSorts,\n\tgithubIssueSorts,\n\tgitlabAccountWideIssueSorts,\n\tgitlabIssueSorts,\n\tjiraIssueSorts,\n\tlinearIssueSorts,\n\ttrelloIssueSorts,\n} from './issueSorts.js';\n\n// Provider metadata (names, domains, icons, scopes, capabilities) and the domain checks built on it. Kept apart from\n// `models.ts`, which holds the `@gitkraken/provider-apis` mappings, so the public facade can re-export this without\n// its declarations reaching the SDK.\n\nexport enum PagingMode {\n\tProject = 'project',\n\tRepo = 'repo',\n\tRepos = 'repos',\n}\n\nexport interface ProviderMetadata {\n\tdomain: string;\n\tid: IntegrationIds;\n\tname: string;\n\ttype: IntegrationType;\n\t/** Key for the `gl-provider-<iconKey>` glicon. Cloud self-managed variants reuse the base\n\t * `'github-enterprise'`/`'gitlab-self-hosted'` icon (no enum member exists for those anymore). */\n\ticonKey: string;\n\tissuesPagingMode?: PagingMode;\n\tpullRequestsPagingMode?: PagingMode;\n\tscopes: string[];\n\tsupportedPullRequestFilters?: PullRequestFilter[];\n\t/**\n\t * Relationship filters the ACCOUNT-WIDE pull-request read can express as an exact OR union.\n\t * This is independent from `supportedPullRequestFilters`, which describes repo-scoped reads.\n\t */\n\tsupportedAccountWidePullRequestFilters?: PullRequestFilter[];\n\t/**\n\t * What the filtered pull-request search can express server-side. Absent means the provider has\n\t * no such search and the facade refuses it rather than returning an unfiltered page.\n\t */\n\tsupportedPullRequestSearch?: PullRequestSearchCapabilities;\n\t/**\n\t * Maximum results the provider will serve for one pull-request search facet. Matches beyond it are unreachable\n\t * and are reported as a succeeded omission carrying this limit plus the provider's pre-ceiling facet count.\n\t */\n\tpullRequestSearchResultLimit?: number;\n\t/** Filters the REPO-scoped issue read can express. */\n\tsupportedIssueFilters?: IssueFilter[];\n\t/**\n\t * Filters the ACCOUNT-WIDE issue read can express, which is NOT the same set as\n\t * {@link ProviderMetadata.supportedIssueFilters}: the two reads are different provider queries.\n\t *\n\t * Unfiltered, each provider's account-wide read is that provider's own definition of \"my issues\" — GitHub/GHE\n\t * union authored + assigned + mentioned, Azure drains assigned + authored, and GitLab reads assigned-to-me.\n\t * A consumer replacing a narrower tool (`gk`'s `assignee:@me`) must select the `Assignee` filter wherever the\n\t * provider's default is wider.\n\t *\n\t * A filter listed here narrows that read server-side. Absent/empty means the read can't be narrowed at all,\n\t * so the facade refuses a filtered request rather than serving the unnarrowed union as if it had been\n\t * filtered. GitLab lists `Assignee` and `Author` because the SDK's account-wide input exposes both username\n\t * axes; it omits `Mention` because that REST read has no first-class mention filter.\n\t */\n\tsupportedAccountWideIssueFilters?: IssueFilter[];\n\t/**\n\t * Sort keys the REPO-scoped issue read can express server-side — and, for an issue tracker (Jira/Linear/Trello),\n\t * its project-scoped read, which is the only issue surface a tracker has.\n\t *\n\t * Absent/empty means the read can't be ordered at all, so a request carrying `sort` is refused rather than\n\t * served in whatever order the provider felt like. Present, it is a promise: every key here reaches the\n\t * provider query.\n\t *\n\t * A key listed here is expressible on ONE provider query, which is what this read is when it is given ONE\n\t * scope. Given several (GitLab across repositories, Azure across projects, a tracker across projects) it merges\n\t * their results here and can only honor a key a normalized issue carries, so it additionally refuses\n\t * `priority`/`dueDate`/`resolved` — see `getIssueComparator`. That depends on the caller's scope count rather\n\t * than on the provider, which is why it is a runtime refusal and not a fourth table: encoding it here would\n\t * under-report the single-scope read, which really does support those keys.\n\t */\n\tsupportedIssueSorts?: IssueSorting[];\n\t/**\n\t * Sort keys the ACCOUNT-WIDE issue read can express server-side, which is NOT the same set as\n\t * {@link ProviderMetadata.supportedIssueSorts} — for GitLab the two reads are different APIs (GraphQL vs REST)\n\t * with genuinely different vocabularies, not one narrowed twice.\n\t *\n\t * Absent means the account-wide read can't be ordered (or doesn't exist). An issue tracker leaves this empty\n\t * and reports under `supportedIssueSorts`, so reading a tracker's capability from here under-reports it.\n\t *\n\t * Unlike {@link ProviderMetadata.supportedIssueSorts} this needs no companion runtime refusal, because every\n\t * provider's account-wide read is a union of several queries with no scope count for a caller to reduce: it\n\t * ALWAYS merges. So the keys a merge can't order by are simply absent here — the table states what the read can\n\t * honor, which is what makes intersecting against it sufficient.\n\t */\n\tsupportedAccountWideIssueSorts?: IssueSorting[];\n\t/**\n\t * Whether issue list reads (including Azure project/repository and account-wide reads) can be asked for a `state` other than open, and honor it server-side.\n\t *\n\t * A tracker read is open-only unless asked otherwise, so absent does not mean the read returns every state: it\n\t * means only `'open'` is expressible, and `'closed'`/`'all'` are refused rather than served as the open list.\n\t * Server-side, because each read drains to a page backstop: dropping states afterwards would let a project full\n\t * of done work spend that budget before reaching the open issues.\n\t */\n\tsupportsIssueStates?: boolean;\n\t/**\n\t * What the provider's FILTERED issue search (`searchIssuesPage`, and the `countIssues` probe over the same\n\t * criteria) can express server-side. A third, wider surface than either filter set above: it is not bound to\n\t * the user at all, so it takes relationships those reads have no way to name (`any-assignee`, `unassigned`),\n\t * plus free text and issue attributes.\n\t *\n\t * Absent means the provider has NO filtered issue search and the read is refused. Present, it is a promise:\n\t * every field declared here reaches the provider query, so a consumer that intersects against it never has a\n\t * read refused, and a criterion is never silently ignored.\n\t */\n\tsupportedIssueSearch?: IssueSearchCapabilities;\n\t/**\n\t * The maximum number of results the provider's filtered issue search will serve for ONE query, however it is\n\t * paged. Matches past it are UNREACHABLE, not merely unfetched, which is why a read that hits this reports an\n\t * omission with `recovery: 'none'` and the total match count rather than offering a \"load more\".\n\t *\n\t * Absent means the provider declares no ceiling, in which case a truncated read falls back to generic wording\n\t * instead of quoting a limit that was never published.\n\t */\n\tissueSearchResultLimit?: number;\n\t/**\n\t * Whether the filtered searches reach the provider with scope names verbatim — as encoded URL segments, or\n\t * matched against the names discovery reported — rather than inside a query string the provider sanitizes.\n\t *\n\t * Relaxes the scope-name rule (`isUsableSearchScopeName`) for that provider to refuse only blank names and\n\t * control characters: a space or a quote can't split or alter a scope that is never parsed as a query, and\n\t * refusing them would refuse real names. Absent for a query-string search (GitHub's), where both do.\n\t */\n\texactSearchScopeNames?: boolean;\n}\n\nexport type ProvidersMetadata = { [Id in IntegrationIds]: ProviderMetadata & { id: Id } };\n\n/**\n * GitHub and GitHub Enterprise express every criterion as a search qualifier on the same GraphQL `search` field,\n * so the two share one declaration — a GHE instance running the same search syntax has the same capability, and\n * two copies of this table would be free to drift.\n *\n * Every entry is a claim the implementation must keep: `searchIssuesPage` emits a qualifier for each of these,\n * and a test asserts that (see the `issueSearch` capability tests) so the table can't quietly outrun the code.\n */\nconst githubIssueSearchCapabilities: IssueSearchCapabilities = {\n\t// `author:@me` / `assignee:@me` / `mentions:@me` / `assignee:*` / `no:assignee`, each its own aliased search.\n\trelationships: ['authored', 'assigned', 'mentioned', 'any-assignee', 'unassigned'],\n\ttext: true,\n\tlabels: true,\n\tmilestone: true,\n\tupdatedAfter: true,\n\tcreatedAfter: true,\n\t// `-linked:pr`.\n\twithoutLinkedPullRequest: true,\n\t// `is:open` / `is:closed`, or neither for all states.\n\tstates: true,\n\t// `sort:created-desc`, `sort:updated`, `sort:comments-asc`, … — see `githubIssueSorts`.\n\tsorts: githubIssueSorts,\n};\n\n/**\n * The ordering vocabulary of GitHub's filtered PR search: `created` and `updated`, both directions.\n *\n * Hand-declared rather than derived from `@gitkraken/provider-apis` (which has no PR-sort surface), and narrower\n * than the issue set on purpose: the merged relationship × state facets can only be re-ordered by a field a\n * `PullRequestShape` carries (see `getPullRequestComparator`), and GitHub PRs have no priority and no relevance\n * that orders stably under the result ceiling. A parity test pins this to `gitHubPullRequestSortQualifiers`' keys\n * so the capability can't outrun the emitter.\n */\nconst githubPullRequestSorts: PullRequestSorting[] = ['updated:desc', 'updated:asc', 'created:desc', 'created:asc'];\n\n/** GitHub and GHE use the same filtered pull-request search syntax and result ceiling. */\nconst githubPullRequestSearchCapabilities: PullRequestSearchCapabilities = {\n\trelationships: [\n\t\tPullRequestFilter.Author,\n\t\tPullRequestFilter.Assignee,\n\t\tPullRequestFilter.ReviewRequested,\n\t\tPullRequestFilter.Reviewed,\n\t\tPullRequestFilter.Mention,\n\t],\n\tstates: ['open', 'closed', 'merged', 'all'],\n\ttext: true,\n\tupdatedAfter: true,\n\tcreatedAfter: true,\n\tincludeArchived: true,\n\tdraft: true,\n\trepositoryScope: true,\n\torganizationScope: true,\n\t// `sort:updated`, `sort:updated-asc`, `sort:created-desc`, `sort:created-asc` — see `githubPullRequestSorts`.\n\tsorts: githubPullRequestSorts,\n};\n\n/**\n * Bitbucket Data Center's filtered pull-request search (`bitbucket-server/pullRequestSearch.ts`), declared from what\n * its REST API can express rather than from what a PR shape carries:\n * - relationships: `role=AUTHOR`, and a reviewer's `UNAPPROVED` status for a pending review versus `APPROVED` or\n * `NEEDS_WORK` for one already given. A Bitbucket pull request has no assignee, and nothing filters by mention.\n * - text is `filterText` (title or description), draft is `draft`, and archived repositories are excluded unless\n * asked for — all re-checked on each row, since the dashboard read has neither filter.\n * - no date filters and no `created` ordering: `order` is only `NEWEST`/`OLDEST` by last update, and filtering a\n * date on the rows read would page through everything before it.\n * - no organization scope: there is no project-wide pull-request list, only per repository and the dashboard.\n */\nconst bitbucketServerPullRequestSearchCapabilities: PullRequestSearchCapabilities = {\n\trelationships: [PullRequestFilter.Author, PullRequestFilter.ReviewRequested, PullRequestFilter.Reviewed],\n\tstates: ['open', 'closed', 'merged', 'all'],\n\ttext: true,\n\tupdatedAfter: false,\n\tcreatedAfter: false,\n\tincludeArchived: true,\n\tdraft: true,\n\trepositoryScope: true,\n\torganizationScope: false,\n\tsorts: ['updated:desc', 'updated:asc'],\n};\n\n/**\n * Azure DevOps Server's filtered pull-request search. Azure's pull request query narrows only by creator, reviewer,\n * status and repository, so the provider drains each facet and applies text, draft and dates to the complete facet\n * before merging — so a criterion never narrows a page after its count, and the only sort keys are the two a merged\n * page can be re-ordered by. What text and `updatedAfter` match is bounded by the list endpoint: see\n * `toAzurePullRequestSearchFilter`.\n *\n * `Assignee` and `ReviewRequested` both read by reviewer: Azure has no assignee distinct from its reviewers.\n * `Reviewed` and `Mention` are absent because the pull request query has no axis for either, and `includeArchived`\n * because Azure has no archived repositories to exclude.\n */\nconst azureServerPullRequestSearchCapabilities: PullRequestSearchCapabilities = {\n\trelationships: [PullRequestFilter.Author, PullRequestFilter.Assignee, PullRequestFilter.ReviewRequested],\n\tstates: ['open', 'closed', 'merged', 'all'],\n\ttext: true,\n\tupdatedAfter: true,\n\tcreatedAfter: true,\n\tincludeArchived: false,\n\tdraft: true,\n\trepositoryScope: true,\n\torganizationScope: true,\n\tsorts: azurePullRequestSearchSorts,\n};\n\n/**\n * Azure DevOps Server's filtered work-item search: one WIQL query per collection, every criterion a clause of it.\n * `mentioned` is absent because `@RecentMentions` only reaches back 30 days; `milestone` and\n * `withoutLinkedPullRequest` because WIQL has no flat-query clause for either. See `azure/search.ts`.\n */\nconst azureServerIssueSearchCapabilities: IssueSearchCapabilities = {\n\trelationships: azureWorkItemSearchRelationships,\n\ttext: true,\n\tlabels: true,\n\tmilestone: false,\n\tupdatedAfter: true,\n\tcreatedAfter: true,\n\twithoutLinkedPullRequest: false,\n\tstates: true,\n\tsorts: azureWorkItemSearchSorts,\n};\n\nexport const providersMetadata: ProvidersMetadata = {\n\t[GitCloudHostIntegrationId.GitHub]: {\n\t\tdomain: 'github.com',\n\t\tid: GitCloudHostIntegrationId.GitHub,\n\t\tname: 'GitHub',\n\t\ttype: 'git',\n\t\ticonKey: GitCloudHostIntegrationId.GitHub,\n\t\tissuesPagingMode: PagingMode.Repos,\n\t\tpullRequestsPagingMode: PagingMode.Repos,\n\t\t// Use 'username' property on account for PR filters\n\t\tsupportedPullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t\tPullRequestFilter.Mention,\n\t\t],\n\t\tsupportedAccountWidePullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t\tPullRequestFilter.Reviewed,\n\t\t\tPullRequestFilter.Mention,\n\t\t],\n\t\tsupportedPullRequestSearch: githubPullRequestSearchCapabilities,\n\t\tpullRequestSearchResultLimit: githubSearchResultLimit,\n\t\t// Use 'username' property on account for issue filters\n\t\tsupportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],\n\t\t// The account-wide read is three independent searches (`author:@me`, `assignee:@me`, `mentions:@me`) behind\n\t\t// one composite cursor, so any subset of them is expressible.\n\t\tsupportedAccountWideIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],\n\t\t// One `search` field serves all three issue reads (repo-scoped, account-wide, filtered search), so the same\n\t\t// qualifiers are expressible on each — the account-wide one narrowed to what its three-alias merge can order.\n\t\tsupportedIssueSorts: githubIssueSorts,\n\t\tsupportedAccountWideIssueSorts: githubAccountWideIssueSorts,\n\t\tsupportedIssueSearch: githubIssueSearchCapabilities,\n\t\tissueSearchResultLimit: githubSearchResultLimit,\n\t\tscopes: ['repo', 'read:user', 'user:email'],\n\t},\n\t[GitSelfManagedHostIntegrationId.CloudGitHubEnterprise]: {\n\t\tdomain: '',\n\t\tid: GitSelfManagedHostIntegrationId.CloudGitHubEnterprise,\n\t\tname: 'GitHub Enterprise',\n\t\ttype: 'git',\n\t\ticonKey: 'github-enterprise',\n\t\tissuesPagingMode: PagingMode.Repos,\n\t\tpullRequestsPagingMode: PagingMode.Repos,\n\t\t// Use 'username' property on account for PR filters\n\t\tsupportedPullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t\tPullRequestFilter.Mention,\n\t\t],\n\t\tsupportedAccountWidePullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t\tPullRequestFilter.Reviewed,\n\t\t\tPullRequestFilter.Mention,\n\t\t],\n\t\tsupportedPullRequestSearch: githubPullRequestSearchCapabilities,\n\t\tpullRequestSearchResultLimit: githubSearchResultLimit,\n\t\t// Use 'username' property on account for issue filters\n\t\tsupportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],\n\t\t// The account-wide read is three independent searches (`author:@me`, `assignee:@me`, `mentions:@me`) behind\n\t\t// one composite cursor, so any subset of them is expressible.\n\t\tsupportedAccountWideIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],\n\t\t// One `search` field serves all three issue reads (repo-scoped, account-wide, filtered search), so the same\n\t\t// qualifiers are expressible on each — the account-wide one narrowed to what its three-alias merge can order.\n\t\tsupportedIssueSorts: githubIssueSorts,\n\t\tsupportedAccountWideIssueSorts: githubAccountWideIssueSorts,\n\t\tsupportedIssueSearch: githubIssueSearchCapabilities,\n\t\tissueSearchResultLimit: githubSearchResultLimit,\n\t\tscopes: ['repo', 'read:user', 'user:email'],\n\t},\n\t[GitCloudHostIntegrationId.GitLab]: {\n\t\tdomain: 'gitlab.com',\n\t\tid: GitCloudHostIntegrationId.GitLab,\n\t\tname: 'GitLab',\n\t\ttype: 'git',\n\t\ticonKey: GitCloudHostIntegrationId.GitLab,\n\t\tissuesPagingMode: PagingMode.Repo,\n\t\tpullRequestsPagingMode: PagingMode.Repo,\n\t\t// Use 'username' property on account for PR filters\n\t\tsupportedPullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t],\n\t\tsupportedAccountWidePullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t],\n\t\t// Use 'username' property on account for issue filters\n\t\tsupportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee],\n\t\t// The account-wide read drains one `scope=assigned_to_me` pass and one `scope=all` + `authorUsername` pass,\n\t\t// unioned, so either axis is expressible on its own. Mention is absent because GitLab's REST issue read has\n\t\t// no first-class mention filter to narrow with.\n\t\tsupportedAccountWideIssueFilters: [IssueFilter.Assignee, IssueFilter.Author],\n\t\t// Two different surfaces, not one narrowed twice: the repository-scoped read is GraphQL and the\n\t\t// account-wide one is REST, and REST has neither `title` nor `closed_at`.\n\t\tsupportedIssueSorts: gitlabIssueSorts,\n\t\tsupportedAccountWideIssueSorts: gitlabAccountWideIssueSorts,\n\t\tscopes: ['api', 'read_user', 'read_repository'],\n\t},\n\t[GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted]: {\n\t\tdomain: '',\n\t\tid: GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted,\n\t\tname: 'GitLab Self-Hosted',\n\t\ttype: 'git',\n\t\ticonKey: 'gitlab-self-hosted',\n\t\tissuesPagingMode: PagingMode.Repo,\n\t\tpullRequestsPagingMode: PagingMode.Repo,\n\t\t// Use 'username' property on account for PR filters\n\t\tsupportedPullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t],\n\t\tsupportedAccountWidePullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t],\n\t\t// Use 'username' property on account for issue filters\n\t\tsupportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee],\n\t\t// The account-wide read drains one `scope=assigned_to_me` pass and one `scope=all` + `authorUsername` pass,\n\t\t// unioned, so either axis is expressible on its own. Mention is absent because GitLab's REST issue read has\n\t\t// no first-class mention filter to narrow with.\n\t\tsupportedAccountWideIssueFilters: [IssueFilter.Assignee, IssueFilter.Author],\n\t\t// Two different surfaces, not one narrowed twice: the repository-scoped read is GraphQL and the\n\t\t// account-wide one is REST, and REST has neither `title` nor `closed_at`.\n\t\tsupportedIssueSorts: gitlabIssueSorts,\n\t\tsupportedAccountWideIssueSorts: gitlabAccountWideIssueSorts,\n\t\tscopes: ['api', 'read_user', 'read_repository'],\n\t},\n\t[GitCloudHostIntegrationId.Bitbucket]: {\n\t\tdomain: 'bitbucket.org',\n\t\tid: GitCloudHostIntegrationId.Bitbucket,\n\t\tname: 'Bitbucket',\n\t\ttype: 'git',\n\t\ticonKey: GitCloudHostIntegrationId.Bitbucket,\n\t\tpullRequestsPagingMode: PagingMode.Repo,\n\t\t// Use 'id' property on account for PR filters (reviewer filter keyed by account id / reviewerId)\n\t\tsupportedPullRequestFilters: [PullRequestFilter.Author, PullRequestFilter.ReviewRequested],\n\t\tsupportedAccountWidePullRequestFilters: [PullRequestFilter.Author, PullRequestFilter.ReviewRequested],\n\t\tscopes: ['account:read', 'repository:read', 'pullrequest:read', 'issue:read'],\n\t},\n\t[GitSelfManagedHostIntegrationId.BitbucketServer]: {\n\t\tdomain: '',\n\t\tid: GitSelfManagedHostIntegrationId.BitbucketServer,\n\t\tname: 'Bitbucket Data Center',\n\t\ttype: 'git',\n\t\ticonKey: GitSelfManagedHostIntegrationId.BitbucketServer,\n\t\tpullRequestsPagingMode: PagingMode.Repo,\n\t\tsupportedPullRequestFilters: [PullRequestFilter.Author, PullRequestFilter.ReviewRequested],\n\t\tsupportedAccountWidePullRequestFilters: [PullRequestFilter.Author, PullRequestFilter.ReviewRequested],\n\t\tsupportedPullRequestSearch: bitbucketServerPullRequestSearchCapabilities,\n\t\t// No `pullRequestSearchResultLimit`: nothing caps how far a search pages.\n\t\tscopes: ['Project (Read)', 'Repository (Write)'],\n\t},\n\t[GitCloudHostIntegrationId.AzureDevOps]: {\n\t\tsupportsIssueStates: true,\n\t\tdomain: 'dev.azure.com',\n\t\tid: GitCloudHostIntegrationId.AzureDevOps,\n\t\tname: 'Azure DevOps',\n\t\ttype: 'git',\n\t\ticonKey: GitCloudHostIntegrationId.AzureDevOps,\n\t\tissuesPagingMode: PagingMode.Project,\n\t\tpullRequestsPagingMode: PagingMode.Repo,\n\t\t// Use 'id' property on account for PR filters (reviewer filter keyed by account id / reviewerId)\n\t\tsupportedPullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t],\n\t\tsupportedAccountWidePullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t],\n\t\t// Use 'name' property on account for issue filters\n\t\tsupportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],\n\t\t// The account-wide read drains one (project × assignee) and one (project × author) query per project, so\n\t\t// either axis is expressible on its own. There is no mention query to narrow to.\n\t\tsupportedAccountWideIssueFilters: [IssueFilter.Author, IssueFilter.Assignee],\n\t\t// Both reads emit the same WIQL, but the account-wide one drains every (project x relationship) query and\n\t\t// merges the results, so it can only honor keys a normalized issue carries — `resolved` and `priority` are\n\t\t// dropped from that surface for the same reason they are dropped from GitLab's.\n\t\tsupportedIssueSorts: azureIssueSorts,\n\t\tsupportedAccountWideIssueSorts: azureAccountWideIssueSorts,\n\t\tscopes: ['vso.code', 'vso.identity', 'vso.project', 'vso.profile', 'vso.work'],\n\t},\n\t[GitSelfManagedHostIntegrationId.AzureDevOpsServer]: {\n\t\tsupportsIssueStates: true,\n\t\tdomain: '',\n\t\tid: GitSelfManagedHostIntegrationId.AzureDevOpsServer,\n\t\tname: 'Azure DevOps Server',\n\t\ttype: 'git',\n\t\ticonKey: GitCloudHostIntegrationId.AzureDevOps,\n\t\tissuesPagingMode: PagingMode.Project,\n\t\tpullRequestsPagingMode: PagingMode.Repo,\n\t\t// Use 'id' property on account for PR filters (reviewer filter keyed by account id / reviewerId)\n\t\tsupportedPullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t],\n\t\tsupportedAccountWidePullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t],\n\t\t// Use 'name' property on account for issue filters\n\t\tsupportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],\n\t\t// The account-wide read drains one (project × assignee) and one (project × author) query per project, so\n\t\t// either axis is expressible on its own. There is no mention query to narrow to.\n\t\tsupportedAccountWideIssueFilters: [IssueFilter.Author, IssueFilter.Assignee],\n\t\t// Both reads emit the same WIQL, but the account-wide one drains every (project x relationship) query and\n\t\t// merges the results, so it can only honor keys a normalized issue carries — `resolved` and `priority` are\n\t\t// dropped from that surface for the same reason they are dropped from GitLab's.\n\t\tsupportedIssueSorts: azureIssueSorts,\n\t\tsupportedAccountWideIssueSorts: azureAccountWideIssueSorts,\n\t\tsupportedPullRequestSearch: azureServerPullRequestSearchCapabilities,\n\t\tsupportedIssueSearch: azureServerIssueSearchCapabilities,\n\t\tissueSearchResultLimit: azureWorkItemSearchResultLimit,\n\t\texactSearchScopeNames: true,\n\t\tscopes: ['vso.code', 'vso.identity', 'vso.project', 'vso.profile', 'vso.work'],\n\t},\n\t[IssuesCloudHostIntegrationId.Jira]: {\n\t\tdomain: 'atlassian.net',\n\t\tid: IssuesCloudHostIntegrationId.Jira,\n\t\tname: 'Jira',\n\t\ttype: 'issues',\n\t\ticonKey: IssuesCloudHostIntegrationId.Jira,\n\t\tscopes: [\n\t\t\t'read:status:jira',\n\t\t\t'read:application-role:jira',\n\t\t\t'read:attachment:jira',\n\t\t\t'write:attachment:jira',\n\t\t\t'read:comment:jira',\n\t\t\t'read:project-category:jira',\n\t\t\t'read:project:jira',\n\t\t\t'read:issue.vote:jira',\n\t\t\t'read:field-configuration:jira',\n\t\t\t'write:issue:jira',\n\t\t\t'read:issue-security-level:jira',\n\t\t\t'write:issue.property:jira',\n\t\t\t'read:issue.changelog:jira',\n\t\t\t'read:avatar:jira',\n\t\t\t'read:issue-meta:jira',\n\t\t\t'read:permission:jira',\n\t\t\t'offline_access',\n\t\t\t'read:issue:jira',\n\t\t\t'read:me',\n\t\t\t'read:audit-log:jira',\n\t\t\t'read:project.component:jira',\n\t\t\t'read:group:jira',\n\t\t\t'read:project-role:jira',\n\t\t\t'write:comment:jira',\n\t\t\t'read:label:jira',\n\t\t\t'write:comment.property:jira',\n\t\t\t'read:issue-details:jira',\n\t\t\t'read:issue-type-hierarchy:jira',\n\t\t\t'read:issue.transition:jira',\n\t\t\t'read:user:jira',\n\t\t\t'read:field:jira',\n\t\t\t'read:issue-type:jira',\n\t\t\t'read:project.property:jira',\n\t\t\t'read:comment.property:jira',\n\t\t\t'read:project-version:jira',\n\t\t],\n\t\tsupportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],\n\t\t// A tracker's issues live under resource -> project, so it has no account-wide surface to declare: its\n\t\t// capability is reported under `issues`, which is what `listIssueTrackerIssuesPage` validates against.\n\t\tsupportedIssueSorts: jiraIssueSorts,\n\t\t// `statusCategory` clauses in the same JQL, shared with Server through `jiraHelpers`.\n\t\tsupportsIssueStates: true,\n\t},\n\t[IssuesSelfManagedHostIntegrationId.JiraServer]: {\n\t\t// Self-hosted: there is no canonical domain, so every read is addressed by the connection's own host\n\t\t// (see `JiraServerIntegration.apiBaseUrl`), exactly as the self-managed git hosts do.\n\t\tdomain: '',\n\t\tid: IssuesSelfManagedHostIntegrationId.JiraServer,\n\t\tname: 'Jira Data Center',\n\t\ttype: 'issues',\n\t\t// Reuses Jira's glicon: it is the same product, and the id only selects an icon.\n\t\ticonKey: IssuesCloudHostIntegrationId.Jira,\n\t\t// Jira Cloud's entries are Atlassian OAuth scope strings, which a self-hosted instance doesn't issue:\n\t\t// its token is a PAT the backend stores as-is, so there is no scope set to request.\n\t\tscopes: [],\n\t\t// The same JQL clauses Cloud narrows with — `jiraHelpers` builds one query for both.\n\t\tsupportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],\n\t\t// One JQL `ORDER BY` builder serves Cloud and Server, so they share a surface (see `issueSorts.ts`).\n\t\tsupportedIssueSorts: jiraIssueSorts,\n\t\tsupportsIssueStates: true,\n\t},\n\t[IssuesCloudHostIntegrationId.Linear]: {\n\t\tdomain: 'linear.app',\n\t\tid: IssuesCloudHostIntegrationId.Linear,\n\t\tname: 'Linear',\n\t\ttype: 'issues',\n\t\ticonKey: IssuesCloudHostIntegrationId.Linear,\n\t\tscopes: [],\n\t\t// The user-scoped tracker read scopes Linear's \"my issues\" by the viewer's id: assigned issues, plus the\n\t\t// GitHub-synced issues the viewer created unless `Assignee` is asked for by name. Author/mention aren't supported.\n\t\tsupportedIssueFilters: [IssueFilter.Assignee],\n\t\t// Both directions, and one table for both reads: they are the same root `issues` query taking the same\n\t\t// `sort` argument, so there is no account-wide narrowing to declare.\n\t\tsupportedIssueSorts: linearIssueSorts,\n\t\t// A workflow-state type clause on both reads (`completed`/`canceled`/`duplicate` are closed), the same types\n\t\t// the SDK normalizes to a terminal category (`DONE`, or `CANCELED` for the last two).\n\t\tsupportsIssueStates: true,\n\t},\n\t[IssuesCloudHostIntegrationId.Trello]: {\n\t\tdomain: 'trello.com',\n\t\tid: IssuesCloudHostIntegrationId.Trello,\n\t\tname: 'Trello',\n\t\ttype: 'issues',\n\t\ticonKey: IssuesCloudHostIntegrationId.Trello,\n\t\tscopes: [],\n\t\t// Trello cards are filtered by the assignee (member) only; author/mention have no Trello equivalent.\n\t\tsupportedIssueFilters: [IssueFilter.Assignee],\n\t\t// `sort:edited` / `sort:-edited`. Trello's other search sorts (`created`, `due`) have no card-order effect.\n\t\tsupportedIssueSorts: trelloIssueSorts,\n\t\t// No `supportsIssueStates`: a card has no state beyond being archived, and the board read always sends\n\t\t// `-is:archived`, so `'closed'`/`'all'` are refused rather than answered with the open cards.\n\t},\n\t[IssuesCloudHostIntegrationId.Asana]: {\n\t\tdomain: 'app.asana.com',\n\t\tid: IssuesCloudHostIntegrationId.Asana,\n\t\tname: 'Asana',\n\t\ttype: 'issues',\n\t\ticonKey: IssuesCloudHostIntegrationId.Asana,\n\t\tscopes: [],\n\t\t// A task has a single assignee and no author/mention query; the project read is narrowed to the viewer by\n\t\t// assignee id after the drain, since Asana's task list can't scope a project to an assignee.\n\t\tsupportedIssueFilters: [IssueFilter.Assignee],\n\t\t// Empty: Asana's task list has no ordering parameter, so a read carrying `sort` is refused rather than served in\n\t\t// whatever order Asana returns.\n\t\tsupportedIssueSorts: asanaIssueSorts,\n\t\t// Completion is the only state Asana has: open reads incomplete tasks, closed the completed ones.\n\t\tsupportsIssueStates: true,\n\t},\n};\n\nexport function isGitHubDotCom(domain: string | null | undefined): boolean {\n\treturn equalsIgnoreCase(domain, 'github.com');\n}\n\nexport function isGitLabDotCom(domain: string | null | undefined): boolean {\n\treturn equalsIgnoreCase(domain, 'gitlab.com');\n}\n\n// Anchor the `visualstudio.com` alternative on a label boundary (`^` or `.`) rather than `\\b`: `\\b` treats a\n// hyphen as a word boundary, so `\\bvisualstudio\\.com$` matched attacker-controlled hosts like\n// `evil-visualstudio.com` and classified them as Azure cloud, changing their auth/URL handling.\nconst azureCloudDomainRegex = /^dev\\.azure\\.com$|(?:^|\\.)visualstudio\\.com$/i;\nexport function isAzureCloudDomain(domain: string | undefined): boolean {\n\treturn domain != null && azureCloudDomainRegex.test(domain);\n}\n\nconst bitbucketCloudDomainRegex = /^bitbucket\\.org$/i;\nexport function isBitbucketCloudDomain(domain: string | undefined): boolean {\n\treturn domain != null && bitbucketCloudDomainRegex.test(domain);\n}\n\nexport function supportsCodeSuggest(provider: ProviderReference): boolean {\n\treturn isGitHubDotCom(provider.domain);\n}\n"],"mappings":";;;;;;;;AAyCA,IAAY,aAAL,yBAAA,YAAA;CACN,WAAA,aAAA;CACA,WAAA,UAAA;CACA,WAAA,WAAA;;AACD,EAAA,CAAA,CAAA;;;;;;;;;AA8HA,MAAM,gCAAyD;CAE9D,eAAe;EAAC;EAAY;EAAY;EAAa;EAAgB;CAAY;CACjF,MAAM;CACN,QAAQ;CACR,WAAW;CACX,cAAc;CACd,cAAc;CAEd,0BAA0B;CAE1B,QAAQ;CAER,OAAO;AACR;;AAcA,MAAM,sCAAqE;CAC1E,eAAe;;;;;;CAMf;CACA,QAAQ;EAAC;EAAQ;EAAU;EAAU;CAAK;CAC1C,MAAM;CACN,cAAc;CACd,cAAc;CACd,iBAAiB;CACjB,OAAO;CACP,iBAAiB;CACjB,mBAAmB;CAEnB,OAAO;EApB8C;EAAgB;EAAe;EAAgB;CAoBxE;AAC7B;;;;;;;;;;;;AAaA,MAAM,+CAA8E;CACnF,eAAe;;;;CAAwF;CACvG,QAAQ;EAAC;EAAQ;EAAU;EAAU;CAAK;CAC1C,MAAM;CACN,cAAc;CACd,cAAc;C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eAAe,QAA4C;CAC1E,OAAO,iBAAiB,QAAQ,YAAY;AAC7C;AAEA,SAAgB,eAAe,QAA4C;CAC1E,OAAO,iBAAiB,QAAQ,YAAY;AAC7C;AAKA,MAAM,wBAAwB;AAC9B,SAAgB,mBAAmB,QAAqC;CACvE,OAAO,UAAU,QAAQ,sBAAsB,KAAK,MAAM;AAC3D;AAEA,MAAM,4BAA4B;AAClC,SAAgB,uBAAuB,QAAqC;CAC3E,OAAO,UAAU,QAAQ,0BAA0B,KAAK,MAAM;AAC/D;AAEA,SAAgB,oBAAoB,UAAsC;CACzE,OAAO,eAAe,SAAS,MAAM;AACtC"}
1
+ {"version":3,"file":"metadata.js","names":[],"sources":["../../../../../plus/integrations/src/providers/metadata.ts"],"sourcesContent":["import { githubSearchResultLimit } from '@gitlens/git-github/api/config.js';\nimport type { ProviderReference } from '@gitlens/git/models/remoteProvider.js';\nimport { equalsIgnoreCase } from '@gitlens/utils/string.js';\nimport type { IntegrationIds } from '../constants.js';\nimport {\n\tGitCloudHostIntegrationId,\n\tGitSelfManagedHostIntegrationId,\n\tIssuesCloudHostIntegrationId,\n\tIssuesSelfManagedHostIntegrationId,\n} from '../constants.js';\nimport type { IntegrationType } from '../models/publicIntegration.js';\nimport type {\n\tIssueSearchCapabilities,\n\tIssueSorting,\n\tPullRequestSearchCapabilities,\n\tPullRequestSorting,\n} from '../providerFilters.js';\nimport { IssueFilter, PullRequestFilter } from '../providerFilters.js';\nimport {\n\tazurePullRequestSearchSorts,\n\tazureWorkItemSearchRelationships,\n\tazureWorkItemSearchResultLimit,\n\tazureWorkItemSearchSorts,\n} from './azure/search.js';\nimport {\n\tasanaIssueSorts,\n\tazureAccountWideIssueSorts,\n\tazureIssueSorts,\n\tgithubAccountWideIssueSorts,\n\tgithubIssueSorts,\n\tgitlabAccountWideIssueSorts,\n\tgitlabIssueSorts,\n\tjiraIssueSorts,\n\tlinearIssueSorts,\n\ttrelloIssueSorts,\n} from './issueSorts.js';\n\n// Provider metadata (names, domains, icons, scopes, capabilities) and the domain checks built on it. Kept apart from\n// `models.ts`, which holds the `@gitkraken/provider-apis` mappings, so the public facade can re-export this without\n// its declarations reaching the SDK.\n\nexport enum PagingMode {\n\tProject = 'project',\n\tRepo = 'repo',\n\tRepos = 'repos',\n}\n\nexport interface ProviderMetadata {\n\tdomain: string;\n\tid: IntegrationIds;\n\tname: string;\n\ttype: IntegrationType;\n\t/** Key for the `gl-provider-<iconKey>` glicon. Cloud self-managed variants reuse the base\n\t * `'github-enterprise'`/`'gitlab-self-hosted'` icon (no enum member exists for those anymore). */\n\ticonKey: string;\n\tissuesPagingMode?: PagingMode;\n\tpullRequestsPagingMode?: PagingMode;\n\tscopes: string[];\n\tsupportedPullRequestFilters?: PullRequestFilter[];\n\t/**\n\t * Relationship filters the ACCOUNT-WIDE pull-request read can express as an exact OR union.\n\t * This is independent from `supportedPullRequestFilters`, which describes repo-scoped reads.\n\t */\n\tsupportedAccountWidePullRequestFilters?: PullRequestFilter[];\n\t/**\n\t * What the filtered pull-request search can express server-side. Absent means the provider has\n\t * no such search and the facade refuses it rather than returning an unfiltered page.\n\t */\n\tsupportedPullRequestSearch?: PullRequestSearchCapabilities;\n\t/**\n\t * Maximum results the provider will serve for one pull-request search facet. Matches beyond it are unreachable\n\t * and are reported as a succeeded omission carrying this limit plus the provider's pre-ceiling facet count.\n\t */\n\tpullRequestSearchResultLimit?: number;\n\t/** Filters the REPO-scoped issue read can express. */\n\tsupportedIssueFilters?: IssueFilter[];\n\t/**\n\t * Filters the ACCOUNT-WIDE issue read can express, which is NOT the same set as\n\t * {@link ProviderMetadata.supportedIssueFilters}: the two reads are different provider queries.\n\t *\n\t * Unfiltered, each provider's account-wide read is that provider's own definition of \"my issues\" — GitHub/GHE\n\t * union authored + assigned + mentioned, Azure drains assigned + authored, and GitLab reads assigned-to-me.\n\t * A consumer replacing a narrower tool (`gk`'s `assignee:@me`) must select the `Assignee` filter wherever the\n\t * provider's default is wider.\n\t *\n\t * A filter listed here narrows that read server-side. Absent/empty means the read can't be narrowed at all,\n\t * so the facade refuses a filtered request rather than serving the unnarrowed union as if it had been\n\t * filtered. GitLab lists `Assignee` and `Author` because the SDK's account-wide input exposes both username\n\t * axes; it omits `Mention` because that REST read has no first-class mention filter.\n\t */\n\tsupportedAccountWideIssueFilters?: IssueFilter[];\n\t/**\n\t * Sort keys the REPO-scoped issue read can express server-side — and, for an issue tracker (Jira/Linear/Trello),\n\t * its project-scoped read, which is the only issue surface a tracker has.\n\t *\n\t * Absent/empty means the read can't be ordered at all, so a request carrying `sort` is refused rather than\n\t * served in whatever order the provider felt like. Present, it is a promise: every key here reaches the\n\t * provider query.\n\t *\n\t * A key listed here is expressible on ONE provider query, which is what this read is when it is given ONE\n\t * scope. Given several (GitLab across repositories, Azure across projects, a tracker across projects) it merges\n\t * their results here and can only honor a key a normalized issue carries, so it additionally refuses\n\t * `priority`/`dueDate`/`resolved` — see `getIssueComparator`. That depends on the caller's scope count rather\n\t * than on the provider, which is why it is a runtime refusal and not a fourth table: encoding it here would\n\t * under-report the single-scope read, which really does support those keys.\n\t */\n\tsupportedIssueSorts?: IssueSorting[];\n\t/**\n\t * Sort keys the ACCOUNT-WIDE issue read can express server-side, which is NOT the same set as\n\t * {@link ProviderMetadata.supportedIssueSorts} — for GitLab the two reads are different APIs (GraphQL vs REST)\n\t * with genuinely different vocabularies, not one narrowed twice.\n\t *\n\t * Absent means the account-wide read can't be ordered (or doesn't exist). An issue tracker leaves this empty\n\t * and reports under `supportedIssueSorts`, so reading a tracker's capability from here under-reports it.\n\t *\n\t * Unlike {@link ProviderMetadata.supportedIssueSorts} this needs no companion runtime refusal, because every\n\t * provider's account-wide read is a union of several queries with no scope count for a caller to reduce: it\n\t * ALWAYS merges. So the keys a merge can't order by are simply absent here — the table states what the read can\n\t * honor, which is what makes intersecting against it sufficient.\n\t */\n\tsupportedAccountWideIssueSorts?: IssueSorting[];\n\t/**\n\t * Whether issue list reads (including Azure project/repository and account-wide reads) can be asked for a `state` other than open, and honor it server-side.\n\t *\n\t * A tracker read is open-only unless asked otherwise, so absent does not mean the read returns every state: it\n\t * means only `'open'` is expressible, and `'closed'`/`'all'` are refused rather than served as the open list.\n\t * Server-side, because each read drains to a page backstop: dropping states afterwards would let a project full\n\t * of done work spend that budget before reaching the open issues.\n\t */\n\tsupportsIssueStates?: boolean;\n\t/**\n\t * What the provider's FILTERED issue search (`searchIssuesPage`, and the `countIssues` probe over the same\n\t * criteria) can express server-side. A third, wider surface than either filter set above: it is not bound to\n\t * the user at all, so it takes relationships those reads have no way to name (`any-assignee`, `unassigned`),\n\t * plus free text and issue attributes.\n\t *\n\t * Absent means the provider has NO filtered issue search and the read is refused. Present, it is a promise:\n\t * every field declared here reaches the provider query, so a consumer that intersects against it never has a\n\t * read refused, and a criterion is never silently ignored.\n\t */\n\tsupportedIssueSearch?: IssueSearchCapabilities;\n\t/**\n\t * The maximum number of results the provider's filtered issue search will serve for ONE query, however it is\n\t * paged. Matches past it are UNREACHABLE, not merely unfetched, which is why a read that hits this reports an\n\t * omission with `recovery: 'none'` and the total match count rather than offering a \"load more\".\n\t *\n\t * Absent means the provider declares no ceiling, in which case a truncated read falls back to generic wording\n\t * instead of quoting a limit that was never published.\n\t */\n\tissueSearchResultLimit?: number;\n\t/**\n\t * Whether the filtered searches reach the provider with scope names verbatim — as encoded URL segments, or\n\t * matched against the names discovery reported — rather than inside a query string the provider sanitizes.\n\t *\n\t * Relaxes the scope-name rule (`isUsableSearchScopeName`) for that provider to refuse only blank names and\n\t * control characters: a space or a quote can't split or alter a scope that is never parsed as a query, and\n\t * refusing them would refuse real names. Absent for a query-string search (GitHub's), where both do.\n\t */\n\texactSearchScopeNames?: boolean;\n}\n\nexport type ProvidersMetadata = { [Id in IntegrationIds]: ProviderMetadata & { id: Id } };\n\n/**\n * GitHub and GitHub Enterprise express every criterion as a search qualifier on the same GraphQL `search` field,\n * so the two share one declaration — a GHE instance running the same search syntax has the same capability, and\n * two copies of this table would be free to drift.\n *\n * Every entry is a claim the implementation must keep: `searchIssuesPage` emits a qualifier for each of these,\n * and a test asserts that (see the `issueSearch` capability tests) so the table can't quietly outrun the code.\n */\nconst githubIssueSearchCapabilities: IssueSearchCapabilities = {\n\t// `author:@me` / `assignee:@me` / `mentions:@me` / `assignee:*` / `no:assignee`, each its own aliased search.\n\trelationships: ['authored', 'assigned', 'mentioned', 'any-assignee', 'unassigned'],\n\ttext: true,\n\tlabels: true,\n\tmilestone: true,\n\tupdatedAfter: true,\n\tcreatedAfter: true,\n\t// `-linked:pr`.\n\twithoutLinkedPullRequest: true,\n\t// `is:open` / `is:closed`, or neither for all states.\n\tstates: true,\n\t// `sort:created-desc`, `sort:updated`, `sort:comments-asc`, … — see `githubIssueSorts`.\n\tsorts: githubIssueSorts,\n};\n\n/**\n * The ordering vocabulary of GitHub's filtered PR search: `created` and `updated`, both directions.\n *\n * Hand-declared rather than derived from `@gitkraken/provider-apis` (which has no PR-sort surface), and narrower\n * than the issue set on purpose: the merged relationship × state facets can only be re-ordered by a field a\n * `PullRequestShape` carries (see `getPullRequestComparator`), and GitHub PRs have no priority and no relevance\n * that orders stably under the result ceiling. A parity test pins this to `gitHubPullRequestSortQualifiers`' keys\n * so the capability can't outrun the emitter.\n */\nconst githubPullRequestSorts: PullRequestSorting[] = ['updated:desc', 'updated:asc', 'created:desc', 'created:asc'];\n\n/** GitHub and GHE use the same filtered pull-request search syntax and result ceiling. */\nconst githubPullRequestSearchCapabilities: PullRequestSearchCapabilities = {\n\trelationships: [\n\t\tPullRequestFilter.Author,\n\t\tPullRequestFilter.Assignee,\n\t\tPullRequestFilter.ReviewRequested,\n\t\tPullRequestFilter.Reviewed,\n\t\tPullRequestFilter.Mention,\n\t],\n\tstates: ['open', 'closed', 'merged', 'all'],\n\ttext: true,\n\tupdatedAfter: true,\n\tcreatedAfter: true,\n\tincludeArchived: true,\n\tdraft: true,\n\trepositoryScope: true,\n\torganizationScope: true,\n\t// `sort:updated`, `sort:updated-asc`, `sort:created-desc`, `sort:created-asc` — see `githubPullRequestSorts`.\n\tsorts: githubPullRequestSorts,\n\tchangedSince: true,\n};\n\n/**\n * Bitbucket Data Center's filtered pull-request search (`bitbucket-server/pullRequestSearch.ts`), declared from what\n * its REST API can express rather than from what a PR shape carries:\n * - relationships: `role=AUTHOR`, and a reviewer's `UNAPPROVED` status for a pending review versus `APPROVED` or\n * `NEEDS_WORK` for one already given. A Bitbucket pull request has no assignee, and nothing filters by mention.\n * - text is `filterText` (title or description), draft is `draft`, and archived repositories are excluded unless\n * asked for — all re-checked on each row, since the dashboard read has neither filter.\n * - no date filters and no `created` ordering: `order` is only `NEWEST`/`OLDEST` by last update, and filtering a\n * date on the rows read would page through everything before it.\n * - no organization scope: there is no project-wide pull-request list, only per repository and the dashboard.\n */\nconst bitbucketServerPullRequestSearchCapabilities: PullRequestSearchCapabilities = {\n\trelationships: [PullRequestFilter.Author, PullRequestFilter.ReviewRequested, PullRequestFilter.Reviewed],\n\tstates: ['open', 'closed', 'merged', 'all'],\n\ttext: true,\n\tupdatedAfter: false,\n\tcreatedAfter: false,\n\tincludeArchived: true,\n\tdraft: true,\n\trepositoryScope: true,\n\torganizationScope: false,\n\tsorts: ['updated:desc', 'updated:asc'],\n\tchangedSince: false,\n};\n\n/**\n * Azure DevOps Server's filtered pull-request search. Azure's pull request query narrows only by creator, reviewer,\n * status and repository, so the provider drains each facet and applies text, draft and dates to the complete facet\n * before merging — so a criterion never narrows a page after its count, and the only sort keys are the two a merged\n * page can be re-ordered by. What text and `updatedAfter` match is bounded by the list endpoint: see\n * `toAzurePullRequestSearchFilter`.\n *\n * `Assignee` and `ReviewRequested` both read by reviewer: Azure has no assignee distinct from its reviewers.\n * `Reviewed` and `Mention` are absent because the pull request query has no axis for either, and `includeArchived`\n * because Azure has no archived repositories to exclude.\n */\nconst azureServerPullRequestSearchCapabilities: PullRequestSearchCapabilities = {\n\trelationships: [PullRequestFilter.Author, PullRequestFilter.Assignee, PullRequestFilter.ReviewRequested],\n\tstates: ['open', 'closed', 'merged', 'all'],\n\ttext: true,\n\tupdatedAfter: true,\n\tcreatedAfter: true,\n\tincludeArchived: false,\n\tdraft: true,\n\trepositoryScope: true,\n\torganizationScope: true,\n\tsorts: azurePullRequestSearchSorts,\n\tchangedSince: false,\n};\n\n/**\n * Azure DevOps Server's filtered work-item search: one WIQL query per collection, every criterion a clause of it.\n * `mentioned` is absent because `@RecentMentions` only reaches back 30 days; `milestone` and\n * `withoutLinkedPullRequest` because WIQL has no flat-query clause for either. See `azure/search.ts`.\n */\nconst azureServerIssueSearchCapabilities: IssueSearchCapabilities = {\n\trelationships: azureWorkItemSearchRelationships,\n\ttext: true,\n\tlabels: true,\n\tmilestone: false,\n\tupdatedAfter: true,\n\tcreatedAfter: true,\n\twithoutLinkedPullRequest: false,\n\tstates: true,\n\tsorts: azureWorkItemSearchSorts,\n};\n\nexport const providersMetadata: ProvidersMetadata = {\n\t[GitCloudHostIntegrationId.GitHub]: {\n\t\tdomain: 'github.com',\n\t\tid: GitCloudHostIntegrationId.GitHub,\n\t\tname: 'GitHub',\n\t\ttype: 'git',\n\t\ticonKey: GitCloudHostIntegrationId.GitHub,\n\t\tissuesPagingMode: PagingMode.Repos,\n\t\tpullRequestsPagingMode: PagingMode.Repos,\n\t\t// Use 'username' property on account for PR filters\n\t\tsupportedPullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t\tPullRequestFilter.Mention,\n\t\t],\n\t\tsupportedAccountWidePullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t\tPullRequestFilter.Reviewed,\n\t\t\tPullRequestFilter.Mention,\n\t\t],\n\t\tsupportedPullRequestSearch: githubPullRequestSearchCapabilities,\n\t\tpullRequestSearchResultLimit: githubSearchResultLimit,\n\t\t// Use 'username' property on account for issue filters\n\t\tsupportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],\n\t\t// The account-wide read is three independent searches (`author:@me`, `assignee:@me`, `mentions:@me`) behind\n\t\t// one composite cursor, so any subset of them is expressible.\n\t\tsupportedAccountWideIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],\n\t\t// One `search` field serves all three issue reads (repo-scoped, account-wide, filtered search), so the same\n\t\t// qualifiers are expressible on each — the account-wide one narrowed to what its three-alias merge can order.\n\t\tsupportedIssueSorts: githubIssueSorts,\n\t\tsupportedAccountWideIssueSorts: githubAccountWideIssueSorts,\n\t\tsupportedIssueSearch: githubIssueSearchCapabilities,\n\t\tissueSearchResultLimit: githubSearchResultLimit,\n\t\tscopes: ['repo', 'read:user', 'user:email'],\n\t},\n\t[GitSelfManagedHostIntegrationId.CloudGitHubEnterprise]: {\n\t\tdomain: '',\n\t\tid: GitSelfManagedHostIntegrationId.CloudGitHubEnterprise,\n\t\tname: 'GitHub Enterprise',\n\t\ttype: 'git',\n\t\ticonKey: 'github-enterprise',\n\t\tissuesPagingMode: PagingMode.Repos,\n\t\tpullRequestsPagingMode: PagingMode.Repos,\n\t\t// Use 'username' property on account for PR filters\n\t\tsupportedPullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t\tPullRequestFilter.Mention,\n\t\t],\n\t\tsupportedAccountWidePullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t\tPullRequestFilter.Reviewed,\n\t\t\tPullRequestFilter.Mention,\n\t\t],\n\t\tsupportedPullRequestSearch: githubPullRequestSearchCapabilities,\n\t\tpullRequestSearchResultLimit: githubSearchResultLimit,\n\t\t// Use 'username' property on account for issue filters\n\t\tsupportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],\n\t\t// The account-wide read is three independent searches (`author:@me`, `assignee:@me`, `mentions:@me`) behind\n\t\t// one composite cursor, so any subset of them is expressible.\n\t\tsupportedAccountWideIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],\n\t\t// One `search` field serves all three issue reads (repo-scoped, account-wide, filtered search), so the same\n\t\t// qualifiers are expressible on each — the account-wide one narrowed to what its three-alias merge can order.\n\t\tsupportedIssueSorts: githubIssueSorts,\n\t\tsupportedAccountWideIssueSorts: githubAccountWideIssueSorts,\n\t\tsupportedIssueSearch: githubIssueSearchCapabilities,\n\t\tissueSearchResultLimit: githubSearchResultLimit,\n\t\tscopes: ['repo', 'read:user', 'user:email'],\n\t},\n\t[GitCloudHostIntegrationId.GitLab]: {\n\t\tdomain: 'gitlab.com',\n\t\tid: GitCloudHostIntegrationId.GitLab,\n\t\tname: 'GitLab',\n\t\ttype: 'git',\n\t\ticonKey: GitCloudHostIntegrationId.GitLab,\n\t\tissuesPagingMode: PagingMode.Repo,\n\t\tpullRequestsPagingMode: PagingMode.Repo,\n\t\t// Use 'username' property on account for PR filters\n\t\tsupportedPullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t],\n\t\tsupportedAccountWidePullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t],\n\t\t// Use 'username' property on account for issue filters\n\t\tsupportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee],\n\t\t// The account-wide read drains one `scope=assigned_to_me` pass and one `scope=all` + `authorUsername` pass,\n\t\t// unioned, so either axis is expressible on its own. Mention is absent because GitLab's REST issue read has\n\t\t// no first-class mention filter to narrow with.\n\t\tsupportedAccountWideIssueFilters: [IssueFilter.Assignee, IssueFilter.Author],\n\t\t// Two different surfaces, not one narrowed twice: the repository-scoped read is GraphQL and the\n\t\t// account-wide one is REST, and REST has neither `title` nor `closed_at`.\n\t\tsupportedIssueSorts: gitlabIssueSorts,\n\t\tsupportedAccountWideIssueSorts: gitlabAccountWideIssueSorts,\n\t\tscopes: ['api', 'read_user', 'read_repository'],\n\t},\n\t[GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted]: {\n\t\tdomain: '',\n\t\tid: GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted,\n\t\tname: 'GitLab Self-Hosted',\n\t\ttype: 'git',\n\t\ticonKey: 'gitlab-self-hosted',\n\t\tissuesPagingMode: PagingMode.Repo,\n\t\tpullRequestsPagingMode: PagingMode.Repo,\n\t\t// Use 'username' property on account for PR filters\n\t\tsupportedPullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t],\n\t\tsupportedAccountWidePullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t],\n\t\t// Use 'username' property on account for issue filters\n\t\tsupportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee],\n\t\t// The account-wide read drains one `scope=assigned_to_me` pass and one `scope=all` + `authorUsername` pass,\n\t\t// unioned, so either axis is expressible on its own. Mention is absent because GitLab's REST issue read has\n\t\t// no first-class mention filter to narrow with.\n\t\tsupportedAccountWideIssueFilters: [IssueFilter.Assignee, IssueFilter.Author],\n\t\t// Two different surfaces, not one narrowed twice: the repository-scoped read is GraphQL and the\n\t\t// account-wide one is REST, and REST has neither `title` nor `closed_at`.\n\t\tsupportedIssueSorts: gitlabIssueSorts,\n\t\tsupportedAccountWideIssueSorts: gitlabAccountWideIssueSorts,\n\t\tscopes: ['api', 'read_user', 'read_repository'],\n\t},\n\t[GitCloudHostIntegrationId.Bitbucket]: {\n\t\tdomain: 'bitbucket.org',\n\t\tid: GitCloudHostIntegrationId.Bitbucket,\n\t\tname: 'Bitbucket',\n\t\ttype: 'git',\n\t\ticonKey: GitCloudHostIntegrationId.Bitbucket,\n\t\tpullRequestsPagingMode: PagingMode.Repo,\n\t\t// Use 'id' property on account for PR filters (reviewer filter keyed by account id / reviewerId)\n\t\tsupportedPullRequestFilters: [PullRequestFilter.Author, PullRequestFilter.ReviewRequested],\n\t\tsupportedAccountWidePullRequestFilters: [PullRequestFilter.Author, PullRequestFilter.ReviewRequested],\n\t\tscopes: ['account:read', 'repository:read', 'pullrequest:read', 'issue:read'],\n\t},\n\t[GitSelfManagedHostIntegrationId.BitbucketServer]: {\n\t\tdomain: '',\n\t\tid: GitSelfManagedHostIntegrationId.BitbucketServer,\n\t\tname: 'Bitbucket Data Center',\n\t\ttype: 'git',\n\t\ticonKey: GitSelfManagedHostIntegrationId.BitbucketServer,\n\t\tpullRequestsPagingMode: PagingMode.Repo,\n\t\tsupportedPullRequestFilters: [PullRequestFilter.Author, PullRequestFilter.ReviewRequested],\n\t\tsupportedAccountWidePullRequestFilters: [PullRequestFilter.Author, PullRequestFilter.ReviewRequested],\n\t\tsupportedPullRequestSearch: bitbucketServerPullRequestSearchCapabilities,\n\t\t// No `pullRequestSearchResultLimit`: nothing caps how far a search pages.\n\t\tscopes: ['Project (Read)', 'Repository (Write)'],\n\t},\n\t[GitCloudHostIntegrationId.AzureDevOps]: {\n\t\tsupportsIssueStates: true,\n\t\tdomain: 'dev.azure.com',\n\t\tid: GitCloudHostIntegrationId.AzureDevOps,\n\t\tname: 'Azure DevOps',\n\t\ttype: 'git',\n\t\ticonKey: GitCloudHostIntegrationId.AzureDevOps,\n\t\tissuesPagingMode: PagingMode.Project,\n\t\tpullRequestsPagingMode: PagingMode.Repo,\n\t\t// Use 'id' property on account for PR filters (reviewer filter keyed by account id / reviewerId)\n\t\tsupportedPullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t],\n\t\tsupportedAccountWidePullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t],\n\t\t// Use 'name' property on account for issue filters\n\t\tsupportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],\n\t\t// The account-wide read drains one (project × assignee) and one (project × author) query per project, so\n\t\t// either axis is expressible on its own. There is no mention query to narrow to.\n\t\tsupportedAccountWideIssueFilters: [IssueFilter.Author, IssueFilter.Assignee],\n\t\t// Both reads emit the same WIQL, but the account-wide one drains every (project x relationship) query and\n\t\t// merges the results, so it can only honor keys a normalized issue carries — `resolved` and `priority` are\n\t\t// dropped from that surface for the same reason they are dropped from GitLab's.\n\t\tsupportedIssueSorts: azureIssueSorts,\n\t\tsupportedAccountWideIssueSorts: azureAccountWideIssueSorts,\n\t\tscopes: ['vso.code', 'vso.identity', 'vso.project', 'vso.profile', 'vso.work'],\n\t},\n\t[GitSelfManagedHostIntegrationId.AzureDevOpsServer]: {\n\t\tsupportsIssueStates: true,\n\t\tdomain: '',\n\t\tid: GitSelfManagedHostIntegrationId.AzureDevOpsServer,\n\t\tname: 'Azure DevOps Server',\n\t\ttype: 'git',\n\t\ticonKey: GitCloudHostIntegrationId.AzureDevOps,\n\t\tissuesPagingMode: PagingMode.Project,\n\t\tpullRequestsPagingMode: PagingMode.Repo,\n\t\t// Use 'id' property on account for PR filters (reviewer filter keyed by account id / reviewerId)\n\t\tsupportedPullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t],\n\t\tsupportedAccountWidePullRequestFilters: [\n\t\t\tPullRequestFilter.Author,\n\t\t\tPullRequestFilter.Assignee,\n\t\t\tPullRequestFilter.ReviewRequested,\n\t\t],\n\t\t// Use 'name' property on account for issue filters\n\t\tsupportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],\n\t\t// The account-wide read drains one (project × assignee) and one (project × author) query per project, so\n\t\t// either axis is expressible on its own. There is no mention query to narrow to.\n\t\tsupportedAccountWideIssueFilters: [IssueFilter.Author, IssueFilter.Assignee],\n\t\t// Both reads emit the same WIQL, but the account-wide one drains every (project x relationship) query and\n\t\t// merges the results, so it can only honor keys a normalized issue carries — `resolved` and `priority` are\n\t\t// dropped from that surface for the same reason they are dropped from GitLab's.\n\t\tsupportedIssueSorts: azureIssueSorts,\n\t\tsupportedAccountWideIssueSorts: azureAccountWideIssueSorts,\n\t\tsupportedPullRequestSearch: azureServerPullRequestSearchCapabilities,\n\t\tsupportedIssueSearch: azureServerIssueSearchCapabilities,\n\t\tissueSearchResultLimit: azureWorkItemSearchResultLimit,\n\t\texactSearchScopeNames: true,\n\t\tscopes: ['vso.code', 'vso.identity', 'vso.project', 'vso.profile', 'vso.work'],\n\t},\n\t[IssuesCloudHostIntegrationId.Jira]: {\n\t\tdomain: 'atlassian.net',\n\t\tid: IssuesCloudHostIntegrationId.Jira,\n\t\tname: 'Jira',\n\t\ttype: 'issues',\n\t\ticonKey: IssuesCloudHostIntegrationId.Jira,\n\t\tscopes: [\n\t\t\t'read:status:jira',\n\t\t\t'read:application-role:jira',\n\t\t\t'read:attachment:jira',\n\t\t\t'write:attachment:jira',\n\t\t\t'read:comment:jira',\n\t\t\t'read:project-category:jira',\n\t\t\t'read:project:jira',\n\t\t\t'read:issue.vote:jira',\n\t\t\t'read:field-configuration:jira',\n\t\t\t'write:issue:jira',\n\t\t\t'read:issue-security-level:jira',\n\t\t\t'write:issue.property:jira',\n\t\t\t'read:issue.changelog:jira',\n\t\t\t'read:avatar:jira',\n\t\t\t'read:issue-meta:jira',\n\t\t\t'read:permission:jira',\n\t\t\t'offline_access',\n\t\t\t'read:issue:jira',\n\t\t\t'read:me',\n\t\t\t'read:audit-log:jira',\n\t\t\t'read:project.component:jira',\n\t\t\t'read:group:jira',\n\t\t\t'read:project-role:jira',\n\t\t\t'write:comment:jira',\n\t\t\t'read:label:jira',\n\t\t\t'write:comment.property:jira',\n\t\t\t'read:issue-details:jira',\n\t\t\t'read:issue-type-hierarchy:jira',\n\t\t\t'read:issue.transition:jira',\n\t\t\t'read:user:jira',\n\t\t\t'read:field:jira',\n\t\t\t'read:issue-type:jira',\n\t\t\t'read:project.property:jira',\n\t\t\t'read:comment.property:jira',\n\t\t\t'read:project-version:jira',\n\t\t],\n\t\tsupportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],\n\t\t// A tracker's issues live under resource -> project, so it has no account-wide surface to declare: its\n\t\t// capability is reported under `issues`, which is what `listIssueTrackerIssuesPage` validates against.\n\t\tsupportedIssueSorts: jiraIssueSorts,\n\t\t// `statusCategory` clauses in the same JQL, shared with Server through `jiraHelpers`.\n\t\tsupportsIssueStates: true,\n\t},\n\t[IssuesSelfManagedHostIntegrationId.JiraServer]: {\n\t\t// Self-hosted: there is no canonical domain, so every read is addressed by the connection's own host\n\t\t// (see `JiraServerIntegration.apiBaseUrl`), exactly as the self-managed git hosts do.\n\t\tdomain: '',\n\t\tid: IssuesSelfManagedHostIntegrationId.JiraServer,\n\t\tname: 'Jira Data Center',\n\t\ttype: 'issues',\n\t\t// Reuses Jira's glicon: it is the same product, and the id only selects an icon.\n\t\ticonKey: IssuesCloudHostIntegrationId.Jira,\n\t\t// Jira Cloud's entries are Atlassian OAuth scope strings, which a self-hosted instance doesn't issue:\n\t\t// its token is a PAT the backend stores as-is, so there is no scope set to request.\n\t\tscopes: [],\n\t\t// The same JQL clauses Cloud narrows with — `jiraHelpers` builds one query for both.\n\t\tsupportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee, IssueFilter.Mention],\n\t\t// One JQL `ORDER BY` builder serves Cloud and Server, so they share a surface (see `issueSorts.ts`).\n\t\tsupportedIssueSorts: jiraIssueSorts,\n\t\tsupportsIssueStates: true,\n\t},\n\t[IssuesCloudHostIntegrationId.Linear]: {\n\t\tdomain: 'linear.app',\n\t\tid: IssuesCloudHostIntegrationId.Linear,\n\t\tname: 'Linear',\n\t\ttype: 'issues',\n\t\ticonKey: IssuesCloudHostIntegrationId.Linear,\n\t\tscopes: [],\n\t\t// The user-scoped tracker read scopes Linear's \"my issues\" by the viewer's id: assigned issues, plus the\n\t\t// GitHub-synced issues the viewer created unless `Assignee` is asked for by name. Author/mention aren't supported.\n\t\tsupportedIssueFilters: [IssueFilter.Assignee],\n\t\t// Both directions, and one table for both reads: they are the same root `issues` query taking the same\n\t\t// `sort` argument, so there is no account-wide narrowing to declare.\n\t\tsupportedIssueSorts: linearIssueSorts,\n\t\t// A workflow-state type clause on both reads (`completed`/`canceled`/`duplicate` are closed), the same types\n\t\t// the SDK normalizes to a terminal category (`DONE`, or `CANCELED` for the last two).\n\t\tsupportsIssueStates: true,\n\t},\n\t[IssuesCloudHostIntegrationId.Trello]: {\n\t\tdomain: 'trello.com',\n\t\tid: IssuesCloudHostIntegrationId.Trello,\n\t\tname: 'Trello',\n\t\ttype: 'issues',\n\t\ticonKey: IssuesCloudHostIntegrationId.Trello,\n\t\tscopes: [],\n\t\t// Trello cards are filtered by the assignee (member) only; author/mention have no Trello equivalent.\n\t\tsupportedIssueFilters: [IssueFilter.Assignee],\n\t\t// `sort:edited` / `sort:-edited`. Trello's other search sorts (`created`, `due`) have no card-order effect.\n\t\tsupportedIssueSorts: trelloIssueSorts,\n\t\t// No `supportsIssueStates`: a card has no state beyond being archived, and the board read always sends\n\t\t// `-is:archived`, so `'closed'`/`'all'` are refused rather than answered with the open cards.\n\t},\n\t[IssuesCloudHostIntegrationId.Asana]: {\n\t\tdomain: 'app.asana.com',\n\t\tid: IssuesCloudHostIntegrationId.Asana,\n\t\tname: 'Asana',\n\t\ttype: 'issues',\n\t\ticonKey: IssuesCloudHostIntegrationId.Asana,\n\t\tscopes: [],\n\t\t// A task has a single assignee and no author/mention query; the project read is narrowed to the viewer by\n\t\t// assignee id after the drain, since Asana's task list can't scope a project to an assignee.\n\t\tsupportedIssueFilters: [IssueFilter.Assignee],\n\t\t// Empty: Asana's task list has no ordering parameter, so a read carrying `sort` is refused rather than served in\n\t\t// whatever order Asana returns.\n\t\tsupportedIssueSorts: asanaIssueSorts,\n\t\t// Completion is the only state Asana has: open reads incomplete tasks, closed the completed ones.\n\t\tsupportsIssueStates: true,\n\t},\n};\n\nexport function isGitHubDotCom(domain: string | null | undefined): boolean {\n\treturn equalsIgnoreCase(domain, 'github.com');\n}\n\nexport function isGitLabDotCom(domain: string | null | undefined): boolean {\n\treturn equalsIgnoreCase(domain, 'gitlab.com');\n}\n\n// Anchor the `visualstudio.com` alternative on a label boundary (`^` or `.`) rather than `\\b`: `\\b` treats a\n// hyphen as a word boundary, so `\\bvisualstudio\\.com$` matched attacker-controlled hosts like\n// `evil-visualstudio.com` and classified them as Azure cloud, changing their auth/URL handling.\nconst azureCloudDomainRegex = /^dev\\.azure\\.com$|(?:^|\\.)visualstudio\\.com$/i;\nexport function isAzureCloudDomain(domain: string | undefined): boolean {\n\treturn domain != null && azureCloudDomainRegex.test(domain);\n}\n\nconst bitbucketCloudDomainRegex = /^bitbucket\\.org$/i;\nexport function isBitbucketCloudDomain(domain: string | undefined): boolean {\n\treturn domain != null && bitbucketCloudDomainRegex.test(domain);\n}\n\nexport function supportsCodeSuggest(provider: ProviderReference): boolean {\n\treturn isGitHubDotCom(provider.domain);\n}\n"],"mappings":";;;;;;;;AAyCA,IAAY,aAAL,yBAAA,YAAA;CACN,WAAA,aAAA;CACA,WAAA,UAAA;CACA,WAAA,WAAA;;AACD,EAAA,CAAA,CAAA;;;;;;;;;AA8HA,MAAM,gCAAyD;CAE9D,eAAe;EAAC;EAAY;EAAY;EAAa;EAAgB;CAAY;CACjF,MAAM;CACN,QAAQ;CACR,WAAW;CACX,cAAc;CACd,cAAc;CAEd,0BAA0B;CAE1B,QAAQ;CAER,OAAO;AACR;;AAcA,MAAM,sCAAqE;CAC1E,eAAe;;;;;;CAMf;CACA,QAAQ;EAAC;EAAQ;EAAU;EAAU;CAAK;CAC1C,MAAM;CACN,cAA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EACtC,QAAQ;EACR,IAAA;EACA,MAAM;EACN,MAAM;EACN,SAAA;EACA,QAAQ,CAAC;EAET,uBAAuB,CAAA,UAAqB;EAE5C,qBAAqB;CAGtB;EACsC,UAAA;EACrC,QAAQ;EACR,IAAA;EACA,MAAM;EACN,MAAM;EACN,SAAA;EACA,QAAQ,CAAC;EAGT,uBAAuB,CAAA,UAAqB;EAG5C,qBAAqB;EAErB,qBAAqB;CACtB;AACD;AAEA,SAAgB,eAAe,QAA4C;CAC1E,OAAO,iBAAiB,QAAQ,YAAY;AAC7C;AAEA,SAAgB,eAAe,QAA4C;CAC1E,OAAO,iBAAiB,QAAQ,YAAY;AAC7C;AAKA,MAAM,wBAAwB;AAC9B,SAAgB,mBAAmB,QAAqC;CACvE,OAAO,UAAU,QAAQ,sBAAsB,KAAK,MAAM;AAC3D;AAEA,MAAM,4BAA4B;AAClC,SAAgB,uBAAuB,QAAqC;CAC3E,OAAO,UAAU,QAAQ,0BAA0B,KAAK,MAAM;AAC/D;AAEA,SAAgB,oBAAoB,UAAsC;CACzE,OAAO,eAAe,SAAS,MAAM;AACtC"}
@@ -1,6 +1,7 @@
1
1
  import { ResourceDescriptor } from "../../../git/models/resourceDescriptor.js";
2
2
  import { PullRequest, PullRequestFilter, PullRequestStateFilter } from "../../../git/models/pullRequest.js";
3
3
  import { IntegrationIds } from "../constants.js";
4
+ import "../providerFilters.js";
4
5
  import { ProviderWarning } from "../results.js";
5
6
  import { ProviderSweepTarget, PullRequestSweepOptions } from "../manager.js";
6
7
  import { IntegrationResult } from "../models/publicIntegration.js";
@@ -1,3 +1,4 @@
1
+ import { isValidPullRequestChangedSince } from "../../../git/utils/pullRequest.utils.js";
1
2
  import { providersMetadata } from "../providers/metadata.js";
2
3
  //#region ../plus/integrations/src/reads/filters.ts
3
4
  /**
@@ -50,11 +51,21 @@ function resolvePullRequestSearchCriteria(id, criteria) {
50
51
  if (criteria.includeArchived === true && !supported.includeArchived) unsupported.push("includeArchived");
51
52
  if (criteria.draft != null && !supported.draft) unsupported.push("draft");
52
53
  if (criteria.sort != null && !supported.sorts.includes(criteria.sort)) unsupported.push(`sort:${criteria.sort}`);
54
+ if (criteria.changedSince != null) unsupported.push(...unsupportedChangedSinceCriteria(criteria, criteria.changedSince, supported.changedSince));
53
55
  return unsupported.length > 0 ? { rejection: {
54
56
  reason: "unsupported-criteria",
55
57
  criteria: unsupported
56
58
  } } : {};
57
59
  }
60
+ function unsupportedChangedSinceCriteria(criteria, changedSince, supported) {
61
+ if (!supported) return ["changedSince"];
62
+ const unsupported = [];
63
+ if (!isValidPullRequestChangedSince(changedSince)) unsupported.push(`changedSince:${JSON.stringify(changedSince)} (expected YYYY-MM-DDTHH:MM:SSZ)`);
64
+ for (const state of criteria.states ?? []) if (state !== "all") unsupported.push(`changedSince with states:${state}`);
65
+ if (criteria.sort != null && criteria.sort !== "updated:asc") unsupported.push(`changedSince with sort:${criteria.sort}`);
66
+ if (new Set(criteria.relationships).size > 1) unsupported.push("changedSince with several relationships");
67
+ return unsupported;
68
+ }
58
69
  /**
59
70
  * Validates the search boundary independently from its criteria. A current-user relationship is itself a safe
60
71
  * account-wide boundary; without one, a repository or organization scope is mandatory.
@@ -185,7 +196,8 @@ const unsupportedPullRequestSearchCapabilities = {
185
196
  draft: false,
186
197
  repositoryScope: false,
187
198
  organizationScope: false,
188
- sorts: []
199
+ sorts: [],
200
+ changedSince: false
189
201
  };
190
202
  /**
191
203
  * Whether a scope name reaches the provider NAMING THE SAME SCOPE — the one rule behind every `unusable-scope`
@@ -1 +1 @@
1
- {"version":3,"file":"filters.js","names":[],"sources":["../../../../../plus/integrations/src/reads/filters.ts"],"sourcesContent":["import type { IntegrationIds } from '../constants.js';\nimport type {\n\tIssueFilter,\n\tIssueSearchCapabilities,\n\tIssueSearchCriteria,\n\tIssueSearchRelationship,\n\tPullRequestFilter,\n\tPullRequestSearchCapabilities,\n\tPullRequestSearchCriteria,\n\tSupportedFilters,\n} from '../providerFilters.js';\nimport { providersMetadata } from '../providers/metadata.js';\nimport type { ProviderRepoInput, ProviderReposInput } from '../providers/models.js';\n\n/**\n * Validation of a caller-supplied relationship filter set against what a provider can express server-side.\n *\n * Every one of these is ALL-OR-NOTHING, and deliberately so: dropping the members a provider can't express\n * would silently widen the read past what was asked for (requesting Author+Mention on a host without Mention\n * would return every authored item rather than the requested set), and narrowing the returned page afterward\n * would leave `items` describing a different result set than the `hasMore`/`cursor` the provider produced with\n * it. So an inexpressible set is refused whole, and the caller surfaces a warning instead of reading unfiltered.\n *\n * The three differ only in WHICH capability they check, because they govern three different provider queries —\n * see `IntegrationManager.getSupportedFilters`, which exposes the same capability table so a consumer can\n * intersect against it and never reach a refusal.\n */\nexport interface ResolvedFilters<T> {\n\tfilters?: T[];\n\tunsupported: boolean;\n}\n\n/**\n * Validates a repo-scoped PR filter set, so an unsupported filter never trips the read core's \"Unsupported\n * filters\" guard. `unsupported: true` when the caller DID request filters and the provider can't express even\n * ONE of them — the exact negation of the read core's `providerSupportsPullRequestFilters` (`every`), so this\n * can only ever pre-empt that guard, never disagree with it.\n *\n * Returns `{ filters }` (possibly undefined when none were requested — an unfiltered read is intended). Genuine\n * \"my pull requests\" self-scoping is delivered by the account-wide path\n * (`GitHostIntegration.getMyPullRequestsForUserResult`); this only governs the optional repo-scoped narrowing.\n */\nexport function resolvePullRequestFilters(\n\tid: IntegrationIds,\n\tfilters: PullRequestFilter[] | undefined,\n): ResolvedFilters<PullRequestFilter> {\n\tif (filters == null || filters.length === 0) return { unsupported: false };\n\n\tconst supported = providersMetadata[id]?.supportedPullRequestFilters;\n\tif (supported == null || filters.some(f => !supported.includes(f))) return { unsupported: true };\n\n\treturn { filters: filters, unsupported: false };\n}\n\n/**\n * Validates an account-wide PR relationship union independently from the repo-scoped capability. Dropping an\n * unsupported member would change the requested OR set, so validation is all-or-nothing.\n */\nexport function resolveAccountWidePullRequestFilters(\n\tid: IntegrationIds,\n\tfilters: PullRequestFilter[] | undefined,\n): ResolvedFilters<PullRequestFilter> {\n\tif (filters == null || filters.length === 0) return { unsupported: false };\n\n\tconst supported = providersMetadata[id]?.supportedAccountWidePullRequestFilters;\n\tif (supported == null || filters.some(f => !supported.includes(f))) return { unsupported: true };\n\n\treturn { filters: [...new Set(filters)], unsupported: false };\n}\n\n/** Why {@link resolvePullRequestSearchCriteria} refused a criteria set. */\nexport type PullRequestSearchCriteriaRejection =\n\t/** The provider has no filtered pull-request search. */\n\t| { reason: 'unsupported-search' }\n\t/** The provider has one, but cannot express every requested criterion server-side. */\n\t| { reason: 'unsupported-criteria'; criteria: string[] };\n\n/**\n * Validates filtered pull-request search criteria all-or-nothing. Dropping an unsupported criterion would\n * widen the provider query while leaving its page and cursor describing the wider set, so the facade refuses the\n * request before any upstream call instead.\n */\nexport function resolvePullRequestSearchCriteria(\n\tid: IntegrationIds,\n\tcriteria: PullRequestSearchCriteria | undefined,\n): { rejection?: PullRequestSearchCriteriaRejection } {\n\tconst supported = providersMetadata[id]?.supportedPullRequestSearch;\n\tif (supported == null || supported.relationships.length === 0) {\n\t\treturn { rejection: { reason: 'unsupported-search' } };\n\t}\n\tif (criteria == null) return {};\n\n\tconst unsupported: string[] = [];\n\tfor (const relationship of criteria.relationships ?? []) {\n\t\tif (!supported.relationships.includes(relationship)) {\n\t\t\tunsupported.push(`relationships:${relationship}`);\n\t\t}\n\t}\n\tfor (const state of criteria.states ?? []) {\n\t\tif (!supported.states.includes(state)) {\n\t\t\tunsupported.push(`states:${state}`);\n\t\t}\n\t}\n\tif (criteria.text != null && criteria.text.trim().length > 0 && !supported.text) {\n\t\tunsupported.push('text');\n\t}\n\tif (criteria.updatedAfter != null && !supported.updatedAfter) {\n\t\tunsupported.push('updatedAfter');\n\t}\n\tif (criteria.createdAfter != null && !supported.createdAfter) {\n\t\tunsupported.push('createdAfter');\n\t}\n\tif (criteria.includeArchived === true && !supported.includeArchived) {\n\t\tunsupported.push('includeArchived');\n\t}\n\t// `!= null`, not truthy: `draft: false` (only ready-for-review) is as much a request as `draft: true`.\n\tif (criteria.draft != null && !supported.draft) {\n\t\tunsupported.push('draft');\n\t}\n\t// Folded into the same `unsupported-criteria` rejection rather than its own reason, so a caller asking for one\n\t// inexpressible filter and one inexpressible sort learns about both at once. `updated:desc` is always in\n\t// `sorts` for a usable search, so the omitted (default) case never rejects.\n\tif (criteria.sort != null && !supported.sorts.includes(criteria.sort)) {\n\t\tunsupported.push(`sort:${criteria.sort}`);\n\t}\n\n\treturn unsupported.length > 0 ? { rejection: { reason: 'unsupported-criteria', criteria: unsupported } } : {};\n}\n\n/** Why a filtered pull-request search's repository/organization boundary was refused. */\nexport type PullRequestSearchScopeRejection =\n\t| { reason: 'unscoped' }\n\t| { reason: 'repo-ids' }\n\t| { reason: 'unsupported-repository-scope' }\n\t| { reason: 'unsupported-organization-scope' }\n\t/** Scope names a query cannot carry AS GIVEN; see {@link unusableSearchScopeNames}. */\n\t| { reason: 'unusable-scope'; scopes: string[] };\n\n/**\n * Validates the search boundary independently from its criteria. A current-user relationship is itself a safe\n * account-wide boundary; without one, a repository or organization scope is mandatory.\n *\n * Scope names go through the same {@link unusableSearchScopeNames} rule the issue search uses — shared rather\n * than re-derived, because the defect is identical on both reads.\n */\nexport function resolvePullRequestSearchScope(\n\tid: IntegrationIds,\n\trepos: ProviderReposInput | undefined,\n\torg: string | undefined,\n\tcriteria: PullRequestSearchCriteria | undefined,\n): { rejection?: PullRequestSearchScopeRejection; repos?: ProviderRepoInput[] } {\n\tconst supported = providersMetadata[id]?.supportedPullRequestSearch;\n\tlet resolvedRepos: ProviderRepoInput[] | undefined;\n\n\tif (repos?.length) {\n\t\tif (repos.some(r => typeof r === 'string' || typeof r === 'number')) {\n\t\t\treturn { rejection: { reason: 'repo-ids' } };\n\t\t}\n\t\tif (supported?.repositoryScope !== true) return { rejection: { reason: 'unsupported-repository-scope' } };\n\n\t\tresolvedRepos = repos as ProviderRepoInput[];\n\t}\n\n\tconst hasOrganizationScope = org != null && org.length > 0;\n\tif (hasOrganizationScope && supported?.organizationScope !== true) {\n\t\treturn { rejection: { reason: 'unsupported-organization-scope' } };\n\t}\n\n\t// After the capability checks and before the \"is it scoped at all\" rule: a scope the provider cannot express\n\t// at all is the more fundamental refusal, and an unusable value that WAS supplied must not be reported as a\n\t// missing one. `org` is passed bare, matching the issue twin — the helper applies its own empty-means-\n\t// unsupplied guard, so re-testing `hasOrganizationScope` here would only make the two resolvers look like\n\t// they differ.\n\tconst unusable = unusableSearchScopeNames(id, org, resolvedRepos);\n\tif (unusable.length > 0) return { rejection: { reason: 'unusable-scope', scopes: unusable } };\n\n\tif (resolvedRepos != null || hasOrganizationScope || (criteria?.relationships?.length ?? 0) > 0) {\n\t\treturn { repos: resolvedRepos };\n\t}\n\n\treturn { rejection: { reason: 'unscoped' } };\n}\n\n/**\n * Validates a caller-provided issue filter set against what the provider's ACCOUNT-WIDE issue read can express\n * server-side (`ProviderMetadata.supportedAccountWideIssueFilters`), which is a different — usually narrower —\n * set than the repo-scoped `ProviderMetadata.supportedIssueFilters`.\n *\n * Dropping the unexpressible members would silently widen the read back toward the provider's own union\n * (authored ∪ assigned ∪ mentioned for GitHub), which is the opposite of what a caller narrowing to\n * `[Assignee]` asked for.\n */\nexport function resolveAccountWideIssueFilters(\n\tid: IntegrationIds,\n\tfilters: IssueFilter[] | undefined,\n): ResolvedFilters<IssueFilter> {\n\tif (filters == null || filters.length === 0) return { unsupported: false };\n\n\tconst supported = providersMetadata[id]?.supportedAccountWideIssueFilters;\n\tif (supported == null || filters.some(f => !supported.includes(f))) return { unsupported: true };\n\n\treturn { filters: filters, unsupported: false };\n}\n\n/** Why {@link resolveIssueSearchCriteria} refused a criteria set, so the caller can word the refusal exactly. */\nexport type IssueSearchCriteriaRejection =\n\t/** The provider has no filtered issue search at all. */\n\t| { reason: 'unsupported-search' }\n\t/** The provider has one, but can't express these criteria server-side. */\n\t| { reason: 'unsupported-criteria'; criteria: string[] }\n\t/** `any-assignee` and `unassigned` partition the scope between them; asking for both asks for nothing. */\n\t| { reason: 'contradictory-relationships' };\n\n/**\n * Whether a provider exposes the FILTERED issue search at all — the one predicate a caller can check BEFORE\n * building criteria, so a read that would only be refused is never issued.\n *\n * The same test {@link resolveIssueSearchCriteria} makes for its `unsupported-search` rejection, named rather\n * than re-derived at each call site: a caller writing `supportedIssueSearch != null` itself is a copy free to\n * disagree with the validator about what \"has a search\" means. `broadenIssues` reads it to pick its engine —\n * the org-scoped search where there is one, the repository drain where there isn't — which is a CHOICE rather\n * than a refusal, so it needs the predicate without the rejection.\n */\nexport function supportsFilteredIssueSearch(id: IntegrationIds): boolean {\n\treturn providersMetadata[id]?.supportedIssueSearch != null;\n}\n\n/**\n * Validates a filtered issue search's criteria against {@link ProviderMetadata.supportedIssueSearch}.\n *\n * All-or-nothing like its three siblings above, and for the same reason: a criterion dropped because the\n * provider can't express it would serve a WIDER result than was asked for, and narrowing the returned page\n * afterward would leave `items` describing a different result set than the `hasMore`/`cursor` the provider\n * produced with it. So an inexpressible set is refused whole and the caller surfaces a warning.\n *\n * Unlike the sibling validators this also rejects a set that is internally contradictory, because this criteria\n * model is the only one with two members that partition the scope between them (`any-assignee` ∪ `unassigned` =\n * everything, ∩ = nothing). Silently keeping one would answer a question the caller didn't ask.\n *\n * `undefined` (or an empty relationship list plus no other criterion) is a valid UNNARROWED search of the given\n * scope, not an error — the caller's `repos`/`org` is what bounds it.\n */\nexport function resolveIssueSearchCriteria(\n\tid: IntegrationIds,\n\tcriteria: IssueSearchCriteria | undefined,\n): { rejection?: IssueSearchCriteriaRejection } {\n\tconst supported = providersMetadata[id]?.supportedIssueSearch;\n\tif (supported == null) return { rejection: { reason: 'unsupported-search' } };\n\tif (criteria == null) return {};\n\n\tconst relationships = criteria.relationships;\n\tif (relationships?.includes('any-assignee') && relationships.includes('unassigned')) {\n\t\treturn { rejection: { reason: 'contradictory-relationships' } };\n\t}\n\n\tconst unsupported: string[] = [];\n\tfor (const relationship of relationships ?? []) {\n\t\tif (!supported.relationships.includes(relationship)) {\n\t\t\tunsupported.push(`relationships:${relationship}`);\n\t\t}\n\t}\n\t// Only a criterion the caller actually SET can be unsupported. `false`/empty means \"don't narrow on this\",\n\t// which every provider can honor by doing nothing, so it must not be validated as a request.\n\tif (criteria.text != null && criteria.text.trim().length > 0 && !supported.text) {\n\t\tunsupported.push('text');\n\t}\n\tif (criteria.labels?.length && !supported.labels) {\n\t\tunsupported.push('labels');\n\t}\n\tif (criteria.milestone != null && !supported.milestone) {\n\t\tunsupported.push('milestone');\n\t}\n\tif (criteria.updatedAfter != null && !supported.updatedAfter) {\n\t\tunsupported.push('updatedAfter');\n\t}\n\tif (criteria.createdAfter != null && !supported.createdAfter) {\n\t\tunsupported.push('createdAfter');\n\t}\n\tif (criteria.withoutLinkedPullRequest === true && !supported.withoutLinkedPullRequest) {\n\t\tunsupported.push('withoutLinkedPullRequest');\n\t}\n\t// `'open'` is every provider's own default, so asking for it needs no state capability.\n\tif (criteria.state != null && criteria.state !== 'open' && !supported.states) {\n\t\tunsupported.push('state');\n\t}\n\t// Folded into the same `unsupported-criteria` rejection rather than given its own reason, so a caller asking\n\t// for one inexpressible filter and one inexpressible sort learns about both at once instead of fixing them one\n\t// refusal at a time. The `sorts` list is `supported`'s own, so this needs no branch on which surface it is.\n\tif (criteria.sort != null && !supported.sorts.includes(criteria.sort)) {\n\t\tunsupported.push(`sort:${criteria.sort}`);\n\t}\n\n\tif (unsupported.length > 0) return { rejection: { reason: 'unsupported-criteria', criteria: unsupported } };\n\n\treturn {};\n}\n\n/**\n * The relationships that bound a filtered issue search to the CURRENT USER, and so can stand in for a\n * repository/org scope.\n *\n * Derived from the union rather than spelled out per call site, because the distinction it encodes is the whole\n * reason the scope rule exists: `any-assignee` and `unassigned` are deliberately absent — they describe the\n * ISSUE, not the caller, so neither reduces the search to anyone's own world (measured: unscoped `no:assignee`\n * matches ~45 million issues on GitHub).\n */\nconst userScopingIssueSearchRelationships: readonly IssueSearchRelationship[] = ['authored', 'assigned', 'mentioned'];\n\n/** What a provider with NO filtered issue search reports: nothing expressible, spelled out rather than absent. */\nconst unsupportedIssueSearchCapabilities: IssueSearchCapabilities = {\n\trelationships: [],\n\ttext: false,\n\tlabels: false,\n\tmilestone: false,\n\tupdatedAfter: false,\n\tcreatedAfter: false,\n\twithoutLinkedPullRequest: false,\n\tstates: false,\n\tsorts: [],\n};\n\n/** What a provider with no filtered pull-request search reports. */\nconst unsupportedPullRequestSearchCapabilities: PullRequestSearchCapabilities = {\n\trelationships: [],\n\tstates: [],\n\ttext: false,\n\tupdatedAfter: false,\n\tcreatedAfter: false,\n\tincludeArchived: false,\n\tdraft: false,\n\trepositoryScope: false,\n\torganizationScope: false,\n\tsorts: [],\n};\n\n/** Why a filtered issue search's scope was refused, or `undefined` when it is usable. */\nexport type IssueSearchScopeRejection =\n\t/** No repositories, no org, and no user-relative relationship: a search of the whole host. */\n\t| { reason: 'unscoped' }\n\t/** Repositories given as ids. A search names repositories by PATH, so ids can't express a scope. */\n\t| { reason: 'repo-ids' }\n\t/** Scope names a query cannot carry AS GIVEN; see {@link unusableSearchScopeNames}. */\n\t| { reason: 'unusable-scope'; scopes: string[] };\n\n/**\n * Whether a scope name reaches the provider NAMING THE SAME SCOPE — the one rule behind every `unusable-scope`\n * refusal, and the canonical home for its reasoning: the call sites point here rather than restating it.\n *\n * The defect it exists to prevent: the boundary is checked against the value AS SUPPLIED while the request is\n * built from the value AFTER the provider sanitizes it, so a name a query cannot spell produces a read that is no\n * longer the read that was authorized. Three outcomes, all of which LOOK LIKE SUCCESS, so there is nothing for a\n * consumer to branch on:\n * - **emptied** — a value of only quotes/whitespace/control characters emits no scope qualifier at all. A scope is\n * also what makes a relationship-less read legal, so the request carries neither and every item on the host\n * matches: measured at 52 million issues across unrelated accounts.\n * - **altered** — a quote inside a real name sanitizes to a real but DIFFERENT scope (`git\"kraken` -> `gitkraken`),\n * whose answer looks entirely normal.\n * - **split** — whitespace delimits qualifiers, so `my org` emits `org:my org`: a search of `my` additionally\n * filtered by the free text `org`. Measured against the live API this is a wrong NARROWING rather than a\n * widening — `org:gitkraken bar` returns 12 where `org:gitkraken` returns 379.\n *\n * Refusing beats sanitizing, and the count probes are why it matters most: they deliberately apply exactly the\n * qualifiers their search would, so a sanitized scope makes the count AGREE with the wrong search rather than\n * disagree with it, and a consumer cross-checking \"N matched\" cannot detect it by construction. Nor can it\n * pre-empt the rule — the free-text sanitizing rules are published precisely so a caller can mirror them, the\n * scope rules are not — so only the caller knows which scope it meant, and the refusal goes back to it NAMING the\n * offending value.\n *\n * Provider-NEUTRAL by design, and deliberately not an import of GitHub's `sanitizeGitHubQualifierValue`: this\n * module validates for every provider, and a GitHub-specific rule reaching in here would be wrong for the next\n * one that declares a search. The character class below is stated as the common part of any query language,\n * because each class breaks a query on its own terms — a quote closes its own qualifier, a control character\n * cannot appear at all, whitespace delimits the next qualifier.\n *\n * A provider that never puts a scope name into a query string declares\n * {@link ProviderMetadata.exactSearchScopeNames}, and only blank names and control characters are refused for it:\n * Azure DevOps Server addresses a collection or repository as an encoded URL segment and matches a project against\n * the names discovery reported, so a space or a quote reaches it naming the same scope — and its names legitimately\n * contain both.\n *\n * EDGES ARE STRIPPED before the test, which is what keeps the predicate no stricter than the provider's own\n * sanitizing — the invariant that makes refusing safe to add, since it means this can only reject a name the\n * provider would have altered, never one it would have resolved correctly. Leading and trailing whitespace AND\n * control characters both qualify: a sanitizer maps a control character to a space, then collapses and trims, so\n * `'gitkraken\\n'` and `'gitkraken\\u0000'` alike emit `org:gitkraken` — the scope that was asked for. Note this\n * is wider than `String.trim()`, which leaves control characters in place.\n *\n * None of the three outcomes above survives the stripping, so the rule loses nothing: an all-edge value still\n * empties, an INNER space or control character still splits (`'git\\u0000kraken'` emits `git kraken`, two\n * tokens), and a quote still alters wherever it sits.\n */\nfunction isUsableSearchScopeName(id: IntegrationIds, name: string): boolean {\n\tconst stripped = stripSearchScopeEdges(name);\n\tif (providersMetadata[id]?.exactSearchScopeNames === true) {\n\t\t// eslint-disable-next-line no-control-regex\n\t\treturn stripped.length > 0 && !/[\\u0000-\\u001f\\u007f]/.test(stripped);\n\t}\n\n\t// eslint-disable-next-line no-control-regex\n\treturn stripped.length > 0 && !/[\"\\u0000-\\u001f\\u007f\\s]/.test(stripped);\n}\n\n/** The leading/trailing run a provider's sanitizing removes — see {@link isUsableSearchScopeName}. */\nfunction stripSearchScopeEdges(value: string): string {\n\t// eslint-disable-next-line no-control-regex\n\treturn value.replace(/^[\\s\\u0000-\\u001f\\u007f]+|[\\s\\u0000-\\u001f\\u007f]+$/g, '');\n}\n\n/**\n * The scope names a search cannot carry as given, as the strings to name in the refusal — empty when every one is\n * usable. See {@link isUsableSearchScopeName} for the rule and why it refuses rather than sanitizes.\n */\nfunction unusableSearchScopeNames(\n\tid: IntegrationIds,\n\torg: string | undefined,\n\trepos: readonly ProviderRepoInput[] | undefined,\n): string[] {\n\tconst unusable: string[] = [];\n\n\t// An EMPTY org is \"no org supplied\" and falls through to the remaining scopes; any other unusable value WAS\n\t// supplied, so it is refused rather than dropped.\n\tif (org != null && org.length > 0 && !isUsableSearchScopeName(id, org)) {\n\t\tunusable.push(org);\n\t}\n\n\t// A `repo:` qualifier names a repository by its JOINED `namespace/name` path, which is the value the rule\n\t// below is applied to. Both halves are read defensively, through the SAME locals the label is built from: the\n\t// descriptor form is only narrowed from a union by an element-type check, so a half-built descriptor reaches\n\t// here as `undefined` and must refuse rather than throw out of a facade that reports refusals as warnings —\n\t// and reporting it as `undefined/a` would name a value the caller never passed.\n\tfor (const repo of repos ?? []) {\n\t\tconst namespace = repo.namespace ?? '';\n\t\tconst name = repo.name ?? '';\n\t\tconst path = `${namespace}/${name}`;\n\t\t// BOTH the composite and each half, because neither sees what the other does:\n\t\t// - the composite catches an offender the halves cannot, since an edge of a half is an INTERIOR character\n\t\t// of the path — `{ 'git ', 'kraken' }` has two usable-looking halves and emits `repo:git /kraken`.\n\t\t// - the halves catch a BLANK one the composite cannot, since that offender sits at a composite EDGE where\n\t\t// stripping removes it — `' /a'` strips to `'/a'`, a perfectly spellable qualifier naming no repository.\n\t\t// Each half is measured after the same stripping, so `' '` and `''` are one case rather than two.\n\t\tif (\n\t\t\t!isUsableSearchScopeName(id, path) ||\n\t\t\tstripSearchScopeEdges(namespace).length === 0 ||\n\t\t\tstripSearchScopeEdges(name).length === 0\n\t\t) {\n\t\t\tunusable.push(path);\n\t\t}\n\t}\n\n\treturn unusable;\n}\n\n/**\n * Validates that a filtered issue search is scoped at all, and narrows `repos` to the descriptor form the\n * provider query needs.\n *\n * Shared by `searchIssuesPage` and `countIssues` because a count computed under different constraints than the\n * read it previews is a WRONG number rather than a missing one. The rejection is returned as a reason code, not a\n * warning: the two callers word it differently (whole-read vs naming the offending scope's key), and wording is\n * the warning layer's business.\n *\n * `repo-ids` and `unscoped` are mutually exclusive — one requires repositories and the other requires none — so\n * their relative order is free. `unusable-scope` is NOT: it must precede `unscoped`, so a value that was supplied\n * but cannot be used is never reported as a missing one.\n *\n * Every scope name is checked for naming the same scope after the provider sanitizes it, not merely for being\n * non-empty, and that distinction is a SECURITY one rather than a nicety — see {@link isUsableSearchScopeName}.\n */\nexport function resolveIssueSearchScope(\n\tid: IntegrationIds,\n\trepos: ProviderReposInput | undefined,\n\torg: string | undefined,\n\tcriteria: IssueSearchCriteria | undefined,\n): { rejection?: IssueSearchScopeRejection; repos?: ProviderRepoInput[] } {\n\tlet resolvedRepos: ProviderRepoInput[] | undefined;\n\n\tif (repos?.length) {\n\t\t// `ProviderReposInput` is a union of descriptor and id arrays; only the descriptor form is usable here.\n\t\tif (repos.some(r => typeof r === 'string' || typeof r === 'number')) {\n\t\t\treturn { rejection: { reason: 'repo-ids' } };\n\t\t}\n\n\t\tresolvedRepos = repos as ProviderRepoInput[];\n\t}\n\n\t// Checked BEFORE the \"is it scoped at all\" rule below, so an unusable value is never reported as a missing\n\t// one: it was supplied, and telling the caller to pass a scope it already passed names the wrong defect.\n\tconst unusable = unusableSearchScopeNames(id, org, resolvedRepos);\n\tif (unusable.length > 0) return { rejection: { reason: 'unusable-scope', scopes: unusable } };\n\n\tif (resolvedRepos != null) return { repos: resolvedRepos };\n\tif (org != null && org.length > 0) return {};\n\tif (criteria?.relationships?.some(r => userScopingIssueSearchRelationships.includes(r)) === true) return {};\n\n\treturn { rejection: { reason: 'unscoped' } };\n}\n\n/**\n * The filters `listPullRequestsPage`/`listIssuesPage` (and the sweeps) accept for a provider, so a caller can\n * narrow to what the provider can express BEFORE issuing the read.\n *\n * This matters because the filter contract is all-or-nothing: a set containing even one unsupported filter is\n * refused outright ({@link resolvePullRequestFilters}) rather than silently narrowed, since falling through to\n * an unfiltered fetch would return every PR instead of the user's. Without this accessor a consumer had to\n * hardcode its own copy of the table — reachable only by importing the internal `providers/models.js`\n * subpath — and a copy that drifts turns a supported read into an empty page with `fetchFailed`.\n *\n * Empty means \"no filter of that kind is expressible\": either the provider has no such surface (issue trackers\n * have no pull requests; Bitbucket exposes no issues) or its metadata declares none. Callers should treat it as\n * \"don't pass filters\", not as an error. Returns copies, so mutating the result can't corrupt the metadata.\n *\n * `issues` and `issuesAccountWide` are separate because the repo-scoped and account-wide issue reads are\n * different provider queries with different filter surfaces, and the same `filters` input is validated against\n * whichever one the read uses (`repos` present or not). `issuesAccountWide` is generally the narrower of the\n * two: GitLab, for instance, can express `Assignee` and `Author` account-wide, but not `Mention`.\n *\n * That split describes the GIT-HOST reads only. An issue tracker (Jira/Linear/Trello) has neither — its issues\n * live under resource → project — so it reports its filters under `issues`, which is what\n * {@link IntegrationService.listIssueTrackerIssuesPage} validates against, and leaves `issuesAccountWide`\n * empty. Reading a tracker's capability off `issuesAccountWide` therefore under-reports it.\n *\n * `issueSearch` is a third, wider surface: the FILTERED issue search (`searchIssuesPage`, and the `countIssues`\n * probe over the same criteria), which is not bound to the user at all. It is a record of per-criterion flags\n * rather than a list, because its criteria aren't a single kind. An empty `relationships` means the provider has\n * no filtered issue search — hide the surface, not just its chips.\n *\n * `pullRequestSearch` describes the separate filtered PR search. Its table declares each criteria vocabulary\n * plus repository/organization scope support; an empty relationship list means the search itself is absent.\n *\n * `issueSorts` / `issueSortsAccountWide` / `issueSearch.sorts` are the ORDERING vocabulary of those same three\n * issue reads, split the same way and for the same reason (GitLab's repo-scoped read is GraphQL and its\n * account-wide read is REST, with genuinely different sort vocabularies). Empty means the read can't be ordered,\n * so pass no `sort`; a key not listed refuses the whole read exactly like an inexpressible filter. Note a key\n * listed here is expressible on ONE provider query: a read that fans out across projects can only honor a key\n * derivable from a normalized issue, so it refuses `priority`/`dueDate`/`resolved` on top of this table.\n *\n * Note this is a CAPABILITY table — \"what the provider can express\" — not a recommendation. A consumer\n * matching another tool's behavior may deliberately pass fewer filters than are listed here (or none, where an\n * already-scoped read would only be narrowed by them). Intersecting against this table is what keeps a\n * filtered read from being refused; it isn't a directive to use every filter in it.\n */\nexport function getSupportedFilters(providerId: IntegrationIds): SupportedFilters {\n\tconst metadata = providersMetadata[providerId];\n\tconst issueSearch = metadata?.supportedIssueSearch;\n\tconst pullRequestSearch = metadata?.supportedPullRequestSearch;\n\treturn {\n\t\tpullRequests: [...(metadata?.supportedPullRequestFilters ?? [])],\n\t\tpullRequestsAccountWide: [...(metadata?.supportedAccountWidePullRequestFilters ?? [])],\n\t\tpullRequestSearch: {\n\t\t\t...unsupportedPullRequestSearchCapabilities,\n\t\t\t...pullRequestSearch,\n\t\t\trelationships: [...(pullRequestSearch?.relationships ?? [])],\n\t\t\tstates: [...(pullRequestSearch?.states ?? [])],\n\t\t\t// Copied, so mutating the result can't corrupt the metadata table.\n\t\t\tsorts: [...(pullRequestSearch?.sorts ?? [])],\n\t\t},\n\t\tissues: [...(metadata?.supportedIssueFilters ?? [])],\n\t\tissuesAccountWide: [...(metadata?.supportedAccountWideIssueFilters ?? [])],\n\t\t// Always an object, never `undefined`: a provider WITHOUT a filtered issue search reports one whose\n\t\t// `relationships` is empty and whose flags are all false, so a consumer reads capabilities the same way\n\t\t// for every provider (and an empty `relationships` is the signal to hide the surface itself).\n\t\t//\n\t\t// Spread over the all-false baseline rather than defaulting each flag: a criterion added to\n\t\t// `IssueSearchCapabilities` then can't be forgotten here and silently reported as `undefined` (which a\n\t\t// consumer's `if (caps.x)` would read as unsupported — right answer, wrong reason, and untyped).\n\t\t// `supportedIssueSearch` is typed as the complete shape, so no member can arrive as an explicit undefined.\n\t\tissueSearch: {\n\t\t\t...unsupportedIssueSearchCapabilities,\n\t\t\t...issueSearch,\n\t\t\t// Copied, so mutating the result can't corrupt the metadata table.\n\t\t\trelationships: [...(issueSearch?.relationships ?? [])],\n\t\t\tsorts: [...(issueSearch?.sorts ?? [])],\n\t\t},\n\t\tissueSorts: [...(metadata?.supportedIssueSorts ?? [])],\n\t\tissueSortsAccountWide: [...(metadata?.supportedAccountWideIssueSorts ?? [])],\n\t\tissueStates: metadata?.supportsIssueStates === true,\n\t};\n}\n"],"mappings":";;;;;;;;;;;;AA0CA,SAAgB,0BACf,IACA,SACqC;CACrC,IAAI,WAAW,QAAQ,QAAQ,WAAW,GAAG,OAAO,EAAE,aAAa,MAAM;CAEzE,MAAM,YAAY,kBAAkB,GAAG,EAAE;CACzC,IAAI,aAAa,QAAQ,QAAQ,MAAK,MAAK,CAAC,UAAU,SAAS,CAAC,CAAC,GAAG,OAAO,EAAE,aAAa,KAAK;CAE/F,OAAO;EAAW;EAAS,aAAa;CAAM;AAC/C;;;;;AAMA,SAAgB,qCACf,IACA,SACqC;CACrC,IAAI,WAAW,QAAQ,QAAQ,WAAW,GAAG,OAAO,EAAE,aAAa,MAAM;CAEzE,MAAM,YAAY,kBAAkB,GAAG,EAAE;CACzC,IAAI,aAAa,QAAQ,QAAQ,MAAK,MAAK,CAAC,UAAU,SAAS,CAAC,CAAC,GAAG,OAAO,EAAE,aAAa,KAAK;CAE/F,OAAO;EAAE,SAAS,CAAC,GAAG,IAAI,IAAI,OAAO,CAAC;EAAG,aAAa;CAAM;AAC7D;;;;;;AAcA,SAAgB,iCACf,IACA,UACqD;CACrD,MAAM,YAAY,kBAAkB,GAAG,EAAE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.ts"],"sourcesContent":["import { isValidPullRequestChangedSince } from '@gitlens/git/utils/pullRequest.utils.js';\nimport type { IntegrationIds } from '../constants.js';\nimport type {\n\tIssueFilter,\n\tIssueSearchCapabilities,\n\tIssueSearchCriteria,\n\tIssueSearchRelationship,\n\tPullRequestFilter,\n\tPullRequestSearchCapabilities,\n\tPullRequestSearchCriteria,\n\tSupportedFilters,\n} from '../providerFilters.js';\nimport { providersMetadata } from '../providers/metadata.js';\nimport type { ProviderRepoInput, ProviderReposInput } from '../providers/models.js';\n\n/**\n * Validation of a caller-supplied relationship filter set against what a provider can express server-side.\n *\n * Every one of these is ALL-OR-NOTHING, and deliberately so: dropping the members a provider can't express\n * would silently widen the read past what was asked for (requesting Author+Mention on a host without Mention\n * would return every authored item rather than the requested set), and narrowing the returned page afterward\n * would leave `items` describing a different result set than the `hasMore`/`cursor` the provider produced with\n * it. So an inexpressible set is refused whole, and the caller surfaces a warning instead of reading unfiltered.\n *\n * The three differ only in WHICH capability they check, because they govern three different provider queries —\n * see `IntegrationManager.getSupportedFilters`, which exposes the same capability table so a consumer can\n * intersect against it and never reach a refusal.\n */\nexport interface ResolvedFilters<T> {\n\tfilters?: T[];\n\tunsupported: boolean;\n}\n\n/**\n * Validates a repo-scoped PR filter set, so an unsupported filter never trips the read core's \"Unsupported\n * filters\" guard. `unsupported: true` when the caller DID request filters and the provider can't express even\n * ONE of them — the exact negation of the read core's `providerSupportsPullRequestFilters` (`every`), so this\n * can only ever pre-empt that guard, never disagree with it.\n *\n * Returns `{ filters }` (possibly undefined when none were requested — an unfiltered read is intended). Genuine\n * \"my pull requests\" self-scoping is delivered by the account-wide path\n * (`GitHostIntegration.getMyPullRequestsForUserResult`); this only governs the optional repo-scoped narrowing.\n */\nexport function resolvePullRequestFilters(\n\tid: IntegrationIds,\n\tfilters: PullRequestFilter[] | undefined,\n): ResolvedFilters<PullRequestFilter> {\n\tif (filters == null || filters.length === 0) return { unsupported: false };\n\n\tconst supported = providersMetadata[id]?.supportedPullRequestFilters;\n\tif (supported == null || filters.some(f => !supported.includes(f))) return { unsupported: true };\n\n\treturn { filters: filters, unsupported: false };\n}\n\n/**\n * Validates an account-wide PR relationship union independently from the repo-scoped capability. Dropping an\n * unsupported member would change the requested OR set, so validation is all-or-nothing.\n */\nexport function resolveAccountWidePullRequestFilters(\n\tid: IntegrationIds,\n\tfilters: PullRequestFilter[] | undefined,\n): ResolvedFilters<PullRequestFilter> {\n\tif (filters == null || filters.length === 0) return { unsupported: false };\n\n\tconst supported = providersMetadata[id]?.supportedAccountWidePullRequestFilters;\n\tif (supported == null || filters.some(f => !supported.includes(f))) return { unsupported: true };\n\n\treturn { filters: [...new Set(filters)], unsupported: false };\n}\n\n/** Why {@link resolvePullRequestSearchCriteria} refused a criteria set. */\nexport type PullRequestSearchCriteriaRejection =\n\t/** The provider has no filtered pull-request search. */\n\t| { reason: 'unsupported-search' }\n\t/** The provider has one, but cannot express every requested criterion server-side. */\n\t| { reason: 'unsupported-criteria'; criteria: string[] };\n\n/**\n * Validates filtered pull-request search criteria all-or-nothing. Dropping an unsupported criterion would\n * widen the provider query while leaving its page and cursor describing the wider set, so the facade refuses the\n * request before any upstream call instead.\n */\nexport function resolvePullRequestSearchCriteria(\n\tid: IntegrationIds,\n\tcriteria: PullRequestSearchCriteria | undefined,\n): { rejection?: PullRequestSearchCriteriaRejection } {\n\tconst supported = providersMetadata[id]?.supportedPullRequestSearch;\n\tif (supported == null || supported.relationships.length === 0) {\n\t\treturn { rejection: { reason: 'unsupported-search' } };\n\t}\n\tif (criteria == null) return {};\n\n\tconst unsupported: string[] = [];\n\tfor (const relationship of criteria.relationships ?? []) {\n\t\tif (!supported.relationships.includes(relationship)) {\n\t\t\tunsupported.push(`relationships:${relationship}`);\n\t\t}\n\t}\n\tfor (const state of criteria.states ?? []) {\n\t\tif (!supported.states.includes(state)) {\n\t\t\tunsupported.push(`states:${state}`);\n\t\t}\n\t}\n\tif (criteria.text != null && criteria.text.trim().length > 0 && !supported.text) {\n\t\tunsupported.push('text');\n\t}\n\tif (criteria.updatedAfter != null && !supported.updatedAfter) {\n\t\tunsupported.push('updatedAfter');\n\t}\n\tif (criteria.createdAfter != null && !supported.createdAfter) {\n\t\tunsupported.push('createdAfter');\n\t}\n\tif (criteria.includeArchived === true && !supported.includeArchived) {\n\t\tunsupported.push('includeArchived');\n\t}\n\t// `!= null`, not truthy: `draft: false` (only ready-for-review) is as much a request as `draft: true`.\n\tif (criteria.draft != null && !supported.draft) {\n\t\tunsupported.push('draft');\n\t}\n\t// Folded into the same `unsupported-criteria` rejection rather than its own reason, so a caller asking for one\n\t// inexpressible filter and one inexpressible sort learns about both at once. `updated:desc` is always in\n\t// `sorts` for a usable search, so the omitted (default) case never rejects.\n\tif (criteria.sort != null && !supported.sorts.includes(criteria.sort)) {\n\t\tunsupported.push(`sort:${criteria.sort}`);\n\t}\n\tif (criteria.changedSince != null) {\n\t\tunsupported.push(...unsupportedChangedSinceCriteria(criteria, criteria.changedSince, supported.changedSince));\n\t}\n\n\treturn unsupported.length > 0 ? { rejection: { reason: 'unsupported-criteria', criteria: unsupported } } : {};\n}\n\nfunction unsupportedChangedSinceCriteria(\n\tcriteria: PullRequestSearchCriteria,\n\tchangedSince: string,\n\tsupported: boolean,\n): string[] {\n\tif (!supported) return ['changedSince'];\n\n\tconst unsupported: string[] = [];\n\tif (!isValidPullRequestChangedSince(changedSince)) {\n\t\tunsupported.push(`changedSince:${JSON.stringify(changedSince)} (expected YYYY-MM-DDTHH:MM:SSZ)`);\n\t}\n\tfor (const state of criteria.states ?? []) {\n\t\tif (state !== 'all') {\n\t\t\tunsupported.push(`changedSince with states:${state}`);\n\t\t}\n\t}\n\tif (criteria.sort != null && criteria.sort !== 'updated:asc') {\n\t\tunsupported.push(`changedSince with sort:${criteria.sort}`);\n\t}\n\tif (new Set(criteria.relationships).size > 1) {\n\t\tunsupported.push('changedSince with several relationships');\n\t}\n\treturn unsupported;\n}\n\n/** Why a filtered pull-request search's repository/organization boundary was refused. */\nexport type PullRequestSearchScopeRejection =\n\t| { reason: 'unscoped' }\n\t| { reason: 'repo-ids' }\n\t| { reason: 'unsupported-repository-scope' }\n\t| { reason: 'unsupported-organization-scope' }\n\t/** Scope names a query cannot carry AS GIVEN; see {@link unusableSearchScopeNames}. */\n\t| { reason: 'unusable-scope'; scopes: string[] };\n\n/**\n * Validates the search boundary independently from its criteria. A current-user relationship is itself a safe\n * account-wide boundary; without one, a repository or organization scope is mandatory.\n *\n * Scope names go through the same {@link unusableSearchScopeNames} rule the issue search uses — shared rather\n * than re-derived, because the defect is identical on both reads.\n */\nexport function resolvePullRequestSearchScope(\n\tid: IntegrationIds,\n\trepos: ProviderReposInput | undefined,\n\torg: string | undefined,\n\tcriteria: PullRequestSearchCriteria | undefined,\n): { rejection?: PullRequestSearchScopeRejection; repos?: ProviderRepoInput[] } {\n\tconst supported = providersMetadata[id]?.supportedPullRequestSearch;\n\tlet resolvedRepos: ProviderRepoInput[] | undefined;\n\n\tif (repos?.length) {\n\t\tif (repos.some(r => typeof r === 'string' || typeof r === 'number')) {\n\t\t\treturn { rejection: { reason: 'repo-ids' } };\n\t\t}\n\t\tif (supported?.repositoryScope !== true) return { rejection: { reason: 'unsupported-repository-scope' } };\n\n\t\tresolvedRepos = repos as ProviderRepoInput[];\n\t}\n\n\tconst hasOrganizationScope = org != null && org.length > 0;\n\tif (hasOrganizationScope && supported?.organizationScope !== true) {\n\t\treturn { rejection: { reason: 'unsupported-organization-scope' } };\n\t}\n\n\t// After the capability checks and before the \"is it scoped at all\" rule: a scope the provider cannot express\n\t// at all is the more fundamental refusal, and an unusable value that WAS supplied must not be reported as a\n\t// missing one. `org` is passed bare, matching the issue twin — the helper applies its own empty-means-\n\t// unsupplied guard, so re-testing `hasOrganizationScope` here would only make the two resolvers look like\n\t// they differ.\n\tconst unusable = unusableSearchScopeNames(id, org, resolvedRepos);\n\tif (unusable.length > 0) return { rejection: { reason: 'unusable-scope', scopes: unusable } };\n\n\tif (resolvedRepos != null || hasOrganizationScope || (criteria?.relationships?.length ?? 0) > 0) {\n\t\treturn { repos: resolvedRepos };\n\t}\n\n\treturn { rejection: { reason: 'unscoped' } };\n}\n\n/**\n * Validates a caller-provided issue filter set against what the provider's ACCOUNT-WIDE issue read can express\n * server-side (`ProviderMetadata.supportedAccountWideIssueFilters`), which is a different — usually narrower —\n * set than the repo-scoped `ProviderMetadata.supportedIssueFilters`.\n *\n * Dropping the unexpressible members would silently widen the read back toward the provider's own union\n * (authored ∪ assigned ∪ mentioned for GitHub), which is the opposite of what a caller narrowing to\n * `[Assignee]` asked for.\n */\nexport function resolveAccountWideIssueFilters(\n\tid: IntegrationIds,\n\tfilters: IssueFilter[] | undefined,\n): ResolvedFilters<IssueFilter> {\n\tif (filters == null || filters.length === 0) return { unsupported: false };\n\n\tconst supported = providersMetadata[id]?.supportedAccountWideIssueFilters;\n\tif (supported == null || filters.some(f => !supported.includes(f))) return { unsupported: true };\n\n\treturn { filters: filters, unsupported: false };\n}\n\n/** Why {@link resolveIssueSearchCriteria} refused a criteria set, so the caller can word the refusal exactly. */\nexport type IssueSearchCriteriaRejection =\n\t/** The provider has no filtered issue search at all. */\n\t| { reason: 'unsupported-search' }\n\t/** The provider has one, but can't express these criteria server-side. */\n\t| { reason: 'unsupported-criteria'; criteria: string[] }\n\t/** `any-assignee` and `unassigned` partition the scope between them; asking for both asks for nothing. */\n\t| { reason: 'contradictory-relationships' };\n\n/**\n * Whether a provider exposes the FILTERED issue search at all — the one predicate a caller can check BEFORE\n * building criteria, so a read that would only be refused is never issued.\n *\n * The same test {@link resolveIssueSearchCriteria} makes for its `unsupported-search` rejection, named rather\n * than re-derived at each call site: a caller writing `supportedIssueSearch != null` itself is a copy free to\n * disagree with the validator about what \"has a search\" means. `broadenIssues` reads it to pick its engine —\n * the org-scoped search where there is one, the repository drain where there isn't — which is a CHOICE rather\n * than a refusal, so it needs the predicate without the rejection.\n */\nexport function supportsFilteredIssueSearch(id: IntegrationIds): boolean {\n\treturn providersMetadata[id]?.supportedIssueSearch != null;\n}\n\n/**\n * Validates a filtered issue search's criteria against {@link ProviderMetadata.supportedIssueSearch}.\n *\n * All-or-nothing like its three siblings above, and for the same reason: a criterion dropped because the\n * provider can't express it would serve a WIDER result than was asked for, and narrowing the returned page\n * afterward would leave `items` describing a different result set than the `hasMore`/`cursor` the provider\n * produced with it. So an inexpressible set is refused whole and the caller surfaces a warning.\n *\n * Unlike the sibling validators this also rejects a set that is internally contradictory, because this criteria\n * model is the only one with two members that partition the scope between them (`any-assignee` ∪ `unassigned` =\n * everything, ∩ = nothing). Silently keeping one would answer a question the caller didn't ask.\n *\n * `undefined` (or an empty relationship list plus no other criterion) is a valid UNNARROWED search of the given\n * scope, not an error — the caller's `repos`/`org` is what bounds it.\n */\nexport function resolveIssueSearchCriteria(\n\tid: IntegrationIds,\n\tcriteria: IssueSearchCriteria | undefined,\n): { rejection?: IssueSearchCriteriaRejection } {\n\tconst supported = providersMetadata[id]?.supportedIssueSearch;\n\tif (supported == null) return { rejection: { reason: 'unsupported-search' } };\n\tif (criteria == null) return {};\n\n\tconst relationships = criteria.relationships;\n\tif (relationships?.includes('any-assignee') && relationships.includes('unassigned')) {\n\t\treturn { rejection: { reason: 'contradictory-relationships' } };\n\t}\n\n\tconst unsupported: string[] = [];\n\tfor (const relationship of relationships ?? []) {\n\t\tif (!supported.relationships.includes(relationship)) {\n\t\t\tunsupported.push(`relationships:${relationship}`);\n\t\t}\n\t}\n\t// Only a criterion the caller actually SET can be unsupported. `false`/empty means \"don't narrow on this\",\n\t// which every provider can honor by doing nothing, so it must not be validated as a request.\n\tif (criteria.text != null && criteria.text.trim().length > 0 && !supported.text) {\n\t\tunsupported.push('text');\n\t}\n\tif (criteria.labels?.length && !supported.labels) {\n\t\tunsupported.push('labels');\n\t}\n\tif (criteria.milestone != null && !supported.milestone) {\n\t\tunsupported.push('milestone');\n\t}\n\tif (criteria.updatedAfter != null && !supported.updatedAfter) {\n\t\tunsupported.push('updatedAfter');\n\t}\n\tif (criteria.createdAfter != null && !supported.createdAfter) {\n\t\tunsupported.push('createdAfter');\n\t}\n\tif (criteria.withoutLinkedPullRequest === true && !supported.withoutLinkedPullRequest) {\n\t\tunsupported.push('withoutLinkedPullRequest');\n\t}\n\t// `'open'` is every provider's own default, so asking for it needs no state capability.\n\tif (criteria.state != null && criteria.state !== 'open' && !supported.states) {\n\t\tunsupported.push('state');\n\t}\n\t// Folded into the same `unsupported-criteria` rejection rather than given its own reason, so a caller asking\n\t// for one inexpressible filter and one inexpressible sort learns about both at once instead of fixing them one\n\t// refusal at a time. The `sorts` list is `supported`'s own, so this needs no branch on which surface it is.\n\tif (criteria.sort != null && !supported.sorts.includes(criteria.sort)) {\n\t\tunsupported.push(`sort:${criteria.sort}`);\n\t}\n\n\tif (unsupported.length > 0) return { rejection: { reason: 'unsupported-criteria', criteria: unsupported } };\n\n\treturn {};\n}\n\n/**\n * The relationships that bound a filtered issue search to the CURRENT USER, and so can stand in for a\n * repository/org scope.\n *\n * Derived from the union rather than spelled out per call site, because the distinction it encodes is the whole\n * reason the scope rule exists: `any-assignee` and `unassigned` are deliberately absent — they describe the\n * ISSUE, not the caller, so neither reduces the search to anyone's own world (measured: unscoped `no:assignee`\n * matches ~45 million issues on GitHub).\n */\nconst userScopingIssueSearchRelationships: readonly IssueSearchRelationship[] = ['authored', 'assigned', 'mentioned'];\n\n/** What a provider with NO filtered issue search reports: nothing expressible, spelled out rather than absent. */\nconst unsupportedIssueSearchCapabilities: IssueSearchCapabilities = {\n\trelationships: [],\n\ttext: false,\n\tlabels: false,\n\tmilestone: false,\n\tupdatedAfter: false,\n\tcreatedAfter: false,\n\twithoutLinkedPullRequest: false,\n\tstates: false,\n\tsorts: [],\n};\n\n/** What a provider with no filtered pull-request search reports. */\nconst unsupportedPullRequestSearchCapabilities: PullRequestSearchCapabilities = {\n\trelationships: [],\n\tstates: [],\n\ttext: false,\n\tupdatedAfter: false,\n\tcreatedAfter: false,\n\tincludeArchived: false,\n\tdraft: false,\n\trepositoryScope: false,\n\torganizationScope: false,\n\tsorts: [],\n\tchangedSince: false,\n};\n\n/** Why a filtered issue search's scope was refused, or `undefined` when it is usable. */\nexport type IssueSearchScopeRejection =\n\t/** No repositories, no org, and no user-relative relationship: a search of the whole host. */\n\t| { reason: 'unscoped' }\n\t/** Repositories given as ids. A search names repositories by PATH, so ids can't express a scope. */\n\t| { reason: 'repo-ids' }\n\t/** Scope names a query cannot carry AS GIVEN; see {@link unusableSearchScopeNames}. */\n\t| { reason: 'unusable-scope'; scopes: string[] };\n\n/**\n * Whether a scope name reaches the provider NAMING THE SAME SCOPE — the one rule behind every `unusable-scope`\n * refusal, and the canonical home for its reasoning: the call sites point here rather than restating it.\n *\n * The defect it exists to prevent: the boundary is checked against the value AS SUPPLIED while the request is\n * built from the value AFTER the provider sanitizes it, so a name a query cannot spell produces a read that is no\n * longer the read that was authorized. Three outcomes, all of which LOOK LIKE SUCCESS, so there is nothing for a\n * consumer to branch on:\n * - **emptied** — a value of only quotes/whitespace/control characters emits no scope qualifier at all. A scope is\n * also what makes a relationship-less read legal, so the request carries neither and every item on the host\n * matches: measured at 52 million issues across unrelated accounts.\n * - **altered** — a quote inside a real name sanitizes to a real but DIFFERENT scope (`git\"kraken` -> `gitkraken`),\n * whose answer looks entirely normal.\n * - **split** — whitespace delimits qualifiers, so `my org` emits `org:my org`: a search of `my` additionally\n * filtered by the free text `org`. Measured against the live API this is a wrong NARROWING rather than a\n * widening — `org:gitkraken bar` returns 12 where `org:gitkraken` returns 379.\n *\n * Refusing beats sanitizing, and the count probes are why it matters most: they deliberately apply exactly the\n * qualifiers their search would, so a sanitized scope makes the count AGREE with the wrong search rather than\n * disagree with it, and a consumer cross-checking \"N matched\" cannot detect it by construction. Nor can it\n * pre-empt the rule — the free-text sanitizing rules are published precisely so a caller can mirror them, the\n * scope rules are not — so only the caller knows which scope it meant, and the refusal goes back to it NAMING the\n * offending value.\n *\n * Provider-NEUTRAL by design, and deliberately not an import of GitHub's `sanitizeGitHubQualifierValue`: this\n * module validates for every provider, and a GitHub-specific rule reaching in here would be wrong for the next\n * one that declares a search. The character class below is stated as the common part of any query language,\n * because each class breaks a query on its own terms — a quote closes its own qualifier, a control character\n * cannot appear at all, whitespace delimits the next qualifier.\n *\n * A provider that never puts a scope name into a query string declares\n * {@link ProviderMetadata.exactSearchScopeNames}, and only blank names and control characters are refused for it:\n * Azure DevOps Server addresses a collection or repository as an encoded URL segment and matches a project against\n * the names discovery reported, so a space or a quote reaches it naming the same scope — and its names legitimately\n * contain both.\n *\n * EDGES ARE STRIPPED before the test, which is what keeps the predicate no stricter than the provider's own\n * sanitizing — the invariant that makes refusing safe to add, since it means this can only reject a name the\n * provider would have altered, never one it would have resolved correctly. Leading and trailing whitespace AND\n * control characters both qualify: a sanitizer maps a control character to a space, then collapses and trims, so\n * `'gitkraken\\n'` and `'gitkraken\\u0000'` alike emit `org:gitkraken` — the scope that was asked for. Note this\n * is wider than `String.trim()`, which leaves control characters in place.\n *\n * None of the three outcomes above survives the stripping, so the rule loses nothing: an all-edge value still\n * empties, an INNER space or control character still splits (`'git\\u0000kraken'` emits `git kraken`, two\n * tokens), and a quote still alters wherever it sits.\n */\nfunction isUsableSearchScopeName(id: IntegrationIds, name: string): boolean {\n\tconst stripped = stripSearchScopeEdges(name);\n\tif (providersMetadata[id]?.exactSearchScopeNames === true) {\n\t\t// eslint-disable-next-line no-control-regex\n\t\treturn stripped.length > 0 && !/[\\u0000-\\u001f\\u007f]/.test(stripped);\n\t}\n\n\t// eslint-disable-next-line no-control-regex\n\treturn stripped.length > 0 && !/[\"\\u0000-\\u001f\\u007f\\s]/.test(stripped);\n}\n\n/** The leading/trailing run a provider's sanitizing removes — see {@link isUsableSearchScopeName}. */\nfunction stripSearchScopeEdges(value: string): string {\n\t// eslint-disable-next-line no-control-regex\n\treturn value.replace(/^[\\s\\u0000-\\u001f\\u007f]+|[\\s\\u0000-\\u001f\\u007f]+$/g, '');\n}\n\n/**\n * The scope names a search cannot carry as given, as the strings to name in the refusal — empty when every one is\n * usable. See {@link isUsableSearchScopeName} for the rule and why it refuses rather than sanitizes.\n */\nfunction unusableSearchScopeNames(\n\tid: IntegrationIds,\n\torg: string | undefined,\n\trepos: readonly ProviderRepoInput[] | undefined,\n): string[] {\n\tconst unusable: string[] = [];\n\n\t// An EMPTY org is \"no org supplied\" and falls through to the remaining scopes; any other unusable value WAS\n\t// supplied, so it is refused rather than dropped.\n\tif (org != null && org.length > 0 && !isUsableSearchScopeName(id, org)) {\n\t\tunusable.push(org);\n\t}\n\n\t// A `repo:` qualifier names a repository by its JOINED `namespace/name` path, which is the value the rule\n\t// below is applied to. Both halves are read defensively, through the SAME locals the label is built from: the\n\t// descriptor form is only narrowed from a union by an element-type check, so a half-built descriptor reaches\n\t// here as `undefined` and must refuse rather than throw out of a facade that reports refusals as warnings —\n\t// and reporting it as `undefined/a` would name a value the caller never passed.\n\tfor (const repo of repos ?? []) {\n\t\tconst namespace = repo.namespace ?? '';\n\t\tconst name = repo.name ?? '';\n\t\tconst path = `${namespace}/${name}`;\n\t\t// BOTH the composite and each half, because neither sees what the other does:\n\t\t// - the composite catches an offender the halves cannot, since an edge of a half is an INTERIOR character\n\t\t// of the path — `{ 'git ', 'kraken' }` has two usable-looking halves and emits `repo:git /kraken`.\n\t\t// - the halves catch a BLANK one the composite cannot, since that offender sits at a composite EDGE where\n\t\t// stripping removes it — `' /a'` strips to `'/a'`, a perfectly spellable qualifier naming no repository.\n\t\t// Each half is measured after the same stripping, so `' '` and `''` are one case rather than two.\n\t\tif (\n\t\t\t!isUsableSearchScopeName(id, path) ||\n\t\t\tstripSearchScopeEdges(namespace).length === 0 ||\n\t\t\tstripSearchScopeEdges(name).length === 0\n\t\t) {\n\t\t\tunusable.push(path);\n\t\t}\n\t}\n\n\treturn unusable;\n}\n\n/**\n * Validates that a filtered issue search is scoped at all, and narrows `repos` to the descriptor form the\n * provider query needs.\n *\n * Shared by `searchIssuesPage` and `countIssues` because a count computed under different constraints than the\n * read it previews is a WRONG number rather than a missing one. The rejection is returned as a reason code, not a\n * warning: the two callers word it differently (whole-read vs naming the offending scope's key), and wording is\n * the warning layer's business.\n *\n * `repo-ids` and `unscoped` are mutually exclusive — one requires repositories and the other requires none — so\n * their relative order is free. `unusable-scope` is NOT: it must precede `unscoped`, so a value that was supplied\n * but cannot be used is never reported as a missing one.\n *\n * Every scope name is checked for naming the same scope after the provider sanitizes it, not merely for being\n * non-empty, and that distinction is a SECURITY one rather than a nicety — see {@link isUsableSearchScopeName}.\n */\nexport function resolveIssueSearchScope(\n\tid: IntegrationIds,\n\trepos: ProviderReposInput | undefined,\n\torg: string | undefined,\n\tcriteria: IssueSearchCriteria | undefined,\n): { rejection?: IssueSearchScopeRejection; repos?: ProviderRepoInput[] } {\n\tlet resolvedRepos: ProviderRepoInput[] | undefined;\n\n\tif (repos?.length) {\n\t\t// `ProviderReposInput` is a union of descriptor and id arrays; only the descriptor form is usable here.\n\t\tif (repos.some(r => typeof r === 'string' || typeof r === 'number')) {\n\t\t\treturn { rejection: { reason: 'repo-ids' } };\n\t\t}\n\n\t\tresolvedRepos = repos as ProviderRepoInput[];\n\t}\n\n\t// Checked BEFORE the \"is it scoped at all\" rule below, so an unusable value is never reported as a missing\n\t// one: it was supplied, and telling the caller to pass a scope it already passed names the wrong defect.\n\tconst unusable = unusableSearchScopeNames(id, org, resolvedRepos);\n\tif (unusable.length > 0) return { rejection: { reason: 'unusable-scope', scopes: unusable } };\n\n\tif (resolvedRepos != null) return { repos: resolvedRepos };\n\tif (org != null && org.length > 0) return {};\n\tif (criteria?.relationships?.some(r => userScopingIssueSearchRelationships.includes(r)) === true) return {};\n\n\treturn { rejection: { reason: 'unscoped' } };\n}\n\n/**\n * The filters `listPullRequestsPage`/`listIssuesPage` (and the sweeps) accept for a provider, so a caller can\n * narrow to what the provider can express BEFORE issuing the read.\n *\n * This matters because the filter contract is all-or-nothing: a set containing even one unsupported filter is\n * refused outright ({@link resolvePullRequestFilters}) rather than silently narrowed, since falling through to\n * an unfiltered fetch would return every PR instead of the user's. Without this accessor a consumer had to\n * hardcode its own copy of the table — reachable only by importing the internal `providers/models.js`\n * subpath — and a copy that drifts turns a supported read into an empty page with `fetchFailed`.\n *\n * Empty means \"no filter of that kind is expressible\": either the provider has no such surface (issue trackers\n * have no pull requests; Bitbucket exposes no issues) or its metadata declares none. Callers should treat it as\n * \"don't pass filters\", not as an error. Returns copies, so mutating the result can't corrupt the metadata.\n *\n * `issues` and `issuesAccountWide` are separate because the repo-scoped and account-wide issue reads are\n * different provider queries with different filter surfaces, and the same `filters` input is validated against\n * whichever one the read uses (`repos` present or not). `issuesAccountWide` is generally the narrower of the\n * two: GitLab, for instance, can express `Assignee` and `Author` account-wide, but not `Mention`.\n *\n * That split describes the GIT-HOST reads only. An issue tracker (Jira/Linear/Trello) has neither — its issues\n * live under resource → project — so it reports its filters under `issues`, which is what\n * {@link IntegrationService.listIssueTrackerIssuesPage} validates against, and leaves `issuesAccountWide`\n * empty. Reading a tracker's capability off `issuesAccountWide` therefore under-reports it.\n *\n * `issueSearch` is a third, wider surface: the FILTERED issue search (`searchIssuesPage`, and the `countIssues`\n * probe over the same criteria), which is not bound to the user at all. It is a record of per-criterion flags\n * rather than a list, because its criteria aren't a single kind. An empty `relationships` means the provider has\n * no filtered issue search — hide the surface, not just its chips.\n *\n * `pullRequestSearch` describes the separate filtered PR search. Its table declares each criteria vocabulary\n * plus repository/organization scope support; an empty relationship list means the search itself is absent.\n *\n * `issueSorts` / `issueSortsAccountWide` / `issueSearch.sorts` are the ORDERING vocabulary of those same three\n * issue reads, split the same way and for the same reason (GitLab's repo-scoped read is GraphQL and its\n * account-wide read is REST, with genuinely different sort vocabularies). Empty means the read can't be ordered,\n * so pass no `sort`; a key not listed refuses the whole read exactly like an inexpressible filter. Note a key\n * listed here is expressible on ONE provider query: a read that fans out across projects can only honor a key\n * derivable from a normalized issue, so it refuses `priority`/`dueDate`/`resolved` on top of this table.\n *\n * Note this is a CAPABILITY table — \"what the provider can express\" — not a recommendation. A consumer\n * matching another tool's behavior may deliberately pass fewer filters than are listed here (or none, where an\n * already-scoped read would only be narrowed by them). Intersecting against this table is what keeps a\n * filtered read from being refused; it isn't a directive to use every filter in it.\n */\nexport function getSupportedFilters(providerId: IntegrationIds): SupportedFilters {\n\tconst metadata = providersMetadata[providerId];\n\tconst issueSearch = metadata?.supportedIssueSearch;\n\tconst pullRequestSearch = metadata?.supportedPullRequestSearch;\n\treturn {\n\t\tpullRequests: [...(metadata?.supportedPullRequestFilters ?? [])],\n\t\tpullRequestsAccountWide: [...(metadata?.supportedAccountWidePullRequestFilters ?? [])],\n\t\tpullRequestSearch: {\n\t\t\t...unsupportedPullRequestSearchCapabilities,\n\t\t\t...pullRequestSearch,\n\t\t\trelationships: [...(pullRequestSearch?.relationships ?? [])],\n\t\t\tstates: [...(pullRequestSearch?.states ?? [])],\n\t\t\t// Copied, so mutating the result can't corrupt the metadata table.\n\t\t\tsorts: [...(pullRequestSearch?.sorts ?? [])],\n\t\t},\n\t\tissues: [...(metadata?.supportedIssueFilters ?? [])],\n\t\tissuesAccountWide: [...(metadata?.supportedAccountWideIssueFilters ?? [])],\n\t\t// Always an object, never `undefined`: a provider WITHOUT a filtered issue search reports one whose\n\t\t// `relationships` is empty and whose flags are all false, so a consumer reads capabilities the same way\n\t\t// for every provider (and an empty `relationships` is the signal to hide the surface itself).\n\t\t//\n\t\t// Spread over the all-false baseline rather than defaulting each flag: a criterion added to\n\t\t// `IssueSearchCapabilities` then can't be forgotten here and silently reported as `undefined` (which a\n\t\t// consumer's `if (caps.x)` would read as unsupported — right answer, wrong reason, and untyped).\n\t\t// `supportedIssueSearch` is typed as the complete shape, so no member can arrive as an explicit undefined.\n\t\tissueSearch: {\n\t\t\t...unsupportedIssueSearchCapabilities,\n\t\t\t...issueSearch,\n\t\t\t// Copied, so mutating the result can't corrupt the metadata table.\n\t\t\trelationships: [...(issueSearch?.relationships ?? [])],\n\t\t\tsorts: [...(issueSearch?.sorts ?? [])],\n\t\t},\n\t\tissueSorts: [...(metadata?.supportedIssueSorts ?? [])],\n\t\tissueSortsAccountWide: [...(metadata?.supportedAccountWideIssueSorts ?? [])],\n\t\tissueStates: metadata?.supportsIssueStates === true,\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;AA2CA,SAAgB,0BACf,IACA,SACqC;CACrC,IAAI,WAAW,QAAQ,QAAQ,WAAW,GAAG,OAAO,EAAE,aAAa,MAAM;CAEzE,MAAM,YAAY,kBAAkB,GAAG,EAAE;CACzC,IAAI,aAAa,QAAQ,QAAQ,MAAK,MAAK,CAAC,UAAU,SAAS,CAAC,CAAC,GAAG,OAAO,EAAE,aAAa,KAAK;CAE/F,OAAO;EAAW;EAAS,aAAa;CAAM;AAC/C;;;;;AAMA,SAAgB,qCACf,IACA,SACqC;CACrC,IAAI,WAAW,QAAQ,QAAQ,WAAW,GAAG,OAAO,EAAE,aAAa,MAAM;CAEzE,MAAM,YAAY,kBAAkB,GAAG,EAAE;CACzC,IAAI,aAAa,QAAQ,QAAQ,MAAK,MAAK,CAAC,UAAU,SAAS,CAAC,CAAC,GAAG,OAAO,EAAE,aAAa,KAAK;CAE/F,OAAO;EAAE,SAAS,CAAC,GAAG,IAAI,IAAI,OAAO,CAAC;EAAG,aAAa;CAAM;AAC7D;;;;;;AAcA,SAAgB,iCACf,IACA,UACqD;CACrD,MAAM,YAAY,kBAAkB,GAAG,EAAE;CACzC,IAAI,aAAa,QAAQ,UAAU,cAAc,WAAW,GAC3D,OAAO,EAAE,WAAW,EAAE,QAAQ,qBAAqB,EAAE;CAEtD,IAAI,YAAY,MAAM,OAAO,CAAC;CAE9B,MAAM,cAAwB,CAAC;CAC/B,KAAK,MAAM,gBAAgB,SAAS,iBAAiB,CAAC,GACrD,IAAI,CAAC,UAAU,cAAc,SAAS,YAAY,GACjD,YAAY,KAAK,iBAAiB,cAAc;CAGlD,KAAK,MAAM,SAAS,SAAS,UAAU,CAAC,GACvC,IAAI,CAAC,UAAU,OA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Aa,SAAS,CAAC,CAAE;EACtC;EACA,YAAY,CAAC,GAAI,UAAU,uBAAuB,CAAC,CAAE;EACrD,uBAAuB,CAAC,GAAI,UAAU,kCAAkC,CAAC,CAAE;EAC3E,aAAa,UAAU,wBAAwB;CAChD;AACD"}
@@ -1,8 +1,8 @@
1
1
  import { githubGraphQLInt32Max, isAzureProviderId, isGitHubProviderId } from "../providers/providerErrors.js";
2
2
  import { isIssuesHostIntegrationId } from "../utils/integration.utils.js";
3
- import { findInvalidPullRequestEtagInclude, normalizePullRequestEtagIncludes, pullRequestEtag, pullRequestEtagFieldsFromShape, pullRequestEtagIncludes } from "./etag.js";
3
+ import { findInvalidPullRequestEtagInclude, normalizePullRequestEtagIncludes, pullRequestEtag, pullRequestEtagFieldsFromShape } from "./etag.js";
4
4
  import { isGitHostIntegration } from "../models/publicIntegration.js";
5
- import { gitHostOnlySurfaceWarning, otherWarning, unsupportedWarning } from "./warnings.js";
5
+ import { gitHostOnlySurfaceWarning, otherWarning, unknownPullRequestEtagIncludeWarning, unsupportedWarning } from "./warnings.js";
6
6
  import { getCurrentAccountIdentity, runCaptured } from "./drains.js";
7
7
  import { readEtaggedBatch } from "./batchEtags.js";
8
8
  import { findDuplicateKey, trimCoordinateFields, unresolvedIntegration } from "./issueBatch.js";
@@ -42,7 +42,7 @@ async function getPullRequestsBatch(ctx, options) {
42
42
  const duplicateKey = findDuplicateKey(options.targets);
43
43
  if (duplicateKey != null) return refused(otherWarning(options.providerId, void 0, options.connectionId, `Duplicate pull request batch target key '${duplicateKey}'; keys identify results, so each must be unique.`));
44
44
  const invalidInclude = findInvalidPullRequestEtagInclude(options.etagIncludes ?? []);
45
- if (invalidInclude != null) return refused(otherWarning(options.providerId, void 0, options.connectionId, `Unknown pull request etag include '${invalidInclude}'; expected one of ${pullRequestEtagIncludes.map((i) => `'${i}'`).join(", ")}.`));
45
+ if (invalidInclude != null) return refused(unknownPullRequestEtagIncludeWarning(options.providerId, void 0, options.connectionId, invalidInclude));
46
46
  const targets = options.targets.map(trimCoordinateFields);
47
47
  const invalid = findInvalidTarget(options.providerId, targets);
48
48
  if (invalid != null) return refused(otherWarning(options.providerId, void 0, options.connectionId, invalid));