@gitkraken/core-gitlens 0.23.0 → 0.25.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 (152) hide show
  1. package/CHANGELOG.md +34 -1
  2. package/README.md +23 -15
  3. package/dist/git/errors.d.ts +6 -5
  4. package/dist/git/errors.js +7 -6
  5. package/dist/git/errors.js.map +1 -1
  6. package/dist/git/features.d.ts +1 -1
  7. package/dist/git/features.js +1 -1
  8. package/dist/git/features.js.map +1 -1
  9. package/dist/git/models/remoteProvider.d.ts +4 -1
  10. package/dist/git/models/remoteProvider.js.map +1 -1
  11. package/dist/git/providers/provider.d.ts +4 -2
  12. package/dist/git/utils/branch.utils.d.ts +4 -1
  13. package/dist/git/utils/branch.utils.js +5 -2
  14. package/dist/git/utils/branch.utils.js.map +1 -1
  15. package/dist/git/utils/mergeConflicts.utils.js +2 -2
  16. package/dist/git/utils/mergeConflicts.utils.js.map +1 -1
  17. package/dist/git-cli/cliGitProvider.d.ts +14 -3
  18. package/dist/git-cli/cliGitProvider.js +71 -34
  19. package/dist/git-cli/cliGitProvider.js.map +1 -1
  20. package/dist/git-cli/exec/git.d.ts +7 -1
  21. package/dist/git-cli/exec/git.js +19 -4
  22. package/dist/git-cli/exec/git.js.map +1 -1
  23. package/dist/git-cli/providers/branchRemote.js +2 -5
  24. package/dist/git-cli/providers/branchRemote.js.map +1 -1
  25. package/dist/git-cli/providers/branches.js +4 -4
  26. package/dist/git-cli/providers/branches.js.map +1 -1
  27. package/dist/git-cli/providers/config.js +6 -3
  28. package/dist/git-cli/providers/config.js.map +1 -1
  29. package/dist/git-cli/providers/pausedOperations.js +2 -2
  30. package/dist/git-cli/providers/pausedOperations.js.map +1 -1
  31. package/dist/git-cli/providers/staging.js +1 -1
  32. package/dist/ipc/discovery.js +1 -1
  33. package/dist/plus/agents/providers/claudeCodeTranscript.js +6 -6
  34. package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
  35. package/dist/plus/ai/errors.d.ts +4 -1
  36. package/dist/plus/ai/errors.js +4 -0
  37. package/dist/plus/ai/errors.js.map +1 -1
  38. package/dist/plus/ai/providers/mistralProvider.js +1 -1
  39. package/dist/plus/ai/providers/mistralProvider.js.map +1 -1
  40. package/dist/plus/ai/providers/openAICompatibleProviderBase.js +2 -1
  41. package/dist/plus/ai/providers/openAICompatibleProviderBase.js.map +1 -1
  42. package/dist/plus/git-github/api/github.js +12 -13
  43. package/dist/plus/git-github/api/github.js.map +1 -1
  44. package/dist/plus/git-github/api/token.d.ts +2 -0
  45. package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts +1 -1
  46. package/dist/plus/integrations/authentication/cloudIntegrationService.js +6 -1
  47. package/dist/plus/integrations/authentication/cloudIntegrationService.js.map +1 -1
  48. package/dist/plus/integrations/authentication/configuredIntegrationService.js +2 -2
  49. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js +18 -5
  50. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js.map +1 -1
  51. package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts +3 -1
  52. package/dist/plus/integrations/authentication/integrationAuthenticationService.js +4 -0
  53. package/dist/plus/integrations/authentication/integrationAuthenticationService.js.map +1 -1
  54. package/dist/plus/integrations/authentication/models.d.ts +2 -0
  55. package/dist/plus/integrations/authentication/models.js +2 -1
  56. package/dist/plus/integrations/authentication/models.js.map +1 -1
  57. package/dist/plus/integrations/authentication/observedAuthenticationProvider.js +1 -1
  58. package/dist/plus/integrations/authentication/rejectedTokenTracker.d.ts +5 -4
  59. package/dist/plus/integrations/authentication/rejectedTokenTracker.js +5 -4
  60. package/dist/plus/integrations/authentication/rejectedTokenTracker.js.map +1 -1
  61. package/dist/plus/integrations/index.d.ts +2 -2
  62. package/dist/plus/integrations/index.js +1 -1
  63. package/dist/plus/integrations/index.js.map +1 -1
  64. package/dist/plus/integrations/integrationService.d.ts +6 -0
  65. package/dist/plus/integrations/integrationService.js +3 -3
  66. package/dist/plus/integrations/integrationService.js.map +1 -1
  67. package/dist/plus/integrations/lite.js +1 -1
  68. package/dist/plus/integrations/manager.d.ts +51 -3
  69. package/dist/plus/integrations/models/gitHostIntegration.d.ts +14 -0
  70. package/dist/plus/integrations/models/gitHostIntegration.js +50 -41
  71. package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
  72. package/dist/plus/integrations/models/integration.d.ts +27 -5
  73. package/dist/plus/integrations/models/integration.js +57 -15
  74. package/dist/plus/integrations/models/integration.js.map +1 -1
  75. package/dist/plus/integrations/models/issueReads.d.ts +6 -0
  76. package/dist/plus/integrations/models/issuesIntegration.js +11 -11
  77. package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
  78. package/dist/plus/integrations/providers/azure/azure.js +2 -2
  79. package/dist/plus/integrations/providers/azureDevOps.js +1 -1
  80. package/dist/plus/integrations/providers/azureDevOpsServer.js +1 -1
  81. package/dist/plus/integrations/providers/bitbucket/bitbucket.js +1 -1
  82. package/dist/plus/integrations/providers/bitbucket/bitbucket.js.map +1 -1
  83. package/dist/plus/integrations/providers/bitbucket-server.js +1 -1
  84. package/dist/plus/integrations/providers/bitbucket.js +1 -1
  85. package/dist/plus/integrations/providers/github.js +1 -1
  86. package/dist/plus/integrations/providers/gitlab/gitlab.js +2 -2
  87. package/dist/plus/integrations/providers/gitlab/gitlab.js.map +1 -1
  88. package/dist/plus/integrations/providers/gitlab.js +1 -1
  89. package/dist/plus/integrations/providers/jira-server.js +2 -2
  90. package/dist/plus/integrations/providers/jira.js +1 -1
  91. package/dist/plus/integrations/providers/linear.d.ts +4 -4
  92. package/dist/plus/integrations/providers/linear.js +26 -9
  93. package/dist/plus/integrations/providers/linear.js.map +1 -1
  94. package/dist/plus/integrations/providers/models.js +2 -1
  95. package/dist/plus/integrations/providers/models.js.map +1 -1
  96. package/dist/plus/integrations/providers/providerErrors.js +9 -0
  97. package/dist/plus/integrations/providers/providerErrors.js.map +1 -1
  98. package/dist/plus/integrations/providers/providersApi.d.ts +2 -0
  99. package/dist/plus/integrations/providers/providersApi.js +1 -1
  100. package/dist/plus/integrations/providers/providersApi.js.map +1 -1
  101. package/dist/plus/integrations/providers/trello.js +1 -1
  102. package/dist/plus/integrations/providers/utils.js +1 -1
  103. package/dist/plus/integrations/reads/counts.js +1 -1
  104. package/dist/plus/integrations/reads/cursors.js +1 -1
  105. package/dist/plus/integrations/reads/drains.d.ts +5 -4
  106. package/dist/plus/integrations/reads/drains.js +28 -8
  107. package/dist/plus/integrations/reads/drains.js.map +1 -1
  108. package/dist/plus/integrations/reads/hierarchy.js +1 -1
  109. package/dist/plus/integrations/reads/issueBatch.d.ts +1 -1
  110. package/dist/plus/integrations/reads/issueBatch.js.map +1 -1
  111. package/dist/plus/integrations/reads/issueTracker.d.ts +4 -1
  112. package/dist/plus/integrations/reads/issueTracker.js +1 -1
  113. package/dist/plus/integrations/reads/issueTracker.js.map +1 -1
  114. package/dist/plus/integrations/reads/issues.d.ts +2 -0
  115. package/dist/plus/integrations/reads/issues.js +5 -3
  116. package/dist/plus/integrations/reads/issues.js.map +1 -1
  117. package/dist/plus/integrations/reads/paging.d.ts +5 -6
  118. package/dist/plus/integrations/reads/paging.js +5 -6
  119. package/dist/plus/integrations/reads/paging.js.map +1 -1
  120. package/dist/plus/integrations/reads/pullRequests.d.ts +4 -0
  121. package/dist/plus/integrations/reads/pullRequests.js +4 -2
  122. package/dist/plus/integrations/reads/pullRequests.js.map +1 -1
  123. package/dist/plus/integrations/reads/resolveRepository.js +1 -1
  124. package/dist/plus/integrations/reads/sweeps.js +42 -10
  125. package/dist/plus/integrations/reads/sweeps.js.map +1 -1
  126. package/dist/plus/integrations/results.d.ts +23 -3
  127. package/dist/plus/integrations/results.js.map +1 -1
  128. package/dist/plus/notifications/api.d.ts +20 -0
  129. package/dist/plus/notifications/api.js +89 -0
  130. package/dist/plus/notifications/api.js.map +1 -0
  131. package/dist/plus/notifications/context.d.ts +28 -0
  132. package/dist/plus/notifications/context.js +0 -0
  133. package/dist/plus/notifications/errors.d.ts +13 -0
  134. package/dist/plus/notifications/errors.js +22 -0
  135. package/dist/plus/notifications/errors.js.map +1 -0
  136. package/dist/plus/notifications/models.d.ts +94 -0
  137. package/dist/plus/notifications/models.js +0 -0
  138. package/dist/plus/notifications/notificationsService.d.ts +115 -0
  139. package/dist/plus/notifications/notificationsService.js +381 -0
  140. package/dist/plus/notifications/notificationsService.js.map +1 -0
  141. package/dist/plus/notifications/parse.d.ts +12 -0
  142. package/dist/plus/notifications/parse.js +152 -0
  143. package/dist/plus/notifications/parse.js.map +1 -0
  144. package/dist/plus/notifications/presentation.d.ts +28 -0
  145. package/dist/plus/notifications/presentation.js +55 -0
  146. package/dist/plus/notifications/presentation.js.map +1 -0
  147. package/dist/utils/env/node/exec.d.ts +10 -1
  148. package/dist/utils/env/node/exec.js +41 -4
  149. package/dist/utils/env/node/exec.js.map +1 -1
  150. package/docs/integrations.md +25 -3
  151. package/docs/notifications.md +239 -0
  152. package/package.json +22 -2
