@gitkraken/core-gitlens 0.28.0 → 0.30.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 (120) hide show
  1. package/CHANGELOG.md +48 -1
  2. package/dist/git/cache.d.ts +39 -1
  3. package/dist/git/cache.js +108 -7
  4. package/dist/git/cache.js.map +1 -1
  5. package/dist/git/providers/branches.d.ts +17 -12
  6. package/dist/git/providers/revision.d.ts +4 -0
  7. package/dist/git/watching/worktreeSummary.d.ts +16 -7
  8. package/dist/git/watching/worktreeSummary.js +44 -14
  9. package/dist/git/watching/worktreeSummary.js.map +1 -1
  10. package/dist/git-cli/cliGitProvider.js +3 -3
  11. package/dist/git-cli/cliGitProvider.js.map +1 -1
  12. package/dist/git-cli/exec/exec.d.ts +2 -2
  13. package/dist/git-cli/exec/exec.js +2 -2
  14. package/dist/git-cli/exec/gitDirResolver.d.ts +6 -1
  15. package/dist/git-cli/exec/gitDirResolver.js +9 -4
  16. package/dist/git-cli/exec/gitDirResolver.js.map +1 -1
  17. package/dist/git-cli/providers/branches.d.ts +91 -13
  18. package/dist/git-cli/providers/branches.js +673 -176
  19. package/dist/git-cli/providers/branches.js.map +1 -1
  20. package/dist/git-cli/providers/config.js +1 -1
  21. package/dist/git-cli/providers/config.js.map +1 -1
  22. package/dist/git-cli/providers/revision.d.ts +4 -0
  23. package/dist/git-cli/providers/revision.js +64 -3
  24. package/dist/git-cli/providers/revision.js.map +1 -1
  25. package/dist/ipc/ipcServer.d.ts +6 -1
  26. package/dist/ipc/ipcServer.js +15 -6
  27. package/dist/ipc/ipcServer.js.map +1 -1
  28. package/dist/plus/ai/errors.js +4 -4
  29. package/dist/plus/ai/errors.js.map +1 -1
  30. package/dist/plus/ai/models/model.d.ts +1 -1
  31. package/dist/plus/ai/models/model.js.map +1 -1
  32. package/dist/plus/ai/models/promptTemplates.d.ts +45 -2
  33. package/dist/plus/ai/models/results.d.ts +41 -0
  34. package/dist/plus/ai/models/results.js +14 -0
  35. package/dist/plus/ai/models/results.js.map +1 -0
  36. package/dist/plus/ai/prompts.d.ts +6 -0
  37. package/dist/plus/ai/prompts.js +255 -5
  38. package/dist/plus/ai/prompts.js.map +1 -1
  39. package/dist/plus/ai/providers/gitkrakenProvider.js +2 -2
  40. package/dist/plus/ai/providers/gitkrakenProvider.js.map +1 -1
  41. package/dist/plus/ai/providers/openAICompatibleProviderBase.js +1 -0
  42. package/dist/plus/ai/providers/openAICompatibleProviderBase.js.map +1 -1
  43. package/dist/plus/ai/utils/ai.utils.d.ts +4 -0
  44. package/dist/plus/ai/utils/ai.utils.js +8 -1
  45. package/dist/plus/ai/utils/ai.utils.js.map +1 -1
  46. package/dist/plus/ai/utils/results.utils.d.ts +15 -1
  47. package/dist/plus/ai/utils/results.utils.js +80 -4
  48. package/dist/plus/ai/utils/results.utils.js.map +1 -1
  49. package/dist/plus/integrations/authentication/integrationAuthenticationService.js +2 -0
  50. package/dist/plus/integrations/authentication/integrationAuthenticationService.js.map +1 -1
  51. package/dist/plus/integrations/authentication/models.d.ts +1 -1
  52. package/dist/plus/integrations/authentication/models.js +2 -0
  53. package/dist/plus/integrations/authentication/models.js.map +1 -1
  54. package/dist/plus/integrations/constants.d.ts +2 -1
  55. package/dist/plus/integrations/constants.js +12 -2
  56. package/dist/plus/integrations/constants.js.map +1 -1
  57. package/dist/plus/integrations/fieldPresence.js +17 -1
  58. package/dist/plus/integrations/fieldPresence.js.map +1 -1
  59. package/dist/plus/integrations/integrationService.d.ts +1 -1
  60. package/dist/plus/integrations/integrationService.js +8 -2
  61. package/dist/plus/integrations/integrationService.js.map +1 -1
  62. package/dist/plus/integrations/lite.js +5 -6
  63. package/dist/plus/integrations/lite.js.map +1 -1
  64. package/dist/plus/integrations/models/gitHostIntegration.d.ts +11 -1
  65. package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
  66. package/dist/plus/integrations/providers/asana.d.ts +91 -0
  67. package/dist/plus/integrations/providers/asana.js +344 -0
  68. package/dist/plus/integrations/providers/asana.js.map +1 -0
  69. package/dist/plus/integrations/providers/azure/azure.js +3 -2
  70. package/dist/plus/integrations/providers/azure/azure.js.map +1 -1
  71. package/dist/plus/integrations/providers/azure/models.js +3 -2
  72. package/dist/plus/integrations/providers/azure/models.js.map +1 -1
  73. package/dist/plus/integrations/providers/azureDevOps.d.ts +7 -1
  74. package/dist/plus/integrations/providers/azureDevOps.js +9 -1
  75. package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
  76. package/dist/plus/integrations/providers/bitbucket-server/discovery.js +2 -1
  77. package/dist/plus/integrations/providers/bitbucket-server/discovery.js.map +1 -1
  78. package/dist/plus/integrations/providers/bitbucket-server/models.js.map +1 -1
  79. package/dist/plus/integrations/providers/github.d.ts +2 -2
  80. package/dist/plus/integrations/providers/github.js +2 -2
  81. package/dist/plus/integrations/providers/github.js.map +1 -1
  82. package/dist/plus/integrations/providers/issueSorts.d.ts +5 -0
  83. package/dist/plus/integrations/providers/issueSorts.js +6 -1
  84. package/dist/plus/integrations/providers/issueSorts.js.map +1 -1
  85. package/dist/plus/integrations/providers/jiraIssueByKey.js +2 -1
  86. package/dist/plus/integrations/providers/jiraIssueByKey.js.map +1 -1
  87. package/dist/plus/integrations/providers/models.d.ts +19 -3
  88. package/dist/plus/integrations/providers/models.js +12 -1
  89. package/dist/plus/integrations/providers/models.js.map +1 -1
  90. package/dist/plus/integrations/providers/providerApiClient.d.ts +0 -3
  91. package/dist/plus/integrations/providers/providerApiClient.js +1 -3
  92. package/dist/plus/integrations/providers/providerApiClient.js.map +1 -1
  93. package/dist/plus/integrations/providers/providersApi.d.ts +22 -1
  94. package/dist/plus/integrations/providers/providersApi.js +63 -12
  95. package/dist/plus/integrations/providers/providersApi.js.map +1 -1
  96. package/dist/plus/integrations/providers/utils.d.ts +1 -0
  97. package/dist/plus/integrations/providers/utils.js +8 -2
  98. package/dist/plus/integrations/providers/utils.js.map +1 -1
  99. package/dist/plus/integrations/reads/hierarchy.utils.d.ts +3 -3
  100. package/dist/plus/integrations/reads/hierarchy.utils.js +4 -4
  101. package/dist/plus/integrations/reads/hierarchy.utils.js.map +1 -1
  102. package/dist/plus/integrations/reads/resolveRepository.js +29 -21
  103. package/dist/plus/integrations/reads/resolveRepository.js.map +1 -1
  104. package/dist/plus/integrations/results.d.ts +18 -10
  105. package/dist/plus/integrations/results.js.map +1 -1
  106. package/dist/plus/integrations/utils/domain.utils.js +2 -1
  107. package/dist/plus/integrations/utils/domain.utils.js.map +1 -1
  108. package/dist/plus/integrations/utils/integration.utils.js +5 -13
  109. package/dist/plus/integrations/utils/integration.utils.js.map +1 -1
  110. package/dist/utils/diff.d.ts +19 -0
  111. package/dist/utils/diff.js +121 -3
  112. package/dist/utils/diff.js.map +1 -1
  113. package/dist/utils/env/node/exec.d.ts +0 -1
  114. package/dist/utils/env/node/exec.js +2 -14
  115. package/dist/utils/env/node/exec.js.map +1 -1
  116. package/dist/utils/path.d.ts +2 -0
  117. package/dist/utils/path.js +7 -1
  118. package/dist/utils/path.js.map +1 -1
  119. package/docs/integrations.md +72 -43
  120. package/package.json +2 -2
