@gitkraken/core-gitlens 0.49.0 → 0.51.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 +15 -1
  2. package/dist/git-cli/providers/config.js +2 -2
  3. package/dist/git-cli/providers/pausedOperations.js +2 -2
  4. package/dist/git-cli/providers/pausedOperations.js.map +1 -1
  5. package/dist/git-cli/providers/staging.js +1 -1
  6. package/dist/ipc/discovery.js +1 -1
  7. package/dist/plus/agents/providers/claudeCodeTranscript.js +6 -6
  8. package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
  9. package/dist/plus/ai/providers/openAICompatibleProviderBase.js +1 -1
  10. package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts +1 -0
  11. package/dist/plus/integrations/authentication/integrationAuthenticationService.js +3 -0
  12. package/dist/plus/integrations/authentication/integrationAuthenticationService.js.map +1 -1
  13. package/dist/plus/integrations/index.d.ts +4 -2
  14. package/dist/plus/integrations/index.js.map +1 -1
  15. package/dist/plus/integrations/integrationService.d.ts +14 -0
  16. package/dist/plus/integrations/integrationService.js +83 -0
  17. package/dist/plus/integrations/integrationService.js.map +1 -1
  18. package/dist/plus/integrations/manager.d.ts +10 -0
  19. package/dist/plus/integrations/models/azurePullRequestWrites.d.ts +93 -0
  20. package/dist/plus/integrations/models/azurePullRequestWrites.js +0 -0
  21. package/dist/plus/integrations/models/workItemWrites.d.ts +136 -0
  22. package/dist/plus/integrations/models/workItemWrites.js +0 -0
  23. package/dist/plus/integrations/providers/azure/azure.js +1 -1
  24. package/dist/plus/integrations/providers/azure/models.d.ts +1 -1
  25. package/dist/plus/integrations/providers/azure/models.js.map +1 -1
  26. package/dist/plus/integrations/providers/azure/workItemWriteMetadata.d.ts +38 -0
  27. package/dist/plus/integrations/providers/azure/workItemWriteMetadata.js +73 -0
  28. package/dist/plus/integrations/providers/azure/workItemWriteMetadata.js.map +1 -0
  29. package/dist/plus/integrations/providers/azure/writeIdentity.d.ts +17 -0
  30. package/dist/plus/integrations/providers/azure/writeIdentity.js +33 -0
  31. package/dist/plus/integrations/providers/azure/writeIdentity.js.map +1 -0
  32. package/dist/plus/integrations/providers/azureDevOps.d.ts +7 -0
  33. package/dist/plus/integrations/providers/azureDevOps.js +23 -1
  34. package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
  35. package/dist/plus/integrations/providers/azureDevOpsServer.d.ts +1 -1
  36. package/dist/plus/integrations/providers/azurePullRequestWriteErrors.d.ts +11 -0
  37. package/dist/plus/integrations/providers/azurePullRequestWriteErrors.js +72 -0
  38. package/dist/plus/integrations/providers/azurePullRequestWriteErrors.js.map +1 -0
  39. package/dist/plus/integrations/providers/azurePullRequestWrites.d.ts +36 -0
  40. package/dist/plus/integrations/providers/azurePullRequestWrites.js +443 -0
  41. package/dist/plus/integrations/providers/azurePullRequestWrites.js.map +1 -0
  42. package/dist/plus/integrations/providers/azureWorkItemWriteErrors.d.ts +14 -0
  43. package/dist/plus/integrations/providers/azureWorkItemWriteErrors.js +91 -0
  44. package/dist/plus/integrations/providers/azureWorkItemWriteErrors.js.map +1 -0
  45. package/dist/plus/integrations/providers/azureWorkItemWrites.d.ts +38 -0
  46. package/dist/plus/integrations/providers/azureWorkItemWrites.js +431 -0
  47. package/dist/plus/integrations/providers/azureWorkItemWrites.js.map +1 -0
  48. package/dist/plus/integrations/providers/providersApi.d.ts +7 -1
  49. package/dist/plus/integrations/providers/providersApi.js +15 -0
  50. package/dist/plus/integrations/providers/providersApi.js.map +1 -1
  51. package/dist/utils/env/node/exec.js +2 -2
  52. package/docs/integrations.md +117 -0
  53. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
