opencode-magi 0.0.0-dev-20260522105819 → 0.0.0-dev-20260522141520
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/index.js +23 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -96,6 +96,7 @@ export function parseRunArguments(value, dryRun = false, command = "review") {
|
|
|
96
96
|
const configOverrides = {};
|
|
97
97
|
const prTokens = [];
|
|
98
98
|
let sync = false;
|
|
99
|
+
let timeoutMs;
|
|
99
100
|
for (let index = 0; index < tokens.length; index++) {
|
|
100
101
|
const token = tokens[index];
|
|
101
102
|
if (token === "--dry-run") {
|
|
@@ -110,6 +111,11 @@ export function parseRunArguments(value, dryRun = false, command = "review") {
|
|
|
110
111
|
case "--language":
|
|
111
112
|
setConfigOverride(configOverrides, ["language"], nextFlagValue(tokens, ++index, token));
|
|
112
113
|
break;
|
|
114
|
+
case "--timeout":
|
|
115
|
+
timeoutMs =
|
|
116
|
+
parseIntegerFlag(nextFlagValue(tokens, ++index, token), token, 0) *
|
|
117
|
+
1_000;
|
|
118
|
+
break;
|
|
113
119
|
case "--merge":
|
|
114
120
|
case "--no-merge":
|
|
115
121
|
setConfigOverride(configOverrides, [command, "automation", "merge"], token === "--merge");
|
|
@@ -151,13 +157,20 @@ export function parseRunArguments(value, dryRun = false, command = "review") {
|
|
|
151
157
|
prTokens.push(token);
|
|
152
158
|
}
|
|
153
159
|
}
|
|
154
|
-
return {
|
|
160
|
+
return {
|
|
161
|
+
configOverrides,
|
|
162
|
+
dryRun,
|
|
163
|
+
prs: parsePrs(prTokens.join(" ")),
|
|
164
|
+
sync,
|
|
165
|
+
timeoutMs,
|
|
166
|
+
};
|
|
155
167
|
}
|
|
156
168
|
export function parseIssueRunArguments(value, dryRun = false) {
|
|
157
169
|
const tokens = value.split(/[\s,]+/).filter(Boolean);
|
|
158
170
|
const configOverrides = {};
|
|
159
171
|
const issueTokens = [];
|
|
160
172
|
let sync = false;
|
|
173
|
+
let timeoutMs;
|
|
161
174
|
for (let index = 0; index < tokens.length; index++) {
|
|
162
175
|
const token = tokens[index];
|
|
163
176
|
if (token === "--dry-run") {
|
|
@@ -172,6 +185,11 @@ export function parseIssueRunArguments(value, dryRun = false) {
|
|
|
172
185
|
case "--language":
|
|
173
186
|
setConfigOverride(configOverrides, ["language"], nextFlagValue(tokens, ++index, token));
|
|
174
187
|
break;
|
|
188
|
+
case "--timeout":
|
|
189
|
+
timeoutMs =
|
|
190
|
+
parseIntegerFlag(nextFlagValue(tokens, ++index, token), token, 0) *
|
|
191
|
+
1_000;
|
|
192
|
+
break;
|
|
175
193
|
case "--close":
|
|
176
194
|
case "--no-close":
|
|
177
195
|
setConfigOverride(configOverrides, ["triage", "automation", "close"], token === "--close");
|
|
@@ -210,6 +228,7 @@ export function parseIssueRunArguments(value, dryRun = false) {
|
|
|
210
228
|
dryRun,
|
|
211
229
|
issues: parseIssues(issueTokens.join(" ")),
|
|
212
230
|
sync,
|
|
231
|
+
timeoutMs,
|
|
213
232
|
};
|
|
214
233
|
}
|
|
215
234
|
function nextFlagValue(tokens, index, flag) {
|
|
@@ -461,7 +480,6 @@ export const MagiPlugin = async ({ client, directory }) => {
|
|
|
461
480
|
prs: tool.schema.string(),
|
|
462
481
|
dryRun: tool.schema.boolean().optional(),
|
|
463
482
|
sync: tool.schema.boolean().optional(),
|
|
464
|
-
timeoutSeconds: tool.schema.number().optional(),
|
|
465
483
|
},
|
|
466
484
|
async execute(args, context) {
|
|
467
485
|
const parsed = parseRunArguments(args.prs, args.dryRun ?? false, "merge");
|
|
@@ -487,9 +505,7 @@ export const MagiPlugin = async ({ client, directory }) => {
|
|
|
487
505
|
parentSessionId: context.sessionID,
|
|
488
506
|
signal: context.abort,
|
|
489
507
|
sync,
|
|
490
|
-
timeoutMs:
|
|
491
|
-
? undefined
|
|
492
|
-
: args.timeoutSeconds * 1_000,
|
|
508
|
+
timeoutMs: parsed.timeoutMs,
|
|
493
509
|
}), { signal: context.abort });
|
|
494
510
|
if (sync)
|
|
495
511
|
return syncResult(runManager, states);
|
|
@@ -507,7 +523,6 @@ export const MagiPlugin = async ({ client, directory }) => {
|
|
|
507
523
|
prs: tool.schema.string(),
|
|
508
524
|
dryRun: tool.schema.boolean().optional(),
|
|
509
525
|
sync: tool.schema.boolean().optional(),
|
|
510
|
-
timeoutSeconds: tool.schema.number().optional(),
|
|
511
526
|
},
|
|
512
527
|
async execute(args, context) {
|
|
513
528
|
const parsed = parseRunArguments(args.prs, args.dryRun ?? false);
|
|
@@ -532,9 +547,7 @@ export const MagiPlugin = async ({ client, directory }) => {
|
|
|
532
547
|
parentSessionId: context.sessionID,
|
|
533
548
|
signal: context.abort,
|
|
534
549
|
sync,
|
|
535
|
-
timeoutMs:
|
|
536
|
-
? undefined
|
|
537
|
-
: args.timeoutSeconds * 1_000,
|
|
550
|
+
timeoutMs: parsed.timeoutMs,
|
|
538
551
|
}), { signal: context.abort });
|
|
539
552
|
if (sync)
|
|
540
553
|
return syncResult(runManager, states);
|
|
@@ -549,7 +562,6 @@ export const MagiPlugin = async ({ client, directory }) => {
|
|
|
549
562
|
issues: tool.schema.string(),
|
|
550
563
|
dryRun: tool.schema.boolean().optional(),
|
|
551
564
|
sync: tool.schema.boolean().optional(),
|
|
552
|
-
timeoutSeconds: tool.schema.number().optional(),
|
|
553
565
|
},
|
|
554
566
|
async execute(args, context) {
|
|
555
567
|
const parsed = parseIssueRunArguments(args.issues, args.dryRun ?? false);
|
|
@@ -580,9 +592,7 @@ export const MagiPlugin = async ({ client, directory }) => {
|
|
|
580
592
|
repository,
|
|
581
593
|
signal: context.abort,
|
|
582
594
|
sync,
|
|
583
|
-
timeoutMs:
|
|
584
|
-
? undefined
|
|
585
|
-
: args.timeoutSeconds * 1_000,
|
|
595
|
+
timeoutMs: parsed.timeoutMs,
|
|
586
596
|
}), { signal: context.abort });
|
|
587
597
|
if (sync)
|
|
588
598
|
return syncResult(runManager, states);
|
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-20260522141520",
|
|
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>",
|