opencode-resolve 0.1.20 → 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.ko.md +39 -46
- package/README.md +39 -46
- package/dist/agents.d.ts +3 -19
- package/dist/agents.js +45 -205
- package/dist/checkpoint.d.ts +22 -0
- package/dist/checkpoint.js +72 -0
- package/dist/config.d.ts +3 -1
- package/dist/config.js +30 -47
- package/dist/hooks/index.js +299 -118
- package/dist/index.d.ts +5 -1
- package/dist/index.js +4 -1
- package/dist/messages.d.ts +1 -1
- package/dist/messages.js +28 -56
- package/dist/state.d.ts +13 -0
- package/dist/state.js +9 -0
- package/dist/tools/index.d.ts +11 -2
- package/dist/tools/index.js +131 -21
- package/dist/types.d.ts +12 -5
- package/dist/utils.d.ts +11 -11
- package/dist/utils.js +55 -97
- package/opencode-resolve.example.json +0 -15
- package/opencode-resolve.reference.jsonc +94 -130
- package/package.json +1 -1
- package/scripts/cli.mjs +13 -9
- package/scripts/install-local.mjs +4 -18
- package/scripts/postinstall.mjs +132 -495
package/README.ko.md
CHANGED
|
@@ -29,7 +29,6 @@ opencode-resolve setup
|
|
|
29
29
|
- [모델 설정](#모델-설정)
|
|
30
30
|
- [에이전트](#에이전트)
|
|
31
31
|
- [권한](#권한)
|
|
32
|
-
- [Context7](#context7)
|
|
33
32
|
- [프로젝트 컨텍스트](#프로젝트-컨텍스트)
|
|
34
33
|
- [업그레이드](#업그레이드)
|
|
35
34
|
- [개발](#개발)
|
|
@@ -40,7 +39,6 @@ opencode-resolve setup
|
|
|
40
39
|
- 작은 패치와 검증 증거를 중시하는 `resolver -> coder` 루프
|
|
41
40
|
- 코드베이스 탐색과 리뷰 갭 점검을 위한 읽기 전용 서브에이전트
|
|
42
41
|
- 선택적 명령어: `/resolve`, `/resolve-code`, `/resolve-review`
|
|
43
|
-
- 선택적 Context7 MCP 자동 등록
|
|
44
42
|
- 엄격한 설정 검증: 알 수 없는 키, 잘못된 모드, 잘못된 에이전트 이름, 잘못된 타입은 즉시 실패
|
|
45
43
|
- 보수적 마이그레이션: 기존 값은 동의 없이 덮어쓰지 않음
|
|
46
44
|
|
|
@@ -75,7 +73,7 @@ opencode plugin opencode-resolve --global --force
|
|
|
75
73
|
opencode
|
|
76
74
|
```
|
|
77
75
|
|
|
78
|
-
npm `postinstall`이 `~/.config/opencode/opencode.json`에 플러그인을 등록하고, 없을 때만 `~/.config/opencode/resolve.json`을 만들고, 기존
|
|
76
|
+
npm `postinstall`이 `~/.config/opencode/opencode.json`에 플러그인을 등록하고, 없을 때만 `~/.config/opencode/resolve.json`을 만들고, 기존 설정을 보존하며 (`--reset`으로 명시 시 완전 초기화), `~/.cache/opencode/packages/` 의 OpenCode 플러그인 캐시를 새로고침합니다.
|
|
79
77
|
|
|
80
78
|
### 다시 셋업하기
|
|
81
79
|
|
|
@@ -83,8 +81,8 @@ npm `postinstall`이 `~/.config/opencode/opencode.json`에 플러그인을 등
|
|
|
83
81
|
|
|
84
82
|
| 명령 | 언제 사용 |
|
|
85
83
|
| --- | --- |
|
|
86
|
-
| `opencode-resolve setup --
|
|
87
|
-
| `opencode-resolve setup --
|
|
84
|
+
| `opencode-resolve setup --reset` | `resolve.json`을 백업 후 완전히 지우고(모델 핀 포함) 재생성. 별칭: `--fresh`, `--reset-config`, `--nuke`. |
|
|
85
|
+
| `opencode-resolve setup --update` | `resolve.json`을 유지하고 빠진 기본값만 추가. |
|
|
88
86
|
| `opencode-resolve setup --models` | 모델 핀만 다시 감지 |
|
|
89
87
|
| `opencode-resolve setup --force-cache` | OpenCode 플러그인 캐시만 새로고침 |
|
|
90
88
|
|
|
@@ -94,11 +92,6 @@ npm `postinstall`이 `~/.config/opencode/opencode.json`에 플러그인을 등
|
|
|
94
92
|
OPENCODE_RESOLVE_SKIP_POSTINSTALL=1 npm install -g opencode-resolve
|
|
95
93
|
```
|
|
96
94
|
|
|
97
|
-
### 선택적 companion 플러그인
|
|
98
|
-
|
|
99
|
-
- `@tarquinen/opencode-dcp@latest` — 긴 루프에서 오래된 tool output을 줄여 토큰 비용을 낮춥니다.
|
|
100
|
-
- `@slkiser/opencode-quota@latest` — 컨텍스트를 오염시키지 않고 토큰/quota 사용량을 보여줍니다.
|
|
101
|
-
|
|
102
95
|
### 수동 설정
|
|
103
96
|
|
|
104
97
|
`~/.config/opencode/opencode.json`에 플러그인을 추가합니다.
|
|
@@ -115,7 +108,6 @@ OPENCODE_RESOLVE_SKIP_POSTINSTALL=1 npm install -g opencode-resolve
|
|
|
115
108
|
{
|
|
116
109
|
"enabled": ["coder", "resolver", "explorer", "reviewer", "deep-reviewer", "planner"],
|
|
117
110
|
"preserveNative": true,
|
|
118
|
-
"context7": true,
|
|
119
111
|
"commands": false,
|
|
120
112
|
"models": {},
|
|
121
113
|
"agents": {
|
|
@@ -194,18 +186,44 @@ irm https://raw.githubusercontent.com/jshsakura/awesome-opencode-skills/main/ins
|
|
|
194
186
|
|
|
195
187
|
| 키 | 타입 | 기본값 | 용도 |
|
|
196
188
|
| --- | --- | --- | --- |
|
|
197
|
-
| `profile` | `mix` / `glm` / `gpt` | `mix` | 프롬프트/profile preset. |
|
|
198
189
|
| `tier` | `bronze` / `silver` / `gold` | 미설정 | 설정된 tier preset 활성화. |
|
|
199
190
|
| `enabled` | 에이전트 이름 배열 | 기본 에이전트 | 주입할 resolve 에이전트. |
|
|
200
191
|
| `models` | object | `{}` | 모델 별칭과 역할별 모델 핀. |
|
|
201
192
|
| `agents` | object | `{}` | 에이전트별 override. |
|
|
202
193
|
| `preserveNative` | boolean | `true` | 명시 override가 없으면 OpenCode 기본 에이전트 보존. |
|
|
203
|
-
| `context7` | boolean | `true` | 없을 때 Context7 MCP 등록. |
|
|
204
194
|
| `commands` | boolean | `false` | `/resolve`, `/resolve-code`, `/resolve-review` 추가. |
|
|
205
195
|
| `autoApprove` | boolean | `true` | 하위 호환용 플래그. 현재 권한은 명시 설정과 분류기가 제어. |
|
|
206
|
-
| `autoUpdate` | boolean | `
|
|
196
|
+
| `autoUpdate` | boolean | (no-op) | **사용 중단.** 하위 호환을 위해 필드는 받되 무시합니다. 기존 auto-update는 `hooks.config()` 호출마다 `opencode plugin`을 spawn했고, 여러 OpenCode 인스턴스가 동시에 플러그인을 로드하면 수백 건의 병렬 설치로 폭주했습니다. 업데이트는 `npm i -g opencode-resolve`로 수동 실행하세요. |
|
|
207
197
|
| `language` | `auto` / `en` / `ko` | `auto` | 프롬프트 언어 선호. |
|
|
208
198
|
| `maxParallelSubagents` | positive integer | 미설정 | 동시 coder 디스패치에 대한 선택적 프롬프트 수준 soft limit. |
|
|
199
|
+
| `singleAgentMode` | boolean | `false` | `true`면 resolver가 `coder` 서브에이전트를 디스패치하지 않고 모든 편집을 직접 수행합니다. 단순 작업에서 지연과 토큰 비용을 절약합니다. 정보/진단용 서브에이전트(explorer/debugger)는 여전히 사용 가능합니다. |
|
|
200
|
+
| `permissions` | object | `{}` | 옵트인 롤백 권한. 아래 참조. |
|
|
201
|
+
|
|
202
|
+
### 롤백 권한
|
|
203
|
+
|
|
204
|
+
`git reset --hard` 와 `git clean -f` 는 기본적으로 차단됩니다. 커밋하지 않은 작업을 보호하지만, 동시에 디버깅 도중 작업트리가 꼬인 에이전트가 깨끗한 상태로 되돌아갈 방법이 없다는 뜻이기도 합니다 — 그대로 고립됩니다. 두 개의 옵트인 플래그가 이를 풀어주며, resolve 에이전트에만 적용됩니다.
|
|
205
|
+
|
|
206
|
+
```json
|
|
207
|
+
{
|
|
208
|
+
"permissions": {
|
|
209
|
+
"allowGitReset": true,
|
|
210
|
+
"allowGitClean": true
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
두 명령이 실행되기 전에, 플러그인은 **작업트리 전체** — 추적 중인 수정과 추적되지 않은 파일 모두 — 를 `refs/resolve-checkpoint/<timestamp>-<reset|clean>` 이라는 git ref 로 스냅샷합니다. 스냅샷은 임시 인덱스를 통해 기록되므로 실제 인덱스, 작업트리, 브랜치, `HEAD` 는 전혀 건드리지 않습니다. 스테이징도 커밋도 일어나지 않습니다. 스냅샷을 남기지 못하면 파괴적 명령은 무방비로 실행되는 대신 차단됩니다.
|
|
216
|
+
|
|
217
|
+
되돌린 것을 후회할 때 복구하려면:
|
|
218
|
+
|
|
219
|
+
```sh
|
|
220
|
+
git for-each-ref refs/resolve-checkpoint # 체크포인트 목록
|
|
221
|
+
git restore --source=<ref> -- . # 전부 복원
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
`git clean -x` 와 `-X` 는 이 플래그와 무관하게 계속 차단됩니다. gitignore 대상 파일을 삭제하는데, 체크포인트는 `.gitignore` 를 존중하는 `git add -A` 로 스냅샷하기 때문입니다 — 즉 `-x` clean 은 체크포인트가 되살릴 수 없는 파일(`.env`, 로컬 시크릿)을 파괴합니다.
|
|
225
|
+
|
|
226
|
+
체크포인트는 resolve 에이전트가 해당 명령을 실행할 때마다 생성됩니다 — 두 플래그를 `false` 로 둔 채 권한 프롬프트에서 직접 승인한 경우에도 마찬가지입니다. OpenCode 기본 에이전트(`build`/`plan`/chat)는 무조건 차단이 유지되며 이 플래그의 영향을 받지 않습니다.
|
|
209
227
|
|
|
210
228
|
### 에이전트 override
|
|
211
229
|
|
|
@@ -241,9 +259,9 @@ irm https://raw.githubusercontent.com/jshsakura/awesome-opencode-skills/main/ins
|
|
|
241
259
|
```json
|
|
242
260
|
{
|
|
243
261
|
"models": {
|
|
244
|
-
"bronze": "zai-coding-plan/glm-
|
|
245
|
-
"silver": "zai-coding-plan/glm-5.
|
|
246
|
-
"gold": "
|
|
262
|
+
"bronze": "zai-coding-plan/glm-5.2",
|
|
263
|
+
"silver": "zai-coding-plan/glm-5.2",
|
|
264
|
+
"gold": "zai-coding-plan/glm-5.2",
|
|
247
265
|
"explorer": "bronze",
|
|
248
266
|
"coder": "silver",
|
|
249
267
|
"resolver": "gold",
|
|
@@ -257,10 +275,8 @@ irm https://raw.githubusercontent.com/jshsakura/awesome-opencode-skills/main/ins
|
|
|
257
275
|
지원 모델 별칭:
|
|
258
276
|
|
|
259
277
|
```text
|
|
260
|
-
fast, strong, mini,
|
|
278
|
+
fast, strong, mini, quick, deep,
|
|
261
279
|
bronze, silver, gold,
|
|
262
|
-
gpt-bronze, gpt-silver, gpt-gold,
|
|
263
|
-
glm-bronze, glm-silver, glm-gold,
|
|
264
280
|
모든 지원 에이전트 이름
|
|
265
281
|
```
|
|
266
282
|
|
|
@@ -274,11 +290,7 @@ glm-bronze, glm-silver, glm-gold,
|
|
|
274
290
|
| `reviewer` | yes | `subagent` | deny | deny | allow | 읽기 전용 검증 갭 리뷰. |
|
|
275
291
|
| `deep-reviewer` | yes | `subagent` | deny | deny | allow | 위험/고영향 변경 리뷰. |
|
|
276
292
|
| `planner` | yes | `subagent` | deny | deny | allow | 필요할 때만 읽기 전용 계획. |
|
|
277
|
-
| `gpt` | no | `all` | allow | ask | allow | GPT 최적화 primary resolver. |
|
|
278
|
-
| `glm` | no | `all` | allow | ask | allow | GLM/ZAI 최적화 primary resolver. |
|
|
279
|
-
| `codex` | no | `all` | allow | ask | allow | 레거시 Codex 최적화 primary resolver. |
|
|
280
293
|
| `architect` | no | `subagent` | deny | deny | allow | 설계/분해 보조. |
|
|
281
|
-
| `gpt-coder` | no | `subagent` | allow | ask | allow | 더 강한 구현 보조. |
|
|
282
294
|
| `debugger` | no | `subagent` | allow | ask | allow | 재현/root-cause 보조. |
|
|
283
295
|
| `researcher` | no | `subagent` | deny | deny | allow | 코드베이스/문서 리서치 보조. |
|
|
284
296
|
|
|
@@ -288,6 +300,8 @@ resolve 에이전트의 bash는 기본적으로 `ask`입니다. 플러그인의
|
|
|
288
300
|
|
|
289
301
|
`autoApprove`는 오래된 설정과의 호환을 위해 허용되지만, 현재 동작은 명시적 에이전트 권한과 명령 분류기가 제어합니다.
|
|
290
302
|
|
|
303
|
+
`git reset --hard` 와 `git clean -f` 는 옵트인하지 않으면 차단됩니다 — [롤백 권한](#롤백-권한) 참조. 허용된 경우 플러그인이 먼저 작업트리를 체크포인트합니다.
|
|
304
|
+
|
|
291
305
|
신뢰할 수 없는 저장소에서는 샌드박스나 VM을 사용하세요.
|
|
292
306
|
|
|
293
307
|
## 병렬 서브에이전트
|
|
@@ -296,27 +310,6 @@ resolve 에이전트의 bash는 기본적으로 `ask`입니다. 플러그인의
|
|
|
296
310
|
|
|
297
311
|
값을 설정하면 resolver 프롬프트에 삽입됩니다. 런타임 semaphore는 아닙니다. 변경 후 OpenCode를 재시작하세요. `agents.resolver.prompt`를 직접 지정하면 템플릿된 규칙은 대체됩니다.
|
|
298
312
|
|
|
299
|
-
## Context7
|
|
300
|
-
|
|
301
|
-
`context7: true`이면 `mcp.context7`이 없을 때 Context7 MCP를 등록합니다.
|
|
302
|
-
|
|
303
|
-
```json
|
|
304
|
-
{
|
|
305
|
-
"mcp": {
|
|
306
|
-
"context7": {
|
|
307
|
-
"type": "remote",
|
|
308
|
-
"url": "https://mcp.context7.com/mcp"
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
끄려면:
|
|
315
|
-
|
|
316
|
-
```json
|
|
317
|
-
{ "context7": false }
|
|
318
|
-
```
|
|
319
|
-
|
|
320
313
|
## 프로젝트 컨텍스트
|
|
321
314
|
|
|
322
315
|
플러그인은 repo 전체를 프롬프트에 밀어 넣지 않고, 커밋된 프로젝트 컨텍스트 위치만 노출합니다. 감지 대상:
|
|
@@ -370,7 +363,7 @@ Git hook:
|
|
|
370
363
|
npm run hooks:install
|
|
371
364
|
```
|
|
372
365
|
|
|
373
|
-
테스트는 에이전트 주입, 설정 로딩, 모델 별칭, 권한, 선택적 명령어,
|
|
366
|
+
테스트는 에이전트 주입, 설정 로딩, 모델 별칭, 권한, 선택적 명령어, 네이티브 에이전트 보존, postinstall 동작을 검증합니다.
|
|
374
367
|
|
|
375
368
|
## 릴리스
|
|
376
369
|
|
package/README.md
CHANGED
|
@@ -29,7 +29,6 @@ opencode-resolve setup
|
|
|
29
29
|
- [Model Setup](#model-setup)
|
|
30
30
|
- [Agents](#agents)
|
|
31
31
|
- [Permissions](#permissions)
|
|
32
|
-
- [Context7](#context7)
|
|
33
32
|
- [Project Context](#project-context)
|
|
34
33
|
- [Upgrade](#upgrade)
|
|
35
34
|
- [Development](#development)
|
|
@@ -40,7 +39,6 @@ opencode-resolve setup
|
|
|
40
39
|
- A verified `resolver -> coder` loop that favors small patches and evidence-backed completion.
|
|
41
40
|
- Read-only scout/review subagents for targeted discovery and verification gaps.
|
|
42
41
|
- Optional command aliases: `/resolve`, `/resolve-code`, `/resolve-review`.
|
|
43
|
-
- Optional Context7 MCP registration for documentation lookup.
|
|
44
42
|
- Strict config validation: unknown keys, bad modes, bad agent names, and invalid types fail early.
|
|
45
43
|
- Conservative migration: generated config is additive and existing values are not overwritten without consent.
|
|
46
44
|
|
|
@@ -75,7 +73,7 @@ opencode plugin opencode-resolve --global --force
|
|
|
75
73
|
opencode
|
|
76
74
|
```
|
|
77
75
|
|
|
78
|
-
The npm `postinstall` script registers the plugin in `~/.config/opencode/opencode.json`, creates `~/.config/opencode/resolve.json` if missing, preserves existing
|
|
76
|
+
The npm `postinstall` script registers the plugin in `~/.config/opencode/opencode.json`, creates `~/.config/opencode/resolve.json` if missing, preserves existing settings (unless you opt out with `--reset`), and refreshes the OpenCode plugin cache under `~/.cache/opencode/packages/`.
|
|
79
77
|
|
|
80
78
|
### Re-run setup
|
|
81
79
|
|
|
@@ -83,8 +81,8 @@ Re-run the installer any time with the `opencode-resolve setup` CLI:
|
|
|
83
81
|
|
|
84
82
|
| Command | When to use |
|
|
85
83
|
| --- | --- |
|
|
86
|
-
| `opencode-resolve setup --
|
|
87
|
-
| `opencode-resolve setup --
|
|
84
|
+
| `opencode-resolve setup --reset` | Back up and wipe `resolve.json` completely (model pins included) and regenerate it. Aliases: `--fresh`, `--reset-config`, `--nuke`. |
|
|
85
|
+
| `opencode-resolve setup --update` | Keep `resolve.json` and only add missing defaults. |
|
|
88
86
|
| `opencode-resolve setup --models` | Re-detect model pins only |
|
|
89
87
|
| `opencode-resolve setup --force-cache` | Refresh OpenCode plugin cache only |
|
|
90
88
|
|
|
@@ -94,11 +92,6 @@ Skip postinstall automation:
|
|
|
94
92
|
OPENCODE_RESOLVE_SKIP_POSTINSTALL=1 npm install -g opencode-resolve
|
|
95
93
|
```
|
|
96
94
|
|
|
97
|
-
### Optional companion plugins
|
|
98
|
-
|
|
99
|
-
- `@tarquinen/opencode-dcp@latest` — trims obsolete tool output during long loops.
|
|
100
|
-
- `@slkiser/opencode-quota@latest` — shows token/quota usage without polluting context.
|
|
101
|
-
|
|
102
95
|
### Manual setup
|
|
103
96
|
|
|
104
97
|
Add the plugin to `~/.config/opencode/opencode.json`:
|
|
@@ -115,7 +108,6 @@ Create `~/.config/opencode/resolve.json`:
|
|
|
115
108
|
{
|
|
116
109
|
"enabled": ["coder", "resolver", "explorer", "reviewer", "deep-reviewer", "planner"],
|
|
117
110
|
"preserveNative": true,
|
|
118
|
-
"context7": true,
|
|
119
111
|
"commands": false,
|
|
120
112
|
"models": {},
|
|
121
113
|
"agents": {
|
|
@@ -194,18 +186,44 @@ Full commented reference: [opencode-resolve.reference.jsonc](./opencode-resolve.
|
|
|
194
186
|
|
|
195
187
|
| Key | Type | Default | Purpose |
|
|
196
188
|
| --- | --- | --- | --- |
|
|
197
|
-
| `profile` | `mix` / `glm` / `gpt` | `mix` | Prompt/profile preset. |
|
|
198
189
|
| `tier` | `bronze` / `silver` / `gold` | unset | Enables the matching tier preset when configured. |
|
|
199
190
|
| `enabled` | agent name array | default agents | Which resolve agents to inject. |
|
|
200
191
|
| `models` | object | `{}` | Model aliases and per-role model pins. |
|
|
201
192
|
| `agents` | object | `{}` | Per-agent overrides. |
|
|
202
193
|
| `preserveNative` | boolean | `true` | Keep native OpenCode agents unless explicitly overridden. |
|
|
203
|
-
| `context7` | boolean | `true` | Register Context7 MCP if missing. |
|
|
204
194
|
| `commands` | boolean | `false` | Add `/resolve`, `/resolve-code`, and `/resolve-review`. |
|
|
205
195
|
| `autoApprove` | boolean | `true` | Backward-compatible config flag; current permissions remain explicit. |
|
|
206
|
-
| `autoUpdate` | boolean |
|
|
196
|
+
| `autoUpdate` | boolean | (no-op) | **Deprecated.** Field is accepted for backward compatibility but ignored. Auto-update spawned `opencode plugin` per `hooks.config()` call, which fanned out into hundreds of parallel installs when multiple OpenCode instances loaded the plugin at once. Update manually with `npm i -g opencode-resolve`. |
|
|
207
197
|
| `language` | `auto` / `en` / `ko` | `auto` | Prompt language preference. |
|
|
208
198
|
| `maxParallelSubagents` | positive integer | unset | Optional prompt-level soft limit for concurrent coder dispatch. |
|
|
199
|
+
| `singleAgentMode` | boolean | `false` | When `true`, the resolver makes all edits directly instead of dispatching a `coder` subagent — lower latency and token cost on simple tasks. Information/diagnostic subagents (explorer/debugger) are still available. |
|
|
200
|
+
| `permissions` | object | `{}` | Opt-in rollback permissions. See below. |
|
|
201
|
+
|
|
202
|
+
### Rollback Permissions
|
|
203
|
+
|
|
204
|
+
`git reset --hard` and `git clean -f` are denied by default. That protects your uncommitted work, but it also means an agent that tangles the worktree mid-debug cannot get back to a clean state — it stalls. Two opt-in flags un-gate them, for resolve agents only:
|
|
205
|
+
|
|
206
|
+
```json
|
|
207
|
+
{
|
|
208
|
+
"permissions": {
|
|
209
|
+
"allowGitReset": true,
|
|
210
|
+
"allowGitClean": true
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Before either command runs, the plugin snapshots the **entire worktree** — tracked edits *and* untracked files — into a git ref named `refs/resolve-checkpoint/<timestamp>-<reset|clean>`. The snapshot is written through a throwaway index, so your real index, working tree, branches, and `HEAD` are never touched: nothing is staged, nothing is committed. If the snapshot cannot be written, the destructive command is blocked instead of run unprotected.
|
|
216
|
+
|
|
217
|
+
To recover from a rollback you regret:
|
|
218
|
+
|
|
219
|
+
```sh
|
|
220
|
+
git for-each-ref refs/resolve-checkpoint # list checkpoints
|
|
221
|
+
git restore --source=<ref> -- . # bring everything back
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
`git clean -x` and `-X` stay denied regardless of these flags. They delete gitignored files, and the checkpoint snapshots via `git add -A`, which honours `.gitignore` — so a `-x` clean would destroy files (`.env`, local secrets) the checkpoint cannot bring back.
|
|
225
|
+
|
|
226
|
+
Checkpoints are taken whenever one of these commands executes under a resolve agent — including when you approve it yourself at the permission prompt with both flags left `false`. Native OpenCode agents (`build`/`plan`/chat) keep the unconditional deny and are unaffected by these flags.
|
|
209
227
|
|
|
210
228
|
### Agent Overrides
|
|
211
229
|
|
|
@@ -241,9 +259,9 @@ Example three-tier setup:
|
|
|
241
259
|
```json
|
|
242
260
|
{
|
|
243
261
|
"models": {
|
|
244
|
-
"bronze": "zai-coding-plan/glm-
|
|
245
|
-
"silver": "zai-coding-plan/glm-5.
|
|
246
|
-
"gold": "
|
|
262
|
+
"bronze": "zai-coding-plan/glm-5.2",
|
|
263
|
+
"silver": "zai-coding-plan/glm-5.2",
|
|
264
|
+
"gold": "zai-coding-plan/glm-5.2",
|
|
247
265
|
"explorer": "bronze",
|
|
248
266
|
"coder": "silver",
|
|
249
267
|
"resolver": "gold",
|
|
@@ -257,10 +275,8 @@ Example three-tier setup:
|
|
|
257
275
|
Supported model alias keys:
|
|
258
276
|
|
|
259
277
|
```text
|
|
260
|
-
fast, strong, mini,
|
|
278
|
+
fast, strong, mini, quick, deep,
|
|
261
279
|
bronze, silver, gold,
|
|
262
|
-
gpt-bronze, gpt-silver, gpt-gold,
|
|
263
|
-
glm-bronze, glm-silver, glm-gold,
|
|
264
280
|
and every supported agent name
|
|
265
281
|
```
|
|
266
282
|
|
|
@@ -274,11 +290,7 @@ and every supported agent name
|
|
|
274
290
|
| `reviewer` | yes | `subagent` | deny | deny | allow | Read-only verification-gap review. |
|
|
275
291
|
| `deep-reviewer` | yes | `subagent` | deny | deny | allow | Read-only review for risky/high-impact changes. |
|
|
276
292
|
| `planner` | yes | `subagent` | deny | deny | allow | Read-only planning when explicitly useful. |
|
|
277
|
-
| `gpt` | no | `all` | allow | ask | allow | GPT-optimized primary resolver. |
|
|
278
|
-
| `glm` | no | `all` | allow | ask | allow | GLM/ZAI-optimized primary resolver. |
|
|
279
|
-
| `codex` | no | `all` | allow | ask | allow | Legacy Codex-optimized primary resolver. |
|
|
280
293
|
| `architect` | no | `subagent` | deny | deny | allow | Design/decomposition helper. |
|
|
281
|
-
| `gpt-coder` | no | `subagent` | allow | ask | allow | Stronger implementation helper. |
|
|
282
294
|
| `debugger` | no | `subagent` | allow | ask | allow | Failure reproduction/root-cause helper. |
|
|
283
295
|
| `researcher` | no | `subagent` | deny | deny | allow | Codebase/docs research helper. |
|
|
284
296
|
|
|
@@ -288,6 +300,8 @@ Resolve agents keep bash at `ask` by default. The plugin's permission hook auto-
|
|
|
288
300
|
|
|
289
301
|
`autoApprove` is accepted for compatibility with older configs, but current behavior is controlled by explicit agent permissions and the command classifier.
|
|
290
302
|
|
|
303
|
+
`git reset --hard` and `git clean -f` are denied unless you opt in — see [Rollback Permissions](#rollback-permissions). When permitted, the plugin checkpoints the worktree first.
|
|
304
|
+
|
|
291
305
|
Use a sandbox or VM for untrusted repositories.
|
|
292
306
|
|
|
293
307
|
## Parallel Subagents
|
|
@@ -296,27 +310,6 @@ Use a sandbox or VM for untrusted repositories.
|
|
|
296
310
|
|
|
297
311
|
When set, the value is inserted into the resolver prompt. It is not a runtime semaphore. Restart OpenCode after changing it. A custom `agents.resolver.prompt` replaces the templated rule.
|
|
298
312
|
|
|
299
|
-
## Context7
|
|
300
|
-
|
|
301
|
-
When `context7: true`, the plugin registers Context7 MCP if `mcp.context7` is not already present:
|
|
302
|
-
|
|
303
|
-
```json
|
|
304
|
-
{
|
|
305
|
-
"mcp": {
|
|
306
|
-
"context7": {
|
|
307
|
-
"type": "remote",
|
|
308
|
-
"url": "https://mcp.context7.com/mcp"
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
Disable it with:
|
|
315
|
-
|
|
316
|
-
```json
|
|
317
|
-
{ "context7": false }
|
|
318
|
-
```
|
|
319
|
-
|
|
320
313
|
## Project Context
|
|
321
314
|
|
|
322
315
|
The plugin exposes committed project context without stuffing the entire repo into prompts. It detects:
|
|
@@ -370,7 +363,7 @@ Git hooks:
|
|
|
370
363
|
npm run hooks:install
|
|
371
364
|
```
|
|
372
365
|
|
|
373
|
-
Verification covered by tests includes agent injection, config loading, model aliases, permissions, optional commands,
|
|
366
|
+
Verification covered by tests includes agent injection, config loading, model aliases, permissions, optional commands, native agent preservation, and postinstall behavior.
|
|
374
367
|
|
|
375
368
|
## Release
|
|
376
369
|
|
package/dist/agents.d.ts
CHANGED
|
@@ -1,27 +1,11 @@
|
|
|
1
1
|
import { ResolveAgentName, ResolveAgentConfig, ModelAlias, TierName } from "./types.js";
|
|
2
2
|
export declare const DEFAULT_MODELS: Partial<Record<ModelAlias, string>>;
|
|
3
3
|
export declare const DEFAULT_ENABLED: ResolveAgentName[];
|
|
4
|
-
export declare const VALID_AGENT_NAMES: readonly ["coder", "reviewer", "resolver", "
|
|
4
|
+
export declare const VALID_AGENT_NAMES: readonly ["coder", "reviewer", "resolver", "architect", "debugger", "researcher", "explorer", "deep-reviewer", "planner"];
|
|
5
5
|
export declare const VALID_AGENT_NAME_SET: Set<string>;
|
|
6
6
|
export declare const DEFAULT_AGENT_CONFIG: Record<ResolveAgentName, Required<Pick<ResolveAgentConfig, "mode" | "description" | "prompt" | "color">> & ResolveAgentConfig>;
|
|
7
|
-
export declare
|
|
8
|
-
export declare const
|
|
9
|
-
export declare function buildGLMResolverPrompt(maxParallelSubagents: number | undefined): string;
|
|
10
|
-
export declare function buildGPTResolverPrompt(): string;
|
|
11
|
-
export declare function buildCodexResolverPrompt(): string;
|
|
12
|
-
export declare function buildResolverPrompt(maxParallelSubagents: number | undefined): string;
|
|
13
|
-
export declare const VALID_MODEL_ALIASES: readonly ["coder", "reviewer", "resolver", "codex", "gpt", "glm", "architect", "gpt-coder", "debugger", "researcher", "explorer", "deep-reviewer", "planner", "glm", "gpt", "quick", "deep", "fast", "strong", "mini", "codex", "bronze", "silver", "gold", "gpt-bronze", "gpt-silver", "gpt-gold", "glm-bronze", "glm-silver", "glm-gold"];
|
|
7
|
+
export declare function buildResolverPrompt(maxParallelSubagents: number | undefined, singleAgentMode?: boolean): string;
|
|
8
|
+
export declare const VALID_MODEL_ALIASES: readonly ["coder", "reviewer", "resolver", "architect", "debugger", "researcher", "explorer", "deep-reviewer", "planner", "quick", "deep", "fast", "strong", "mini", "bronze", "silver", "gold"];
|
|
14
9
|
export declare const VALID_MODEL_ALIAS_SET: Set<string>;
|
|
15
|
-
export declare const VALID_PROFILES: Set<string>;
|
|
16
10
|
export declare const VALID_TIERS: Set<string>;
|
|
17
|
-
export declare const GLM_ENABLED: ResolveAgentName[];
|
|
18
|
-
export declare const GPT_ENABLED: ResolveAgentName[];
|
|
19
11
|
export declare const TIER_ENABLED: Record<TierName, ResolveAgentName[]>;
|
|
20
|
-
export declare const GLM_AGENT_OVERRIDES: Partial<Record<ResolveAgentName, {
|
|
21
|
-
maxSteps?: number;
|
|
22
|
-
description?: string;
|
|
23
|
-
}>>;
|
|
24
|
-
export declare const GPT_AGENT_OVERRIDES: Partial<Record<ResolveAgentName, {
|
|
25
|
-
maxSteps?: number;
|
|
26
|
-
description?: string;
|
|
27
|
-
}>>;
|