1
  import { getScopedLogger, maybeStartScopedLogger } from "../../logger.scoped.js";
2
2
  import { isWindows } from "./platform.js";
3
3
  import { join } from "path";
4
- import { execFile, spawn } from "child_process";
5
- import { access, constants } from "fs";
6
4
  import { stat } from "fs/promises";
7
5
  import * as process from "process";
6
+ import { execFile, spawn } from "child_process";
7
+ import { access, constants } from "fs";
8
8
  //#region ../utils/src/env/node/exec.ts
9
9
  var RunError = class extends Error {
10
10
  cmd;
@@ -983,6 +983,123 @@ credential. `mutationDispatched: false` means Core stopped before sending the wr
983
983
  `applied: 'maybe'` as uncertain and reconcile the issue state before retrying. A successful delete
984
984
  requires Jira's `204` acknowledgement. Jira can also return `404` when visibility changes. [Jira Cloud REST v2 issue operations](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/)
985
985
 
986
+ ### Azure DevOps Services work item writes
987
+
988
+ Use the work item methods on `IntegrationManager` from `@gitkraken/core-gitlens/plus/integrations/index.js`.
989
+ Every request names `GitCloudHostIntegrationId.AzureDevOps`, the selected `connectionId`, the Azure
990
+ `organizationId` and `organizationName`, and the `projectId`. Use the IDs and names returned by
991
+ Azure discovery. Existing-item operations also take a numeric `workItemId` scoped to that organization
992
+ and project.
993
+
994
+ | Method | Additional input | Success |
995
+ | ---------------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
996
+ | `getWorkItemCreateOptions` | Optional `workItemType` (Azure type name) | Enabled type names, or the selected type's fields, states, initial states and optional `bodyField`. |
997
+ | `getWorkItemWriteOptions` | `workItemId` | Current work item with revision, editable fields, candidate states, optional `bodyField` and delete capability. |
998
+ | `writeWorkItem` | `action: 'create'`, `workItemType`, `expectedAccountId`, `fields` | Created work item. |
999
+ | `writeWorkItem` | `action: 'edit'`, `workItemId`, `expectedAccountId`, `expectedRevision`, `fields` | Updated work item. |
1000
+ | `writeWorkItem` | `action: 'set-state'`, `workItemId`, `expectedAccountId`, `expectedRevision`, `state`, optional `fields` | Updated work item with state name and Azure category. |
1001
+ | `resolveWorkItemWriteTarget` | `workItemId`, optional `intent: 'delete'` | Canonical item and account for confirmation, with capability on delete intent. |
1002
+ | `deleteWorkItem` | `workItemId`, `expectedAccountId`, `expectedRevision` | Confirmed Recycle Bin result with `disposition: 'recycle-bin'`, `restorable: true`, `revision` and optional `deletedAt`. |
1003
+
1004
+ Pass the verified `accountId` returned by the options or target call as `expectedAccountId`. It is the Azure
1005
+ profile ID. The organization-local member ID used for viewer filters has a different purpose. Core resolves
1006
+ the selected read connection, checks the live Azure profile and the organization/project coordinates, and
1007
+ rechecks that the selected connection's credential is unchanged before dispatch. A profile that doesn't match
1008
+ `expectedAccountId` returns `no-connection`. Azure DevOps Services work item writes require an OAuth or Entra
1009
+ credential that can read the live Azure profile. Core returns `unsupported` without sending a request to
1010
+ Azure when the selected session has `type: 'pat'`. Before dispatch, an HTTP 401 or 403 that names a missing
1011
+ scope returns `insufficient-scope`, any other HTTP 401 or a sign-in page returns `no-connection`, and any
1012
+ other HTTP 403 returns `forbidden`.
1013
+
1014
+ Field keys are Azure reference names such as `System.Title` or `Custom.Sponsor`. For rich text, use the
1015
+ returned `bodyField` such as `Microsoft.VSTS.TCM.ReproSteps` when available. Options report the type's
1016
+ always-required writable fields, configured defaults and allowed values. A field without a value list has no
1017
+ `allowedValues`. Azure assigns the area and iteration when a create omits them. `System.AreaPath` and
1018
+ `System.IterationPath` are never required, and their values must be paths in the selected project. Of the
1019
+ `System.*` fields, Core accepts only `Title`, `Description`, `AssignedTo`, `Tags`, `Reason`, `History`,
1020
+ `AreaPath` and `IterationPath`; other fields follow Azure's read-only flag. Edits use `null` to clear a
1021
+ field. Send the selected state name through `set-state`. Azure applies conditional field and transition
1022
+ rules at save time. `Removed` is a workflow category that hides the item from boards, while delete moves it
1023
+ to the Recycle Bin.
1024
+
1025
+ Keep the item and revision returned by target resolution across confirmation. Edit and state changes send
1026
+ the expected revision as a JSON Patch precondition that Azure checks atomically. Azure exposes no such check
1027
+ on DELETE and doesn't enforce the project in the DELETE path. Before sending the request, Core checks the
1028
+ delete permission and test artifact types, then rereads the item for its project, revision and type, and
1029
+ rechecks the credential last. Afterwards it verifies Azure's deletion record, from the DELETE response or
1030
+ the Recycle Bin, by its item ID, project and revision. A plain success means the approved item was deleted
1031
+ at the next revision. When the record shows another project, or doesn't show exactly the next revision, the
1032
+ result is `{ ok: false, reason: 'target-changed', applied: true }`. It carries the deleted item's `project`
1033
+ and, when Azure reports it, its `revision` under `deleted`, and the Recycle Bin `deletion`. `deletedAt` is an
1034
+ ISO 8601 UTC timestamp, omitted when Core doesn't recognize Azure's deletion date format.
1035
+ `deleted.project.id` equals the approved project's ID when only the revision differs; it's absent when Core
1036
+ couldn't resolve the project. A missing `deleted.revision` means Azure didn't report it. Treat it as a
1037
+ confirmed deletion that Core can't match to the approved item and revision, not as a success. Core never
1038
+ sends a second DELETE, a restore or a permanent deletion. The delete capability reflects Azure's project
1039
+ permission. It's `allowed: 'unknown'` when Azure won't report the permission to the credential, and Azure
1040
+ decides at dispatch. Test artifacts use a separate Azure deletion flow and return `unsupported` for delete
1041
+ intent. Core identifies them by type and by Azure's test work item categories.
1042
+
1043
+ Failures use `IssueTrackerWriteFailure`, including Azure field errors on `invalid-input` and `conflict`
1044
+ for stale revisions. A scope refusal leaves the read connection usable. After dispatch, Azure's HTTP 401 or
1045
+ 403 is `insufficient-scope` when Azure names the missing scope and `forbidden` otherwise. An HTTP 429,
1046
+ including one produced by the host's fetch, is `rate-limit` and never reported as applied. When Core cannot
1047
+ confirm the result of a dispatched write, it returns `applied: 'maybe'`. Reconcile the provider state before
1048
+ attempting a new write.
1049
+
1050
+ ### Azure DevOps Services pull request writes
1051
+
1052
+ The following `IntegrationManager` methods and their types are exported from
1053
+ `@gitkraken/core-gitlens/plus/integrations/index.js`.
1054
+
1055
+ | Method | Input | Success |
1056
+ | ------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
1057
+ | `getAzurePullRequestCreateCapability` | `connectionId`, `organization`, project and repository names or IDs, optional `expectedAccountId`. | Live Azure profile ID and canonical organization, project and repository. |
1058
+ | `resolveAzurePullRequestWriteTarget` | The same scope plus the pull request `number`. | Live profile ID, pull request snapshot and action capabilities, including allowed merge types. |
1059
+ | `writeAzurePullRequest` | `connectionId`, `expectedAccountId`, `organization`, `projectId`, `repositoryId` and one of the actions below. | A typed write status and pull request receipt. |
1060
+
1061
+ - `create` takes fully qualified `sourceRef` and `targetRef` in the selected repository, `title` and optional `description`.
1062
+ - `edit` takes `number` and at least one of `title` or `description`. Pass an empty description to clear it.
1063
+ - `abandon` and `reactivate` take `number`.
1064
+ - `complete` takes `number`, `strategy`, `expectedSourceRef`, `expectedSourceSha`, `expectedTargetRef` and `expectedTargetSha`.
1065
+ Strategy values are `noFastForward`, `squash`, `rebase` and `rebaseMerge`.
1066
+
1067
+ Use the connection that read the repository or pull request. Keep the returned `accountId` as
1068
+ `expectedAccountId` and the canonical repository and PR number across confirmation. This API uses Azure
1069
+ DevOps Services OAuth or Entra credentials with profile, organization and repository access. Writes
1070
+ require `vso.code_write` or a scope that includes it, such as `vso.code_manage`. A selected PAT reports
1071
+ `unsupported`. Azure DevOps Server has its own integration. Core checks the live profile and the scope,
1072
+ then checks that the same credential is still current immediately before dispatch.
1073
+
1074
+ Capabilities reflect repository and PR state, applicable blocking merge strategy policies, and the refs
1075
+ available for confirmation. Azure evaluates the viewer's write permissions and required reviewers and
1076
+ policies at dispatch. Draft and fork PRs are unavailable for completion through this API. For drafts,
1077
+ Azure requires a ready PR. The completion contract carries the source ref in the selected repository,
1078
+ which cannot identify a fork repository.
1079
+
1080
+ Keep both fully qualified refs and SHAs from a resolved target with completion available. In that
1081
+ snapshot, `targetSha` is the exact live target ref tip. Azure's `lastMergeTargetCommit` describes its
1082
+ last merge preview and can remain behind the branch tip. Core checks the preview's source commit against
1083
+ the live source tip and sends Azure the approved SHA in `lastMergeSourceCommit`.
1084
+
1085
+ Before dispatch Core checks the strategy and live refs, rereads the PR for retargeting, and checks the
1086
+ approved target tip again. A conflict from the current preview blocks completion. If the preview targets
1087
+ an older tip, Azure evaluates the current merge on dispatch. A queued merge remains unavailable for
1088
+ completion. Azure's update API provides no atomic target or PR revision comparison, so the target may
1089
+ move after the preflight reads.
1090
+ Completion explicitly requests the selected merge strategy with policy bypass disabled.
1091
+ See the [Azure DevOps update API](https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-requests/update?view=azure-devops-rest-7.1)
1092
+ and [scoped policy configurations API](https://learn.microsoft.com/en-us/rest/api/azure/devops/git/policy-configurations/get?view=azure-devops-rest-7.1).
1093
+
1094
+ `forbidden` includes write-scope and permission rejections. `policy-blocked`, `invalid-input`,
1095
+ `conflict`, `source-changed`, and `target-changed` distinguish provider and preflight failures.
1096
+ `completed` confirms Azure reported the PR completed and the merge succeeded. `pending` acknowledges a queued completion.
1097
+ The typed target read reports the PR as active while Azure still reports the merge queued, even if Azure
1098
+ sets its PR status to completed. A completed PR status with a failed or unconfirmed merge reports a
1099
+ failure. Use the typed read to reconcile pending completion before publishing a merged state.
1100
+ `outcome-unknown` means Core dispatched a write and could not confirm the result. For pending or
1101
+ uncertain writes, reconcile with a read before attempting another write. Core sends each mutation once.
1102
+
986
1103
  ### GitHub and GitHub Enterprise Server pull request writes
987
1104
 
988
1105
  Use `providerId: 'github'` and the `connectionId` that read the repository or pull request. Pass the
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gitkraken/core-gitlens",
3
3
  "description": "GitLens core — shared Git / AI / GitHub primitives for internal GitKraken consumption",
4
- "version": "0.49.0",
4
+ "version": "0.51.0",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": {
7
7
  "name": "GitKraken",