@@ -1,3 +1,4 @@
1
+ import { trimTrailingSlashes } from "../../utils/path.js";
1
2
  import "./constants.js";
2
3
  import { providersMetadata } from "./providers/models.js";
3
4
  import { toTokenInfo } from "./authentication/models.js";
@@ -72,13 +73,11 @@ function createProviderStub(id, domain, ignoreSSLErrors) {
72
73
  }
73
74
  /** Strips a leading `scheme://` and any trailing slashes; a subpath/collection (e.g. `host/tfs/Col`) is preserved. */
74
75
  function stripScheme(domain) {
75
- return domain.replace(/^[a-z][\w+.-]*:\/\//i, "").replace(/\/+$/, "");
76
+ return trimTrailingSlashes(domain.replace(/^[a-z][\w+.-]*:\/\//i, ""));
76
77
  }
77
78
  /**
78
- * GitHub's base URL, which `@gitkraken/provider-apis` derives BOTH the REST and the GraphQL endpoint from by
79
- * appending GitHub Enterprise's paths (`/api/v3`, `/api/graphql`). Cloud must therefore pass nothing rather than
80
- * `https://api.github.com`, which would build `https://api.github.com/api/graphql` and get a 404; omitting it is
81
- * what selects the cloud endpoints. Mirrors the cloud `GitHubIntegration.apiBaseUrlFor`.
79
+ * GitHub's base URL, which `@gitkraken/provider-apis` derives BOTH the REST and the GraphQL endpoint from. Omitting it
80
+ * is what selects the cloud endpoints, so cloud passes nothing. Mirrors the cloud `GitHubIntegration.apiBaseUrlFor`.
82
81
  */
83
82
  function resolveGitHubApiBaseUrl(id, host) {
84
83
  return id === "github" ? void 0 : `https://${host}/api/v3`;
@@ -95,7 +94,7 @@ function resolveApiBaseUrl(id, rawDomain, host) {
95
94
  case "cloud-gitlab-self-hosted": return `https://${host}/api`;
96
95
  case "bitbucket": return "https://api.bitbucket.org/2.0";
97
96
  case "azureDevOps": return "https://dev.azure.com";
98
- case "azure-devops-server": return rawDomain.includes("://") ? rawDomain.replace(/\/+$/, "") : `https://${host}`;
97
+ case "azure-devops-server": return rawDomain.includes("://") ? trimTrailingSlashes(rawDomain) : `https://${host}`;
99
98
  }
100
99
  }
101
100
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"lite.js","names":[],"sources":["../../../../plus/integrations/src/lite.ts"],"sourcesContent":["// A lightweight, token-scoped entry point for stateless single-shot provider reads.\n//\n// Unlike `createIntegrationManager`, this does NOT build an `IntegrationServiceContext`\n// (no storage/account/config/cache/repositories/hooks) and runs no session/OAuth lifecycle.\n// A consumer that already holds a provider access token (obtained by its own means, e.g.\n// the GitKraken account backend's `v1/provider-tokens/{provider}` endpoint) can call the\n// per-provider API client directly and get back the same DTOs the session-managed\n// `GitHostIntegration` returns.\n//\n// Provider notes:\n// - Azure DevOps encodes the repository as the composite string `\"{project}/_git/{repoName}\"`\n// in the `repo` argument (matching the descriptor `GitHostIntegration` uses); `owner` is the\n// organization. Pass `repo` in that shape for Azure.\n// - Bitbucket Cloud `getDefaultBranch`/`getRepositoryMetadata` depend on `mainbranch`/`parent`\n// fields the API may omit for some repos; they resolve to `undefined` when absent.\n// - Bitbucket Server (`bitbucket-server`) is not supported here — its reads use a different\n// REST surface that this token-scoped path doesn't wire up.\n\nimport type { GitHubApiConfig } from '@gitlens/git-github/api/config.js';\nimport { GitHubApi } from '@gitlens/git-github/api/github.js';\nimport type { DefaultBranch } from '@gitlens/git/models/defaultBranch.js';\nimport type { Provider } from '@gitlens/git/models/remoteProvider.js';\nimport type { RepositoryMetadata } from '@gitlens/git/models/repositoryMetadata.js';\nimport type { TokenWithInfo } from './authentication/models.js';\nimport { toTokenInfo } from './authentication/models.js';\nimport { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId } from './constants.js';\nimport type { ProviderApiConfig } from './providers/apiConfig.js';\nimport { AzureDevOpsApi } from './providers/azure/azure.js';\nimport { BitbucketApi } from './providers/bitbucket/bitbucket.js';\nimport { GitLabApi } from './providers/gitlab/gitlab.js';\nimport { providersMetadata } from './providers/models.js';\n\n/** The git-hosting integrations that expose a token-scoped read path here. */\nexport type TokenScopedGitHostId =\n\t| GitCloudHostIntegrationId.GitHub\n\t| GitCloudHostIntegrationId.GitLab\n\t| GitCloudHostIntegrationId.Bitbucket\n\t| GitCloudHostIntegrationId.AzureDevOps\n\t| GitSelfManagedHostIntegrationId.CloudGitHubEnterprise\n\t| GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted\n\t| GitSelfManagedHostIntegrationId.AzureDevOpsServer;\n\nexport interface TokenScopedGitHostToken {\n\t/** The provider access token the consumer already holds. */\n\treadonly accessToken: string;\n\t/**\n\t * Host domain for self-managed instances (e.g. `git.example.com`). Ignored for cloud ids. For an Azure\n\t * DevOps Server reachable over plain HTTP, include the scheme (e.g. `http://tfs.example.com`); otherwise\n\t * `https` is assumed.\n\t */\n\treadonly domain?: string;\n\t/** Optional scopes carried by the token, surfaced only in logging metadata. */\n\treadonly scopes?: readonly string[];\n\t/** Whether the token came from a GK-cloud connection (vs a raw PAT). Defaults to `true`. */\n\treadonly cloud?: boolean;\n}\n\nexport interface TokenScopedHttpConfig {\n\t/** The `fetch` implementation to use for HTTP requests. */\n\tfetch(input: string | URL, init?: RequestInit): Promise<Response>;\n\t/**\n\t * Wrap an async op so TLS validation is disabled when `ignoreSSLErrors` is `'force'`. Optional —\n\t * defaults to a pass-through, which is correct for the browser and for any consumer not toggling SSL.\n\t */\n\twrapForForcedInsecureSSL?<T>(ignoreSSLErrors: boolean | 'force', fn: () => Promise<T> | PromiseLike<T>): Promise<T>;\n\t/** Whether to ignore SSL certificate errors on requests. Defaults to `false`. */\n\tignoreSSLErrors?: boolean | 'force';\n\t/**\n\t * Whether the consumer runs in a web worker / browser (vs Node.js). GitHub uses this to drop the\n\t * `user-agent` header, which browsers reject and warn about. Defaults to `false`.\n\t */\n\tisWeb?: boolean;\n}\n\n/** The stateless reads a token-scoped integration exposes. */\nexport interface TokenScopedGitHostIntegration {\n\tgetRepositoryMetadata(\n\t\towner: string,\n\t\trepo: string,\n\t\tcancellation?: AbortSignal,\n\t): Promise<RepositoryMetadata | undefined>;\n\tgetDefaultBranch(owner: string, repo: string, cancellation?: AbortSignal): Promise<DefaultBranch | undefined>;\n}\n\n/**\n * Build a token-scoped git-host integration for a single provider, backed only by a `fetch` + a token —\n * no `IntegrationServiceContext`, no session/OAuth lifecycle. The returned DTOs match those from the\n * session-managed {@link GitHostIntegration}.\n */\nexport function createTokenScopedGitHostIntegration(\n\tid: TokenScopedGitHostId,\n\ttoken: TokenScopedGitHostToken,\n\thttp: TokenScopedHttpConfig,\n): TokenScopedGitHostIntegration {\n\t// `token.domain` only applies to self-managed ids; cloud ids always use their canonical domain.\n\tconst selfManaged =\n\t\tid === GitSelfManagedHostIntegrationId.CloudGitHubEnterprise ||\n\t\tid === GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted ||\n\t\tid === GitSelfManagedHostIntegrationId.AzureDevOpsServer;\n\t// Self-managed ids carry no canonical domain (`providersMetadata[id].domain` is empty), so a missing\n\t// `token.domain` would silently build a malformed base URL (e.g. `https:///api/v3`). Fail fast instead.\n\tif (selfManaged && !token.domain) {\n\t\tthrow new Error(`A token-scoped integration for the self-managed host '${id}' requires 'token.domain'.`);\n\t}\n\n\tconst rawDomain = (selfManaged && token.domain) || providersMetadata[id].domain;\n\t// The provider/DTO domain drops the scheme (a subpath/collection is preserved for Azure Server and subpath\n\t// installs); only Azure DevOps Server's base URL honors an explicit scheme (per its doc). Stripping keeps a\n\t// scheme out of the DTO and prevents a malformed base URL (e.g. `https://http://host/api/v3`) if one is\n\t// accidentally passed for GHE/GitLab.\n\tconst host = stripScheme(rawDomain);\n\tconst provider = createProviderStub(id, host, http.ignoreSSLErrors ?? false);\n\tconst tokenInfo = buildTokenWithInfo(id, token);\n\n\tconst wrapForForcedInsecureSSL: NonNullable<TokenScopedHttpConfig['wrapForForcedInsecureSSL']> =\n\t\t// `Promise.resolve().then(fn)` (not `Promise.resolve(fn())`) so a synchronous throw in `fn` surfaces as\n\t\t// a rejected promise, honoring the `Promise<T>` contract.\n\t\thttp.wrapForForcedInsecureSSL ?? ((_ignore, fn) => Promise.resolve().then(fn));\n\n\t// GitHub has its own VS Code-free config type and a `getDefaultBranch` without a cancellation param.\n\tif (id === GitCloudHostIntegrationId.GitHub || id === GitSelfManagedHostIntegrationId.CloudGitHubEnterprise) {\n\t\tconst config: GitHubApiConfig = {\n\t\t\tisWeb: http.isWeb ?? false,\n\t\t\tfetch: (url, init) => http.fetch(url, init),\n\t\t\twrapForForcedInsecureSSL: wrapForForcedInsecureSSL,\n\t\t};\n\t\tconst api = new GitHubApi(config);\n\t\t// GitHub is the one family whose base URL can legitimately be absent — see `resolveGitHubApiBaseUrl`.\n\t\tconst baseUrl = resolveGitHubApiBaseUrl(id, host);\n\t\treturn {\n\t\t\tgetRepositoryMetadata: (owner, repo, cancellation) =>\n\t\t\t\tapi.getRepositoryMetadata(provider, tokenInfo, owner, repo, { baseUrl: baseUrl }, cancellation),\n\t\t\t// `GitHubApi.getDefaultBranch` has no cancellation param; accept and intentionally ignore it here so\n\t\t\t// the signature matches the other providers and the drop is explicit at the call site.\n\t\t\tgetDefaultBranch: (owner, repo, _cancellation) =>\n\t\t\t\tapi.getDefaultBranch(provider, tokenInfo, owner, repo, { baseUrl: baseUrl }),\n\t\t};\n\t}\n\n\t// GitLab, Bitbucket, and Azure DevOps share the `ProviderApiConfig` client shape and identical read signatures.\n\tconst baseUrl = resolveApiBaseUrl(id, rawDomain, host);\n\tconst config = toProviderApiConfig(http, wrapForForcedInsecureSSL);\n\tconst api =\n\t\tid === GitCloudHostIntegrationId.GitLab || id === GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted\n\t\t\t? new GitLabApi(config)\n\t\t\t: id === GitCloudHostIntegrationId.Bitbucket\n\t\t\t\t? new BitbucketApi(config)\n\t\t\t\t: new AzureDevOpsApi(config);\n\treturn {\n\t\tgetRepositoryMetadata: (owner, repo, cancellation) =>\n\t\t\tapi.getRepositoryMetadata(provider, tokenInfo, owner, repo, { baseUrl: baseUrl }, cancellation),\n\t\tgetDefaultBranch: (owner, repo, cancellation) =>\n\t\t\tapi.getDefaultBranch(provider, tokenInfo, owner, repo, { baseUrl: baseUrl }, cancellation),\n\t};\n}\n\nfunction toProviderApiConfig(\n\thttp: TokenScopedHttpConfig,\n\twrapForForcedInsecureSSL: NonNullable<TokenScopedHttpConfig['wrapForForcedInsecureSSL']>,\n): ProviderApiConfig {\n\treturn {\n\t\tfetch: (input, init) => http.fetch(input, init),\n\t\twrapForForcedInsecureSSL: wrapForForcedInsecureSSL,\n\t};\n}\n\nfunction buildTokenWithInfo(id: TokenScopedGitHostId, token: TokenScopedGitHostToken): TokenWithInfo {\n\tconst cloud = token.cloud ?? true;\n\treturn {\n\t\t...toTokenInfo(id, token.accessToken, { cloud: cloud, type: undefined, scopes: token.scopes }),\n\t\taccessToken: token.accessToken,\n\t};\n}\n\n/** A minimal {@link Provider} for the API clients: identity + no-op reauth/telemetry, SSL from config. */\nfunction createProviderStub(id: TokenScopedGitHostId, domain: string, ignoreSSLErrors: boolean | 'force'): Provider {\n\tconst metadata = providersMetadata[id];\n\treturn {\n\t\tid: id,\n\t\tname: metadata.name,\n\t\tdomain: domain,\n\t\ticon: metadata.iconKey,\n\t\tgetIgnoreSSLErrors: () => ignoreSSLErrors,\n\t\treauthenticate: () => Promise.resolve(),\n\t\ttrackRequestException: () => {},\n\t};\n}\n\n/** Strips a leading `scheme://` and any trailing slashes; a subpath/collection (e.g. `host/tfs/Col`) is preserved. */\nfunction stripScheme(domain: string): string {\n\treturn domain.replace(/^[a-z][\\w+.-]*:\\/\\//i, '').replace(/\\/+$/, '');\n}\n\n/**\n * GitHub's base URL, which `@gitkraken/provider-apis` derives BOTH the REST and the GraphQL endpoint from by\n * appending GitHub Enterprise's paths (`/api/v3`, `/api/graphql`). Cloud must therefore pass nothing rather than\n * `https://api.github.com`, which would build `https://api.github.com/api/graphql` and get a 404; omitting it is\n * what selects the cloud endpoints. Mirrors the cloud `GitHubIntegration.apiBaseUrlFor`.\n */\nfunction resolveGitHubApiBaseUrl(\n\tid: GitCloudHostIntegrationId.GitHub | GitSelfManagedHostIntegrationId.CloudGitHubEnterprise,\n\thost: string,\n): string | undefined {\n\treturn id === GitCloudHostIntegrationId.GitHub ? undefined : `https://${host}/api/v3`;\n}\n\n/**\n * Mirrors the per-provider `apiBaseUrlFor` methods on the `GitHostIntegration` subclasses for an installation at\n * the host root. Covers every family whose base URL is always concrete (GitHub's is not — see\n * {@link resolveGitHubApiBaseUrl}). `rawDomain` may carry a scheme (only Azure DevOps Server honors it); `host` is\n * the bare host used everywhere else.\n */\nfunction resolveApiBaseUrl(\n\tid: Exclude<\n\t\tTokenScopedGitHostId,\n\t\tGitCloudHostIntegrationId.GitHub | GitSelfManagedHostIntegrationId.CloudGitHubEnterprise\n\t>,\n\trawDomain: string,\n\thost: string,\n): string {\n\tswitch (id) {\n\t\tcase GitCloudHostIntegrationId.GitLab:\n\t\t\treturn 'https://gitlab.com/api';\n\t\tcase GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted:\n\t\t\treturn `https://${host}/api`;\n\t\tcase GitCloudHostIntegrationId.Bitbucket:\n\t\t\treturn 'https://api.bitbucket.org/2.0';\n\t\tcase GitCloudHostIntegrationId.AzureDevOps:\n\t\t\treturn 'https://dev.azure.com';\n\t\tcase GitSelfManagedHostIntegrationId.AzureDevOpsServer:\n\t\t\t// Mirror the session-managed getter, which honors the connection protocol; default to https.\n\t\t\treturn rawDomain.includes('://') ? rawDomain.replace(/\\/+$/, '') : `https://${host}`;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;AAyFA,SAAgB,oCACf,IACA,OACA,MACgC;CAEhC,MAAM,cACL,OAAA,6BACA,OAAA,8BACA,OAAA;CAGD,IAAI,eAAe,CAAC,MAAM,QACzB,MAAM,IAAI,MAAM,yDAAyD,GAAG,2BAA2B;CAGxG,MAAM,YAAa,eAAe,MAAM,UAAW,kBAAkB,GAAG,CAAC;CAKzE,MAAM,OAAO,YAAY,SAAS;CAClC,MAAM,WAAW,mBAAmB,IAAI,MAAM,KAAK,mBAAmB,KAAK;CAC3E,MAAM,YAAY,mBAAmB,IAAI,KAAK;CAE9C,MAAM,2BAGL,KAAK,8BAA8B,SAAS,OAAO,QAAQ,QAAQ,CAAC,CAAC,KAAK,EAAE;CAG7E,IAAI,OAAA,YAA2C,OAAA,2BAA8D;EAC5G,MAAM,SAA0B;GAC/B,OAAO,KAAK,SAAS;GACrB,QAAQ,KAAK,SAAS,KAAK,MAAM,KAAK,IAAI;GAChB;EAC3B;EACA,MAAM,MAAM,IAAI,UAAU,MAAM;EAEhC,MAAM,UAAU,wBAAwB,IAAI,IAAI;EAChD,OAAO;GACN,wBAAwB,OAAO,MAAM,iBACpC,IAAI,sBAAsB,UAAU,WAAW,OAAO,MAAM,EAAW,QAAQ,GAAG,YAAY;GAG/F,mBAAmB,OAAO,MAAM,kBAC/B,IAAI,iBAAiB,UAAU,WAAW,OAAO,MAAM,EAAW,QAAQ,CAAC;EAC7E;CACD;CAGA,MAAM,UAAU,kBAAkB,IAAI,WAAW,IAAI;CACrD,MAAM,SAAS,oBAAoB,MAAM,wBAAwB;CACjE,MAAM,MACL,OAAA,YAA2C,OAAA,6BACxC,IAAI,UAAU,MAAM,IACpB,OAAA,cACC,IAAI,aAAa,MAAM,IACvB,IAAI,eAAe,MAAM;CAC9B,OAAO;EACN,wBAAwB,OAAO,MAAM,iBACpC,IAAI,sBAAsB,UAAU,WAAW,OAAO,MAAM,EAAW,QAAQ,GAAG,YAAY;EAC/F,mBAAmB,OAAO,MAAM,iBAC/B,IAAI,iBAAiB,UAAU,WAAW,OAAO,MAAM,EAAW,QAAQ,GAAG,YAAY;CAC3F;AACD;AAEA,SAAS,oBACR,MACA,0BACoB;CACpB,OAAO;EACN,QAAQ,OAAO,SAAS,KAAK,MAAM,OAAO,IAAI;EACpB;CAC3B;AACD;AAEA,SAAS,mBAAmB,IAA0B,OAA+C;CACpG,MAAM,QAAQ,MAAM,SAAS;CAC7B,OAAO;EACN,GAAG,YAAY,IAAI,MAAM,aAAa;GAAS;GAAO,MAAM,KAAA;GAAW,QAAQ,MAAM;EAAO,CAAC;EAC7F,aAAa,MAAM;CACpB;AACD;;AAGA,SAAS,mBAAmB,IAA0B,QAAgB,iBAA8C;CACnH,MAAM,WAAW,kBAAkB;CACnC,OAAO;EACF;EACJ,MAAM,SAAS;EACP;EACR,MAAM,SAAS;EACf,0BAA0B;EAC1B,sBAAsB,QAAQ,QAAQ;EACtC,6BAA6B,CAAC;CAC/B;AACD;;AAGA,SAAS,YAAY,QAAwB;CAC5C,OAAO,OAAO,QAAQ,wBAAwB,EAAE,CAAC,CAAC,QAAQ,QAAQ,EAAE;AACrE;;;;;;;AAQA,SAAS,wBACR,IACA,MACqB;CACrB,OAAO,OAAA,WAA0C,KAAA,IAAY,WAAW,KAAK;AAC9E;;;;;;;AAQA,SAAS,kBACR,IAIA,WACA,MACS;CACT,QAAQ,IAAR;EACC,KAAA,UACC,OAAO;EACR,KAAA,4BACC,OAAO,WAAW,KAAK;EACxB,KAAA,aACC,OAAO;EACR,KAAA,eACC,OAAO;EACR,KAAA,uBAEC,OAAO,UAAU,SAAS,KAAK,IAAI,UAAU,QAAQ,QAAQ,EAAE,IAAI,WAAW;CAChF;AACD"}
1
+ {"version":3,"file":"lite.js","names":[],"sources":["../../../../plus/integrations/src/lite.ts"],"sourcesContent":["// A lightweight, token-scoped entry point for stateless single-shot provider reads.\n//\n// Unlike `createIntegrationManager`, this does NOT build an `IntegrationServiceContext`\n// (no storage/account/config/cache/repositories/hooks) and runs no session/OAuth lifecycle.\n// A consumer that already holds a provider access token (obtained by its own means, e.g.\n// the GitKraken account backend's `v1/provider-tokens/{provider}` endpoint) can call the\n// per-provider API client directly and get back the same DTOs the session-managed\n// `GitHostIntegration` returns.\n//\n// Provider notes:\n// - Azure DevOps encodes the repository as the composite string `\"{project}/_git/{repoName}\"`\n// in the `repo` argument (matching the descriptor `GitHostIntegration` uses); `owner` is the\n// organization. Pass `repo` in that shape for Azure.\n// - Bitbucket Cloud `getDefaultBranch`/`getRepositoryMetadata` depend on `mainbranch`/`parent`\n// fields the API may omit for some repos; they resolve to `undefined` when absent.\n// - Bitbucket Server (`bitbucket-server`) is not supported here — its reads use a different\n// REST surface that this token-scoped path doesn't wire up.\n\nimport type { GitHubApiConfig } from '@gitlens/git-github/api/config.js';\nimport { GitHubApi } from '@gitlens/git-github/api/github.js';\nimport type { DefaultBranch } from '@gitlens/git/models/defaultBranch.js';\nimport type { Provider } from '@gitlens/git/models/remoteProvider.js';\nimport type { RepositoryMetadata } from '@gitlens/git/models/repositoryMetadata.js';\nimport { trimTrailingSlashes } from '@gitlens/utils/path.js';\nimport type { TokenWithInfo } from './authentication/models.js';\nimport { toTokenInfo } from './authentication/models.js';\nimport { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId } from './constants.js';\nimport type { ProviderApiConfig } from './providers/apiConfig.js';\nimport { AzureDevOpsApi } from './providers/azure/azure.js';\nimport { BitbucketApi } from './providers/bitbucket/bitbucket.js';\nimport { GitLabApi } from './providers/gitlab/gitlab.js';\nimport { providersMetadata } from './providers/models.js';\n\n/** The git-hosting integrations that expose a token-scoped read path here. */\nexport type TokenScopedGitHostId =\n\t| GitCloudHostIntegrationId.GitHub\n\t| GitCloudHostIntegrationId.GitLab\n\t| GitCloudHostIntegrationId.Bitbucket\n\t| GitCloudHostIntegrationId.AzureDevOps\n\t| GitSelfManagedHostIntegrationId.CloudGitHubEnterprise\n\t| GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted\n\t| GitSelfManagedHostIntegrationId.AzureDevOpsServer;\n\nexport interface TokenScopedGitHostToken {\n\t/** The provider access token the consumer already holds. */\n\treadonly accessToken: string;\n\t/**\n\t * Host domain for self-managed instances (e.g. `git.example.com`). Ignored for cloud ids. For an Azure\n\t * DevOps Server reachable over plain HTTP, include the scheme (e.g. `http://tfs.example.com`); otherwise\n\t * `https` is assumed.\n\t */\n\treadonly domain?: string;\n\t/** Optional scopes carried by the token, surfaced only in logging metadata. */\n\treadonly scopes?: readonly string[];\n\t/** Whether the token came from a GK-cloud connection (vs a raw PAT). Defaults to `true`. */\n\treadonly cloud?: boolean;\n}\n\nexport interface TokenScopedHttpConfig {\n\t/** The `fetch` implementation to use for HTTP requests. */\n\tfetch(input: string | URL, init?: RequestInit): Promise<Response>;\n\t/**\n\t * Wrap an async op so TLS validation is disabled when `ignoreSSLErrors` is `'force'`. Optional —\n\t * defaults to a pass-through, which is correct for the browser and for any consumer not toggling SSL.\n\t */\n\twrapForForcedInsecureSSL?<T>(ignoreSSLErrors: boolean | 'force', fn: () => Promise<T> | PromiseLike<T>): Promise<T>;\n\t/** Whether to ignore SSL certificate errors on requests. Defaults to `false`. */\n\tignoreSSLErrors?: boolean | 'force';\n\t/**\n\t * Whether the consumer runs in a web worker / browser (vs Node.js). GitHub uses this to drop the\n\t * `user-agent` header, which browsers reject and warn about. Defaults to `false`.\n\t */\n\tisWeb?: boolean;\n}\n\n/** The stateless reads a token-scoped integration exposes. */\nexport interface TokenScopedGitHostIntegration {\n\tgetRepositoryMetadata(\n\t\towner: string,\n\t\trepo: string,\n\t\tcancellation?: AbortSignal,\n\t): Promise<RepositoryMetadata | undefined>;\n\tgetDefaultBranch(owner: string, repo: string, cancellation?: AbortSignal): Promise<DefaultBranch | undefined>;\n}\n\n/**\n * Build a token-scoped git-host integration for a single provider, backed only by a `fetch` + a token —\n * no `IntegrationServiceContext`, no session/OAuth lifecycle. The returned DTOs match those from the\n * session-managed {@link GitHostIntegration}.\n */\nexport function createTokenScopedGitHostIntegration(\n\tid: TokenScopedGitHostId,\n\ttoken: TokenScopedGitHostToken,\n\thttp: TokenScopedHttpConfig,\n): TokenScopedGitHostIntegration {\n\t// `token.domain` only applies to self-managed ids; cloud ids always use their canonical domain.\n\tconst selfManaged =\n\t\tid === GitSelfManagedHostIntegrationId.CloudGitHubEnterprise ||\n\t\tid === GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted ||\n\t\tid === GitSelfManagedHostIntegrationId.AzureDevOpsServer;\n\t// Self-managed ids carry no canonical domain (`providersMetadata[id].domain` is empty), so a missing\n\t// `token.domain` would silently build a malformed base URL (e.g. `https:///api/v3`). Fail fast instead.\n\tif (selfManaged && !token.domain) {\n\t\tthrow new Error(`A token-scoped integration for the self-managed host '${id}' requires 'token.domain'.`);\n\t}\n\n\tconst rawDomain = (selfManaged && token.domain) || providersMetadata[id].domain;\n\t// The provider/DTO domain drops the scheme (a subpath/collection is preserved for Azure Server and subpath\n\t// installs); only Azure DevOps Server's base URL honors an explicit scheme (per its doc). Stripping keeps a\n\t// scheme out of the DTO and prevents a malformed base URL (e.g. `https://http://host/api/v3`) if one is\n\t// accidentally passed for GHE/GitLab.\n\tconst host = stripScheme(rawDomain);\n\tconst provider = createProviderStub(id, host, http.ignoreSSLErrors ?? false);\n\tconst tokenInfo = buildTokenWithInfo(id, token);\n\n\tconst wrapForForcedInsecureSSL: NonNullable<TokenScopedHttpConfig['wrapForForcedInsecureSSL']> =\n\t\t// `Promise.resolve().then(fn)` (not `Promise.resolve(fn())`) so a synchronous throw in `fn` surfaces as\n\t\t// a rejected promise, honoring the `Promise<T>` contract.\n\t\thttp.wrapForForcedInsecureSSL ?? ((_ignore, fn) => Promise.resolve().then(fn));\n\n\t// GitHub has its own VS Code-free config type and a `getDefaultBranch` without a cancellation param.\n\tif (id === GitCloudHostIntegrationId.GitHub || id === GitSelfManagedHostIntegrationId.CloudGitHubEnterprise) {\n\t\tconst config: GitHubApiConfig = {\n\t\t\tisWeb: http.isWeb ?? false,\n\t\t\tfetch: (url, init) => http.fetch(url, init),\n\t\t\twrapForForcedInsecureSSL: wrapForForcedInsecureSSL,\n\t\t};\n\t\tconst api = new GitHubApi(config);\n\t\t// GitHub is the one family whose base URL can legitimately be absent — see `resolveGitHubApiBaseUrl`.\n\t\tconst baseUrl = resolveGitHubApiBaseUrl(id, host);\n\t\treturn {\n\t\t\tgetRepositoryMetadata: (owner, repo, cancellation) =>\n\t\t\t\tapi.getRepositoryMetadata(provider, tokenInfo, owner, repo, { baseUrl: baseUrl }, cancellation),\n\t\t\t// `GitHubApi.getDefaultBranch` has no cancellation param; accept and intentionally ignore it here so\n\t\t\t// the signature matches the other providers and the drop is explicit at the call site.\n\t\t\tgetDefaultBranch: (owner, repo, _cancellation) =>\n\t\t\t\tapi.getDefaultBranch(provider, tokenInfo, owner, repo, { baseUrl: baseUrl }),\n\t\t};\n\t}\n\n\t// GitLab, Bitbucket, and Azure DevOps share the `ProviderApiConfig` client shape and identical read signatures.\n\tconst baseUrl = resolveApiBaseUrl(id, rawDomain, host);\n\tconst config = toProviderApiConfig(http, wrapForForcedInsecureSSL);\n\tconst api =\n\t\tid === GitCloudHostIntegrationId.GitLab || id === GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted\n\t\t\t? new GitLabApi(config)\n\t\t\t: id === GitCloudHostIntegrationId.Bitbucket\n\t\t\t\t? new BitbucketApi(config)\n\t\t\t\t: new AzureDevOpsApi(config);\n\treturn {\n\t\tgetRepositoryMetadata: (owner, repo, cancellation) =>\n\t\t\tapi.getRepositoryMetadata(provider, tokenInfo, owner, repo, { baseUrl: baseUrl }, cancellation),\n\t\tgetDefaultBranch: (owner, repo, cancellation) =>\n\t\t\tapi.getDefaultBranch(provider, tokenInfo, owner, repo, { baseUrl: baseUrl }, cancellation),\n\t};\n}\n\nfunction toProviderApiConfig(\n\thttp: TokenScopedHttpConfig,\n\twrapForForcedInsecureSSL: NonNullable<TokenScopedHttpConfig['wrapForForcedInsecureSSL']>,\n): ProviderApiConfig {\n\treturn {\n\t\tfetch: (input, init) => http.fetch(input, init),\n\t\twrapForForcedInsecureSSL: wrapForForcedInsecureSSL,\n\t};\n}\n\nfunction buildTokenWithInfo(id: TokenScopedGitHostId, token: TokenScopedGitHostToken): TokenWithInfo {\n\tconst cloud = token.cloud ?? true;\n\treturn {\n\t\t...toTokenInfo(id, token.accessToken, { cloud: cloud, type: undefined, scopes: token.scopes }),\n\t\taccessToken: token.accessToken,\n\t};\n}\n\n/** A minimal {@link Provider} for the API clients: identity + no-op reauth/telemetry, SSL from config. */\nfunction createProviderStub(id: TokenScopedGitHostId, domain: string, ignoreSSLErrors: boolean | 'force'): Provider {\n\tconst metadata = providersMetadata[id];\n\treturn {\n\t\tid: id,\n\t\tname: metadata.name,\n\t\tdomain: domain,\n\t\ticon: metadata.iconKey,\n\t\tgetIgnoreSSLErrors: () => ignoreSSLErrors,\n\t\treauthenticate: () => Promise.resolve(),\n\t\ttrackRequestException: () => {},\n\t};\n}\n\n/** Strips a leading `scheme://` and any trailing slashes; a subpath/collection (e.g. `host/tfs/Col`) is preserved. */\nfunction stripScheme(domain: string): string {\n\treturn trimTrailingSlashes(domain.replace(/^[a-z][\\w+.-]*:\\/\\//i, ''));\n}\n\n/**\n * GitHub's base URL, which `@gitkraken/provider-apis` derives BOTH the REST and the GraphQL endpoint from. Omitting it\n * is what selects the cloud endpoints, so cloud passes nothing. Mirrors the cloud `GitHubIntegration.apiBaseUrlFor`.\n */\nfunction resolveGitHubApiBaseUrl(\n\tid: GitCloudHostIntegrationId.GitHub | GitSelfManagedHostIntegrationId.CloudGitHubEnterprise,\n\thost: string,\n): string | undefined {\n\treturn id === GitCloudHostIntegrationId.GitHub ? undefined : `https://${host}/api/v3`;\n}\n\n/**\n * Mirrors the per-provider `apiBaseUrlFor` methods on the `GitHostIntegration` subclasses for an installation at\n * the host root. Covers every family whose base URL is always concrete (GitHub's is not — see\n * {@link resolveGitHubApiBaseUrl}). `rawDomain` may carry a scheme (only Azure DevOps Server honors it); `host` is\n * the bare host used everywhere else.\n */\nfunction resolveApiBaseUrl(\n\tid: Exclude<\n\t\tTokenScopedGitHostId,\n\t\tGitCloudHostIntegrationId.GitHub | GitSelfManagedHostIntegrationId.CloudGitHubEnterprise\n\t>,\n\trawDomain: string,\n\thost: string,\n): string {\n\tswitch (id) {\n\t\tcase GitCloudHostIntegrationId.GitLab:\n\t\t\treturn 'https://gitlab.com/api';\n\t\tcase GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted:\n\t\t\treturn `https://${host}/api`;\n\t\tcase GitCloudHostIntegrationId.Bitbucket:\n\t\t\treturn 'https://api.bitbucket.org/2.0';\n\t\tcase GitCloudHostIntegrationId.AzureDevOps:\n\t\t\treturn 'https://dev.azure.com';\n\t\tcase GitSelfManagedHostIntegrationId.AzureDevOpsServer:\n\t\t\t// Mirror the session-managed getter, which honors the connection protocol; default to https.\n\t\t\treturn rawDomain.includes('://') ? trimTrailingSlashes(rawDomain) : `https://${host}`;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AA0FA,SAAgB,oCACf,IACA,OACA,MACgC;CAEhC,MAAM,cACL,OAAA,6BACA,OAAA,8BACA,OAAA;CAGD,IAAI,eAAe,CAAC,MAAM,QACzB,MAAM,IAAI,MAAM,yDAAyD,GAAG,2BAA2B;CAGxG,MAAM,YAAa,eAAe,MAAM,UAAW,kBAAkB,GAAG,CAAC;CAKzE,MAAM,OAAO,YAAY,SAAS;CAClC,MAAM,WAAW,mBAAmB,IAAI,MAAM,KAAK,mBAAmB,KAAK;CAC3E,MAAM,YAAY,mBAAmB,IAAI,KAAK;CAE9C,MAAM,2BAGL,KAAK,8BAA8B,SAAS,OAAO,QAAQ,QAAQ,CAAC,CAAC,KAAK,EAAE;CAG7E,IAAI,OAAA,YAA2C,OAAA,2BAA8D;EAC5G,MAAM,SAA0B;GAC/B,OAAO,KAAK,SAAS;GACrB,QAAQ,KAAK,SAAS,KAAK,MAAM,KAAK,IAAI;GAChB;EAC3B;EACA,MAAM,MAAM,IAAI,UAAU,MAAM;EAEhC,MAAM,UAAU,wBAAwB,IAAI,IAAI;EAChD,OAAO;GACN,wBAAwB,OAAO,MAAM,iBACpC,IAAI,sBAAsB,UAAU,WAAW,OAAO,MAAM,EAAW,QAAQ,GAAG,YAAY;GAG/F,mBAAmB,OAAO,MAAM,kBAC/B,IAAI,iBAAiB,UAAU,WAAW,OAAO,MAAM,EAAW,QAAQ,CAAC;EAC7E;CACD;CAGA,MAAM,UAAU,kBAAkB,IAAI,WAAW,IAAI;CACrD,MAAM,SAAS,oBAAoB,MAAM,wBAAwB;CACjE,MAAM,MACL,OAAA,YAA2C,OAAA,6BACxC,IAAI,UAAU,MAAM,IACpB,OAAA,cACC,IAAI,aAAa,MAAM,IACvB,IAAI,eAAe,MAAM;CAC9B,OAAO;EACN,wBAAwB,OAAO,MAAM,iBACpC,IAAI,sBAAsB,UAAU,WAAW,OAAO,MAAM,EAAW,QAAQ,GAAG,YAAY;EAC/F,mBAAmB,OAAO,MAAM,iBAC/B,IAAI,iBAAiB,UAAU,WAAW,OAAO,MAAM,EAAW,QAAQ,GAAG,YAAY;CAC3F;AACD;AAEA,SAAS,oBACR,MACA,0BACoB;CACpB,OAAO;EACN,QAAQ,OAAO,SAAS,KAAK,MAAM,OAAO,IAAI;EACpB;CAC3B;AACD;AAEA,SAAS,mBAAmB,IAA0B,OAA+C;CACpG,MAAM,QAAQ,MAAM,SAAS;CAC7B,OAAO;EACN,GAAG,YAAY,IAAI,MAAM,aAAa;GAAS;GAAO,MAAM,KAAA;GAAW,QAAQ,MAAM;EAAO,CAAC;EAC7F,aAAa,MAAM;CACpB;AACD;;AAGA,SAAS,mBAAmB,IAA0B,QAAgB,iBAA8C;CACnH,MAAM,WAAW,kBAAkB;CACnC,OAAO;EACF;EACJ,MAAM,SAAS;EACP;EACR,MAAM,SAAS;EACf,0BAA0B;EAC1B,sBAAsB,QAAQ,QAAQ;EACtC,6BAA6B,CAAC;CAC/B;AACD;;AAGA,SAAS,YAAY,QAAwB;CAC5C,OAAO,oBAAoB,OAAO,QAAQ,wBAAwB,EAAE,CAAC;AACtE;;;;;AAMA,SAAS,wBACR,IACA,MACqB;CACrB,OAAO,OAAA,WAA0C,KAAA,IAAY,WAAW,KAAK;AAC9E;;;;;;;AAQA,SAAS,kBACR,IAIA,WACA,MACS;CACT,QAAQ,IAAR;EACC,KAAA,UACC,OAAO;EACR,KAAA,4BACC,OAAO,WAAW,KAAK;EACxB,KAAA,aACC,OAAO;EACR,KAAA,eACC,OAAO;EACR,KAAA,uBAEC,OAAO,UAAU,SAAS,KAAK,IAAI,oBAAoB,SAAS,IAAI,WAAW;CACjF;AACD"}
@@ -142,12 +142,22 @@ export declare abstract class GitHostIntegration<ID extends IntegrationIds = Int
142
142
  cancellation?: AbortSignal;
143
143
  expiryOverride?: boolean | number;
144
144
  }): Promise<DefaultBranch | undefined>;
145
+ /**
146
+ * Reads one repository. `readAt`, when set, is where it was read, which may not be where `repo` names it: an Azure
147
+ * DevOps Server integration may read a remote's path as another collection and project than the remote parser did.
148
+ */
145
149
  getRepoInfo?(repo: {
146
150
  owner: string;
147
151
  name: string;
148
152
  project?: string;
149
153
  connectionId?: string;
150
- }): Promise<ProviderRepository | undefined>;
154
+ }): Promise<(ProviderRepository & {
155
+ readAt?: {
156
+ owner: string;
157
+ name: string;
158
+ project?: string;
159
+ };
160
+ }) | undefined>;
151
161
  /**
152
162
  * Settles what one repository's refusal of the credential means, as a batch read settles a refused target (see
153
163
  * `IntegrationBase.settleBatchRefusals`): the scope failure it is recorded as, against that repository as the host