opencode-magi 0.0.0-dev-20260720123132 → 0.0.0-dev-20260721051405
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 +14 -3
- package/package.json +1 -1
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;
|
|
@@ -24,6 +24,7 @@ export class Magi {
|
|
|
24
24
|
const client = createOpencodeClient({
|
|
25
25
|
baseUrl: input.serverUrl.toString(),
|
|
26
26
|
directory: input.directory,
|
|
27
|
+
fetch: input.client.session._client.getConfig().fetch,
|
|
27
28
|
});
|
|
28
29
|
this.input = { ...input, client };
|
|
29
30
|
this.options = options;
|
|
@@ -203,7 +204,12 @@ export class Magi {
|
|
|
203
204
|
title,
|
|
204
205
|
}, { signal });
|
|
205
206
|
if (result.error) {
|
|
206
|
-
|
|
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));
|
|
207
213
|
}
|
|
208
214
|
else {
|
|
209
215
|
const id = result.data.id;
|
|
@@ -216,7 +222,12 @@ export class Magi {
|
|
|
216
222
|
sessionID,
|
|
217
223
|
}, { signal });
|
|
218
224
|
if (result.error) {
|
|
219
|
-
|
|
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));
|
|
220
231
|
}
|
|
221
232
|
else {
|
|
222
233
|
const output = result.data.parts
|
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-20260721051405",
|
|
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>",
|