opencode-magi 0.0.0-dev-20260521013053 → 0.0.0-dev-20260521140843

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 CHANGED
@@ -61,26 +61,33 @@ Add the following content to the configuration file.
61
61
  ```json
62
62
  {
63
63
  "$schema": "https://raw.githubusercontent.com/magi-ai/opencode-magi/main/schema.json",
64
- "review": {
65
- "agents": [
66
- {
67
- "account": "your-account-1",
68
- "model": "openai/gpt-5.5"
64
+ "agents": {
65
+ "refs": {
66
+ "account-1": {
67
+ "model": "openai/gpt-5.5",
68
+ "account": "account-1"
69
69
  },
70
- {
71
- "account": "your-account-2",
72
- "model": "anthropic/claude-opus-4-7"
70
+ "account-2": {
71
+ "model": "anthropic/claude-opus-4-7",
72
+ "account": "account-2"
73
73
  },
74
- {
75
- "account": "your-account-3",
76
- "model": "opencode/kimi-k2-6"
74
+ "account-3": {
75
+ "model": "opencode/kimi-k2-6",
76
+ "account": "account-3"
77
77
  }
78
+ }
79
+ },
80
+ "review": {
81
+ "agents": [
82
+ { "ref": "account-1" },
83
+ { "ref": "account-2" },
84
+ { "ref": "account-3" }
78
85
  ]
79
86
  }
80
87
  }
81
88
  ```
82
89
 
83
- `review.agents[].account` is the GitHub account used to post reviews and approvals. Must be authenticated with `gh auth token --user <account>` and must be unique.
90
+ After refs are expanded, `review.agents[].account` is the GitHub account used to post reviews and approvals. Must be authenticated with `gh auth token --user <account>` and must be unique.
84
91
 
85
92
  #### Set project config
86
93
 
@@ -101,53 +108,54 @@ Add the following content to the configuration file.
101
108
  "owner": "your-owner",
102
109
  "repo": "your-repo"
103
110
  },
104
- "review": {
105
- "agents": [
106
- {
107
- "account": "your-account-1",
108
- "model": "openai/gpt-5.5"
111
+ "agents": {
112
+ "refs": {
113
+ "account-1": {
114
+ "model": "openai/gpt-5.5",
115
+ "account": "account-1"
109
116
  },
110
- {
111
- "account": "your-account-2",
112
- "model": "anthropic/claude-opus-4-7"
117
+ "account-2": {
118
+ "model": "anthropic/claude-opus-4-7",
119
+ "account": "account-2"
113
120
  },
114
- {
115
- "account": "your-account-3",
116
- "model": "opencode/kimi-k2-6"
121
+ "account-3": {
122
+ "model": "opencode/kimi-k2-6",
123
+ "account": "account-3"
124
+ },
125
+ "account-4": {
126
+ "model": "openai/gpt-5.5",
127
+ "account": "account-4",
128
+ "author": {
129
+ "name": "account-4",
130
+ "email": "your-email@example.com"
131
+ }
117
132
  }
133
+ }
134
+ },
135
+ "review": {
136
+ "agents": [
137
+ { "ref": "account-1" },
138
+ { "ref": "account-2" },
139
+ { "ref": "account-3" }
118
140
  ]
119
141
  },
120
142
  "merge": {
121
- "editor": {
122
- "account": "your-editor-account",
123
- "model": "openai/gpt-5.5",
124
- "author": {
125
- "name": "your-account",
126
- "email": "your-email@example.com"
127
- }
128
- }
143
+ "editor": { "ref": "account-4" }
129
144
  },
130
145
  "triage": {
131
- "account": "your-triage-account",
146
+ "account": "account-5",
132
147
  "agents": [
133
- {
134
- "id": "general",
135
- "model": "openai/gpt-5.5"
136
- },
137
- {
138
- "id": "maintenance",
139
- "model": "anthropic/claude-opus-4-7"
140
- },
141
- {
142
- "id": "product",
143
- "model": "opencode/kimi-k2-6"
144
- }
148
+ { "ref": "account-1" },
149
+ { "ref": "account-2" },
150
+ { "ref": "account-3" }
145
151
  ]
146
152
  }
147
153
  }
148
154
  ```
149
155
 
150
- `review.agents[].account` is the GitHub account used to post reviews and approvals. Must be authenticated with `gh auth token --user <account>` and must be unique. `merge.editor.account` is used by `/magi:merge` to push fixes, close PRs, and merge PRs.
156
+ Entries with `ref` are expanded from `agents.refs`. Fields set alongside `ref` override fields from the preset.
157
+
158
+ After refs are expanded, `review.agents[].account` is the GitHub account used to post reviews and approvals. Must be authenticated with `gh auth token --user <account>` and must be unique. `merge.editor.account` is used by `/magi:merge` to push fixes, close PRs, and merge PRs.
151
159
 
152
160
  #### Validate config
153
161
 
@@ -246,6 +246,12 @@ function duplicateReferences(text) {
246
246
  refs.add(Number(match[1]));
247
247
  return [...refs];
248
248
  }
249
+ function issueTitleSearchQuery(title, fallback) {
250
+ return (title
251
+ .replaceAll(/[^\p{L}\p{N}_]+/gu, " ")
252
+ .replaceAll(/\s+/g, " ")
253
+ .trim() || fallback);
254
+ }
249
255
  async function fetchIssueCandidate(exec, repository, number, whyCandidate) {
250
256
  const raw = await exec(`gh issue view ${number} --repo ${shellQuote(repoSpecifier(repository))} --json number,title,url,state,body,createdAt`).catch(() => undefined);
251
257
  if (!raw)
@@ -254,7 +260,7 @@ async function fetchIssueCandidate(exec, repository, number, whyCandidate) {
254
260
  return { ...data, whyCandidate };
255
261
  }
256
262
  export async function searchDuplicateIssues(exec, repository, issue, limit = 5) {
257
- const query = issue.title;
263
+ const query = issueTitleSearchQuery(issue.title, String(issue.number));
258
264
  const explicitCandidates = await Promise.all(duplicateReferences(issue.body)
259
265
  .filter((number) => number !== issue.number)
260
266
  .map((number) => fetchIssueCandidate(exec, repository, number, "Issue body explicitly references a duplicate target.")));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-magi",
3
- "version": "0.0.0-dev-20260521013053",
3
+ "version": "0.0.0-dev-20260521140843",
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>",