opencode-magi 0.0.0-dev-20260721030358 → 0.0.0-dev-20260721051451

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/magi.js CHANGED
@@ -6,7 +6,7 @@ import { dirname, isAbsolute, join } from "node:path";
6
6
  import { Octokit } from "octokit";
7
7
  import { getConfig, resolvePermissions, validateConfig } from "@/config";
8
8
  import { graphql } from "@/graphql";
9
- import { command, createExec, filterEmpty, isArray, isNumber, isObject, merge, quote, rm, } from "@/utils";
9
+ import { command, createExec, filterEmpty, isArray, isNumber, isObject, isUndefined, merge, quote, rm, } from "@/utils";
10
10
  const active = new Set(["preparing", "running"]);
11
11
  export class MagiError extends Error {
12
12
  status;
@@ -204,7 +204,12 @@ export class Magi {
204
204
  title,
205
205
  }, { signal });
206
206
  if (result.error) {
207
- throw new Error(result.response.statusText);
207
+ if (!isUndefined(result.response) && result.response.statusText)
208
+ throw new Error(result.response.statusText);
209
+ else if (result.error instanceof Error)
210
+ throw new Error(result.error.message);
211
+ else
212
+ throw new Error(JSON.stringify(result.error));
208
213
  }
209
214
  else {
210
215
  const id = result.data.id;
@@ -217,7 +222,12 @@ export class Magi {
217
222
  sessionID,
218
223
  }, { signal });
219
224
  if (result.error) {
220
- throw new Error(result.response.statusText);
225
+ if (!isUndefined(result.response) && result.response.statusText)
226
+ throw new Error(result.response.statusText);
227
+ else if (result.error instanceof Error)
228
+ throw new Error(result.error.message);
229
+ else
230
+ throw new Error(JSON.stringify(result.error));
221
231
  }
222
232
  else {
223
233
  const output = result.data.parts
@@ -53,7 +53,7 @@ export async function checkExistingReviews() {
53
53
  }
54
54
  }));
55
55
  if (!targetReviews.length) {
56
- return [id, { status: "initial" }];
56
+ return [id, { account, status: "initial" }];
57
57
  }
58
58
  else {
59
59
  const latestReviews = targetReviews.filter(({ submitted_at }) => latestNonMergeCommit?.commit.author?.date &&
@@ -61,9 +61,9 @@ export async function checkExistingReviews() {
61
61
  submitted_at.localeCompare(latestNonMergeCommit.commit.author.date) >= 0);
62
62
  const review = targetReviews.at(-1);
63
63
  if (latestReviews.length)
64
- return [id, { review, status: "skip" }];
64
+ return [id, { account, review, status: "skip" }];
65
65
  else
66
- return [id, { review, status: "rereview" }];
66
+ return [id, { account, review, status: "rereview" }];
67
67
  }
68
68
  }));
69
69
  for (const [id, reviewer] of Object.entries(reviewers)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-magi",
3
- "version": "0.0.0-dev-20260721030358",
3
+ "version": "0.0.0-dev-20260721051451",
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>",