opencode-magi 0.0.0-dev-20260714073209 → 0.0.0-dev-20260714091053
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/README.md +2 -2
- package/dist/tools/review/reviewer.js +23 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MagiError } from "@/magi";
|
|
2
2
|
import { Prompt } from "@/prompts";
|
|
3
|
-
import { filterEmpty, marker, omitNullish, retry, Worker } from "@/utils";
|
|
3
|
+
import { filterEmpty, marker, omitNullish, retry, toTitleCase, Worker, } from "@/utils";
|
|
4
4
|
export async function review() {
|
|
5
5
|
this.context.abort.throwIfAborted();
|
|
6
6
|
await this.updateEvent(`Reviewing.`);
|
|
@@ -102,6 +102,27 @@ export async function review() {
|
|
|
102
102
|
if (!prompt.validate(parsed))
|
|
103
103
|
throw new Error(`Invalid output for reviewer ${id}.`);
|
|
104
104
|
validateInlineCommentTargets(status, parsed, inlineCommentTargets);
|
|
105
|
+
const findings = parsed.findings ?? parsed.newFindings ?? [];
|
|
106
|
+
await this.updateEvent(filterEmpty([
|
|
107
|
+
`Finished ${label} with reviewer ${id}.`,
|
|
108
|
+
`Verdict: ${toTitleCase(parsed.verdict.toLocaleLowerCase())}.`,
|
|
109
|
+
parsed.comment ? `Comment:\n${parsed.comment}` : undefined,
|
|
110
|
+
findings.length
|
|
111
|
+
? `Findings:\n${findings
|
|
112
|
+
.map(({ body, line, path, startLine }) => `- ${path}:${startLine != null ? `${startLine}-` : ""}${line}: ${body}`)
|
|
113
|
+
.join("\n")}`
|
|
114
|
+
: undefined,
|
|
115
|
+
parsed.followUps?.length
|
|
116
|
+
? `FollowUps:\n${parsed.followUps
|
|
117
|
+
.map(({ body, commentId }) => `- Comment ${commentId}: ${body}`)
|
|
118
|
+
.join("\n")}`
|
|
119
|
+
: undefined,
|
|
120
|
+
parsed.resolves?.length
|
|
121
|
+
? `Resolved threads:\n${parsed.resolves
|
|
122
|
+
.map(({ commentId, threadId }) => `- Comment ${commentId} in thread ${threadId}`)
|
|
123
|
+
.join("\n")}`
|
|
124
|
+
: undefined,
|
|
125
|
+
]).join("\n\n"));
|
|
105
126
|
return parsed;
|
|
106
127
|
}, {
|
|
107
128
|
error: (_, count) => this.updateEvent(`Attempt ${count} failed to ${label} with reviewer ${id}. Retrying...`),
|
|
@@ -331,7 +352,7 @@ async function notifyVerdictChanges(prev, next, reason) {
|
|
|
331
352
|
const nextVerdict = reviewer.outputs?.at(-1)?.verdict;
|
|
332
353
|
if (!prevVerdict || !nextVerdict || prevVerdict === nextVerdict)
|
|
333
354
|
return;
|
|
334
|
-
await this.updateEvent(`Reviewer ${id} verdict changed from ${prevVerdict} to ${nextVerdict} ${reason}.`);
|
|
355
|
+
await this.updateEvent(`Reviewer ${id} verdict changed from ${toTitleCase(prevVerdict.toLocaleLowerCase())} to ${toTitleCase(nextVerdict.toLocaleLowerCase())} ${reason}.`);
|
|
335
356
|
}));
|
|
336
357
|
}
|
|
337
358
|
function validateInlineCommentTargets(status, output, inlineCommentTargets) {
|
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-20260714091053",
|
|
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>",
|