opencode-magi 0.0.0-dev-20260520033518 → 0.0.0-dev-20260520045208
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/github/commands.js +24 -2
- package/package.json +1 -1
package/dist/github/commands.js
CHANGED
|
@@ -98,7 +98,30 @@ export async function fetchPullRequest(exec, repository, pr) {
|
|
|
98
98
|
return JSON.parse(json);
|
|
99
99
|
}
|
|
100
100
|
export async function fetchIssue(exec, repository, issue) {
|
|
101
|
-
const
|
|
101
|
+
const query = `query($owner: String!, $repo: String!, $issue: Int!) { repository(owner: $owner, name: $repo) { issue(number: $issue) { number title body url state author { login } labels(first: 100) { nodes { name } } issueType { name } } } }`;
|
|
102
|
+
try {
|
|
103
|
+
const raw = await exec(`gh api${ghHostOption(repository)} graphql -f query=${shellQuote(query)} -F owner=${shellQuote(repository.github.owner)} -F repo=${shellQuote(repository.github.repo)} -F issue=${issue}`);
|
|
104
|
+
const data = JSON.parse(raw);
|
|
105
|
+
const graphqlIssue = data.data?.repository?.issue;
|
|
106
|
+
if (!graphqlIssue)
|
|
107
|
+
throw new Error(`Could not fetch issue #${issue}`);
|
|
108
|
+
return {
|
|
109
|
+
author: graphqlIssue.author?.login ?? "",
|
|
110
|
+
body: graphqlIssue.body ?? "",
|
|
111
|
+
labels: graphqlIssue.labels?.nodes?.map((label) => label.name) ?? [],
|
|
112
|
+
number: graphqlIssue.number,
|
|
113
|
+
state: graphqlIssue.state,
|
|
114
|
+
title: graphqlIssue.title,
|
|
115
|
+
type: graphqlIssue.issueType?.name,
|
|
116
|
+
url: graphqlIssue.url,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
return fetchIssueWithCli(exec, repository, issue);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
async function fetchIssueWithCli(exec, repository, issue) {
|
|
124
|
+
const raw = await exec(`gh issue view ${issue} --repo ${shellQuote(repoSpecifier(repository))} --json number,title,body,url,state,author,labels`);
|
|
102
125
|
const data = JSON.parse(raw);
|
|
103
126
|
return {
|
|
104
127
|
author: data.author?.login ?? "",
|
|
@@ -107,7 +130,6 @@ export async function fetchIssue(exec, repository, issue) {
|
|
|
107
130
|
number: data.number,
|
|
108
131
|
state: data.state,
|
|
109
132
|
title: data.title,
|
|
110
|
-
type: data.type?.name,
|
|
111
133
|
url: data.url,
|
|
112
134
|
};
|
|
113
135
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-magi",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20260520045208",
|
|
4
4
|
"description": "Multi-agent PR review and merge orchestration plugin for OpenCode.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Hirotomo Yamada <hirotomo.yamada@avap.co.jp>",
|