@@ -2,9 +2,9 @@ import { CacheController } from "../../utils/promiseCache.js";
2
2
  import { PullRequestFilter } from "../../git/models/pullRequest.js";
3
3
  import { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId, IssuesCloudHostIntegrationId, IssuesSelfManagedHostIntegrationId, isIntegrationId, isSupportedCloudIntegrationId } from "./constants.js";
4
4
  import { getIssueFieldPresence, getPullRequestFieldPresence } from "./fieldPresence.js";
5
- import { toCloudIntegrationType, toIntegrationId } from "./authentication/models.js";
6
5
  import { IssueFilter } from "./providerFilters.js";
7
6
  import { areDomainsOnSameHost, hostFromDomain } from "./utils/domain.utils.js";
7
+ import { toCloudIntegrationType, toIntegrationId } from "./authentication/models.js";
8
8
  import { createIntegrationService } from "./integrationService.js";
9
9
  import { createManualTokenAuthProvider } from "./authentication/manualTokenProvider.js";
10
10
  //#region ../plus/integrations/src/index.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../plus/integrations/src/index.ts"],"sourcesContent":["// Public facade for `@gitlens/integrations`.\n//\n// External consumers should import from this entry point only, not from the\n// package's internal subpaths, with one exception: the lightweight, token-scoped\n// read API is a supported public subpath (`./lite.js`). It's kept out of this\n// facade on purpose so importing the session-managed manager doesn't eagerly pull\n// in every provider API client. The internal classes (IntegrationService,\n// IntegrationAuthenticationService, etc.) are not part of the public API and\n// may be refactored without semver bumps.\n\nimport type { Account } from '@gitlens/git/models/author.js';\nimport { CacheController } from '@gitlens/utils/promiseCache.js';\nimport type { IntegrationIds } from './constants.js';\nimport type {\n\tAccountProvider,\n\tConfigProvider,\n\tHttpProvider,\n\tIntegrationCacheProvider,\n\tIntegrationServiceHooks,\n\tIntegrationStorageProvider,\n\tRepositoriesProvider,\n} from './context.js';\nimport { createIntegrationService } from './integrationService.js';\nimport type { IntegrationManager } from './manager.js';\n\nexport type { Autolink, AutolinkReference, DynamicAutolinkReference, RefSet } from '@gitlens/git/models/autolink.js';\nexport type { ProviderReference } from '@gitlens/git/models/remoteProvider.js';\n\n/** A cached provider value, which may still be resolving. */\nexport type IntegrationManagerCacheResult<T> = Promise<T | undefined> | T | undefined;\n\n/** Produces an account value on a cache miss. */\nexport type IntegrationManagerCacheLoader<T> = (cacheable: CacheController) => {\n\tvalue: IntegrationManagerCacheResult<T>;\n\texpiresAt?: number;\n};\n\n/** Stable integration identity supplied to the consumer-owned account cache. */\nexport interface IntegrationAccountCacheDescriptor {\n\treadonly id: IntegrationIds;\n\treadonly domain?: string;\n}\n\n/** Cache controls attached to a provider account lookup. */\nexport interface IntegrationManagerCacheOptions {\n\treadonly connectionId?: string;\n\treadonly etag?: string;\n\treadonly expiryOverride?: boolean | number;\n\treadonly expireOnError?: boolean;\n}\n\n/**\n * Optional consumer-owned cache for values reused by the public manager facade.\n *\n * The manager only needs cross-call caching for provider identity lookups. Other caches used by the GitLens\n * extension host are implementation details and deliberately stay out of this contract.\n */\nexport interface IntegrationManagerCacheProvider {\n\tgetCurrentAccount(\n\t\tintegration: IntegrationAccountCacheDescriptor,\n\t\tcacheable: IntegrationManagerCacheLoader<Account>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<Account>;\n}\n\nfunction loadUncached<T>(loader: IntegrationManagerCacheLoader<T>): IntegrationManagerCacheResult<T> {\n\treturn loader(new CacheController()).value;\n}\n\nconst uncachedIntegrationCacheProvider: IntegrationCacheProvider = {\n\tgetRepositoryMetadata: (_repo, _integration, loader) => loadUncached(loader),\n\tgetRepositoryDefaultBranch: (_repo, _integration, loader) => loadUncached(loader),\n\tgetPullRequestForSha: (_sha, _repo, _integration, loader) => loadUncached(loader),\n\tgetPullRequestForBranch: (_branch, _repo, _integration, loader) => loadUncached(loader),\n\tgetPullRequest: (_id, _resource, _integration, loader) => loadUncached(loader),\n\tgetIssueOrPullRequest: (_id, _type, _resource, _integration, loader) => loadUncached(loader),\n\tgetIssue: (_id, _resource, _integration, loader) => loadUncached(loader),\n\tgetCurrentAccount: (_integration, loader) => loadUncached(loader),\n\t// Nothing is cached, so there is nothing to evict.\n\tdeletePullRequests: () => {},\n};\n\nfunction toIntegrationCacheProvider(cache: IntegrationManagerCacheProvider | undefined): IntegrationCacheProvider {\n\tif (cache == null) return uncachedIntegrationCacheProvider;\n\n\treturn {\n\t\t...uncachedIntegrationCacheProvider,\n\t\tgetCurrentAccount: (integration, loader, options) =>\n\t\t\tcache.getCurrentAccount({ id: integration.id, domain: integration.domain }, loader, options),\n\t};\n}\n\n/**\n * Consumer-facing runtime for {@link createIntegrationManager}.\n *\n * External consumers may omit `cache`; reads then execute their loaders directly without cross-call caching.\n * The extension host's broader integration context remains private to the implementation.\n */\nexport interface IntegrationManagerContext {\n\treadonly storage: IntegrationStorageProvider;\n\treadonly account: AccountProvider;\n\treadonly config: ConfigProvider;\n\treadonly http: HttpProvider;\n\treadonly cache?: IntegrationManagerCacheProvider;\n\treadonly repositories: RepositoriesProvider;\n\treadonly hooks?: IntegrationServiceHooks;\n}\n\nexport type {\n\tClosedPullRequestSweepOptions,\n\tGetAutolinkReferencesOptions,\n\tIntegrationManager,\n\tListLinearProjectsOptions,\n\tListOrgsOptions,\n\tListProjectsOptions,\n\t// Every option shape a caller has to BUILD is exported, not just the ones the manager returns:\n\t// `manager.js` is not a public subpath, so a type omitted here can't be named by a consumer at all\n\t// (`broadenIssues`' `orgs` needed `ProviderBroadenOrg` and had to be re-declared downstream).\n\tProviderBroadenOrg,\n\tProviderRepositoriesInput,\n\tProviderRepositoryInput,\n\tProviderSweepTarget,\n\tProviderSweepTargetEvent,\n\tPullRequestSweepOptions,\n} from './manager.js';\n\n/**\n * Construct an `@gitlens/integrations` manager bound to the supplied runtime.\n *\n * The runtime is the **single** cross-boundary contract — anything the\n * package needs (HTTP, storage, cache, auth, subscription, telemetry, UI,\n * configuration, environment) flows through it. The package never imports\n * `vscode`, `Container`, or any consumer-internal types.\n *\n * The returned manager owns its internal services; dispose it (or its\n * containing scope) to release every cached integration plus the runtime's\n * own VS Code subscriptions.\n */\nexport function createIntegrationManager(ctx: IntegrationManagerContext): IntegrationManager {\n\treturn createIntegrationService({\n\t\t...ctx,\n\t\tcache: toIntegrationCacheProvider(ctx.cache),\n\t});\n}\n\n// Re-exports for the public API surface.\nexport type {\n\tAccountProvider,\n\tAuthenticationSessionsChangeEvent,\n\tConfigChangeEvent,\n\tConfigProvider,\n\tRepositoriesProvider,\n\tHttpProvider,\n\tIntegrationsRemoteConfig,\n\tIntegrationServiceHooks,\n\tIntegrationStorageProvider,\n} from './context.js';\nexport type { Source, Sources } from './telemetry.js';\nexport type { IntegrationIds, SupportedCloudIntegrationIds } from './constants.js';\nexport type { ConfiguredIntegrationsChangeEvent } from './authentication/configuredIntegrationService.js';\n\n// Authentication contract — what `IntegrationServiceHooks.createAuthenticationProvider`\n// implementers return. Consumers can plug in any auth strategy (manual token,\n// OAuth, host-managed) by returning an object implementing this interface from\n// the hook.\nexport type {\n\tIntegrationAuthenticationProvider,\n\tIntegrationAuthenticationProviderDescriptor,\n\tIntegrationAuthenticationSessionDescriptor,\n} from './authentication/integrationAuthenticationProvider.js';\nexport type {\n\tAuthenticationSessionLike,\n\tCloudIntegrationAuthType,\n\tCloudIntegrationConnection,\n\tCloudIntegrationType,\n\tConfiguredIntegrationDescriptor,\n\tProviderAuthenticationSession,\n} from './authentication/models.js';\n// Provider-id mapping helpers for consumers bridging their own provider ids to `IntegrationIds`\n// (e.g. mapping multi-account connections from `getConfigured` back to a provider) and vice versa.\nexport { toCloudIntegrationType, toIntegrationId } from './authentication/models.js';\n// Domain normalization is part of connection selection and repository resolution; consumers should use the\n// same implementation rather than importing an internal utility subpath or maintaining a divergent copy.\nexport { areDomainsOnSameHost, hostFromDomain } from './utils/domain.utils.js';\n\n// Convenience: wrap a static access token (env var, CLI flag, secret manager)\n// as an `IntegrationAuthenticationProvider`. For OAuth/refresh flows, implement\n// the interface directly — this helper is for non-interactive consumers only.\nexport {\n\tcreateManualTokenAuthProvider,\n\ttype ManualTokenAuthProviderOptions,\n} from './authentication/manualTokenProvider.js';\n\nexport {\n\tGitCloudHostIntegrationId,\n\tGitSelfManagedHostIntegrationId,\n\tIssuesCloudHostIntegrationId,\n\tIssuesSelfManagedHostIntegrationId,\n\tisIntegrationId,\n\tisSupportedCloudIntegrationId,\n} from './constants.js';\n\n// Neutral pagination + warning result types the Kepler ProviderBackend adapter maps to its own DTOs.\n// These carry no `@gitkraken/provider-apis` types, so consumers depend only on `@gitkraken/core-gitlens`.\nexport type {\n\tConnectionStateChangeEvent,\n\tProviderBroadenResult,\n\tProviderPagedResult,\n\tProviderPageInfo,\n\tProviderResult,\n\tProviderSweepResult,\n\tProviderWarning,\n\tProviderWarningCause,\n\tProviderWarningCauseReason,\n\tProviderWarningKind,\n\tProviderWarningOmission,\n\tProviderWarningOmissionKind,\n\tProviderWarningOmissionRecovery,\n\tProviderWarningOmissionScope,\n\tProviderWarningScope,\n\tProviderWarningSelector,\n\tProviderWarningUnreadableItems,\n\tProviderLinearProjectShape,\n\tProviderOrganization,\n\tProviderRepositoryShape,\n\tRepositoryIdentity,\n\tRepositoryResolution,\n\tRepositoryResolutionStatus,\n\tResolveRepositoryResult,\n} from './results.js';\n// Runtime enums — re-exported as values (not `export type`) so consumers can read their members.\nexport { IssueFilter, PullRequestFilter } from './providerFilters.js';\n// The filtered issue search's criteria model and the capability table that says which of it a provider honors.\n// String unions and plain interfaces, so a consumer builds criteria without importing an internal subpath.\nexport type { IssueSearchCapabilities, IssueSearchCriteria, IssueSearchRelationship } from './providerFilters.js';\n// Account-wide pull-request search criteria and the per-provider capability table.\nexport type { PullRequestSearchCapabilities, PullRequestSearchCriteria } from './providerFilters.js';\n// The count-only issue and pull-request probes' input and result shapes.\nexport type {\n\tIssueCountResult,\n\tIssueCountScope,\n\tPullRequestCountResult,\n\tPullRequestCountScope,\n} from './reads/counts.js';\nexport type { IssueBatchResult, IssueBatchTarget } from './reads/issueBatch.js';\nexport type { PullRequestBatchResult, PullRequestBatchTarget } from './reads/pullRequestBatch.js';\nexport type { IssueEtagInclude, PullRequestEtagInclude } from './models/integration.js';\nexport type { PullRequestBranchResult, PullRequestBranchTarget } from './reads/pullRequestBranches.js';\n// The current-account read's result, and the account shape every identity-bearing read already returns.\nexport type { CurrentAccountResult } from './reads/currentAccount.js';\nexport type { Account } from '@gitlens/git/models/author.js';\n// Cross-provider PR/issue state filters (string unions in the git models).\nexport type { PullRequestStateFilter } from '@gitlens/git/models/pullRequest.js';\nexport type { IssueStateFilter } from '@gitlens/git/models/issue.js';\n// Which read produced a row, and which of its fields that read fetched.\nexport type { PullRequestProjection } from '@gitlens/git/models/pullRequest.js';\nexport type { IssueProjection } from '@gitlens/git/models/issue.js';\nexport type { FieldPresence, IssueFieldGroup, PullRequestFieldGroup } from './fieldPresence.js';\nexport { getIssueFieldPresence, getPullRequestFieldPresence } from './fieldPresence.js';\n"],"mappings":";;;;;;;;;;AAiEA,SAAS,aAAgB,QAA4E;CACpG,OAAO,OAAO,IAAI,gBAAgB,CAAC,CAAC,CAAC;AACtC;AAEA,MAAM,mCAA6D;CAClE,wBAAwB,OAAO,cAAc,WAAW,aAAa,MAAM;CAC3E,6BAA6B,OAAO,cAAc,WAAW,aAAa,MAAM;CAChF,uBAAuB,MAAM,OAAO,cAAc,WAAW,aAAa,MAAM;CAChF,0BAA0B,SAAS,OAAO,cAAc,WAAW,aAAa,MAAM;CACtF,iBAAiB,KAAK,WAAW,cAAc,WAAW,aAAa,MAAM;CAC7E,wBAAwB,KAAK,OAAO,WAAW,cAAc,WAAW,aAAa,MAAM;CAC3F,WAAW,KAAK,WAAW,cAAc,WAAW,aAAa,MAAM;CACvE,oBAAoB,cAAc,WAAW,aAAa,MAAM;CAEhE,0BAA0B,CAAC;AAC5B;AAEA,SAAS,2BAA2B,OAA8E;CACjH,IAAI,SAAS,MAAM,OAAO;CAE1B,OAAO;EACN,GAAG;EACH,oBAAoB,aAAa,QAAQ,YACxC,MAAM,kBAAkB;GAAE,IAAI,YAAY;GAAI,QAAQ,YAAY;EAAO,GAAG,QAAQ,OAAO;CAC7F;AACD;;;;;;;;;;;;;AAgDA,SAAgB,yBAAyB,KAAoD;CAC5F,OAAO,yBAAyB;EAC/B,GAAG;EACH,OAAO,2BAA2B,IAAI,KAAK;CAC5C,CAAC;AACF"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../plus/integrations/src/index.ts"],"sourcesContent":["// Public facade for `@gitlens/integrations`.\n//\n// External consumers should import from this entry point only, not from the\n// package's internal subpaths, with one exception: the lightweight, token-scoped\n// read API is a supported public subpath (`./lite.js`). It's kept out of this\n// facade on purpose so importing the session-managed manager doesn't eagerly pull\n// in every provider API client. The internal classes (IntegrationService,\n// IntegrationAuthenticationService, etc.) are not part of the public API and\n// may be refactored without semver bumps.\n\nimport type { Account } from '@gitlens/git/models/author.js';\nimport { CacheController } from '@gitlens/utils/promiseCache.js';\nimport type { IntegrationIds } from './constants.js';\nimport type {\n\tAccountProvider,\n\tConfigProvider,\n\tHttpProvider,\n\tIntegrationCacheProvider,\n\tIntegrationServiceHooks,\n\tIntegrationStorageProvider,\n\tRepositoriesProvider,\n} from './context.js';\nimport { createIntegrationService } from './integrationService.js';\nimport type { IntegrationManager } from './manager.js';\n\nexport type { Autolink, AutolinkReference, DynamicAutolinkReference, RefSet } from '@gitlens/git/models/autolink.js';\nexport type { ProviderReference } from '@gitlens/git/models/remoteProvider.js';\n\n/** A cached provider value, which may still be resolving. */\nexport type IntegrationManagerCacheResult<T> = Promise<T | undefined> | T | undefined;\n\n/** Produces an account value on a cache miss. */\nexport type IntegrationManagerCacheLoader<T> = (cacheable: CacheController) => {\n\tvalue: IntegrationManagerCacheResult<T>;\n\texpiresAt?: number;\n};\n\n/** Stable integration identity supplied to the consumer-owned account cache. */\nexport interface IntegrationAccountCacheDescriptor {\n\treadonly id: IntegrationIds;\n\treadonly domain?: string;\n}\n\n/** Cache controls attached to a provider account lookup. */\nexport interface IntegrationManagerCacheOptions {\n\treadonly connectionId?: string;\n\treadonly etag?: string;\n\treadonly expiryOverride?: boolean | number;\n\treadonly expireOnError?: boolean;\n}\n\n/**\n * Optional consumer-owned cache for values reused by the public manager facade.\n *\n * The manager only needs cross-call caching for provider identity lookups. Other caches used by the GitLens\n * extension host are implementation details and deliberately stay out of this contract.\n */\nexport interface IntegrationManagerCacheProvider {\n\tgetCurrentAccount(\n\t\tintegration: IntegrationAccountCacheDescriptor,\n\t\tcacheable: IntegrationManagerCacheLoader<Account>,\n\t\toptions?: IntegrationManagerCacheOptions,\n\t): IntegrationManagerCacheResult<Account>;\n}\n\nfunction loadUncached<T>(loader: IntegrationManagerCacheLoader<T>): IntegrationManagerCacheResult<T> {\n\treturn loader(new CacheController()).value;\n}\n\nconst uncachedIntegrationCacheProvider: IntegrationCacheProvider = {\n\tgetRepositoryMetadata: (_repo, _integration, loader) => loadUncached(loader),\n\tgetRepositoryDefaultBranch: (_repo, _integration, loader) => loadUncached(loader),\n\tgetPullRequestForSha: (_sha, _repo, _integration, loader) => loadUncached(loader),\n\tgetPullRequestForBranch: (_branch, _repo, _integration, loader) => loadUncached(loader),\n\tgetPullRequest: (_id, _resource, _integration, loader) => loadUncached(loader),\n\tgetIssueOrPullRequest: (_id, _type, _resource, _integration, loader) => loadUncached(loader),\n\tgetIssue: (_id, _resource, _integration, loader) => loadUncached(loader),\n\tgetCurrentAccount: (_integration, loader) => loadUncached(loader),\n\t// Nothing is cached, so there is nothing to evict.\n\tdeletePullRequests: () => {},\n};\n\nfunction toIntegrationCacheProvider(cache: IntegrationManagerCacheProvider | undefined): IntegrationCacheProvider {\n\tif (cache == null) return uncachedIntegrationCacheProvider;\n\n\treturn {\n\t\t...uncachedIntegrationCacheProvider,\n\t\tgetCurrentAccount: (integration, loader, options) =>\n\t\t\tcache.getCurrentAccount({ id: integration.id, domain: integration.domain }, loader, options),\n\t};\n}\n\n/**\n * Consumer-facing runtime for {@link createIntegrationManager}.\n *\n * External consumers may omit `cache`; reads then execute their loaders directly without cross-call caching.\n * The extension host's broader integration context remains private to the implementation.\n */\nexport interface IntegrationManagerContext {\n\treadonly storage: IntegrationStorageProvider;\n\treadonly account: AccountProvider;\n\treadonly config: ConfigProvider;\n\treadonly http: HttpProvider;\n\treadonly cache?: IntegrationManagerCacheProvider;\n\treadonly repositories: RepositoriesProvider;\n\treadonly hooks?: IntegrationServiceHooks;\n}\n\nexport type {\n\tClosedPullRequestSweepOptions,\n\tGetAutolinkReferencesOptions,\n\tIntegrationManager,\n\tListLinearProjectsOptions,\n\tListOrgsOptions,\n\tListProjectsOptions,\n\t// Every option shape a caller has to BUILD is exported, not just the ones the manager returns:\n\t// `manager.js` is not a public subpath, so a type omitted here can't be named by a consumer at all\n\t// (`broadenIssues`' `orgs` needed `ProviderBroadenOrg` and had to be re-declared downstream).\n\tProviderBroadenOrg,\n\tProviderRepositoriesInput,\n\tProviderRepositoryInput,\n\tProviderSweepTarget,\n\tProviderSweepTargetEvent,\n\tPullRequestSweepOptions,\n} from './manager.js';\n\n/**\n * Construct an `@gitlens/integrations` manager bound to the supplied runtime.\n *\n * The runtime is the **single** cross-boundary contract — anything the\n * package needs (HTTP, storage, cache, auth, subscription, telemetry, UI,\n * configuration, environment) flows through it. The package never imports\n * `vscode`, `Container`, or any consumer-internal types.\n *\n * The returned manager owns its internal services; dispose it (or its\n * containing scope) to release every cached integration plus the runtime's\n * own VS Code subscriptions.\n */\nexport function createIntegrationManager(ctx: IntegrationManagerContext): IntegrationManager {\n\treturn createIntegrationService({\n\t\t...ctx,\n\t\tcache: toIntegrationCacheProvider(ctx.cache),\n\t});\n}\n\n// Re-exports for the public API surface.\nexport type {\n\tAccountProvider,\n\tAuthenticationSessionsChangeEvent,\n\tConfigChangeEvent,\n\tConfigProvider,\n\tRepositoriesProvider,\n\tHttpProvider,\n\tIntegrationsRemoteConfig,\n\tIntegrationServiceHooks,\n\tIntegrationStorageProvider,\n} from './context.js';\nexport type { Source, Sources } from './telemetry.js';\nexport type { IntegrationIds, SupportedCloudIntegrationIds } from './constants.js';\nexport type { ConfiguredIntegrationsChangeEvent } from './authentication/configuredIntegrationService.js';\n\n// Authentication contract — what `IntegrationServiceHooks.createAuthenticationProvider`\n// implementers return. Consumers can plug in any auth strategy (manual token,\n// OAuth, host-managed) by returning an object implementing this interface from\n// the hook.\nexport type {\n\tIntegrationAuthenticationProvider,\n\tIntegrationAuthenticationProviderDescriptor,\n\tIntegrationAuthenticationSessionDescriptor,\n} from './authentication/integrationAuthenticationProvider.js';\nexport type {\n\tAuthenticationSessionLike,\n\tCloudIntegrationAuthType,\n\tCloudIntegrationConnection,\n\tCloudIntegrationType,\n\tConfiguredIntegrationDescriptor,\n\tProviderAuthenticationSession,\n} from './authentication/models.js';\n// Provider-id mapping helpers for consumers bridging their own provider ids to `IntegrationIds`\n// (e.g. mapping multi-account connections from `getConfigured` back to a provider) and vice versa.\nexport { toCloudIntegrationType, toIntegrationId } from './authentication/models.js';\n// Domain normalization is part of connection selection and repository resolution; consumers should use the\n// same implementation rather than importing an internal utility subpath or maintaining a divergent copy.\nexport { areDomainsOnSameHost, hostFromDomain } from './utils/domain.utils.js';\n\n// Convenience: wrap a static access token (env var, CLI flag, secret manager)\n// as an `IntegrationAuthenticationProvider`. For OAuth/refresh flows, implement\n// the interface directly — this helper is for non-interactive consumers only.\nexport {\n\tcreateManualTokenAuthProvider,\n\ttype ManualTokenAuthProviderOptions,\n} from './authentication/manualTokenProvider.js';\n\nexport {\n\tGitCloudHostIntegrationId,\n\tGitSelfManagedHostIntegrationId,\n\tIssuesCloudHostIntegrationId,\n\tIssuesSelfManagedHostIntegrationId,\n\tisIntegrationId,\n\tisSupportedCloudIntegrationId,\n} from './constants.js';\n\n// Neutral pagination + warning result types the Kepler ProviderBackend adapter maps to its own DTOs.\n// These carry no `@gitkraken/provider-apis` types, so consumers depend only on `@gitkraken/core-gitlens`.\nexport type {\n\tConnectionStateChangeEvent,\n\tProviderBroadenResult,\n\tProviderPagedResult,\n\tProviderPageInfo,\n\tProviderResult,\n\tProviderSweepResult,\n\tProviderSweepTargetRef,\n\tProviderWarning,\n\tProviderWarningCause,\n\tProviderWarningCauseReason,\n\tProviderWarningKind,\n\tProviderWarningOmission,\n\tProviderWarningOmissionKind,\n\tProviderWarningOmissionRecovery,\n\tProviderWarningOmissionScope,\n\tProviderWarningScope,\n\tProviderWarningSelector,\n\tProviderWarningUnreadableItems,\n\tProviderLinearProjectShape,\n\tProviderOrganization,\n\tProviderRepositoryShape,\n\tRepositoryIdentity,\n\tRepositoryResolution,\n\tRepositoryResolutionStatus,\n\tResolveRepositoryResult,\n} from './results.js';\n// Runtime enums — re-exported as values (not `export type`) so consumers can read their members.\nexport { IssueFilter, PullRequestFilter } from './providerFilters.js';\n// The filtered issue search's criteria model and the capability table that says which of it a provider honors.\n// String unions and plain interfaces, so a consumer builds criteria without importing an internal subpath.\nexport type { IssueSearchCapabilities, IssueSearchCriteria, IssueSearchRelationship } from './providerFilters.js';\n// Account-wide pull-request search criteria and the per-provider capability table.\nexport type { PullRequestSearchCapabilities, PullRequestSearchCriteria } from './providerFilters.js';\n// The count-only issue and pull-request probes' input and result shapes.\nexport type {\n\tIssueCountResult,\n\tIssueCountScope,\n\tPullRequestCountResult,\n\tPullRequestCountScope,\n} from './reads/counts.js';\nexport type { IssueBatchResult, IssueBatchTarget } from './reads/issueBatch.js';\nexport type { PullRequestBatchResult, PullRequestBatchTarget } from './reads/pullRequestBatch.js';\nexport type { IssueEtagInclude, PullRequestEtagInclude } from './models/integration.js';\nexport type { PullRequestBranchResult, PullRequestBranchTarget } from './reads/pullRequestBranches.js';\n// The current-account read's result, and the account shape every identity-bearing read already returns.\nexport type { CurrentAccountResult } from './reads/currentAccount.js';\nexport type { Account } from '@gitlens/git/models/author.js';\n// Cross-provider PR/issue state filters (string unions in the git models).\nexport type { PullRequestStateFilter } from '@gitlens/git/models/pullRequest.js';\nexport type { IssueStateFilter } from '@gitlens/git/models/issue.js';\n// Which read produced a row, and which of its fields that read fetched.\nexport type { PullRequestProjection } from '@gitlens/git/models/pullRequest.js';\nexport type { IssueProjection } from '@gitlens/git/models/issue.js';\nexport type { FieldPresence, IssueFieldGroup, PullRequestFieldGroup } from './fieldPresence.js';\nexport { getIssueFieldPresence, getPullRequestFieldPresence } from './fieldPresence.js';\n"],"mappings":";;;;;;;;;;AAiEA,SAAS,aAAgB,QAA4E;CACpG,OAAO,OAAO,IAAI,gBAAgB,CAAC,CAAC,CAAC;AACtC;AAEA,MAAM,mCAA6D;CAClE,wBAAwB,OAAO,cAAc,WAAW,aAAa,MAAM;CAC3E,6BAA6B,OAAO,cAAc,WAAW,aAAa,MAAM;CAChF,uBAAuB,MAAM,OAAO,cAAc,WAAW,aAAa,MAAM;CAChF,0BAA0B,SAAS,OAAO,cAAc,WAAW,aAAa,MAAM;CACtF,iBAAiB,KAAK,WAAW,cAAc,WAAW,aAAa,MAAM;CAC7E,wBAAwB,KAAK,OAAO,WAAW,cAAc,WAAW,aAAa,MAAM;CAC3F,WAAW,KAAK,WAAW,cAAc,WAAW,aAAa,MAAM;CACvE,oBAAoB,cAAc,WAAW,aAAa,MAAM;CAEhE,0BAA0B,CAAC;AAC5B;AAEA,SAAS,2BAA2B,OAA8E;CACjH,IAAI,SAAS,MAAM,OAAO;CAE1B,OAAO;EACN,GAAG;EACH,oBAAoB,aAAa,QAAQ,YACxC,MAAM,kBAAkB;GAAE,IAAI,YAAY;GAAI,QAAQ,YAAY;EAAO,GAAG,QAAQ,OAAO;CAC7F;AACD;;;;;;;;;;;;;AAgDA,SAAgB,yBAAyB,KAAoD;CAC5F,OAAO,yBAAyB;EAC/B,GAAG;EACH,OAAO,2BAA2B,IAAI,KAAK;CAC5C,CAAC;AACF"}
