@open-cr-agent/vcs-github 0.2.0 → 0.3.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.
- package/dist/adapter.js +3 -2
- package/dist/client.d.ts +2 -1
- package/dist/client.js +4 -2
- package/dist/index.d.ts +2 -3
- package/dist/index.js +2 -3
- package/dist/internal.d.ts +3 -0
- package/dist/internal.js +5 -0
- package/package.json +12 -4
package/dist/adapter.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OcraError } from "@open-cr-agent/core";
|
|
2
|
+
import { errorMessage } from "@open-cr-agent/core/internal";
|
|
2
3
|
import { PlatformReview, } from "@open-cr-agent/vcs-platform";
|
|
3
4
|
import { GitHubApiError, } from "./client.js";
|
|
4
5
|
export const DEFAULT_BOT_LOGIN = "github-actions[bot]";
|
|
@@ -51,7 +52,7 @@ class GitHubPlatform {
|
|
|
51
52
|
async editor(comment) {
|
|
52
53
|
const nodeId = this.listed.get(comment.id)?.node_id;
|
|
53
54
|
if (!nodeId)
|
|
54
|
-
throw new
|
|
55
|
+
throw new OcraError("VCS_API_FAILED", "the comment has no node id to look up its editor");
|
|
55
56
|
return this.options.api.commentEditor(nodeId);
|
|
56
57
|
}
|
|
57
58
|
canWrite(login) {
|
package/dist/client.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OcraError } from "@open-cr-agent/core";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
declare const pullRequestSchema: z.ZodObject<{
|
|
3
4
|
number: z.ZodNumber;
|
|
@@ -42,7 +43,7 @@ export interface CreateReview {
|
|
|
42
43
|
body: string;
|
|
43
44
|
comments: ReviewComment[];
|
|
44
45
|
}
|
|
45
|
-
export declare class GitHubApiError extends
|
|
46
|
+
export declare class GitHubApiError extends OcraError {
|
|
46
47
|
readonly status: number;
|
|
47
48
|
constructor(status: number, message: string);
|
|
48
49
|
}
|
package/dist/client.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OcraError } from "@open-cr-agent/core";
|
|
1
2
|
import { MAX_ATTEMPTS, retryDecision } from "@open-cr-agent/vcs-platform";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
// Commit ids reach git as arguments; anything else is refused at the boundary.
|
|
@@ -21,11 +22,12 @@ const commentSchema = z.object({
|
|
|
21
22
|
node_id: z.string().optional(),
|
|
22
23
|
author_association: z.string().optional(),
|
|
23
24
|
});
|
|
24
|
-
export class GitHubApiError extends
|
|
25
|
+
export class GitHubApiError extends OcraError {
|
|
25
26
|
status;
|
|
26
27
|
constructor(status, message) {
|
|
27
|
-
super(message);
|
|
28
|
+
super("VCS_API_FAILED", message);
|
|
28
29
|
this.status = status;
|
|
30
|
+
this.name = "GitHubApiError";
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
const reviewSchema = z.object({
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/internal.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-cr-agent/vcs-github",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "GitHub pull request adapter for Open-CR-Agent",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"code-review",
|
|
@@ -19,19 +19,27 @@
|
|
|
19
19
|
"node": ">=22.19"
|
|
20
20
|
},
|
|
21
21
|
"type": "module",
|
|
22
|
+
"sideEffects": false,
|
|
22
23
|
"exports": {
|
|
23
24
|
".": {
|
|
25
|
+
"@open-cr-agent/source": "./src/index.ts",
|
|
24
26
|
"types": "./dist/index.d.ts",
|
|
25
27
|
"default": "./dist/index.js"
|
|
26
|
-
}
|
|
28
|
+
},
|
|
29
|
+
"./internal": {
|
|
30
|
+
"@open-cr-agent/source": "./src/internal.ts",
|
|
31
|
+
"types": "./dist/internal.d.ts",
|
|
32
|
+
"default": "./dist/internal.js"
|
|
33
|
+
},
|
|
34
|
+
"./package.json": "./package.json"
|
|
27
35
|
},
|
|
28
36
|
"files": [
|
|
29
37
|
"dist",
|
|
30
38
|
"!dist/**/*.map"
|
|
31
39
|
],
|
|
32
40
|
"dependencies": {
|
|
33
|
-
"@open-cr-agent/core": "0.
|
|
34
|
-
"@open-cr-agent/vcs-platform": "0.
|
|
41
|
+
"@open-cr-agent/core": "0.3.0",
|
|
42
|
+
"@open-cr-agent/vcs-platform": "0.3.0",
|
|
35
43
|
"zod": "^4.6.5"
|
|
36
44
|
},
|
|
37
45
|
"publishConfig": {
|