@noldova/git.github.protocol 0.0.6 → 0.0.8

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noldova/git.github.protocol",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "What the GitHub module's parts share: GitHubNames, the module's id, method, event, tool and service names, and the IGitHubAccess service through which another module reads the signed-in token as a GitHubAccessGrant, or why not as a GitHubAccessRefusal.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,7 +30,7 @@
30
30
  "registry": "https://registry.npmjs.org/"
31
31
  },
32
32
  "dependencies": {
33
- "@noldova/git.hosting.protocol": "0.0.6"
33
+ "@noldova/git.hosting.protocol": "0.0.8"
34
34
  },
35
- "gitHead": "1c2798e01c4c0ae4f1757fd56b0cf7346a219f58"
35
+ "gitHead": "9915474fda79eb6cadb9d336d7ca47f8c28ad4dd"
36
36
  }
@@ -6,6 +6,8 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
8
 
9
+ import type { HostCapabilities } from "@noldova/git.hosting.protocol";
10
+
9
11
  /**
10
12
  * The names the GitHub module's parts share.
11
13
  *
@@ -80,6 +82,50 @@ export declare class GitHubNames {
80
82
  */
81
83
  public static readonly createPullRequestMethod: string;
82
84
 
85
+ /**
86
+ * `git-github.readAuthorAvatar`: takes an `AuthorQuery` as JSON and answers the author's GitHub picture as `HostAvatar` JSON: for a GitHub
87
+ * no-reply email, the account it names, and signed in, the account GitHub links to the commit; else, and for a repository not on
88
+ * `github.com`, none.
89
+ */
90
+ public static readonly readAuthorAvatarMethod: string;
91
+
92
+ /**
93
+ * `git-github.readPullRequests`: takes a `RepositoryQuery` as JSON and answers the repository's open pull requests as `HostPullRequestList` JSON,
94
+ * the most recently updated first, each with its approving reviewers, the check runs on its head commit and its head branch; signed out, the signed-out list,
95
+ * and for a repository not on `github.com`, none.
96
+ */
97
+ public static readonly readPullRequestsMethod: string;
98
+
99
+ /**
100
+ * `git-github.readReviewRequests`: takes a `RepositoryQuery` as JSON and answers the open pull requests on that repository that ask the signed-in
101
+ * person for a review, their own or one of their teams', as `HostReviewRequestList` JSON, the newest first. It reads one search of the account's
102
+ * review requests at most once a minute and shares it out by repository, so `hasMore` says the account's search was cut; signed out, the signed-out
103
+ * list, and for a repository not on `github.com`, none.
104
+ */
105
+ public static readonly readReviewRequestsMethod: string;
106
+
107
+ /**
108
+ * `git-github.readCommitComments`: takes a `CommitQuery` as JSON and answers the review comments on that commit as `HostCommitComments` JSON: the
109
+ * commit's own comments and, in the pull request that brought it in, the review comments made on it, one page of 100 of each, and the page that
110
+ * shows them, kept only when it is an https page on `github.com`. Signed out, for a repository not on `github.com`, or with no comments, none.
111
+ */
112
+ public static readonly readCommitCommentsMethod: string;
113
+
114
+ /**
115
+ * `git-github.readPullRequest`: takes a `HostReference` as JSON and answers its pull request as `HostPullRequest` JSON: the pull request, its
116
+ * description, its commit count, its reviewers by their latest review, the check runs on its head as builds, and whether it conflicts with its base;
117
+ * no policies or work items, which GitHub doesn't have. Signed out, for another host, or for a pull request GitHub can't show, `null`.
118
+ */
119
+ public static readonly readPullRequestMethod: string;
120
+
121
+ /**
122
+ * `git-github.readPullRequestThreads`: takes a `HostReference` as JSON and answers its comments as `HostPullRequestThreads` JSON, the threads oldest
123
+ * first: each conversation comment its own thread with no path, and each review comment with its replies a thread on its file and line, with no
124
+ * state, since GitHub's REST API keeps none; the newest 100 of each kind, with `hasMore` when there are older ones. Signed out, for another host, or
125
+ * for a pull request GitHub can't show, no threads.
126
+ */
127
+ public static readonly readPullRequestThreadsMethod: string;
128
+
83
129
  /**
84
130
  * `git-github.access`: the service the GitHub runtime part publishes as an `IGitHubAccess`, through which another module's runtime part,
85
131
  * such as an app's for GitHub's own MCP server, reads the signed-in token.
@@ -126,6 +172,12 @@ export declare class GitHubNames {
126
172
  * GitHub's page where the person reviews or revokes the access they gave Noldova's OAuth app.
127
173
  */
128
174
  public static readonly manageAccessUrl: string;
175
+
176
+ /**
177
+ * What the module does today, so a window shows only that: sign-in, reading an item and a branch's pull request with its checks, opening
178
+ * a pull request, showing commit authors' pictures and listing a repository's open pull requests.
179
+ */
180
+ public static readonly capabilities: HostCapabilities;
129
181
  }
130
182
 
131
183
  /**
@@ -5,7 +5,7 @@
5
5
  * This source code is licensed under the license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
- import { HostingNames } from "@noldova/git.hosting.protocol";
8
+ import { HostCapabilities, HostCapability, HostingNames } from "@noldova/git.hosting.protocol";
9
9
  import { Resources } from "../resources.js";
10
10
  export class GitHubNames {
11
11
  static moduleId = "git-github";
@@ -17,10 +17,19 @@ export class GitHubNames {
17
17
  static readReferenceMethod = HostingNames.nameOf(GitHubNames.moduleId, HostingNames.readReferenceMethod);
18
18
  static readBranchPullRequestMethod = HostingNames.nameOf(GitHubNames.moduleId, HostingNames.readBranchPullRequestMethod);
19
19
  static createPullRequestMethod = HostingNames.nameOf(GitHubNames.moduleId, HostingNames.createPullRequestMethod);
20
+ static readAuthorAvatarMethod = HostingNames.nameOf(GitHubNames.moduleId, HostingNames.readAuthorAvatarMethod);
21
+ static readPullRequestsMethod = HostingNames.nameOf(GitHubNames.moduleId, HostingNames.readPullRequestsMethod);
22
+ static readReviewRequestsMethod = HostingNames.nameOf(GitHubNames.moduleId, HostingNames.readReviewRequestsMethod);
23
+ static readCommitCommentsMethod = HostingNames.nameOf(GitHubNames.moduleId, HostingNames.readCommitCommentsMethod);
24
+ static readPullRequestMethod = HostingNames.nameOf(GitHubNames.moduleId, HostingNames.readPullRequestMethod);
25
+ static readPullRequestThreadsMethod = HostingNames.nameOf(GitHubNames.moduleId, HostingNames.readPullRequestThreadsMethod);
20
26
  static accessService = HostingNames.nameOf(GitHubNames.moduleId, Resources.accessMember);
21
27
  static signInChangedEvent = HostingNames.nameOf(GitHubNames.moduleId, HostingNames.signInChangedEvent);
22
28
  static readTool = "git_github_read";
23
29
  static prChecksTool = "git_github_pr_checks";
24
30
  static prCreateTool = "git_github_pr_create";
25
31
  static manageAccessUrl = Resources.formatManageAccessUrl(GitHubNames.clientId);
32
+ static capabilities = new HostCapabilities([HostCapability.SignIn, HostCapability.ReadItem,
33
+ HostCapability.BranchPullRequest, HostCapability.CreatePullRequest, HostCapability.Checks, HostCapability.AuthorAvatars,
34
+ HostCapability.PullRequests]);
26
35
  }