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
package/dist/config/resolve.js
CHANGED
|
@@ -1,254 +1,128 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
{
|
|
40
|
-
add: ["wontfix"],
|
|
41
|
-
remove: ["triage"],
|
|
42
|
-
when: { disposition: "rejected" },
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
add: ["invalid"],
|
|
46
|
-
remove: ["triage"],
|
|
47
|
-
when: { disposition: "invalid" },
|
|
48
|
-
},
|
|
49
|
-
{ add: ["question"], when: { disposition: "needs_category" } },
|
|
50
|
-
{ add: ["question"], when: { disposition: "needs_acceptance" } },
|
|
51
|
-
];
|
|
52
|
-
export function reviewerKey(reviewer, index) {
|
|
53
|
-
return reviewer.id ?? `reviewer-${index + 1}`;
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { CONFIG_PATH, DEFAULT_CONFIG } from "@/constant";
|
|
4
|
+
import editPermissions from "@/permissions/editor.json" with { type: "json" };
|
|
5
|
+
import { filterEmpty, getModels, isArray, isObject, isString, merge, } from "@/utils";
|
|
6
|
+
export function resolvePermissions(permissions) {
|
|
7
|
+
if (!permissions)
|
|
8
|
+
return undefined;
|
|
9
|
+
if (isString(permissions))
|
|
10
|
+
return [
|
|
11
|
+
"read",
|
|
12
|
+
"edit",
|
|
13
|
+
"glob",
|
|
14
|
+
"grep",
|
|
15
|
+
"bash",
|
|
16
|
+
"task",
|
|
17
|
+
"skill",
|
|
18
|
+
"lsp",
|
|
19
|
+
"webfetch",
|
|
20
|
+
"websearch",
|
|
21
|
+
"external_directory",
|
|
22
|
+
"doom_loop",
|
|
23
|
+
].map((permission) => ({
|
|
24
|
+
action: permissions,
|
|
25
|
+
pattern: "*",
|
|
26
|
+
permission,
|
|
27
|
+
}));
|
|
28
|
+
else
|
|
29
|
+
return Object.entries(permissions).flatMap(([permission, rule]) => {
|
|
30
|
+
if (isString(rule))
|
|
31
|
+
return [{ action: rule, pattern: "*", permission }];
|
|
32
|
+
else
|
|
33
|
+
return Object.entries(rule).map(([pattern, action]) => ({
|
|
34
|
+
action,
|
|
35
|
+
pattern,
|
|
36
|
+
permission,
|
|
37
|
+
}));
|
|
38
|
+
});
|
|
54
39
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
40
|
+
function mergePermissions(base, override) {
|
|
41
|
+
if (!override)
|
|
42
|
+
return base;
|
|
43
|
+
else if (isString(override) || isString(base))
|
|
44
|
+
return override;
|
|
45
|
+
else
|
|
46
|
+
return merge(base, override);
|
|
60
47
|
}
|
|
61
|
-
function
|
|
62
|
-
if (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
48
|
+
function mergeAgent(base, agent) {
|
|
49
|
+
if (base.agents.refs && agent.ref)
|
|
50
|
+
agent = { ...base.agents.refs[agent.ref], ...agent };
|
|
51
|
+
agent.permissions = mergePermissions(base.agents.permissions, agent.permissions);
|
|
52
|
+
if (base.account)
|
|
53
|
+
agent.account ??= base.account;
|
|
54
|
+
return agent;
|
|
66
55
|
}
|
|
67
|
-
function
|
|
68
|
-
|
|
56
|
+
function resolveModel(models, model) {
|
|
57
|
+
if (isArray(model))
|
|
58
|
+
model = model.find((model) => isString(model) ? models.includes(model) : models.includes(model.id));
|
|
59
|
+
if (!model)
|
|
60
|
+
return undefined;
|
|
61
|
+
if (isString(model))
|
|
62
|
+
return models.includes(model) ? { id: model } : undefined;
|
|
63
|
+
else
|
|
64
|
+
return models.includes(model.id) ? model : undefined;
|
|
69
65
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
clonePermissionValue(value),
|
|
77
|
-
]));
|
|
66
|
+
async function readConfig(path) {
|
|
67
|
+
try {
|
|
68
|
+
const config = JSON.parse(await readFile(path, "utf8"));
|
|
69
|
+
if (!isObject(config))
|
|
70
|
+
throw new Error(`Config must be a JSON object: ${path}`);
|
|
71
|
+
return config;
|
|
78
72
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
key,
|
|
84
|
-
clonePermissionValue(value),
|
|
85
|
-
]));
|
|
73
|
+
catch (e) {
|
|
74
|
+
if (e.code === "ENOENT")
|
|
75
|
+
return undefined;
|
|
76
|
+
throw e;
|
|
86
77
|
}
|
|
87
|
-
const merged = Object.fromEntries(Object.entries(base).map(([key, value]) => [
|
|
88
|
-
key,
|
|
89
|
-
clonePermissionValue(value),
|
|
90
|
-
]));
|
|
91
|
-
for (const [permission, value] of Object.entries(override)) {
|
|
92
|
-
const existing = merged[permission];
|
|
93
|
-
merged[permission] =
|
|
94
|
-
existing && typeof existing !== "string" && typeof value !== "string"
|
|
95
|
-
? { ...existing, ...value }
|
|
96
|
-
: clonePermissionValue(value);
|
|
97
|
-
}
|
|
98
|
-
return merged;
|
|
99
|
-
}
|
|
100
|
-
export function resolveReviewerPermission(agents, reviewer) {
|
|
101
|
-
return mergePermissions(mergePermissions(DEFAULT_REVIEWER_PERMISSION, agents.permissions), reviewer.permissions);
|
|
102
|
-
}
|
|
103
|
-
export function resolveEditorPermission(agents, editor) {
|
|
104
|
-
return mergePermissions(mergePermissions(DEFAULT_EDITOR_PERMISSION, agents.permissions), editor.permissions);
|
|
105
78
|
}
|
|
106
|
-
export function
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
model
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
id: category.id ?? "",
|
|
156
|
-
labels: category.labels ?? [],
|
|
157
|
-
types: category.types ?? [],
|
|
158
|
-
}));
|
|
159
|
-
}
|
|
160
|
-
export function resolveRepository(config) {
|
|
161
|
-
if (!config.github?.owner)
|
|
162
|
-
throw new Error("github.owner is required");
|
|
163
|
-
if (!config.github?.repo)
|
|
164
|
-
throw new Error("github.repo is required");
|
|
165
|
-
return {
|
|
166
|
-
alias: config.github.repo,
|
|
167
|
-
agents: resolveAgents(config),
|
|
168
|
-
automation: {
|
|
169
|
-
close: config.merge?.automation?.close ?? false,
|
|
170
|
-
conflict: config.merge?.automation?.conflict ?? false,
|
|
171
|
-
merge: config.merge?.automation?.merge ?? true,
|
|
172
|
-
},
|
|
173
|
-
checks: {
|
|
174
|
-
exclude: config.review?.checks?.exclude ?? [],
|
|
175
|
-
retryFailedJobs: config.review?.checks?.retryFailedJobs ?? 3,
|
|
176
|
-
wait: config.review?.checks?.wait ?? true,
|
|
177
|
-
waitAfterEdit: config.merge?.checks?.wait ?? true,
|
|
178
|
-
waitBeforeReview: config.review?.checks?.wait ?? true,
|
|
179
|
-
},
|
|
180
|
-
concurrency: {
|
|
181
|
-
runs: config.review?.concurrency?.runs ?? 3,
|
|
182
|
-
reviewers: config.review?.concurrency?.reviewers ?? 3,
|
|
183
|
-
},
|
|
184
|
-
github: {
|
|
185
|
-
apiRetryAttempts: config.github.apiRetryAttempts ?? 3,
|
|
186
|
-
host: config.github.host ?? "github.com",
|
|
187
|
-
owner: config.github.owner,
|
|
188
|
-
repo: config.github.repo,
|
|
189
|
-
},
|
|
190
|
-
language: config.language,
|
|
191
|
-
account: config.account,
|
|
192
|
-
mode: config.mode ?? "single",
|
|
193
|
-
merge: {
|
|
194
|
-
approvalPolicy: config.review?.merge?.approvalPolicy ?? "majority",
|
|
195
|
-
method: config.review?.merge?.method ?? "squash",
|
|
196
|
-
auto: config.review?.merge?.auto ?? true,
|
|
197
|
-
deleteBranch: config.review?.merge?.deleteBranch ?? true,
|
|
198
|
-
queue: config.review?.merge?.queue ?? false,
|
|
199
|
-
mergeQueue: config.review?.merge?.queue ?? false,
|
|
200
|
-
maxThreadResolutionCycles: config.merge?.maxThreadResolutionCycles ?? 5,
|
|
201
|
-
},
|
|
202
|
-
prompts: {
|
|
203
|
-
ciClassification: config.review?.prompts?.ciClassification,
|
|
204
|
-
ciClassificationAfterEdit: config.merge?.prompts?.ciClassification,
|
|
205
|
-
closeReconsideration: config.review?.prompts?.closeReconsideration,
|
|
206
|
-
edit: config.merge?.prompts?.edit,
|
|
207
|
-
editGuidelines: config.merge?.prompts?.editGuidelines,
|
|
208
|
-
findingValidation: config.review?.prompts?.findingValidation,
|
|
209
|
-
rereview: config.review?.prompts?.rereview,
|
|
210
|
-
review: config.review?.prompts?.review,
|
|
211
|
-
reviewGuidelines: config.review?.prompts?.reviewGuidelines,
|
|
212
|
-
},
|
|
213
|
-
reviewAutomation: {
|
|
214
|
-
close: config.review?.automation?.close ?? false,
|
|
215
|
-
merge: config.review?.automation?.merge ?? true,
|
|
216
|
-
},
|
|
217
|
-
safety: {
|
|
218
|
-
allowAuthors: config.review?.safety?.allowAuthors ?? [],
|
|
219
|
-
blockedPaths: config.review?.safety?.blockedPaths ?? [],
|
|
220
|
-
maxChangedFiles: config.review?.safety?.maxChangedFiles,
|
|
221
|
-
requiredLabels: config.review?.safety?.requiredLabels ?? [],
|
|
222
|
-
},
|
|
223
|
-
triage: {
|
|
224
|
-
automation: {
|
|
225
|
-
close: config.triage?.automation?.close ?? false,
|
|
226
|
-
create: config.triage?.automation?.create ?? false,
|
|
227
|
-
label: config.triage?.automation?.label ?? DEFAULT_TRIAGE_LABEL_RULES,
|
|
228
|
-
merge: config.triage?.automation?.merge ?? false,
|
|
229
|
-
review: config.triage?.automation?.review ?? false,
|
|
230
|
-
},
|
|
231
|
-
categories: resolveTriageCategories(config),
|
|
232
|
-
concurrency: {
|
|
233
|
-
runs: config.triage?.concurrency?.runs ?? 3,
|
|
234
|
-
},
|
|
235
|
-
output: config.triage?.output,
|
|
236
|
-
prompts: config.triage?.prompts ?? {},
|
|
237
|
-
reporter: config.triage?.reporter,
|
|
238
|
-
safety: {
|
|
239
|
-
allowAuthors: config.triage?.safety?.allowAuthors ?? [],
|
|
240
|
-
allowMentionActors: config.triage?.safety?.allowMentionActors ?? [],
|
|
241
|
-
allowMentionRoles: config.triage?.safety?.allowMentionRoles ?? [
|
|
242
|
-
"AUTHOR",
|
|
243
|
-
"OWNER",
|
|
244
|
-
"MEMBER",
|
|
245
|
-
"COLLABORATOR",
|
|
246
|
-
],
|
|
247
|
-
blockedLabels: config.triage?.safety?.blockedLabels ?? [],
|
|
248
|
-
requiredLabels: config.triage?.safety?.requiredLabels ?? ["triage"],
|
|
249
|
-
},
|
|
250
|
-
signals: config.triage?.signals ?? [],
|
|
251
|
-
worktree: config.triage?.worktree,
|
|
252
|
-
},
|
|
253
|
-
};
|
|
79
|
+
export async function getConfig(input) {
|
|
80
|
+
const projectPath = join(input.directory, CONFIG_PATH.PROJECT);
|
|
81
|
+
const [models, ...data] = await Promise.all([
|
|
82
|
+
getModels(input),
|
|
83
|
+
readConfig(CONFIG_PATH.GLOBAL),
|
|
84
|
+
readConfig(projectPath),
|
|
85
|
+
]);
|
|
86
|
+
const results = filterEmpty(data);
|
|
87
|
+
if (!models.length)
|
|
88
|
+
throw new Error("No OpenCode models found.");
|
|
89
|
+
if (!results.length)
|
|
90
|
+
throw new Error(`No Magi config found. Expected ${CONFIG_PATH.GLOBAL} or ${projectPath}.`);
|
|
91
|
+
const config = results.reduce((prev, current) => merge(prev, current), DEFAULT_CONFIG);
|
|
92
|
+
config.github.url = `https://${config.github.host}/${config.github.owner}/${config.github.repo}`;
|
|
93
|
+
if (config.review.reviewers)
|
|
94
|
+
config.review.reviewers = config.review.reviewers.map((agent, index) => {
|
|
95
|
+
const { id, model, ...rest } = mergeAgent(config, agent);
|
|
96
|
+
return {
|
|
97
|
+
...rest,
|
|
98
|
+
id: id || `reviewer-${index + 1}`,
|
|
99
|
+
model: resolveModel(models, model),
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
if (config.merge.editor) {
|
|
103
|
+
if (config.merge.editor.permissions)
|
|
104
|
+
config.merge.editor.permissions = mergePermissions(editPermissions, config.merge.editor.permissions);
|
|
105
|
+
else
|
|
106
|
+
config.merge.editor.permissions = editPermissions;
|
|
107
|
+
config.merge.editor = mergeAgent(config, config.merge.editor);
|
|
108
|
+
config.merge.editor.model = resolveModel(models, config.merge.editor.model);
|
|
109
|
+
}
|
|
110
|
+
if (config.triage.voters)
|
|
111
|
+
config.triage.voters = config.triage.voters.map((agent, index) => {
|
|
112
|
+
const { id, model, ...rest } = mergeAgent(config, agent);
|
|
113
|
+
return {
|
|
114
|
+
...rest,
|
|
115
|
+
id: id || `voter-${index + 1}`,
|
|
116
|
+
model: resolveModel(models, model),
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
if (config.triage.creator) {
|
|
120
|
+
if (config.triage.creator.permissions)
|
|
121
|
+
config.triage.creator.permissions = mergePermissions(editPermissions, config.triage.creator.permissions);
|
|
122
|
+
else
|
|
123
|
+
config.triage.creator.permissions = editPermissions;
|
|
124
|
+
config.triage.creator = mergeAgent(config, config.triage.creator);
|
|
125
|
+
config.triage.creator.model = resolveModel(models, config.triage.creator.model);
|
|
126
|
+
}
|
|
127
|
+
return config;
|
|
254
128
|
}
|