opencode-magi 0.10.0 → 0.11.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.ja.md +254 -0
- package/README.md +31 -26
- package/dist/commands.js +11 -9
- package/dist/config/index.js +2 -0
- package/dist/config/resolve.js +120 -246
- package/dist/config/validate.js +103 -1110
- package/dist/constant.js +135 -0
- package/dist/graphql/index.generated.js +125 -0
- package/dist/graphql/index.js +49 -0
- package/dist/index.js +12 -800
- package/dist/magi.js +357 -0
- package/dist/permissions/common.json +22 -22
- package/dist/permissions/editor.json +12 -12
- package/dist/prompts/index.js +98 -0
- package/dist/prompts/merge/ci-classification/output-contract.md +22 -0
- package/dist/prompts/merge/ci-classification/task.md +10 -0
- package/dist/prompts/merge/ci-classification/validate.json +20 -0
- package/dist/prompts/merge/conflict/output-contract.md +12 -0
- package/dist/prompts/merge/conflict/task.md +9 -0
- package/dist/prompts/merge/conflict/validate.json +4 -0
- package/dist/prompts/merge/edit/output-contract.md +26 -0
- package/dist/prompts/merge/edit/task.md +10 -0
- package/dist/prompts/merge/edit/validate.json +60 -0
- package/dist/prompts/review/ci-classification/output-contract.md +21 -0
- package/dist/prompts/review/ci-classification/task.md +7 -0
- package/dist/prompts/review/ci-classification/validate.json +20 -0
- package/dist/prompts/review/close-reconsideration/output-contract.md +21 -0
- package/dist/prompts/review/close-reconsideration/task.md +6 -0
- package/dist/prompts/review/close-reconsideration/validate.json +44 -0
- package/dist/prompts/review/comment/output-contract.md +11 -0
- package/dist/prompts/review/comment/task.md +3 -0
- package/dist/prompts/review/comment/validate.json +8 -0
- package/dist/prompts/review/finding-validation/output-contract.md +25 -0
- package/dist/prompts/{templates/review/finding-validation.md → review/finding-validation/task.md} +2 -3
- package/dist/prompts/review/finding-validation/validate.json +21 -0
- package/dist/prompts/review/rereview/output-contract.md +30 -0
- package/dist/prompts/{templates/review/rereview.md → review/rereview/task.md} +8 -11
- package/dist/prompts/review/rereview/validate.json +87 -0
- package/dist/prompts/review/review/output-contract.md +25 -0
- package/dist/prompts/{templates/review/review.md → review/review/task.md} +2 -5
- package/dist/prompts/review/review/validate.json +54 -0
- package/dist/prompts/triage/acceptance/output-contract.md +16 -0
- package/dist/prompts/triage/acceptance/validate.json +23 -0
- package/dist/prompts/triage/category/output-contract.md +16 -0
- package/dist/prompts/triage/category/validate.json +23 -0
- package/dist/prompts/triage/comment-classification/output-contract.md +15 -0
- package/dist/prompts/triage/comment-classification/validate.json +28 -0
- package/dist/prompts/triage/create/output-contract.md +28 -0
- package/dist/prompts/triage/create/validate.json +73 -0
- package/dist/prompts/triage/deplicate/output-contract.md +16 -0
- package/dist/prompts/triage/deplicate/validate.json +20 -0
- package/dist/prompts/triage/existing/output-contract.md +16 -0
- package/dist/prompts/triage/existing/validate.json +13 -0
- package/dist/prompts/triage/reconsider/output-contract.md +16 -0
- package/dist/prompts/triage/reconsider/validate.json +23 -0
- package/dist/prompts/triage/signal/output-contract.md +19 -0
- package/dist/prompts/triage/signal/validate.json +18 -0
- package/dist/tools/clear/index.js +21 -0
- package/dist/tools/index.js +12 -0
- package/dist/tools/merge/action.js +47 -0
- package/dist/tools/merge/context.js +118 -0
- package/dist/tools/merge/editor.js +264 -0
- package/dist/tools/merge/index.js +151 -0
- package/dist/tools/merge/index.type.js +1 -0
- package/dist/tools/merge/merge.js +42 -0
- package/dist/tools/merge/report.js +73 -0
- package/dist/tools/review/action.js +429 -0
- package/dist/tools/review/check.js +295 -0
- package/dist/tools/review/context.js +258 -0
- package/dist/tools/review/index.js +104 -0
- package/dist/tools/review/index.type.js +1 -0
- package/dist/tools/review/report.js +143 -0
- package/dist/tools/review/review.js +145 -0
- package/dist/tools/review/reviewer.js +409 -0
- package/dist/tools/triage/index.js +16 -0
- package/dist/tools/validate/index.js +28 -0
- package/dist/utils/array.js +6 -0
- package/dist/utils/assertion.js +38 -0
- package/dist/utils/exec.js +14 -0
- package/dist/utils/fs.js +24 -0
- package/dist/utils/function.js +37 -0
- package/dist/utils/github.js +63 -0
- package/dist/utils/index.js +10 -0
- package/dist/utils/index.type.js +1 -0
- package/dist/utils/object.js +21 -0
- package/dist/utils/opencode.js +25 -0
- package/dist/utils/string.js +38 -0
- package/dist/utils/worker.js +30 -0
- package/package.json +20 -8
- package/schema.json +6 -4
- package/dist/config/load.js +0 -62
- package/dist/config/output.js +0 -25
- package/dist/config/worktree.js +0 -25
- package/dist/github/commands.js +0 -905
- package/dist/github/retry.js +0 -44
- package/dist/orchestrator/abort.js +0 -9
- package/dist/orchestrator/ci.js +0 -579
- package/dist/orchestrator/findings.js +0 -88
- package/dist/orchestrator/inline-comments.js +0 -73
- package/dist/orchestrator/majority.js +0 -62
- package/dist/orchestrator/merge.js +0 -1260
- package/dist/orchestrator/model.js +0 -216
- package/dist/orchestrator/pool.js +0 -15
- package/dist/orchestrator/report.js +0 -175
- package/dist/orchestrator/review-context.js +0 -342
- package/dist/orchestrator/review.js +0 -1480
- package/dist/orchestrator/run-manager.js +0 -2132
- package/dist/orchestrator/safety.js +0 -44
- package/dist/orchestrator/triage.js +0 -1370
- package/dist/prompts/compose.js +0 -473
- package/dist/prompts/contracts.js +0 -300
- package/dist/prompts/output.js +0 -401
- package/dist/prompts/templates/merge/ci-classification.md +0 -16
- package/dist/prompts/templates/merge/conflict.md +0 -10
- package/dist/prompts/templates/merge/edit.md +0 -15
- package/dist/prompts/templates/review/ci-classification.md +0 -9
- package/dist/prompts/templates/review/close-reconsideration.md +0 -6
- /package/dist/{types.js → config/index.type.js} +0 -0
- /package/dist/prompts/{templates/triage/acceptance.md → triage/acceptance/task.md} +0 -0
- /package/dist/prompts/{templates/triage/category.md → triage/category/task.md} +0 -0
- /package/dist/prompts/{templates/triage/comment-classification.md → triage/comment-classification/task.md} +0 -0
- /package/dist/prompts/{templates/triage/create.md → triage/create/task.md} +0 -0
- /package/dist/prompts/{templates/triage/duplicate.md → triage/deplicate/task.md} +0 -0
- /package/dist/prompts/{templates/triage/existing-pr.md → triage/existing/task.md} +0 -0
- /package/dist/prompts/{templates/triage/reconsider.md → triage/reconsider/task.md} +0 -0
- /package/dist/prompts/{templates/triage/signal.md → triage/signal/task.md} +0 -0
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
export const reviewOutputContract = `
|
|
2
|
-
<output_contract>
|
|
3
|
-
Return exactly one JSON object and nothing else. Do not wrap it in markdown.
|
|
4
|
-
|
|
5
|
-
The object must match this shape:
|
|
6
|
-
{
|
|
7
|
-
"verdict": "MERGE" | "CHANGES_REQUESTED" | "CLOSE",
|
|
8
|
-
"findings": [
|
|
9
|
-
{
|
|
10
|
-
"path": "relative/path.ext",
|
|
11
|
-
"line": 123,
|
|
12
|
-
"startLine": 120,
|
|
13
|
-
"issue": "What is wrong.",
|
|
14
|
-
"fix": "How to fix it.",
|
|
15
|
-
"perspective": "Optional review perspective."
|
|
16
|
-
}
|
|
17
|
-
],
|
|
18
|
-
"reason": "Required only for CLOSE."
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
Rules:
|
|
22
|
-
- MERGE requires an empty findings array.
|
|
23
|
-
- CHANGES_REQUESTED requires at least one finding.
|
|
24
|
-
- CLOSE requires a reason and an empty findings array.
|
|
25
|
-
- path must be repository-relative.
|
|
26
|
-
- line is required and must target a valid right-side line inside the PR diff hunk.
|
|
27
|
-
- startLine is optional and must also target a valid right-side line inside the same PR diff hunk range.
|
|
28
|
-
- Omit startLine for single-line findings.
|
|
29
|
-
- Do not omit line. Do not create file-level or body-only findings.
|
|
30
|
-
- Missing closing-issue requirements must be normal findings anchored to the nearest responsible changed line.
|
|
31
|
-
- If the problem itself does not have an exact changed line, choose the nearest changed line that represents the cause, responsibility, missing implementation, or affected behavior. This includes but is not limited to missing validation, missing wiring, missing requirements, missing tests, missing documentation, affected configuration, or relevant call sites.
|
|
32
|
-
</output_contract>`.trim();
|
|
33
|
-
export const rereviewOutputContract = `
|
|
34
|
-
<output_contract>
|
|
35
|
-
Return exactly one JSON object and nothing else. Do not wrap it in markdown.
|
|
36
|
-
|
|
37
|
-
The object must match this shape:
|
|
38
|
-
{
|
|
39
|
-
"verdict": "MERGE" | "CHANGES_REQUESTED" | "CLOSE",
|
|
40
|
-
"resolve": [{ "commentId": 123, "threadId": "..." }],
|
|
41
|
-
"followUps": [{ "commentId": 123, "body": "..." }],
|
|
42
|
-
"newFindings": [{ "path": "relative/path.ext", "line": 123, "startLine": 120, "body": "..." }],
|
|
43
|
-
"reason": "Required only for CLOSE."
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
Rules:
|
|
47
|
-
- MERGE requires empty followUps and newFindings arrays.
|
|
48
|
-
- CHANGES_REQUESTED requires at least one followUp or newFinding.
|
|
49
|
-
- CLOSE requires a reason and empty followUps and newFindings arrays.
|
|
50
|
-
- line is required and must target a valid right-side line inside the latest PR diff hunk.
|
|
51
|
-
- startLine is optional and must also target a valid right-side line inside the same latest PR diff hunk range.
|
|
52
|
-
- Omit startLine for single-line findings.
|
|
53
|
-
- Do not omit line. Do not create file-level or body-only findings.
|
|
54
|
-
- Missing closing-issue requirements must be normal newFindings anchored to the nearest responsible changed line.
|
|
55
|
-
- If the problem itself does not have an exact changed line, choose the nearest changed line that represents the cause, responsibility, missing implementation, or affected behavior. This includes but is not limited to missing validation, missing wiring, missing requirements, missing tests, missing documentation, affected configuration, or relevant call sites.
|
|
56
|
-
</output_contract>`.trim();
|
|
57
|
-
export const findingValidationOutputContract = `
|
|
58
|
-
<output_contract>
|
|
59
|
-
Return exactly one JSON object and nothing else. Do not wrap it in markdown.
|
|
60
|
-
|
|
61
|
-
The object must match this shape:
|
|
62
|
-
{
|
|
63
|
-
"votes": [
|
|
64
|
-
{
|
|
65
|
-
"reviewer": "reviewer-key-that-authored-the-finding",
|
|
66
|
-
"findingIndex": 0,
|
|
67
|
-
"vote": "AGREE" | "DISAGREE",
|
|
68
|
-
"reason": "Optional short rationale."
|
|
69
|
-
}
|
|
70
|
-
]
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
Rules:
|
|
74
|
-
- Vote on every finding listed in the task.
|
|
75
|
-
- Do not vote on your own findings.
|
|
76
|
-
- AGREE means the finding should remain posted.
|
|
77
|
-
- DISAGREE means the finding should be discarded.
|
|
78
|
-
</output_contract>`.trim();
|
|
79
|
-
export const closeReconsiderationOutputContract = `
|
|
80
|
-
<output_contract>
|
|
81
|
-
Return exactly one JSON object and nothing else. Do not wrap it in markdown.
|
|
82
|
-
|
|
83
|
-
The object must match this shape:
|
|
84
|
-
{
|
|
85
|
-
"verdict": "MERGE" | "CHANGES_REQUESTED",
|
|
86
|
-
"findings": [
|
|
87
|
-
{
|
|
88
|
-
"path": "relative/path.ext",
|
|
89
|
-
"line": 123,
|
|
90
|
-
"startLine": 120,
|
|
91
|
-
"issue": "What is wrong.",
|
|
92
|
-
"fix": "How to fix it."
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
Rules:
|
|
98
|
-
- MERGE requires an empty findings array.
|
|
99
|
-
- CHANGES_REQUESTED requires at least one finding.
|
|
100
|
-
- CLOSE is not allowed in this reconsideration step.
|
|
101
|
-
- line is required and must target a valid right-side line inside the PR diff hunk.
|
|
102
|
-
- startLine is optional and must also target a valid right-side line inside the same PR diff hunk range.
|
|
103
|
-
- Do not omit line. Do not create file-level or body-only findings.
|
|
104
|
-
</output_contract>`.trim();
|
|
105
|
-
export const rereviewCloseReconsiderationOutputContract = `
|
|
106
|
-
<output_contract>
|
|
107
|
-
Return exactly one JSON object and nothing else. Do not wrap it in markdown.
|
|
108
|
-
|
|
109
|
-
The object must match this shape:
|
|
110
|
-
{
|
|
111
|
-
"verdict": "MERGE" | "CHANGES_REQUESTED",
|
|
112
|
-
"resolve": [{ "commentId": 123, "threadId": "..." }],
|
|
113
|
-
"followUps": [{ "commentId": 123, "body": "..." }],
|
|
114
|
-
"newFindings": [{ "path": "relative/path.ext", "line": 123, "startLine": 120, "body": "..." }]
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
Rules:
|
|
118
|
-
- MERGE requires empty followUps and newFindings arrays.
|
|
119
|
-
- CHANGES_REQUESTED requires at least one followUp or newFinding.
|
|
120
|
-
- CLOSE is not allowed in this reconsideration step.
|
|
121
|
-
- line is required and must target a valid right-side line inside the latest PR diff hunk.
|
|
122
|
-
- startLine is optional and must also target a valid right-side line inside the same latest PR diff hunk range.
|
|
123
|
-
- Do not omit line. Do not create file-level or body-only findings.
|
|
124
|
-
</output_contract>`.trim();
|
|
125
|
-
export const editOutputContract = `
|
|
126
|
-
<output_contract>
|
|
127
|
-
Return exactly one JSON object and nothing else. Do not wrap it in markdown.
|
|
128
|
-
|
|
129
|
-
The object must match this shape:
|
|
130
|
-
{
|
|
131
|
-
"mode": "EDITED" | "REPLIED",
|
|
132
|
-
"commitSha": "full sha, required only when mode is EDITED; omit when mode is REPLIED",
|
|
133
|
-
"commitMessage": "fix(scope): short description, required only when mode is EDITED; omit when mode is REPLIED",
|
|
134
|
-
"filesTouched": ["relative/path.ext"],
|
|
135
|
-
"responses": [{ "commentId": 123, "action": "FIXED" | "DISAGREE" | "ASK", "body": "Fixed." }]
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
Rules:
|
|
139
|
-
- Use EDITED only when you edited files, staged changes, and committed.
|
|
140
|
-
- Use REPLIED when you only replied without code changes.
|
|
141
|
-
- FIXED means you agreed with the reviewer and made a code change.
|
|
142
|
-
- DISAGREE means you did not edit because the requested change is incorrect or unnecessary.
|
|
143
|
-
- ASK means you did not edit because you need clarification.
|
|
144
|
-
- Do not make changes just because a reviewer requested them; edit only when you understand and agree.
|
|
145
|
-
- Do not push. The orchestrator pushes after validating this envelope.
|
|
146
|
-
- filesTouched must include every final changed file.
|
|
147
|
-
- responses must include a reply for each thread you addressed.
|
|
148
|
-
- REPLIED requires filesTouched to be empty and at least one DISAGREE or ASK response.
|
|
149
|
-
</output_contract>`.trim();
|
|
150
|
-
export const triageCreatePrOutputContract = `
|
|
151
|
-
<output_contract>
|
|
152
|
-
Return exactly one JSON object and nothing else. Do not wrap it in markdown.
|
|
153
|
-
|
|
154
|
-
The object must match this shape:
|
|
155
|
-
{
|
|
156
|
-
"mode": "EDITED" | "REPLIED",
|
|
157
|
-
"commitSha": "full sha, required only when mode is EDITED; omit when mode is REPLIED",
|
|
158
|
-
"commitMessage": "fix(scope): short description, required only when mode is EDITED; omit when mode is REPLIED",
|
|
159
|
-
"filesTouched": ["relative/path.ext"],
|
|
160
|
-
"pullRequest": {
|
|
161
|
-
"title": "PR title, required only when mode is EDITED; omit when mode is REPLIED",
|
|
162
|
-
"body": "PR body, required only when mode is EDITED; omit when mode is REPLIED"
|
|
163
|
-
},
|
|
164
|
-
"responses": [{ "commentId": 123, "action": "FIXED" | "DISAGREE" | "ASK", "body": "Fixed." }]
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
Rules:
|
|
168
|
-
- Use EDITED only when you edited files, staged changes, and committed.
|
|
169
|
-
- Use REPLIED when you only replied without code changes.
|
|
170
|
-
- For EDITED, pullRequest.title and pullRequest.body must be non-empty and follow the repository's PR conventions.
|
|
171
|
-
- Do not push or create the PR. The orchestrator pushes and creates the PR using pullRequest exactly as provided.
|
|
172
|
-
- filesTouched must include every final changed file.
|
|
173
|
-
- responses may be empty when no review threads were addressed.
|
|
174
|
-
- REPLIED requires filesTouched to be empty and at least one DISAGREE or ASK response.
|
|
175
|
-
</output_contract>`.trim();
|
|
176
|
-
export const ciClassificationOutputContract = `
|
|
177
|
-
<output_contract>
|
|
178
|
-
Return exactly one JSON object and nothing else. Do not wrap it in markdown.
|
|
179
|
-
{
|
|
180
|
-
"checks": [
|
|
181
|
-
{
|
|
182
|
-
"name": "exact failed check name",
|
|
183
|
-
"classification": "SCOPE_IN" | "SCOPE_OUT",
|
|
184
|
-
"reason": "Short reason."
|
|
185
|
-
}
|
|
186
|
-
]
|
|
187
|
-
}
|
|
188
|
-
Rules:
|
|
189
|
-
- Return one item for every failed check.
|
|
190
|
-
- SCOPE_IN means the failure should be treated as caused by the PR changes and passed to reviewers/editor.
|
|
191
|
-
- SCOPE_OUT means the failure is likely flaky, external, or infrastructure-related and may be rerun.
|
|
192
|
-
- If uncertain, choose SCOPE_IN.
|
|
193
|
-
</output_contract>`.trim();
|
|
194
|
-
export const ciClassificationAfterEditOutputContract = `
|
|
195
|
-
<output_contract>
|
|
196
|
-
Return exactly one JSON object and nothing else. Do not wrap it in markdown.
|
|
197
|
-
{
|
|
198
|
-
"checks": [
|
|
199
|
-
{
|
|
200
|
-
"name": "exact failed check name",
|
|
201
|
-
"classification": "SCOPE_IN" | "SCOPE_OUT",
|
|
202
|
-
"reason": "Short reason."
|
|
203
|
-
}
|
|
204
|
-
]
|
|
205
|
-
}
|
|
206
|
-
Rules:
|
|
207
|
-
- Return one item for every failed check.
|
|
208
|
-
- SCOPE_IN means the failure should be treated as caused by the PR changes or the editor changes and passed to reviewers/editor.
|
|
209
|
-
- SCOPE_OUT means the failure is likely flaky, external, or infrastructure-related and may be rerun.
|
|
210
|
-
- If uncertain, choose SCOPE_IN.
|
|
211
|
-
</output_contract>`.trim();
|
|
212
|
-
export function triageVoteOutputContract(votes) {
|
|
213
|
-
return `
|
|
214
|
-
<output_contract>
|
|
215
|
-
Return exactly one JSON object and nothing else. Do not wrap it in markdown.
|
|
216
|
-
|
|
217
|
-
The object must match this shape:
|
|
218
|
-
{
|
|
219
|
-
"vote": ${votes},
|
|
220
|
-
"reason": "Short rationale.",
|
|
221
|
-
"body": "Required only when vote is ASK. Public issue comment body asking for the missing information."
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
Rules:
|
|
225
|
-
- body is required when vote is ASK and must be written for the issue author.
|
|
226
|
-
- Omit body when vote is not ASK.
|
|
227
|
-
</output_contract>`.trim();
|
|
228
|
-
}
|
|
229
|
-
export const triageDuplicateOutputContract = `
|
|
230
|
-
<output_contract>
|
|
231
|
-
Return exactly one JSON object and nothing else. Do not wrap it in markdown.
|
|
232
|
-
|
|
233
|
-
The object must match this shape:
|
|
234
|
-
{
|
|
235
|
-
"vote": "DUPLICATE" | "NOT_DUPLICATE",
|
|
236
|
-
"duplicateOf": 123,
|
|
237
|
-
"reason": "Short rationale."
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
Rules:
|
|
241
|
-
- duplicateOf is required only when vote is DUPLICATE.
|
|
242
|
-
- duplicateOf must be one of the provided duplicate candidate issue numbers.
|
|
243
|
-
</output_contract>`.trim();
|
|
244
|
-
export const triageCommentClassificationOutputContract = `
|
|
245
|
-
<output_contract>
|
|
246
|
-
Return exactly one JSON object and nothing else. Do not wrap it in markdown.
|
|
247
|
-
|
|
248
|
-
The object must match this shape:
|
|
249
|
-
{
|
|
250
|
-
"comments": [
|
|
251
|
-
{
|
|
252
|
-
"commentId": 123,
|
|
253
|
-
"classification": "OBJECTION" | "NEW_EVIDENCE" | "CLARIFICATION" | "ACKNOWLEDGEMENT" | "UNRELATED",
|
|
254
|
-
"reason": "Short rationale."
|
|
255
|
-
}
|
|
256
|
-
]
|
|
257
|
-
}
|
|
258
|
-
</output_contract>`.trim();
|
|
259
|
-
export const triageSignalOutputContract = `
|
|
260
|
-
<output_contract>
|
|
261
|
-
Return exactly one JSON object and nothing else. Do not wrap it in markdown.
|
|
262
|
-
|
|
263
|
-
The object must match this shape:
|
|
264
|
-
{
|
|
265
|
-
"signals": [
|
|
266
|
-
{
|
|
267
|
-
"id": "configured_signal_id",
|
|
268
|
-
"reason": "Short rationale."
|
|
269
|
-
}
|
|
270
|
-
]
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
Rules:
|
|
274
|
-
- Return only configured signal IDs that apply.
|
|
275
|
-
- Return an empty signals array when none apply.
|
|
276
|
-
</output_contract>`.trim();
|
|
277
|
-
const outputContractsBySchemaName = {
|
|
278
|
-
"CI classification": ciClassificationOutputContract,
|
|
279
|
-
"close reconsideration": closeReconsiderationOutputContract,
|
|
280
|
-
edit: editOutputContract,
|
|
281
|
-
"finding validation": findingValidationOutputContract,
|
|
282
|
-
rereview: rereviewOutputContract,
|
|
283
|
-
"rereview close reconsideration": rereviewCloseReconsiderationOutputContract,
|
|
284
|
-
review: reviewOutputContract,
|
|
285
|
-
"triage acceptance": triageVoteOutputContract('"YES" | "NO" | "INVALID" | "ASK"'),
|
|
286
|
-
"triage category": triageVoteOutputContract('"ASK" or one of the configured category IDs'),
|
|
287
|
-
"triage create PR": triageCreatePrOutputContract,
|
|
288
|
-
"triage comment classification": triageCommentClassificationOutputContract,
|
|
289
|
-
"triage duplicate": triageDuplicateOutputContract,
|
|
290
|
-
"triage existing PR": triageVoteOutputContract('"RELATED_PR_HANDLES_ISSUE" | "RELATED_PR_DOES_NOT_HANDLE_ISSUE"'),
|
|
291
|
-
"triage reconsider": triageVoteOutputContract('"YES" | "NO" | "ASK"'),
|
|
292
|
-
"triage signal": triageSignalOutputContract,
|
|
293
|
-
};
|
|
294
|
-
export function repairPrompt(schemaName) {
|
|
295
|
-
const outputContract = outputContractsBySchemaName[schemaName];
|
|
296
|
-
const instructions = `Your previous ${schemaName} output did not match the required schema. Regenerate the ${schemaName} result.\n\nReturn only a JSON object matching the output contract below. Do not include analysis, explanation, apologies, markdown, or any text before or after the JSON object.`;
|
|
297
|
-
if (!outputContract)
|
|
298
|
-
return instructions;
|
|
299
|
-
return `${instructions}\n\n${outputContract}`;
|
|
300
|
-
}
|