opencode-magi 0.2.0 → 0.3.0
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 +19 -0
- package/dist/commands.js +4 -0
- package/dist/config/output.js +11 -2
- package/dist/config/resolve.js +81 -1
- package/dist/config/validate.js +290 -3
- package/dist/config/worktree.js +8 -2
- package/dist/github/commands.js +343 -15
- package/dist/index.js +252 -26
- package/dist/orchestrator/ci.js +1 -1
- package/dist/orchestrator/findings.js +4 -3
- package/dist/orchestrator/inline-comments.js +73 -0
- package/dist/orchestrator/majority.js +14 -0
- package/dist/orchestrator/merge.js +16 -3
- package/dist/orchestrator/report.js +15 -1
- package/dist/orchestrator/review-context.js +309 -0
- package/dist/orchestrator/review.js +49 -9
- package/dist/orchestrator/run-manager.js +408 -17
- package/dist/orchestrator/triage.js +1119 -0
- package/dist/permissions/editor.json +8 -1
- package/dist/prompts/compose.js +162 -1
- package/dist/prompts/contracts.js +119 -12
- package/dist/prompts/output.js +149 -14
- package/dist/prompts/templates/review/review.md +6 -0
- package/dist/prompts/templates/triage/acceptance.md +7 -0
- package/dist/prompts/templates/triage/action.md +5 -0
- package/dist/prompts/templates/triage/category.md +10 -0
- package/dist/prompts/templates/triage/comment-classification.md +7 -0
- package/dist/prompts/templates/triage/comment.md +5 -0
- package/dist/prompts/templates/triage/create.md +7 -0
- package/dist/prompts/templates/triage/duplicate.md +7 -0
- package/dist/prompts/templates/triage/existing-pr.md +7 -0
- package/dist/prompts/templates/triage/question.md +5 -0
- package/dist/prompts/templates/triage/reconsider.md +5 -0
- package/package.json +5 -2
- package/schema.json +127 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Classify issue #{issue} in {owner}/{repo}.
|
|
2
|
+
|
|
3
|
+
Choose ASK when more information is required to classify what should be done. Otherwise choose exactly one configured category ID.
|
|
4
|
+
|
|
5
|
+
Configured categories:
|
|
6
|
+
{categoryOptions}
|
|
7
|
+
|
|
8
|
+
<context>
|
|
9
|
+
{context}
|
|
10
|
+
</context>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Classify allowed mention replies for issue #{issue} in {owner}/{repo}.
|
|
2
|
+
|
|
3
|
+
Use OBJECTION for disagreement or reconsideration requests. Use NEW_EVIDENCE for new logs, reproduction steps, screenshots, links, or use cases. Use CLARIFICATION for answers to questions or ambiguity reduction. Use ACKNOWLEDGEMENT for acceptance or thanks. Use UNRELATED for unrelated content.
|
|
4
|
+
|
|
5
|
+
<context>
|
|
6
|
+
{context}
|
|
7
|
+
</context>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Decide whether issue #{issue} in {owner}/{repo} duplicates one of the provided duplicate candidates.
|
|
2
|
+
|
|
3
|
+
Use only the provided context. Return DUPLICATE only when the target issue is clearly the same underlying report or request.
|
|
4
|
+
|
|
5
|
+
<context>
|
|
6
|
+
{context}
|
|
7
|
+
</context>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-magi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
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>",
|
|
@@ -41,6 +41,8 @@
|
|
|
41
41
|
"@types/node": "^25.9.0",
|
|
42
42
|
"@types/picomatch": "^4.0.3",
|
|
43
43
|
"@typescript/native-preview": "7.0.0-dev.20260518.1",
|
|
44
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
45
|
+
"@vitest/ui": "^4.1.7",
|
|
44
46
|
"eslint-plugin-perfectionist": "^5.9.0",
|
|
45
47
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
46
48
|
"lefthook": "^2.1.6",
|
|
@@ -48,7 +50,7 @@
|
|
|
48
50
|
"oxlint": "^1.65.0",
|
|
49
51
|
"oxlint-tsgolint": "^0.23.0",
|
|
50
52
|
"rimraf": "^6.1.3",
|
|
51
|
-
"vitest": "^4.1.
|
|
53
|
+
"vitest": "^4.1.7"
|
|
52
54
|
},
|
|
53
55
|
"scripts": {
|
|
54
56
|
"prebuild": "node scripts/copy-data.ts",
|
|
@@ -60,6 +62,7 @@
|
|
|
60
62
|
"lint:fix": "oxlint . --max-warnings=0 --fix",
|
|
61
63
|
"quality": "pnpm format:check && pnpm lint:check && pnpm typecheck && pnpm test",
|
|
62
64
|
"test": "vitest run",
|
|
65
|
+
"test:dev": "vitest --watch --ui",
|
|
63
66
|
"typecheck": "tsgo --noEmit",
|
|
64
67
|
"release": "changeset publish",
|
|
65
68
|
"release:dev": "changeset version --snapshot dev && changeset publish --tag dev"
|
package/schema.json
CHANGED
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
"repairAttempts": { "type": "integer", "minimum": 0, "default": 3 }
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
|
-
"review": { "$ref": "#/$defs/review" }
|
|
50
|
+
"review": { "$ref": "#/$defs/review" },
|
|
51
|
+
"triage": { "$ref": "#/$defs/triage" }
|
|
51
52
|
},
|
|
52
53
|
"$defs": {
|
|
53
54
|
"reviewer": {
|
|
@@ -84,11 +85,44 @@
|
|
|
84
85
|
"persona": { "type": "string" }
|
|
85
86
|
}
|
|
86
87
|
},
|
|
88
|
+
"triageAgent": {
|
|
89
|
+
"type": "object",
|
|
90
|
+
"required": ["model"],
|
|
91
|
+
"additionalProperties": false,
|
|
92
|
+
"properties": {
|
|
93
|
+
"id": { "type": "string", "pattern": "^[A-Za-z0-9_-]+$" },
|
|
94
|
+
"model": { "type": "string", "minLength": 1 },
|
|
95
|
+
"options": { "type": "object", "additionalProperties": true },
|
|
96
|
+
"permissions": { "$ref": "#/$defs/permissions" },
|
|
97
|
+
"persona": { "type": "string" }
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"triageCreator": {
|
|
101
|
+
"type": "object",
|
|
102
|
+
"required": ["model", "author"],
|
|
103
|
+
"additionalProperties": false,
|
|
104
|
+
"properties": {
|
|
105
|
+
"account": { "type": "string", "minLength": 1 },
|
|
106
|
+
"model": { "type": "string", "minLength": 1 },
|
|
107
|
+
"options": { "type": "object", "additionalProperties": true },
|
|
108
|
+
"author": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"required": ["name", "email"],
|
|
111
|
+
"additionalProperties": false,
|
|
112
|
+
"properties": {
|
|
113
|
+
"name": { "type": "string", "minLength": 1 },
|
|
114
|
+
"email": { "type": "string", "minLength": 1 }
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"permissions": { "$ref": "#/$defs/permissions" },
|
|
118
|
+
"persona": { "type": "string" }
|
|
119
|
+
}
|
|
120
|
+
},
|
|
87
121
|
"automation": {
|
|
88
122
|
"type": "object",
|
|
89
123
|
"additionalProperties": false,
|
|
90
124
|
"properties": {
|
|
91
|
-
"merge": { "type": "boolean" },
|
|
125
|
+
"merge": { "type": "boolean", "default": true },
|
|
92
126
|
"close": { "type": "boolean" }
|
|
93
127
|
}
|
|
94
128
|
},
|
|
@@ -116,6 +150,13 @@
|
|
|
116
150
|
"reviewers": { "type": "integer", "minimum": 1, "default": 3 }
|
|
117
151
|
}
|
|
118
152
|
},
|
|
153
|
+
"triageConcurrency": {
|
|
154
|
+
"type": "object",
|
|
155
|
+
"additionalProperties": false,
|
|
156
|
+
"properties": {
|
|
157
|
+
"runs": { "type": "integer", "minimum": 1, "default": 3 }
|
|
158
|
+
}
|
|
159
|
+
},
|
|
119
160
|
"safety": {
|
|
120
161
|
"type": "object",
|
|
121
162
|
"additionalProperties": false,
|
|
@@ -147,6 +188,67 @@
|
|
|
147
188
|
"ciClassification": { "type": "string" }
|
|
148
189
|
}
|
|
149
190
|
},
|
|
191
|
+
"triagePrompts": {
|
|
192
|
+
"type": "object",
|
|
193
|
+
"additionalProperties": false,
|
|
194
|
+
"properties": {
|
|
195
|
+
"existingPr": { "type": "string" },
|
|
196
|
+
"duplicate": { "type": "string" },
|
|
197
|
+
"category": { "type": "string" },
|
|
198
|
+
"acceptance": { "type": "string" },
|
|
199
|
+
"action": { "type": "string" },
|
|
200
|
+
"question": { "type": "string" },
|
|
201
|
+
"comment": { "type": "string" },
|
|
202
|
+
"commentClassification": { "type": "string" },
|
|
203
|
+
"reconsider": { "type": "string" },
|
|
204
|
+
"create": { "type": "string" },
|
|
205
|
+
"createGuidelines": { "type": "string" }
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"triageCategory": {
|
|
209
|
+
"type": "object",
|
|
210
|
+
"additionalProperties": false,
|
|
211
|
+
"required": ["id"],
|
|
212
|
+
"properties": {
|
|
213
|
+
"id": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"pattern": "^[A-Za-z0-9_-]+$",
|
|
216
|
+
"not": { "enum": ["ASK", "none"] }
|
|
217
|
+
},
|
|
218
|
+
"labels": { "type": "array", "items": { "type": "string" } },
|
|
219
|
+
"types": { "type": "array", "items": { "type": "string" } },
|
|
220
|
+
"description": { "type": "string" }
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"triageAutomation": {
|
|
224
|
+
"type": "object",
|
|
225
|
+
"additionalProperties": false,
|
|
226
|
+
"properties": {
|
|
227
|
+
"close": { "type": "boolean", "default": false },
|
|
228
|
+
"create": { "type": "boolean", "default": false },
|
|
229
|
+
"review": { "type": "boolean", "default": false },
|
|
230
|
+
"merge": { "type": "boolean", "default": false },
|
|
231
|
+
"clear": {
|
|
232
|
+
"type": "array",
|
|
233
|
+
"items": { "type": "string" },
|
|
234
|
+
"default": ["triage"]
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"triageSafety": {
|
|
239
|
+
"type": "object",
|
|
240
|
+
"additionalProperties": false,
|
|
241
|
+
"properties": {
|
|
242
|
+
"requiredLabels": { "type": "array", "items": { "type": "string" } },
|
|
243
|
+
"blockedLabels": { "type": "array", "items": { "type": "string" } },
|
|
244
|
+
"allowAuthors": { "type": "array", "items": { "type": "string" } },
|
|
245
|
+
"allowMentionActors": {
|
|
246
|
+
"type": "array",
|
|
247
|
+
"items": { "type": "string" }
|
|
248
|
+
},
|
|
249
|
+
"allowMentionRoles": { "type": "array", "items": { "type": "string" } }
|
|
250
|
+
}
|
|
251
|
+
},
|
|
150
252
|
"reviewMerge": {
|
|
151
253
|
"type": "object",
|
|
152
254
|
"additionalProperties": false,
|
|
@@ -196,6 +298,29 @@
|
|
|
196
298
|
}
|
|
197
299
|
}
|
|
198
300
|
},
|
|
301
|
+
"triage": {
|
|
302
|
+
"type": "object",
|
|
303
|
+
"additionalProperties": false,
|
|
304
|
+
"properties": {
|
|
305
|
+
"account": { "type": "string", "minLength": 1 },
|
|
306
|
+
"agents": {
|
|
307
|
+
"type": "array",
|
|
308
|
+
"minItems": 3,
|
|
309
|
+
"items": { "$ref": "#/$defs/triageAgent" }
|
|
310
|
+
},
|
|
311
|
+
"creator": { "$ref": "#/$defs/triageCreator" },
|
|
312
|
+
"categories": {
|
|
313
|
+
"type": "array",
|
|
314
|
+
"items": { "$ref": "#/$defs/triageCategory" }
|
|
315
|
+
},
|
|
316
|
+
"automation": { "$ref": "#/$defs/triageAutomation" },
|
|
317
|
+
"safety": { "$ref": "#/$defs/triageSafety" },
|
|
318
|
+
"concurrency": { "$ref": "#/$defs/triageConcurrency" },
|
|
319
|
+
"prompts": { "$ref": "#/$defs/triagePrompts" },
|
|
320
|
+
"output": { "type": "string" },
|
|
321
|
+
"worktree": { "type": "string" }
|
|
322
|
+
}
|
|
323
|
+
},
|
|
199
324
|
"permissionAction": { "enum": ["allow", "ask", "deny"] },
|
|
200
325
|
"permissionRule": {
|
|
201
326
|
"oneOf": [
|