@osovv/vv-opencode 0.29.0 → 0.29.1
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 +111 -335
- package/dist/commands/completion.js +11 -8
- package/dist/commands/completion.js.map +1 -1
- package/dist/lib/vvoc-config.js +9 -42
- package/dist/lib/vvoc-config.js.map +1 -1
- package/dist/lib/vvoc-preset-registry.d.ts +41 -0
- package/dist/lib/vvoc-preset-registry.js +73 -0
- package/dist/lib/vvoc-preset-registry.js.map +1 -0
- package/dist/plugins/memory/system-instruction.md +1 -1
- package/dist/plugins/system-context-injection/index.js +31 -31
- package/dist/plugins/system-context-injection/index.js.map +1 -1
- package/dist/plugins/workflow/index.js +46 -40
- package/dist/plugins/workflow/index.js.map +1 -1
- package/dist/plugins/workflow/repair.d.ts +26 -0
- package/dist/plugins/workflow/repair.js +163 -0
- package/dist/plugins/workflow/repair.js.map +1 -0
- package/dist/plugins/workflow/system-instruction.md +4 -3
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,423 +1,199 @@
|
|
|
1
1
|
# @osovv/vv-opencode
|
|
2
2
|
|
|
3
|
-
Portable OpenCode workflow
|
|
3
|
+
**Portable OpenCode workflow toolkit** — one command bootstraps a managed agent ecosystem, seven security-and-productivity plugins, explicit persistent memory, and a unified CLI.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<p>
|
|
6
|
+
<a href="https://www.npmjs.com/package/@osovv/vv-opencode"><img src="https://img.shields.io/npm/v/%40osovv%2Fvv-opencode?style=flat&label=npm&color=blue" alt="npm"></a>
|
|
7
|
+
<a href="https://bun.sh"><img src="https://img.shields.io/badge/runtime-bun-%23f9f9f9?style=flat&logo=bun" alt="bun"></a>
|
|
8
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=flat" alt="MIT"></a>
|
|
9
|
+
</p>
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
- that package entry exports seven plugins: `GuardianPlugin`, `HashlineEditPlugin`, `MemoryPlugin`, `ModelRolesPlugin`, `SystemContextInjectionPlugin`, `WorkflowPlugin`, `SecretsRedactionPlugin`
|
|
9
|
-
- creates and maintains canonical `vvoc` config at `$XDG_CONFIG_HOME/vvoc/vvoc.json`
|
|
10
|
-
- scaffolds managed prompt files under `vvoc/agents/`
|
|
11
|
-
- registers `vv-controller` as the default OpenCode primary agent plus managed OpenCode agents: `enhancer`, `vv-analyst`, `vv-architect`, `vv-implementer`, `vv-spec-reviewer`, `vv-code-reviewer`, `investigator`
|
|
12
|
-
- registers OpenCode slash commands: `/vv-plan`, `/vv-review`
|
|
13
|
-
- installs plugin-managed agents: `guardian`, `memory-reviewer`
|
|
14
|
-
- ships role presets, diagnostics, and shell completion through the `vvoc` CLI
|
|
11
|
+
---
|
|
15
12
|
|
|
16
13
|
## Quick Start
|
|
17
14
|
|
|
18
|
-
If the package is installed as a project dependency, run it via `bun x vvoc` or `bun run vvoc`.
|
|
19
|
-
|
|
20
|
-
Install globally:
|
|
21
|
-
|
|
22
15
|
```bash
|
|
23
16
|
bun add -g @osovv/vv-opencode
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Bootstrap the default global setup:
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
17
|
vvoc install
|
|
30
|
-
vvoc status
|
|
31
18
|
```
|
|
32
19
|
|
|
33
|
-
|
|
20
|
+
That's it. `vvoc install` pins the package, scaffolds managed agents, registers slash commands, writes canonical config, and sets `vv-controller` as your default OpenCode agent.
|
|
21
|
+
|
|
22
|
+
To scope everything to the current project instead of the global OpenCode config:
|
|
34
23
|
|
|
35
24
|
```bash
|
|
36
25
|
vvoc install --scope project
|
|
37
26
|
```
|
|
38
27
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
`vvoc install` and `vvoc sync`:
|
|
42
|
-
|
|
43
|
-
- ensure OpenCode has a pinned `@osovv/vv-opencode@<version>` package entry
|
|
44
|
-
- register managed agents and scaffold their prompt files
|
|
45
|
-
- set OpenCode `default_agent` to `vv-controller`
|
|
46
|
-
- seed OpenCode `model`, `small_model`, `agent.explore`, and managed agent model refs with `vv-role:*` values
|
|
47
|
-
- register managed OpenCode commands `vv-plan` and `vv-review`
|
|
48
|
-
- disable global OpenCode `tools.apply_patch` in managed config so editing stays on the hashline-backed `edit` override
|
|
49
|
-
- create or refresh canonical `vvoc.json`
|
|
50
|
-
- refresh managed built-in presets: `vv-openai`, `vv-zai`, `vv-minimax`, `vv-deepseek`
|
|
51
|
-
|
|
52
|
-
That package entry exports seven plugins:
|
|
53
|
-
|
|
54
|
-
- `GuardianPlugin`
|
|
55
|
-
- `HashlineEditPlugin`
|
|
56
|
-
- `MemoryPlugin`
|
|
57
|
-
- `ModelRolesPlugin`
|
|
58
|
-
- `SystemContextInjectionPlugin`
|
|
59
|
-
- `WorkflowPlugin`
|
|
60
|
-
- `SecretsRedactionPlugin`
|
|
61
|
-
|
|
62
|
-
## Config And Data Layout
|
|
63
|
-
|
|
64
|
-
OpenCode config stays in OpenCode-managed paths:
|
|
65
|
-
|
|
66
|
-
- global: `$XDG_CONFIG_HOME/opencode/opencode.json` or `~/.config/opencode/opencode.json`
|
|
67
|
-
- project: `./opencode.json` or `./opencode.jsonc`
|
|
28
|
+
> **Already installed?** Run `vvoc sync` anytime to refresh plugins, prompts, and presets.
|
|
68
29
|
|
|
69
|
-
|
|
30
|
+
---
|
|
70
31
|
|
|
71
|
-
|
|
32
|
+
## Why vv-opencode?
|
|
72
33
|
|
|
73
|
-
|
|
34
|
+
Setting up OpenCode for serious daily work means juggling config files, agent prompts, plugin wiring, model role assignments, and permission rules — every time, on every machine.
|
|
74
35
|
|
|
75
|
-
-
|
|
76
|
-
- project: `./.vvoc/agents/*.md`
|
|
36
|
+
**vv-opencode collapses that into a single `vvoc install`.** It owns the wiring so you don't have to:
|
|
77
37
|
|
|
78
|
-
|
|
38
|
+
- **Seven plugins, one entry** — all plugins are exported from a single pinned package entry
|
|
39
|
+
- **Managed agent system** — a routed `vv-controller` primary agent, domain-specialized subagents, and a report-only memory reviewer
|
|
40
|
+
- **Model roles & presets** — assign models to roles (`smart`, `fast`, `vision`, …) and switch provider presets with one command
|
|
41
|
+
- **Explicit memory** — persist context across sessions, branches, projects, and even across projects
|
|
42
|
+
- **Security-first** — a `guardian` agent reviews permission requests, secrets are redacted from LLM-bound chat
|
|
43
|
+
- **Stale-line-number defense** — hashline-backed `edit` prevents write-against-wrong-snapshot bugs
|
|
79
44
|
|
|
80
|
-
|
|
45
|
+
---
|
|
81
46
|
|
|
82
|
-
|
|
47
|
+
## Features
|
|
83
48
|
|
|
84
|
-
|
|
49
|
+
| Area | What you get |
|
|
50
|
+
|---|---|
|
|
51
|
+
| **Plugins** | 7 plugins in one pinned package entry — workflow orchestration, memory, model roles, guardian, hashline edit, system context injection, secrets redaction |
|
|
52
|
+
| **Agent System** | `vv-controller` routes work: direct for small changes, `investigator` for bugs, implementer+reviewer loop for risky work, analyst+architect for large features |
|
|
53
|
+
| **One-Click Setup** | `vvoc install` or `vvoc sync` bootstraps everything — config, agents, prompts, commands, presets |
|
|
54
|
+
| **CLI Tooling** | 15+ commands: install, sync, status, doctor, role management, presets, guardian config, shell completion, upgrade |
|
|
55
|
+
| **Explicit Memory** | `memory_search`, `memory_get`, `memory_put`, `memory_update`, `memory_delete`, `memory_list` — session, branch, project, and cross-project scopes |
|
|
56
|
+
| **Security** | GuardianPlugin reviews shell-permission requests; SecretsRedactionPlugin strips tokens before LLM requests; both configurable via `vvoc.json` |
|
|
57
|
+
| **Model Roles** | Assign provider/model/variant to roles (`default`, `smart`, `fast`, `vision`, custom); switch between `vv-openai`, `vv-zai`, `vv-deepseek`, `vv-minimax` presets |
|
|
58
|
+
| **Workflow Tracking** | Work items with open/list/close for tracked implementation-to-review pipelines |
|
|
59
|
+
| **Slash Commands** | `/vv-plan` routes through planning mode, `/vv-review` routes through review-only mode |
|
|
85
60
|
|
|
86
|
-
|
|
87
|
-
- project-local memory: `$XDG_DATA_HOME/vvoc/projects/<project-id>/memory/`
|
|
88
|
-
- shared memory: `$XDG_DATA_HOME/vvoc/memory/shared/<namespace>/`
|
|
61
|
+
---
|
|
89
62
|
|
|
90
|
-
|
|
63
|
+
## The Seven Plugins
|
|
91
64
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
- `
|
|
95
|
-
- `
|
|
96
|
-
-
|
|
65
|
+
| Plugin | What it does |
|
|
66
|
+
|---|---|
|
|
67
|
+
| **WorkflowPlugin** | Tracked orchestration around `task` for subagents; registers `work_item_open/list/close` tools; routes `/vv-plan` and `/vv-review` commands |
|
|
68
|
+
| **ModelRolesPlugin** | Resolves `vv-role:*` references in OpenCode config at startup; translates `:variant` suffixes into native model+variant fields |
|
|
69
|
+
| **GuardianPlugin** | Reviews OpenCode permission requests with a constrained guardian agent and safe-deny defaults; configurable model, timeout, risk threshold |
|
|
70
|
+
| **HashlineEditPlugin** | Replaces OpenCode's `edit` with hash-anchored variant; rewrites `read` output to `line#hash` format; rejects stale snapshots to prevent drift bugs |
|
|
71
|
+
| **MemoryPlugin** | Adds persistent memory tools + report-only `memory-reviewer` subagent; scopes: session, branch, project, shared (cross-project) |
|
|
72
|
+
| **SystemContextInjectionPlugin** | Injects reusable system guidance into primary sessions without polluting subagent prompts; encourages proactive `explore` usage |
|
|
73
|
+
| **SecretsRedactionPlugin** | Redacts secrets (tokens, keys, emails, UUIDs, IPs) before LLM requests; restores placeholders afterward; configurable patterns |
|
|
97
74
|
|
|
98
|
-
|
|
75
|
+
---
|
|
99
76
|
|
|
100
|
-
|
|
101
|
-
{
|
|
102
|
-
"$schema": "https://cdn.jsdelivr.net/npm/@osovv/vv-opencode@<installed-version>/schemas/vvoc/v3.json",
|
|
103
|
-
"version": 3
|
|
104
|
-
}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
Schema source of truth lives in this repository at `schemas/vvoc/v3.json`.
|
|
108
|
-
|
|
109
|
-
## CLI Overview
|
|
77
|
+
## CLI at a Glance
|
|
110
78
|
|
|
111
79
|
| Command | Purpose |
|
|
112
|
-
|
|
80
|
+
|---|---|
|
|
113
81
|
| `vvoc init` | Interactive bootstrap flow |
|
|
114
82
|
| `vvoc install` | Non-interactive setup and scaffolding |
|
|
115
|
-
| `vvoc sync` | Refresh plugin entry,
|
|
83
|
+
| `vvoc sync` | Refresh plugin entry, agents, prompts, config |
|
|
116
84
|
| `vvoc status` | Show current installation state |
|
|
117
|
-
| `vvoc doctor` | Diagnose setup problems
|
|
85
|
+
| `vvoc doctor` | Diagnose setup problems (exits non-zero on issues) |
|
|
118
86
|
| `vvoc config validate` | Validate canonical `vvoc.json` |
|
|
119
|
-
| `vvoc role list
|
|
120
|
-
| `vvoc preset list
|
|
121
|
-
| `vvoc guardian config` | Print or write
|
|
122
|
-
| `vvoc plugin list` | List plugin entries
|
|
123
|
-
| `vvoc patch-provider stepfun-ai
|
|
87
|
+
| `vvoc role list\|set\|unset` | Manage model role assignments |
|
|
88
|
+
| `vvoc preset list\|show\|<name>` | Inspect or apply named presets |
|
|
89
|
+
| `vvoc guardian config` | Print or write guardian section |
|
|
90
|
+
| `vvoc plugin list` | List OpenCode plugin entries |
|
|
91
|
+
| `vvoc patch-provider stepfun-ai\|zai\|openai` | Patch a global OpenCode config preset |
|
|
124
92
|
| `vvoc completion` | Install shell completions |
|
|
125
|
-
| `vvoc upgrade` | Upgrade
|
|
126
|
-
| `vvoc version` | Print
|
|
93
|
+
| `vvoc upgrade` | Upgrade global package and run follow-up sync |
|
|
94
|
+
| `vvoc version` | Print installed version |
|
|
127
95
|
|
|
128
|
-
|
|
96
|
+
---
|
|
129
97
|
|
|
130
|
-
|
|
98
|
+
## Model Roles & Presets
|
|
131
99
|
|
|
132
100
|
```bash
|
|
101
|
+
# View current assignments
|
|
133
102
|
vvoc role list
|
|
134
|
-
```
|
|
135
103
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
```bash
|
|
104
|
+
# Assign models to roles
|
|
139
105
|
vvoc role set default openai/gpt-5.4
|
|
140
106
|
vvoc role set smart openai/vv-gpt-5.5-xhigh
|
|
141
107
|
vvoc role set fast openai/gpt-5.4-mini
|
|
142
|
-
vvoc role set team-review anthropic/claude-sonnet-4-5:high
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
Remove custom role assignments:
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
vvoc role unset team-review
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
Built-in role IDs:
|
|
152
|
-
|
|
153
|
-
- `default`
|
|
154
|
-
- `smart`
|
|
155
|
-
- `fast`
|
|
156
|
-
- `vision`
|
|
157
|
-
|
|
158
|
-
Role notes:
|
|
159
108
|
|
|
160
|
-
|
|
161
|
-
- built-in roles cannot be removed with `vvoc role unset`
|
|
162
|
-
- custom role IDs must use lowercase letters, digits, and hyphens
|
|
163
|
-
|
|
164
|
-
Presets are stored in canonical `vvoc.json` and are useful when you want to switch several role assignments together:
|
|
165
|
-
|
|
166
|
-
```bash
|
|
167
|
-
vvoc preset list
|
|
168
|
-
vvoc preset show vv-openai
|
|
109
|
+
# Switch provider presets
|
|
169
110
|
vvoc preset vv-openai
|
|
170
111
|
vvoc preset vv-zai
|
|
112
|
+
vvoc preset vv-deepseek
|
|
113
|
+
vvoc preset vv-minimax
|
|
171
114
|
```
|
|
172
115
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
- managed built-in presets are `vv-openai`, `vv-zai`, `vv-minimax`, and `vv-deepseek`
|
|
176
|
-
- `vvoc install` and `vvoc sync` always refresh those managed `vv-*` presets back to vvoc defaults
|
|
177
|
-
- `vv-openai` uses normal `openai/gpt-5.4` for `default`, keeps `smart` on the vv-managed xhigh alias `openai/vv-gpt-5.5-xhigh`, and keeps `fast`/`vision` on the conservative OpenAI defaults
|
|
178
|
-
- run `vvoc patch-provider openai` before using the `vv-openai` smart role if the alias model is not already present in your global OpenCode config
|
|
179
|
-
- user-defined presets with other names are preserved as-is, including legacy names such as `openai`, `zai`, and `minimax`
|
|
180
|
-
- presets may be partial
|
|
181
|
-
- applying a preset only changes the roles listed in that preset
|
|
182
|
-
- `vvoc preset list/show/apply` reads the current canonical `vvoc.json` as-is and only bootstraps defaults when the file is missing
|
|
183
|
-
- on existing `vvoc.json`, preset commands do not reseed or refresh managed preset definitions as a side effect
|
|
184
|
-
- preset application updates only canonical global `vvoc.json` role assignments and does not rewrite OpenCode config directly
|
|
185
|
-
|
|
186
|
-
## Plugins Included
|
|
187
|
-
|
|
188
|
-
### ModelRolesPlugin
|
|
189
|
-
|
|
190
|
-
`ModelRolesPlugin` resolves `vv-role:*` model references at startup for supported OpenCode config fields (`model`, `small_model`, `agent.*.model`, and `command.*.model`).
|
|
116
|
+
Built-in role IDs: `default`, `smart`, `fast`, `vision` + any custom lowercase-hyphenated IDs.
|
|
191
117
|
|
|
192
|
-
|
|
118
|
+
Presets are partial — applying one only changes the roles it defines. Managed built-in presets (`vv-*`) are refreshed on every `vvoc install`/`vvoc sync`; user-defined presets are preserved as-is.
|
|
193
119
|
|
|
194
|
-
|
|
120
|
+
---
|
|
195
121
|
|
|
196
|
-
|
|
122
|
+
## Config & Data Layout
|
|
197
123
|
|
|
198
|
-
Runtime settings live in the `guardian` section of canonical `vvoc.json`.
|
|
199
|
-
|
|
200
|
-
Supported `guardian` fields:
|
|
201
|
-
|
|
202
|
-
- `model`
|
|
203
|
-
- `variant`
|
|
204
|
-
- `timeoutMs`
|
|
205
|
-
- `approvalRiskThreshold`
|
|
206
|
-
- `reviewToastDurationMs`
|
|
207
|
-
|
|
208
|
-
Print or update the `guardian` section:
|
|
209
|
-
|
|
210
|
-
```bash
|
|
211
|
-
vvoc guardian config --print
|
|
212
|
-
vvoc guardian config --model "anthropic/claude-sonnet-4-5" --variant high
|
|
213
124
|
```
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
The overridden `edit` tool requires those exact `line#hash#anchor` anchors, still accepts legacy `line#hash` anchors, and rejects stale references when the file changed since the last read, which prevents line-number drift and accidental writes against the wrong snapshot.
|
|
224
|
-
|
|
225
|
-
Managed OpenCode config written by `vvoc install`, `vvoc sync`, and `vvoc init` also sets `tools.apply_patch = false` so sessions are steered away from the global `apply_patch` tool and onto the hashline-backed `edit` override.
|
|
226
|
-
Primary chat sessions also receive a short system reminder to prefer `read` plus the hashline-backed `edit` tool over shell-based file rewrites when an edit is needed.
|
|
227
|
-
|
|
228
|
-
### MemoryPlugin
|
|
229
|
-
|
|
230
|
-
`MemoryPlugin` adds explicit persistent memory tools and installs a report-only `memory-reviewer` subagent.
|
|
231
|
-
|
|
232
|
-
Memory scopes are `session`, `branch`, `project`, and `shared`. Writes default to `project`; `shared` is cross-project, the rest are repository-local.
|
|
233
|
-
|
|
234
|
-
Available tools:
|
|
235
|
-
|
|
236
|
-
- `memory_search`
|
|
237
|
-
- `memory_get`
|
|
238
|
-
- `memory_put`
|
|
239
|
-
- `memory_update`
|
|
240
|
-
- `memory_delete`
|
|
241
|
-
- `memory_list`
|
|
242
|
-
|
|
243
|
-
Memory is explicit-only:
|
|
244
|
-
|
|
245
|
-
- stored entries are never injected into prompts automatically
|
|
246
|
-
- the agent must call memory tools directly when durable context is useful
|
|
247
|
-
- `memory-reviewer` can read memory but cannot modify it
|
|
248
|
-
|
|
249
|
-
Supported `memory` fields:
|
|
250
|
-
|
|
251
|
-
- `enabled`
|
|
252
|
-
- `defaultSearchLimit`
|
|
253
|
-
- `reviewerModel`
|
|
254
|
-
- `reviewerVariant`
|
|
255
|
-
|
|
256
|
-
Example:
|
|
257
|
-
|
|
258
|
-
```text
|
|
259
|
-
@memory-reviewer review the current memory and suggest keep/update/merge/delete actions
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
The runtime prompt is loaded from `memory-reviewer.md`, preferring `./.vvoc/agents/memory-reviewer.md` over the global `vvoc` agents directory.
|
|
263
|
-
|
|
264
|
-
### SystemContextInjectionPlugin
|
|
265
|
-
|
|
266
|
-
`SystemContextInjectionPlugin` injects reusable system guidance into primary sessions without polluting known subagent prompts.
|
|
267
|
-
|
|
268
|
-
The default injected guidance tells the main session to proactively use the `explore` subagent for read-only context gathering when the task depends on unfamiliar code, unclear scope, or multiple candidate implementation areas. The `explore` subagent must not be asked to propose solutions, suggest plans, recommend changes, make design decisions, or evaluate trade-offs.
|
|
269
|
-
|
|
270
|
-
### WorkflowPlugin
|
|
271
|
-
|
|
272
|
-
`vv-controller` is the managed default primary agent. It routes routine localized work directly, uses `investigator` for unclear bugs, uses tracked implementer/reviewer loops for risky or multi-file changes, and uses `vv-analyst` plus `vv-architect` for large-feature planning before implementation approval.
|
|
273
|
-
|
|
274
|
-
Managed OpenCode commands:
|
|
275
|
-
|
|
276
|
-
- `/vv-plan` routes the request through planning mode and stops before implementation
|
|
277
|
-
- `/vv-review` routes the request through review-only mode and reports findings first
|
|
278
|
-
|
|
279
|
-
`WorkflowPlugin` adds tracked workflow orchestration around the `task` tool for these managed subagents:
|
|
280
|
-
|
|
281
|
-
- `vv-implementer`
|
|
282
|
-
- `vv-spec-reviewer`
|
|
283
|
-
- `vv-code-reviewer`
|
|
284
|
-
|
|
285
|
-
It also registers three workflow tools:
|
|
286
|
-
|
|
287
|
-
- `work_item_open`
|
|
288
|
-
- `work_item_list`
|
|
289
|
-
- `work_item_close`
|
|
290
|
-
|
|
291
|
-
Tracked task prompts must start with a first-line header like:
|
|
292
|
-
|
|
293
|
-
```text
|
|
294
|
-
VVOC_WORK_ITEM_ID: wi-1
|
|
295
|
-
<assignment>
|
|
296
|
-
<goal>Implement the approved change.</goal>
|
|
297
|
-
<context>Repository-specific notes.</context>
|
|
298
|
-
<verification>bun test src/plugins/workflow.test.ts</verification>
|
|
299
|
-
</assignment>
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
The lightweight XML-like tags are for assignment prompt bodies only. Keep `VVOC_WORK_ITEM_ID` as line 1 for tracked assignments, use `<reviewer_findings>` as a container when passing normalized review findings, and do not convert tracked final result fields into tags.
|
|
303
|
-
|
|
304
|
-
Tracked result blocks must return strict top-block protocol fields (`VVOC_WORK_ITEM_ID`, `VVOC_STATUS`, and `VVOC_ROUTE` for `vv-implementer`).
|
|
305
|
-
|
|
306
|
-
Main-session guidance reminds agents to open work items first for tracked implementer/reviewer loops, reuse returned headers, keep the tracked header first while using tagged assignment bodies, treat `NEEDS_CONTEXT` as a hard stop, inspect `work_item_list` before retries, and avoid free-form review loops without explicit work-item identity.
|
|
307
|
-
|
|
308
|
-
Review-only workflows may start a fresh work item directly with `vv-spec-reviewer` or `vv-code-reviewer`; implementation workflows still follow `vv-implementer -> vv-spec-reviewer -> vv-code-reviewer`.
|
|
309
|
-
|
|
310
|
-
### SecretsRedactionPlugin
|
|
311
|
-
|
|
312
|
-
`SecretsRedactionPlugin` redacts secrets from chat content before LLM requests and restores placeholders afterward where needed.
|
|
313
|
-
|
|
314
|
-
Settings live in the `secretsRedaction` section of canonical `vvoc.json`.
|
|
315
|
-
|
|
316
|
-
The default seeded config uses:
|
|
317
|
-
|
|
318
|
-
```json
|
|
319
|
-
{
|
|
320
|
-
"secret": "${VVOC_SECRET}"
|
|
321
|
-
}
|
|
125
|
+
OpenCode config → OpenCode-managed paths (global or project)
|
|
126
|
+
vvoc.json (canonical) → $XDG_CONFIG_HOME/vvoc/vvoc.json
|
|
127
|
+
Managed agent prompts → $XDG_CONFIG_HOME/vvoc/agents/*.md (global)
|
|
128
|
+
./.vvoc/agents/*.md (project)
|
|
129
|
+
Planning artifacts → ./.vvoc/plans/*
|
|
130
|
+
Persisted data → $XDG_DATA_HOME/vvoc/
|
|
131
|
+
Project memory → $XDG_DATA_HOME/vvoc/projects/<id>/memory/
|
|
132
|
+
Shared memory → $XDG_DATA_HOME/vvoc/memory/shared/<namespace>/
|
|
322
133
|
```
|
|
323
134
|
|
|
324
|
-
|
|
135
|
+
Schema is versioned and published with the package — source of truth at `schemas/vvoc/v3.json`.
|
|
325
136
|
|
|
326
|
-
|
|
137
|
+
---
|
|
327
138
|
|
|
328
|
-
## Managed
|
|
139
|
+
## Managed Agents
|
|
329
140
|
|
|
330
|
-
|
|
141
|
+
All prompt files are scaffolded by `vvoc install` / `vvoc sync`:
|
|
331
142
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
143
|
+
| Agent | Role |
|
|
144
|
+
|---|---|
|
|
145
|
+
| `vv-controller` | Default primary agent — routes work to the right subagent |
|
|
146
|
+
| `enhancer` | Prompt enhancement |
|
|
147
|
+
| `vv-analyst` | Requirements analysis for large features |
|
|
148
|
+
| `vv-architect` | Module/contract/wave design |
|
|
149
|
+
| `vv-implementer` | Focused implementation with verification |
|
|
150
|
+
| `vv-spec-reviewer` | Checks implementation against spec |
|
|
151
|
+
| `vv-code-reviewer` | Engineering review for bugs and maintainability |
|
|
152
|
+
| `investigator` | Root-cause analysis for unclear bugs |
|
|
153
|
+
| `guardian` | Permission request review (plugin runtime) |
|
|
154
|
+
| `memory-reviewer` | Read-only memory audit (plugin runtime) |
|
|
342
155
|
|
|
343
|
-
|
|
156
|
+
---
|
|
344
157
|
|
|
345
|
-
|
|
346
|
-
- `vv-controller`
|
|
347
|
-
- `enhancer`
|
|
348
|
-
- `vv-analyst`
|
|
349
|
-
- `vv-architect`
|
|
350
|
-
- `vv-implementer`
|
|
351
|
-
- `vv-spec-reviewer`
|
|
352
|
-
- `vv-code-reviewer`
|
|
353
|
-
- `investigator`
|
|
354
|
-
|
|
355
|
-
Plugin runtime agents are:
|
|
356
|
-
|
|
357
|
-
- `guardian`
|
|
358
|
-
- `memory-reviewer`
|
|
359
|
-
|
|
360
|
-
`vvoc install` and `vvoc sync` also keep OpenCode `default_agent` set to `vv-controller` and keep command entries for `vv-plan` and `vv-review` registered.
|
|
361
|
-
|
|
362
|
-
If a managed prompt file is missing, rerun one of these commands:
|
|
158
|
+
## Local Development
|
|
363
159
|
|
|
364
160
|
```bash
|
|
365
|
-
|
|
366
|
-
|
|
161
|
+
bun install # Install dependencies
|
|
162
|
+
bun run check # Typecheck + lint + format check + test
|
|
163
|
+
bun run fmt # Auto-format source files
|
|
367
164
|
```
|
|
368
165
|
|
|
369
|
-
|
|
166
|
+
Git hooks managed via `lefthook`.
|
|
370
167
|
|
|
371
|
-
|
|
168
|
+
### Smoke-test the built CLI
|
|
372
169
|
|
|
373
170
|
```bash
|
|
374
|
-
|
|
171
|
+
tmpdir="$(mktemp -d)"
|
|
172
|
+
bun run build
|
|
173
|
+
bun dist/cli.js install --config-dir "$tmpdir"
|
|
174
|
+
bun dist/cli.js status --config-dir "$tmpdir"
|
|
375
175
|
```
|
|
376
176
|
|
|
377
|
-
|
|
177
|
+
### Full release verification
|
|
378
178
|
|
|
379
179
|
```bash
|
|
380
|
-
bun run
|
|
381
|
-
bun run lint
|
|
382
|
-
bun run fmt:check
|
|
383
|
-
bun test
|
|
180
|
+
bun run check
|
|
384
181
|
bun run build
|
|
385
182
|
bun run pack:check
|
|
386
183
|
```
|
|
387
184
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
```bash
|
|
391
|
-
bun run fmt
|
|
392
|
-
```
|
|
185
|
+
---
|
|
393
186
|
|
|
394
|
-
|
|
187
|
+
## Publishing
|
|
395
188
|
|
|
396
189
|
```bash
|
|
397
|
-
|
|
398
|
-
bun run build
|
|
399
|
-
bun dist/cli.js install --config-dir "$tmpdir"
|
|
400
|
-
bun dist/cli.js status --config-dir "$tmpdir"
|
|
190
|
+
bun run check && bun run build && npm publish
|
|
401
191
|
```
|
|
402
192
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
## Publishing
|
|
193
|
+
Publishing is manual from the terminal. No CI publish workflows.
|
|
406
194
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
Typical release flow:
|
|
410
|
-
|
|
411
|
-
```bash
|
|
412
|
-
bun run typecheck
|
|
413
|
-
bun run lint
|
|
414
|
-
bun run fmt:check
|
|
415
|
-
bun test
|
|
416
|
-
bun run build
|
|
417
|
-
bun run pack:check
|
|
418
|
-
npm publish
|
|
419
|
-
```
|
|
195
|
+
---
|
|
420
196
|
|
|
421
197
|
## Optional: RTK
|
|
422
198
|
|
|
423
|
-
[RTK](https://github.com/rtk-ai/rtk) is a CLI proxy that
|
|
199
|
+
[RTK](https://github.com/rtk-ai/rtk) is a CLI proxy that reduces token usage for common developer commands. The interactive `vvoc init` flow recommends it after setup.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// FILE: src/commands/completion.ts
|
|
2
|
-
// VERSION: 0.5.
|
|
2
|
+
// VERSION: 0.5.15
|
|
3
3
|
// START_MODULE_CONTRACT
|
|
4
4
|
// PURPOSE: Auto-detect shell and install vvoc completions idempotently.
|
|
5
5
|
// SCOPE: Shell detection, completion file writing, nested command and preset completion generation for config/plugin/patch-provider/preset and the `role set|unset` flow, and rc file patching.
|
|
6
6
|
// INPUTS: Current shell environment plus built-in vvoc command and preset names.
|
|
7
7
|
// OUTPUTS: Shell-specific completion scripts and idempotent rc/config patches.
|
|
8
|
-
// DEPENDS: [citty, node:fs/promises, node:path, node:os, src/lib/model-roles.ts]
|
|
8
|
+
// DEPENDS: [citty, node:fs/promises, node:path, node:os, src/lib/model-roles.ts, src/lib/vvoc-preset-registry.ts]
|
|
9
9
|
// LINKS: [M-CLI-COMPLETION, M-CLI-COMMANDS]
|
|
10
10
|
// ROLE: RUNTIME
|
|
11
11
|
// MAP_MODE: EXPORTS
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
// END_MODULE_MAP
|
|
21
21
|
//
|
|
22
22
|
// START_CHANGE_SUMMARY
|
|
23
|
+
// LAST_CHANGE: [v0.5.15 - Switched built-in preset completions to the shared internal preset registry so managed names stay in sync.]
|
|
23
24
|
// LAST_CHANGE: [v0.5.14 - Restricted unset-role completions so shell suggestions no longer imply built-in roles are unsettable.]
|
|
24
25
|
// END_CHANGE_SUMMARY
|
|
25
26
|
import { defineCommand } from "citty";
|
|
@@ -27,6 +28,7 @@ import { appendFile, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
|
27
28
|
import { homedir } from "node:os";
|
|
28
29
|
import { resolve } from "node:path";
|
|
29
30
|
import { BUILTIN_ROLE_NAMES } from "../lib/model-roles.js";
|
|
31
|
+
import { BUILTIN_VVOC_PRESET_NAMES } from "../lib/vvoc-preset-registry.js";
|
|
30
32
|
const VVOC_TOP_LEVEL_COMMANDS = [
|
|
31
33
|
"completion",
|
|
32
34
|
"config",
|
|
@@ -46,7 +48,6 @@ const VVOC_TOP_LEVEL_COMMANDS = [
|
|
|
46
48
|
const VVOC_CONFIG_COMMANDS = ["validate"];
|
|
47
49
|
const VVOC_PATCH_PROVIDER_PRESETS = ["stepfun-ai", "zai", "openai"];
|
|
48
50
|
const VVOC_PRESET_COMMANDS = ["list", "show"];
|
|
49
|
-
const VVOC_PRESET_NAMES = ["vv-openai", "vv-zai", "vv-minimax", "vv-deepseek"];
|
|
50
51
|
const VVOC_PLUGIN_COMMANDS = ["list"];
|
|
51
52
|
const VVOC_ROLE_COMMANDS = ["set", "unset", "list"];
|
|
52
53
|
const VVOC_ROLE_IDS = [...BUILTIN_ROLE_NAMES];
|
|
@@ -148,8 +149,8 @@ export function generateBashCompletion() {
|
|
|
148
149
|
const topLevelCommands = VVOC_TOP_LEVEL_COMMANDS.join(" ");
|
|
149
150
|
const configCommands = VVOC_CONFIG_COMMANDS.join(" ");
|
|
150
151
|
const patchProviderPresets = VVOC_PATCH_PROVIDER_PRESETS.join(" ");
|
|
151
|
-
const presetCommands = [...VVOC_PRESET_COMMANDS, ...
|
|
152
|
-
const presetNames =
|
|
152
|
+
const presetCommands = [...VVOC_PRESET_COMMANDS, ...BUILTIN_VVOC_PRESET_NAMES].join(" ");
|
|
153
|
+
const presetNames = BUILTIN_VVOC_PRESET_NAMES.join(" ");
|
|
153
154
|
const pluginCommands = VVOC_PLUGIN_COMMANDS.join(" ");
|
|
154
155
|
const roleCommands = VVOC_ROLE_COMMANDS.join(" ");
|
|
155
156
|
const roleIds = VVOC_ROLE_IDS.join(" ");
|
|
@@ -264,16 +265,18 @@ export function generateZshCompletion() {
|
|
|
264
265
|
for (const cmd of VVOC_TOP_LEVEL_COMMANDS) {
|
|
265
266
|
lines.push(' "' + cmd + '"');
|
|
266
267
|
}
|
|
267
|
-
lines.push(" )", "", ' _arguments -C "1: :(' + VVOC_TOP_LEVEL_COMMANDS.join(" ") + ')" "*::arg:->args"', "", " case $line[1] in", " role)", " _vvoc_role_cmds", " ;;", " config)", " _vvoc_config_cmds", " ;;", " patch-provider)", " _vvoc_patch_provider_cmds", " ;;", " preset)", " _vvoc_preset_cmds", " ;;", " plugin)", " _vvoc_plugin_cmds", " ;;", " esac", "}", "", "_vvoc_config_cmds() {", " local -a config_commands", " config_commands=(" + VVOC_CONFIG_COMMANDS.join(" ") + ")", ' _arguments "1: :(' + VVOC_CONFIG_COMMANDS.join(" ") + ')"', "}", "", "_vvoc_patch_provider_cmds() {", ' _arguments "1: :(' + VVOC_PATCH_PROVIDER_PRESETS.join(" ") + ')"', "}", "", "_vvoc_preset_cmds() {", " case $words[2] in", " show)", ' _arguments "1: :(' +
|
|
268
|
+
lines.push(" )", "", ' _arguments -C "1: :(' + VVOC_TOP_LEVEL_COMMANDS.join(" ") + ')" "*::arg:->args"', "", " case $line[1] in", " role)", " _vvoc_role_cmds", " ;;", " config)", " _vvoc_config_cmds", " ;;", " patch-provider)", " _vvoc_patch_provider_cmds", " ;;", " preset)", " _vvoc_preset_cmds", " ;;", " plugin)", " _vvoc_plugin_cmds", " ;;", " esac", "}", "", "_vvoc_config_cmds() {", " local -a config_commands", " config_commands=(" + VVOC_CONFIG_COMMANDS.join(" ") + ")", ' _arguments "1: :(' + VVOC_CONFIG_COMMANDS.join(" ") + ')"', "}", "", "_vvoc_patch_provider_cmds() {", ' _arguments "1: :(' + VVOC_PATCH_PROVIDER_PRESETS.join(" ") + ')"', "}", "", "_vvoc_preset_cmds() {", " case $words[2] in", " show)", ' _arguments "1: :(' + BUILTIN_VVOC_PRESET_NAMES.join(" ") + ')"', " ;;", " *)", ' _arguments "1: :(' +
|
|
269
|
+
[...VVOC_PRESET_COMMANDS, ...BUILTIN_VVOC_PRESET_NAMES].join(" ") +
|
|
270
|
+
')"', " ;;", " esac", "}", "", "_vvoc_role_cmds() {", " case $words[2] in", " set)", ' _arguments "1: :(' + VVOC_ROLE_IDS.join(" ") + ')"', " ;;", " unset)", ' _arguments "1: :<custom-role-id>"', " ;;", " *)", ' _arguments "1: :(' + VVOC_ROLE_COMMANDS.join(" ") + ')"', " ;;", " esac", "}", "", "_vvoc_plugin_cmds() {", " local -a plugin_commands", " plugin_commands=(" + VVOC_PLUGIN_COMMANDS.join(" ") + ")", ' _arguments "1: :(' + VVOC_PLUGIN_COMMANDS.join(" ") + ')"', "}", "", "compdef _vvoc vvoc");
|
|
268
271
|
return lines.join("\n") + "\n";
|
|
269
272
|
}
|
|
270
273
|
export function generateFishCompletion() {
|
|
271
|
-
const presetCommands = [...VVOC_PRESET_COMMANDS, ...
|
|
274
|
+
const presetCommands = [...VVOC_PRESET_COMMANDS, ...BUILTIN_VVOC_PRESET_NAMES].join(" ");
|
|
272
275
|
const lines = ["# fish completion for vvoc", "", "function __vvoc_commands"];
|
|
273
276
|
for (const cmd of VVOC_TOP_LEVEL_COMMANDS) {
|
|
274
277
|
lines.push(" echo " + cmd);
|
|
275
278
|
}
|
|
276
|
-
lines.push("end", "", "function __vvoc_config_cmds", " echo " + VVOC_CONFIG_COMMANDS.join(" "), "end", "", "function __vvoc_patch_provider_cmds", " echo " + VVOC_PATCH_PROVIDER_PRESETS.join(" "), "end", "", "function __vvoc_preset_cmds", " echo " + presetCommands, "end", "", "function __vvoc_preset_names", " echo " +
|
|
279
|
+
lines.push("end", "", "function __vvoc_config_cmds", " echo " + VVOC_CONFIG_COMMANDS.join(" "), "end", "", "function __vvoc_patch_provider_cmds", " echo " + VVOC_PATCH_PROVIDER_PRESETS.join(" "), "end", "", "function __vvoc_preset_cmds", " echo " + presetCommands, "end", "", "function __vvoc_preset_names", " echo " + BUILTIN_VVOC_PRESET_NAMES.join(" "), "end", "", "function __vvoc_role_cmds", " echo " + VVOC_ROLE_COMMANDS.join(" "), "end", "", "function __vvoc_role_ids", " echo " + VVOC_ROLE_IDS.join(" "), "end", "", "function __vvoc_plugin_cmds", " echo " + VVOC_PLUGIN_COMMANDS.join(" "), "end", "", 'complete -c vvoc -f -a "(__vvoc_commands)"', 'complete -c vvoc -n "__fish_seen_subcommand_from role; and not __fish_seen_subcommand_from set unset list" -f -a "(__vvoc_role_cmds)"', 'complete -c vvoc -n "__fish_seen_subcommand_from role; and __fish_seen_subcommand_from set" -f -a "(__vvoc_role_ids)"', 'complete -c vvoc -n "__fish_seen_subcommand_from config" -f -a "(__vvoc_config_cmds)"', 'complete -c vvoc -n "__fish_seen_subcommand_from patch-provider" -f -a "(__vvoc_patch_provider_cmds)"', 'complete -c vvoc -n "__fish_seen_subcommand_from preset; and not __fish_seen_subcommand_from ' +
|
|
277
280
|
presetCommands +
|
|
278
281
|
'" -f -a "(__vvoc_preset_cmds)"', 'complete -c vvoc -n "__fish_seen_subcommand_from preset; and __fish_seen_subcommand_from show" -f -a "(__vvoc_preset_names)"', 'complete -c vvoc -n "__fish_seen_subcommand_from plugin" -f -a "(__vvoc_plugin_cmds)"');
|
|
279
282
|
return lines.join("\n") + "\n";
|