@@ -241,6 +241,10 @@ export declare class IntegrationService implements Disposable, RepositoryResolut
241
241
  domain?: string;
242
242
  /** See {@link IntegrationManager.listPullRequestsPage}. */
243
243
  summary?: boolean;
244
+ /** See {@link IntegrationManager.listPullRequestsPage}. */
245
+ scopeConcurrency?: number;
246
+ /** See {@link IntegrationManager.listPullRequestsPage}. */
247
+ includeRemoteInfo?: boolean;
244
248
  }): Promise<ProviderPagedResult<PullRequestShape>>;
245
249
  /** See {@link IntegrationManager.searchPullRequestsPage}. */
246
250
  searchPullRequestsPage(options: {
@@ -286,6 +290,8 @@ export declare class IntegrationService implements Disposable, RepositoryResolut
286
290
  cursor?: string;
287
291
  itemsPerPage?: number;
288
292
  forceSync?: boolean;
293
+ /** See {@link IntegrationManager.listIssuesPage}. */
294
+ scopeConcurrency?: number;
289
295
  connectionId?: string;
290
296
  /**
291
297
  * Explicit self-managed host domain. Used only when the requested connection has no configured domain;
@@ -9,11 +9,11 @@ import __decorate from "../../_virtual/@oxc-project+runtime/helpers/esm/decorate
9
9
  import { gate } from "../../utils/decorators/gate.js";
10
10
  import { toError } from "./errors.js";
11
11
  import { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId, IssuesCloudHostIntegrationId, IssuesSelfManagedHostIntegrationId } from "./constants.js";
12
- import { getSupportedCloudIntegrationIds, isSupportedCloudIntegrationId, toIntegrationId } from "./authentication/models.js";
13
- import { CloudIntegrationService } from "./authentication/cloudIntegrationService.js";
14
12
  import { getRemoteHostMatcher, hostFromDomain, sameConfiguredBaseUrl } from "./utils/domain.utils.js";
15
- import { convertRemoteProviderIdToIntegrationId, getIntegrationIdForRemote, isCloudSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitSelfManagedHostIntegrationId, isNonExpiringZeroTokenIntegrationId, isSelfManagedHostIntegrationId, remoteProviderTypeForConfig, remoteProviderTypeForIntegration } from "./utils/integration.utils.js";
16
13
  import { providersMetadata } from "./providers/models.js";
14
+ import { convertRemoteProviderIdToIntegrationId, getIntegrationIdForRemote, isCloudSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitSelfManagedHostIntegrationId, isNonExpiringZeroTokenIntegrationId, isSelfManagedHostIntegrationId, remoteProviderTypeForConfig, remoteProviderTypeForIntegration } from "./utils/integration.utils.js";
15
+ import { getSupportedCloudIntegrationIds, isSupportedCloudIntegrationId, toIntegrationId } from "./authentication/models.js";
16
+ import { CloudIntegrationService } from "./authentication/cloudIntegrationService.js";
17
17
  import { ConfiguredIntegrationService } from "./authentication/configuredIntegrationService.js";
18
18
  import { IntegrationAuthenticationService } from "./authentication/integrationAuthenticationService.js";
19
19
  import { createApiClients } from "./providers/apiClients.js";