opencode-resolve 0.1.19 → 0.2.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.
@@ -17,23 +17,6 @@
17
17
  // permission values, and wrong types throw an error at load time.
18
18
 
19
19
  {
20
- // -----------------------------------------------------------------------
21
- // profile ("mix" | "glm" | "gpt")
22
- // Activates provider-specific agent configurations.
23
- // Set automatically by postinstall based on detected providers.
24
- //
25
- // "mix" — explicit mixed/default profile. Uses standard resolver prompts,
26
- // DEFAULT_ENABLED, and whatever model aliases you configure.
27
- // "glm" — GLM-only, optimized for ZAI coding-plan: reduced maxSteps,
28
- // token-efficient prompts, no hard concurrency cap by default.
29
- // No deep-reviewer by default.
30
- // "gpt" — GPT-only, high-performance: parallel coder dispatch, full agent
31
- // roster, higher maxSteps.
32
- //
33
- // When omitted, the plugin defaults to "mix".
34
- // -----------------------------------------------------------------------
35
- "profile": "mix",
36
-
37
20
  // -----------------------------------------------------------------------
38
21
  // tier ("bronze" | "silver" | "gold")
39
22
  // Agent roster preset. Overrides the default enabled list when set.
@@ -41,27 +24,22 @@
41
24
  // "bronze" — Minimum agents: coder + resolver only. Maximum token savings.
42
25
  // "silver" — Standard: coder, resolver, explorer, reviewer, planner.
43
26
  // No deep-reviewer. Best balance for most projects.
44
- // "gold" — Full power: all 8 agents including debugger and researcher.
45
- // Maximum capability for complex tasks.
46
- //
47
- // Postinstall sets this automatically:
48
- // GLM → silver, GPT → gold, Mix/unknown → no tier (DEFAULT_ENABLED applies).
27
+ // "gold" — Full power: all 9 agents including deep-reviewer, debugger,
28
+ // architect and researcher. Maximum capability for complex tasks.
49
29
  //
30
+ // When omitted, the default enabled list applies (see `enabled` below).
50
31
  // Explicit `enabled` array always wins over tier.
51
32
  // -----------------------------------------------------------------------
52
33
  // "tier": "silver",
53
34
 
54
35
  // -----------------------------------------------------------------------
55
36
  // enabled (string[])
56
- // Which resolve agents to inject. When omitted, the tier or profile default
57
- // is used. Explicit `enabled` wins over both tier and profile defaults.
37
+ // Which resolve agents to inject. When omitted, the tier default is used.
38
+ // Explicit `enabled` wins over tier.
58
39
  //
59
- // Mix/default (no tier): ["coder", "resolver", "explorer", "reviewer",
40
+ // Default (no tier): ["coder", "resolver", "explorer", "reviewer",
60
41
  // "deep-reviewer", "planner"].
61
42
  //
62
- // GLM profile default: ["coder", "resolver", "explorer", "reviewer",
63
- // "planner"] — deep-reviewer omitted to save tokens.
64
- //
65
43
  // Core path: resolver + coder form the fixed-role verified resolve loop.
66
44
  // Internal specialists: explorer, reviewer, deep-reviewer are injected as
67
45
  // subagents by default (OpenCode-native composition), but are NOT the
@@ -79,13 +57,6 @@
79
57
  // -----------------------------------------------------------------------
80
58
  "preserveNative": true,
81
59
 
82
- // -----------------------------------------------------------------------
83
- // context7 (boolean)
84
- // When true, registers the Context7 MCP server unless `mcp.context7` is
85
- // already configured. Default: true.
86
- // -----------------------------------------------------------------------
87
- "context7": true,
88
-
89
60
  // -----------------------------------------------------------------------
90
61
  // commands (boolean)
91
62
  // When true, adds three optional commands: `resolve`, `resolve-code`,
@@ -95,26 +66,23 @@
95
66
 
96
67
  // -----------------------------------------------------------------------
97
68
  // autoApprove (boolean)
98
- // Documentary flag. The plugin's permission.ask hook automatically
99
- // classifies bash commands as safe (allow) / dangerous (deny) / unknown (ask).
100
- // Base agent permissions are already set to the correct defaults (allow for
101
- // edit/webfetch, ask for bash on write agents, deny for read-only agents).
102
- // Changing this flag has no effect on behavior — it exists for config
103
- // readability and future compatibility. Default: true.
69
+ // When true, the plugin's permission.ask hook auto-approves safe bash
70
+ // commands on resolve agents (read-only probes, verify commands) and
71
+ // denies dangerous ones. Native OpenCode sessions are untouched this
72
+ // only applies while a resolve agent is active. Default: true.
104
73
  // -----------------------------------------------------------------------
105
74
  "autoApprove": true,
106
75
 
107
76
  // -----------------------------------------------------------------------
108
77
  // maxParallelSubagents (positive integer)
109
- // Optional prompt-level cap for how many subagents of the SAME ROLE the
110
- // resolver may dispatch concurrently. When omitted, the resolver uses soft
111
- // fan-out guidance and backs off on rate-limit errors. GLM profile does not
112
- // impose a hard cap unless you set one.
113
- // 1 = strict per-role serial
78
+ // Prompt-level cap for how many subagents of the SAME ROLE the resolver
79
+ // may dispatch concurrently.
80
+ // 1 = strict per-role serial (default when omitted token-efficient,
81
+ // avoids rate-limit thrash on quota-bound plans like ZAI coding-plan)
114
82
  // 2 = up to two coders in parallel
115
83
  // N = up to N of each role
116
84
  // -----------------------------------------------------------------------
117
- "maxParallelSubagents": 2,
85
+ // "maxParallelSubagents": 1,
118
86
 
119
87
  // -----------------------------------------------------------------------
120
88
  // language ("auto" | "en" | "ko")
@@ -125,22 +93,25 @@
125
93
  // "auto" — detect from $LANG (defaults to en if not Korean). Default.
126
94
  // "en" — force English.
127
95
  // "ko" — force Korean.
128
- //
129
- // Examples of what this affects:
130
- // en: "[resolver] Reminder: verify your changes ..."
131
- // ko: "[리졸버] 리마인더: 완료 보고 전에 변경사항을 검증하세요 ..."
132
96
  // -----------------------------------------------------------------------
133
97
  "language": "auto",
134
98
 
99
+ // -----------------------------------------------------------------------
100
+ // singleAgentMode (boolean)
101
+ // When true, the resolver makes ALL edits itself with edit/write tools and
102
+ // does NOT dispatch a coder subagent for implementation. Subagents may still
103
+ // be used to gather information or diagnose (explorer/debugger), but never
104
+ // to write code. Trades isolation for lower latency and token cost on
105
+ // simple tasks. Default: false (resolver dispatches a coder subagent).
106
+ // -----------------------------------------------------------------------
107
+ // "singleAgentMode": false,
108
+
135
109
  // -----------------------------------------------------------------------
136
110
  // models (object)
137
- // Alias map. Keys are either an agent name (coder, reviewer, resolver,
138
- // codex, gpt, glm, architect, gpt-coder, debugger, researcher, explorer,
139
- // deep-reviewer, planner)
140
- // OR one of the well-known aliases (`glm`, `gpt`, `quick`, `deep`,
141
- // `fast`, `strong`, `mini`, `codex`, `bronze`, `silver`, `gold`,
142
- // `gpt-bronze`, `gpt-silver`, `gpt-gold`, `glm-bronze`, `glm-silver`,
143
- // `glm-gold`).
111
+ // Alias map. Keys are either an agent name (coder, reviewer, resolver,
112
+ // architect, debugger, researcher, explorer, deep-reviewer, planner)
113
+ // OR one of the well-known aliases (`quick`, `deep`, `fast`, `strong`,
114
+ // `mini`, `bronze`, `silver`, `gold`).
144
115
  // Values are model identifiers OR another alias.
145
116
  //
146
117
  // Resolution order for a given agent:
@@ -150,26 +121,23 @@
150
121
  // 4. OpenCode's own fallback
151
122
  //
152
123
  // By default the models map is empty — all agents inherit the top-level
153
- // OpenCode default model. Pin models only when you have measured a
154
- // benefit from role-specific model selection.
124
+ // OpenCode default model. Pin models only when you want role-specific
125
+ // selection.
155
126
  //
156
- // When resolve.json is created for the first time by postinstall, the
157
- // plugin inspects your OpenCode model config and writes an adaptive
158
- // preset:
159
- // - interactive terminal always prompts for mix/gpt/glm, three-tier models,
160
- // and optional dedicated codex/glm primary agents
161
- // - non-interactive install → no guessed model pinning; profile mix,
162
- // models {}, and resolver/codex/glm primary routes enabled
163
- // - OPENCODE_RESOLVE_AUTO_PRESET=1 → legacy non-interactive
164
- // provider-adapted presets. GLM presets prefer high-concurrency models
165
- // such as GLM-5.1 / GLM-4.5 over low-concurrency Flash tiers.
127
+ // When resolve.json is created by postinstall, the plugin inspects your
128
+ // OpenCode model config and offers to pin a provider/model:
129
+ // - interactive terminal → detects providers, asks which one + which
130
+ // model(s), pins them. One model for everything is the recommended
131
+ // default.
132
+ // - non-interactive install → no guessed model pinning; all agents
133
+ // inherit the top-level OpenCode model.
166
134
  // Existing resolve.json files are never overwritten without consent.
167
135
  // Interactive reinstall asks whether to update or back up and run fresh
168
136
  // setup. Non-interactive automation can set:
169
137
  // OPENCODE_RESOLVE_REINSTALL=fresh
170
138
  // OPENCODE_RESOLVE_REINSTALL=update
171
139
  //
172
- // Example — one efficient model for everything (recommended default):
140
+ // Example — one model for everything (recommended default):
173
141
  // "models": {}
174
142
  //
175
143
  // Example — pin roles to specific models when needed:
@@ -180,26 +148,22 @@
180
148
  // "resolver": "strong"
181
149
  // }
182
150
  //
183
- // Example — GLM-only three-tier preset (auto-generated for GLM/ZAI users):
184
- // GLM fills all tiers — no GPT dependency, so token exhaustion on
185
- // third-party providers never blocks agent execution.
151
+ // Example — GLM-only three-tier preset (GLM fills all tiers, no GPT
152
+ // dependency, so quota exhaustion on third-party providers never blocks
153
+ // agent execution):
186
154
  // "models": {
187
- // "glm": "zai-coding-plan/glm-5.1",
188
- // "bronze": "zai-coding-plan/glm-4.5",
189
- // "silver": "zai-coding-plan/glm-5.1",
190
- // "gold": "zai-coding-plan/glm-5.1",
191
- // "fast": "bronze",
155
+ // "bronze": "zai-coding-plan/glm-5.2",
156
+ // "silver": "zai-coding-plan/glm-5.2",
157
+ // "gold": "zai-coding-plan/glm-5.2",
158
+ // "fast": "bronze",
192
159
  // "strong": "gold",
193
- // "coder": "gold",
160
+ // "coder": "gold",
194
161
  // "resolver": "gold",
195
162
  // "reviewer": "gold",
196
163
  // "deep-reviewer": "gold",
197
164
  // "explorer": "bronze",
198
165
  // "planner": "gold"
199
166
  // }
200
- //
201
- // Legacy aliases (glm, gpt, quick, deep) remain supported for backward
202
- // compatibility. New configs should prefer provider-neutral aliases.
203
167
  // -----------------------------------------------------------------------
204
168
  "models": {},
205
169
 
@@ -219,7 +183,7 @@
219
183
  "coder": {
220
184
  "enabled": true,
221
185
  "mode": "subagent",
222
- "maxSteps": 20,
186
+ "maxSteps": 15,
223
187
  "permission": {
224
188
  "edit": "allow",
225
189
  "bash": "allow",
@@ -230,7 +194,7 @@
230
194
  "resolver": {
231
195
  "enabled": true,
232
196
  "mode": "all",
233
- "maxSteps": 30,
197
+ "maxSteps": 25,
234
198
  "permission": {
235
199
  "edit": "allow",
236
200
  "bash": "allow",
@@ -238,28 +202,6 @@
238
202
  }
239
203
  },
240
204
 
241
- // codex — Codex-optimized primary resolver (selectable in agent picker)
242
- // Same verified resolve-loop style as resolver, with a Codex-specific
243
- // system prompt. Legacy — kept for backward compatibility. New GPT
244
- // installs should prefer the "gpt" agent instead.
245
- "codex": {
246
- "enabled": false,
247
- "mode": "all",
248
- "maxSteps": 35
249
- },
250
-
251
- // -----------------------------------------------------------------
252
- // gpt — GPT-optimized primary resolver (selectable in agent picker)
253
- // GPT-specific verified resolve-loop with parallel coder dispatch,
254
- // full agent roster, and higher maxSteps. Enabled automatically when
255
- // GPT profile is selected during install. Uses buildGPTResolverPrompt().
256
- // -----------------------------------------------------------------
257
- "gpt": {
258
- "enabled": false,
259
- "mode": "all",
260
- "maxSteps": 35
261
- },
262
-
263
205
  // Internal specialist subagents — enabled by default as subagents only.
264
206
  // Core path is resolver→coder. These are dispatched only when justified.
265
207
 
@@ -268,7 +210,7 @@
268
210
  // dispatches explorer only when scope is genuinely unknown.
269
211
  "explorer": {
270
212
  "mode": "subagent",
271
- "maxSteps": 6,
213
+ "maxSteps": 5,
272
214
  "permission": {
273
215
  "edit": "deny",
274
216
  "bash": "allow",
@@ -281,9 +223,7 @@
281
223
  // non-trivial changes.
282
224
  "reviewer": {
283
225
  "mode": "subagent",
284
- "maxSteps": 8,
285
- // Reviewer is read-only by design. edit and bash are denied even when
286
- // autoApprove is true.
226
+ "maxSteps": 6,
287
227
  "permission": {
288
228
  "edit": "deny",
289
229
  "bash": "deny",
@@ -304,6 +244,11 @@
304
244
  }
305
245
  },
306
246
 
247
+ "planner": {
248
+ "mode": "subagent",
249
+ "maxSteps": 8
250
+ },
251
+
307
252
  // Disabled by default — enable explicitly when needed.
308
253
 
309
254
  "architect": {
@@ -311,11 +256,6 @@
311
256
  "mode": "subagent",
312
257
  "maxSteps": 10
313
258
  },
314
- "gpt-coder": {
315
- "enabled": false,
316
- "mode": "subagent",
317
- "maxSteps": 20
318
- },
319
259
  "debugger": {
320
260
  "enabled": false,
321
261
  "mode": "subagent",
@@ -325,20 +265,6 @@
325
265
  "enabled": false,
326
266
  "mode": "subagent",
327
267
  "maxSteps": 8
328
- },
329
-
330
- // -----------------------------------------------------------------
331
- // glm — GLM-optimized orchestrator (selectable in agent picker)
332
- // Disabled by default. Enable to get a standalone GLM agent with
333
- // coding-plan optimized prompts: session limit handling,
334
- // token-efficient execution, no hard concurrency cap unless configured.
335
- // Users pick this from OpenCode's agent picker as an alternative
336
- // to the default resolver.
337
- // -----------------------------------------------------------------
338
- "glm": {
339
- "enabled": false,
340
- "mode": "all",
341
- "maxSteps": 30
342
268
  }
343
269
  }
344
270
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-resolve",
3
- "version": "0.1.19",
3
+ "version": "0.2.0",
4
4
  "description": "OpenCode plugin that adds a lightweight resolver/coder harness for continuous agentic coding.",
5
5
  "type": "module",
6
6
  "homepage": "https://jshsakura.github.io/opencode-resolve/",
package/scripts/cli.mjs CHANGED
@@ -20,15 +20,21 @@ if (command !== "setup") {
20
20
  }
21
21
 
22
22
  const env = { ...process.env }
23
- if (args.includes("--fresh")) env.OPENCODE_RESOLVE_REINSTALL = "fresh"
24
- if (args.includes("--reset-config")) {
23
+ // All reset flavors collapse into one full wipe — back up resolve.json and run setup
24
+ // from scratch, dropping model pins along with everything else.
25
+ if (
26
+ args.includes("--reset") ||
27
+ args.includes("--fresh") ||
28
+ args.includes("--reset-config") ||
29
+ args.includes("--nuke") ||
30
+ args.includes("--wipe") ||
31
+ args.includes("--full-reset")
32
+ ) {
25
33
  env.OPENCODE_RESOLVE_REINSTALL = "fresh"
26
- env.OPENCODE_RESOLVE_RESET_MODELS = "1"
27
34
  }
28
35
  if (args.includes("--update")) env.OPENCODE_RESOLVE_REINSTALL = "update"
29
36
  if (args.includes("--models") || args.includes("--configure-models")) env.OPENCODE_RESOLVE_CONFIGURE_MODELS = "1"
30
37
  if (args.includes("--auto-preset")) env.OPENCODE_RESOLVE_AUTO_PRESET = "1"
31
- if (args.includes("--no-companions")) env.OPENCODE_RESOLVE_SKIP_COMPANIONS = "1"
32
38
  if (args.includes("--force-cache") || args.includes("--refresh-cache")) env.OPENCODE_RESOLVE_FORCE_CACHE_REFRESH = "1"
33
39
 
34
40
  const child = spawn(process.execPath, [postinstall], {
@@ -53,22 +59,20 @@ function printHelp() {
53
59
  console.log(`opencode-resolve
54
60
 
55
61
  Usage:
56
- opencode-resolve setup [--fresh|--update|--reset-config] [--models] [--auto-preset] [--force-cache] [--no-companions]
62
+ opencode-resolve setup [--reset|--update] [--models] [--auto-preset] [--force-cache]
57
63
 
58
64
  Commands:
59
65
  setup Register the OpenCode plugin, create or migrate resolve.json, and refresh stale plugin cache.
60
66
 
61
67
  Options:
62
- --fresh Back up existing resolve.json and run setup again, preserving existing model pins.
68
+ --reset Back up existing resolve.json and wipe EVERYTHING (model pins included). Aliases: --fresh, --reset-config, --nuke, --wipe, --full-reset.
63
69
  --update Preserve existing resolve.json and add missing defaults.
64
- --reset-config Back up existing resolve.json and regenerate it, including model pins.
65
70
  --models Reconfigure model pins without replacing the rest of resolve.json.
66
71
  --auto-preset Non-interactive provider-based model preset.
67
72
  --force-cache Force OpenCode plugin cache refresh without deleting resolve.json.
68
- --no-companions Skip companion plugin suggestions.
69
73
 
70
74
  Examples:
71
- opencode-resolve setup --fresh
75
+ opencode-resolve setup --reset
72
76
  opencode-resolve setup --update
73
77
  opencode-resolve setup --force-cache
74
78
  `)
@@ -56,7 +56,7 @@ async function chooseExistingResolveConfigAction() {
56
56
  }
57
57
 
58
58
  if (!process.stdin.isTTY || !process.stdout.isTTY) {
59
- console.log("Existing resolve config found; preserving it. Run `opencode-resolve setup --models` for model setup or `opencode-resolve setup --fresh` to regenerate without dropping model pins.")
59
+ console.log("Existing resolve config found; preserving it. Run `opencode-resolve setup --models` for model setup or `opencode-resolve setup --reset` to reset from scratch (model pins wiped).")
60
60
  return "update"
61
61
  }
62
62
 
@@ -106,18 +106,8 @@ async function createAdaptiveResolveConfig(options = {}) {
106
106
 
107
107
  const resolveConfig = { ...example }
108
108
  let preset = {}
109
- if (process.env.OPENCODE_RESOLVE_AUTO_PRESET === "1") {
110
- const currentModel = detectOpenCodeModel(opencodeConfig)
111
- preset = buildModelPreset(currentModel)
112
- } else {
113
- resolveConfig.profile = "mix"
114
- resolveConfig.models = {}
115
- resolveConfig.agents = {
116
- ...resolveConfig.agents,
117
- gpt: { ...(resolveConfig.agents?.gpt ?? {}), enabled: true },
118
- glm: { ...(resolveConfig.agents?.glm ?? {}), enabled: true },
119
- }
120
- }
109
+ const currentModel = detectOpenCodeModel(opencodeConfig)
110
+ preset = buildModelPreset(currentModel)
121
111
  if (preset && Object.keys(preset).length > 0) {
122
112
  resolveConfig.models = preservedModels ? { ...preset, ...preservedModels } : preset
123
113
  } else if (preservedModels) {
@@ -186,11 +176,7 @@ function buildModelPreset(currentModel) {
186
176
  }
187
177
 
188
178
  function getPresetLabel(currentModel) {
189
- if (!currentModel) return "inherited"
190
- const lower = currentModel.toLowerCase()
191
- if (lower.includes("glm") || lower.includes("zai")) return "glm+gpt"
192
- if (lower.includes("openai/") || lower.includes("gpt")) return "gpt-only"
193
- return "inherited"
179
+ return currentModel ? "configured" : "inherited"
194
180
  }
195
181
 
196
182
  async function assertFile(path) {