@osovv/vv-opencode 0.1.0 → 0.2.2
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 +244 -20
- package/dist/commands/doctor.d.ts +1 -7
- package/dist/commands/doctor.js +6 -20
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/guardian.js +1 -1
- package/dist/commands/guardian.js.map +1 -1
- package/dist/commands/install.d.ts +6 -7
- package/dist/commands/install.js +17 -17
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/status.d.ts +1 -1
- package/dist/commands/status.js +5 -5
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/sync.d.ts +2 -8
- package/dist/commands/sync.js +7 -16
- package/dist/commands/sync.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/opencode.d.ts +15 -13
- package/dist/lib/opencode.js +105 -110
- package/dist/lib/opencode.js.map +1 -1
- package/dist/lib/vvoc-paths.d.ts +9 -0
- package/dist/lib/vvoc-paths.js +48 -0
- package/dist/lib/vvoc-paths.js.map +1 -0
- package/dist/plugins/guardian.js +20 -21
- package/dist/plugins/guardian.js.map +1 -1
- package/dist/plugins/memory-store.d.ts +55 -0
- package/dist/plugins/memory-store.js +472 -0
- package/dist/plugins/memory-store.js.map +1 -0
- package/dist/plugins/memory.d.ts +2 -0
- package/dist/plugins/memory.js +323 -0
- package/dist/plugins/memory.js.map +1 -0
- package/package.json +16 -6
- package/AGENTS.md +0 -164
- package/dist/lib/opencode.test.d.ts +0 -1
- package/dist/lib/opencode.test.js +0 -47
- package/dist/lib/opencode.test.js.map +0 -1
- package/docs/development-plan.xml +0 -155
- package/docs/knowledge-graph.xml +0 -42
- package/docs/operational-packets.xml +0 -106
- package/docs/requirements.xml +0 -66
- package/docs/technology.xml +0 -51
- package/docs/verification-plan.xml +0 -145
package/README.md
CHANGED
|
@@ -1,39 +1,53 @@
|
|
|
1
|
-
# vv-opencode
|
|
1
|
+
# @osovv/vv-opencode
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Portable OpenCode workflow package with plugins and a Bun CLI for install, sync, and cross-device setup.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Current package scope:
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
7
|
+
- `GuardianPlugin` for permission review
|
|
8
|
+
- `MemoryPlugin` for explicit persistent memory
|
|
9
|
+
- `vvoc` CLI for bootstrap, sync, and diagnostics
|
|
10
|
+
- vvoc-managed config kept separate from OpenCode config
|
|
10
11
|
|
|
11
|
-
##
|
|
12
|
+
## What is included
|
|
12
13
|
|
|
13
|
-
- npm
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
14
|
+
- npm package: `@osovv/vv-opencode`
|
|
15
|
+
- binary: `vvoc`
|
|
16
|
+
- exported plugins:
|
|
17
|
+
- `GuardianPlugin`
|
|
18
|
+
- `MemoryPlugin`
|
|
19
|
+
- CLI commands:
|
|
20
|
+
- `install`
|
|
21
|
+
- `sync`
|
|
22
|
+
- `status`
|
|
23
|
+
- `doctor`
|
|
24
|
+
- `guardian config`
|
|
17
25
|
|
|
18
|
-
##
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
Install into the current project:
|
|
19
29
|
|
|
20
30
|
```bash
|
|
21
|
-
bun
|
|
22
|
-
bun run build
|
|
23
|
-
bun test
|
|
31
|
+
bun add @osovv/vv-opencode
|
|
24
32
|
```
|
|
25
33
|
|
|
26
|
-
|
|
34
|
+
If installed locally, run the binary as:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
bun x vvoc --help
|
|
38
|
+
```
|
|
27
39
|
|
|
28
|
-
|
|
40
|
+
or:
|
|
29
41
|
|
|
30
42
|
```bash
|
|
31
|
-
|
|
43
|
+
bun run vvoc --help
|
|
32
44
|
```
|
|
33
45
|
|
|
34
|
-
|
|
46
|
+
Plain `vvoc` only works when the binary is available in your `PATH`, for example after a global install.
|
|
35
47
|
|
|
36
|
-
|
|
48
|
+
## OpenCode usage
|
|
49
|
+
|
|
50
|
+
Add the package to your OpenCode config:
|
|
37
51
|
|
|
38
52
|
```json
|
|
39
53
|
{
|
|
@@ -41,3 +55,213 @@ CLI добавит `@osovv/vv-opencode` в `opencode` config и при необ
|
|
|
41
55
|
"plugin": ["@osovv/vv-opencode"]
|
|
42
56
|
}
|
|
43
57
|
```
|
|
58
|
+
|
|
59
|
+
OpenCode loads all exported plugin functions from the package, so this enables both `GuardianPlugin` and `MemoryPlugin`.
|
|
60
|
+
|
|
61
|
+
## Config layout
|
|
62
|
+
|
|
63
|
+
OpenCode config stays in OpenCode-managed locations:
|
|
64
|
+
|
|
65
|
+
- global: `$XDG_CONFIG_HOME/opencode/opencode.json` or `~/.config/opencode/opencode.json`
|
|
66
|
+
- project: `./opencode.json` or `./opencode.jsonc`
|
|
67
|
+
|
|
68
|
+
vvoc-managed config stays separate:
|
|
69
|
+
|
|
70
|
+
- global: `$XDG_CONFIG_HOME/vvoc/` or `~/.config/vvoc/`
|
|
71
|
+
- project: `./.vvoc/`
|
|
72
|
+
|
|
73
|
+
vvoc persisted data stays in the XDG data root:
|
|
74
|
+
|
|
75
|
+
- global data: `$XDG_DATA_HOME/vvoc/` or `~/.local/share/vvoc/`
|
|
76
|
+
|
|
77
|
+
Examples:
|
|
78
|
+
|
|
79
|
+
- global Guardian config: `~/.config/vvoc/guardian.jsonc`
|
|
80
|
+
- project Guardian config: `./.vvoc/guardian.jsonc`
|
|
81
|
+
- global memory data: `~/.local/share/vvoc/projects/<project-id>/memory/`
|
|
82
|
+
- project memory settings: `./.vvoc/memory.jsonc`
|
|
83
|
+
|
|
84
|
+
This keeps vvoc state clearly separated from native OpenCode config and avoids future clashes if OpenCode adds its own memory features.
|
|
85
|
+
|
|
86
|
+
## CLI
|
|
87
|
+
|
|
88
|
+
Show help:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
bun x vvoc --help
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Install package config and bootstrap Guardian config:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
bun x vvoc install
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Use project scope instead of global scope:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
bun x vvoc install --scope project
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Override the global config home used for both `opencode/` and `vvoc/`:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
bun x vvoc install --config-dir /tmp/vvoc-home
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
This writes:
|
|
113
|
+
|
|
114
|
+
- `/tmp/vvoc-home/opencode/opencode.json`
|
|
115
|
+
- `/tmp/vvoc-home/vvoc/guardian.jsonc`
|
|
116
|
+
- `/tmp/vvoc-home/vvoc/memory.jsonc`
|
|
117
|
+
|
|
118
|
+
Sync managed config files:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
bun x vvoc sync
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Inspect current setup:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
bun x vvoc status
|
|
128
|
+
bun x vvoc doctor
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Generate or print `guardian.jsonc`:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
bun x vvoc guardian config --print
|
|
135
|
+
bun x vvoc guardian config --model "anthropic/claude-sonnet-4-5" --variant high
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Guardian config behavior
|
|
139
|
+
|
|
140
|
+
`vvoc` creates a managed `guardian.jsonc` with a marker header.
|
|
141
|
+
|
|
142
|
+
- managed files can be resynced safely
|
|
143
|
+
- existing unmanaged files are not overwritten unless `--force` is passed
|
|
144
|
+
- Guardian now reads vvoc-managed config from `.vvoc/` or `$XDG_CONFIG_HOME/vvoc/`
|
|
145
|
+
- `vvoc install` also creates `memory.jsonc` when it is missing
|
|
146
|
+
|
|
147
|
+
## Memory plugin
|
|
148
|
+
|
|
149
|
+
`MemoryPlugin` adds explicit memory tools to OpenCode.
|
|
150
|
+
|
|
151
|
+
Available tools:
|
|
152
|
+
|
|
153
|
+
- `memory_search`
|
|
154
|
+
- `memory_get`
|
|
155
|
+
- `memory_put`
|
|
156
|
+
- `memory_update`
|
|
157
|
+
- `memory_delete`
|
|
158
|
+
- `memory_list`
|
|
159
|
+
|
|
160
|
+
Memory is explicit-only:
|
|
161
|
+
|
|
162
|
+
- stored entries are never injected into the prompt automatically
|
|
163
|
+
- the agent must call memory tools directly when it needs durable context
|
|
164
|
+
- memory settings live in `./.vvoc/memory.jsonc` or `$XDG_CONFIG_HOME/vvoc/memory.jsonc`
|
|
165
|
+
- memory data lives under `$XDG_DATA_HOME/vvoc/projects/<project-id>/memory/`
|
|
166
|
+
- the plugin adds a short system instruction that reminds the agent to consider memory tools proactively when durable context may help
|
|
167
|
+
|
|
168
|
+
Supported scopes:
|
|
169
|
+
|
|
170
|
+
- `session`
|
|
171
|
+
- `branch`
|
|
172
|
+
- `project`
|
|
173
|
+
- `shared`
|
|
174
|
+
|
|
175
|
+
### Memory review
|
|
176
|
+
|
|
177
|
+
The package also installs a bundled reviewer subagent named `memory-reviewer`.
|
|
178
|
+
|
|
179
|
+
Use it when you want a report-only audit of stored memory:
|
|
180
|
+
|
|
181
|
+
```text
|
|
182
|
+
@memory-reviewer review the current memory and suggest keep/update/merge/delete actions
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
The reviewer can read memory with `memory_list`, `memory_get`, and `memory_search`, but it does not modify entries.
|
|
186
|
+
|
|
187
|
+
## Package API
|
|
188
|
+
|
|
189
|
+
Root exports:
|
|
190
|
+
|
|
191
|
+
```ts
|
|
192
|
+
import { GuardianPlugin, MemoryPlugin } from "@osovv/vv-opencode";
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Subpath exports:
|
|
196
|
+
|
|
197
|
+
```ts
|
|
198
|
+
import { GuardianPlugin } from "@osovv/vv-opencode/plugins/guardian";
|
|
199
|
+
import { MemoryPlugin } from "@osovv/vv-opencode/plugins/memory";
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Local development
|
|
203
|
+
|
|
204
|
+
Install dependencies:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
bun install
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Run checks:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
bun run typecheck
|
|
214
|
+
bun run lint
|
|
215
|
+
bun run fmt:check
|
|
216
|
+
bun test
|
|
217
|
+
bun run build
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Format source files:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
bun run fmt
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Git hooks are managed with `lefthook`.
|
|
227
|
+
|
|
228
|
+
- `bun install` runs `lefthook install --force` through the `prepare` script
|
|
229
|
+
- the `pre-commit` hook runs `bun run lint` and `bun run fmt:check`
|
|
230
|
+
|
|
231
|
+
Smoke-test the CLI against a temporary config home:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
tmpdir="$(mktemp -d)"
|
|
235
|
+
bun run build
|
|
236
|
+
bun dist/cli.js install --config-dir "$tmpdir"
|
|
237
|
+
bun dist/cli.js status --config-dir "$tmpdir"
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## Publishing
|
|
241
|
+
|
|
242
|
+
This project is published manually from the terminal. There is no CI publish workflow.
|
|
243
|
+
|
|
244
|
+
Typical release flow:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
bun run check
|
|
248
|
+
bun run build
|
|
249
|
+
npm publish
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Repository layout
|
|
253
|
+
|
|
254
|
+
- `src/plugins/guardian.ts` - Guardian OpenCode plugin
|
|
255
|
+
- `src/plugins/memory.ts` - Memory OpenCode plugin and reviewer subagent config
|
|
256
|
+
- `src/plugins/memory-store.ts` - file-based memory store and search logic
|
|
257
|
+
- `src/lib/opencode.ts` - config path resolution and JSONC helpers for the CLI
|
|
258
|
+
- `src/lib/vvoc-paths.ts` - shared vvoc/openCode path helpers
|
|
259
|
+
- `src/commands/` - `vvoc` commands
|
|
260
|
+
- `src/cli.ts` - CLI entrypoint
|
|
261
|
+
- `docs/` - GRACE planning, verification, and graph artifacts
|
|
262
|
+
|
|
263
|
+
## Notes
|
|
264
|
+
|
|
265
|
+
- `src/` is the source of truth
|
|
266
|
+
- `dist/` is generated output for packaging and local smoke tests
|
|
267
|
+
- if you change CLI behavior, plugin exports, vvoc config paths, or memory workflow, keep this README in sync
|
|
@@ -5,15 +5,9 @@ declare const _default: import("citty").CommandDef<{
|
|
|
5
5
|
readonly default: "global";
|
|
6
6
|
readonly description: "Inspect global or project config.";
|
|
7
7
|
};
|
|
8
|
-
readonly source: {
|
|
9
|
-
readonly type: "enum";
|
|
10
|
-
readonly options: ["local", "npm"];
|
|
11
|
-
readonly default: "local";
|
|
12
|
-
readonly description: "Validate local plugin shim or npm package configuration.";
|
|
13
|
-
};
|
|
14
8
|
readonly "config-dir": {
|
|
15
9
|
readonly type: "string";
|
|
16
|
-
readonly description: "Override the global
|
|
10
|
+
readonly description: "Override the global config home used for opencode/ and vvoc/.";
|
|
17
11
|
};
|
|
18
12
|
}>;
|
|
19
13
|
export default _default;
|
package/dist/commands/doctor.js
CHANGED
|
@@ -12,15 +12,9 @@ export default defineCommand({
|
|
|
12
12
|
default: "global",
|
|
13
13
|
description: "Inspect global or project config.",
|
|
14
14
|
},
|
|
15
|
-
source: {
|
|
16
|
-
type: "enum",
|
|
17
|
-
options: ["local", "npm"],
|
|
18
|
-
default: "local",
|
|
19
|
-
description: "Validate local plugin shim or npm package configuration.",
|
|
20
|
-
},
|
|
21
15
|
"config-dir": {
|
|
22
16
|
type: "string",
|
|
23
|
-
description: "Override the global
|
|
17
|
+
description: "Override the global config home used for opencode/ and vvoc/.",
|
|
24
18
|
},
|
|
25
19
|
},
|
|
26
20
|
async run({ args }) {
|
|
@@ -32,33 +26,25 @@ export default defineCommand({
|
|
|
32
26
|
configDir,
|
|
33
27
|
});
|
|
34
28
|
const inspection = await inspectInstallation(paths);
|
|
35
|
-
const problems = [...inspection.problems];
|
|
36
|
-
if (args.source === "npm") {
|
|
37
|
-
if (!inspection.opencode.packageConfigured) {
|
|
38
|
-
problems.push(`${inspection.opencode.path} does not include ${"@osovv/vv-opencode"}`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
else if (!inspection.localPlugin.exists) {
|
|
42
|
-
problems.push(`${inspection.localPlugin.path} is missing`);
|
|
43
|
-
}
|
|
44
29
|
console.log(`Scope: ${inspection.scope}`);
|
|
45
30
|
console.log(`OpenCode config: ${inspection.opencode.path}`);
|
|
46
31
|
console.log(`OpenCode config parse: ${inspection.opencode.parseError ? inspection.opencode.parseError : "ok"}`);
|
|
47
32
|
console.log(`Configured plugins: ${inspection.opencode.plugins.length > 0 ? inspection.opencode.plugins.join(", ") : "<none>"}`);
|
|
48
|
-
console.log(`Local plugin shim: ${inspection.localPlugin.path}`);
|
|
49
|
-
console.log(`Local plugin shim state: ${inspection.localPlugin.exists ? inspection.localPlugin.managed ? "managed" : "unmanaged" : "missing"}`);
|
|
50
33
|
console.log(`Guardian config: ${inspection.guardian.path}`);
|
|
51
34
|
console.log(`Guardian config parse: ${inspection.guardian.parseError ? inspection.guardian.parseError : inspection.guardian.exists ? "ok" : "missing"}`);
|
|
52
35
|
console.log(`Guardian config managed by vvoc: ${inspection.guardian.managed ? "yes" : "no"}`);
|
|
36
|
+
console.log(`Memory config: ${inspection.memory.path}`);
|
|
37
|
+
console.log(`Memory config parse: ${inspection.memory.parseError ? inspection.memory.parseError : inspection.memory.exists ? "ok" : "missing"}`);
|
|
38
|
+
console.log(`Memory config managed by vvoc: ${inspection.memory.managed ? "yes" : "no"}`);
|
|
53
39
|
if (inspection.warnings.length > 0) {
|
|
54
40
|
console.log("Warnings:");
|
|
55
41
|
for (const warning of inspection.warnings) {
|
|
56
42
|
console.log(`- ${warning}`);
|
|
57
43
|
}
|
|
58
44
|
}
|
|
59
|
-
if (problems.length > 0) {
|
|
45
|
+
if (inspection.problems.length > 0) {
|
|
60
46
|
console.error("Problems:");
|
|
61
|
-
for (const problem of problems) {
|
|
47
|
+
for (const problem of inspection.problems) {
|
|
62
48
|
console.error(`- ${problem}`);
|
|
63
49
|
}
|
|
64
50
|
process.exitCode = 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAc,MAAM,oBAAoB,CAAC;AAEnF,eAAe,aAAa,CAAC;IAC3B,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,2CAA2C;KACzD;IACD,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;YAC9B,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,mCAAmC;SACjD;QACD,
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAc,MAAM,oBAAoB,CAAC;AAEnF,eAAe,aAAa,CAAC;IAC3B,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,2CAA2C;KACzD;IACD,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;YAC9B,OA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,MAAM,OAAO,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;gBAC1C,OAAO,CAAC,KAAK,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;YAChC,CAAC;YACD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC5B,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guardian.js","sourceRoot":"","sources":["../../src/commands/guardian.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,mBAAmB,GAGpB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,GAAG,aAAa,CAAC;IAC3B,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,gCAAgC;KAC9C;IACD,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;YAC9B,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,0CAA0C;SACxD;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE
|
|
1
|
+
{"version":3,"file":"guardian.js","sourceRoot":"","sources":["../../src/commands/guardian.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,mBAAmB,GAGpB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,GAAG,aAAa,CAAC;IAC3B,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,gCAAgC;KAC9C;IACD,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,IAAI,E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,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -5,15 +5,9 @@ declare const _default: import("citty").CommandDef<{
|
|
|
5
5
|
readonly default: "global";
|
|
6
6
|
readonly description: "Write to global or project config.";
|
|
7
7
|
};
|
|
8
|
-
readonly source: {
|
|
9
|
-
readonly type: "enum";
|
|
10
|
-
readonly options: ["local", "npm"];
|
|
11
|
-
readonly default: "local";
|
|
12
|
-
readonly description: "Install a local plugin shim or npm package reference.";
|
|
13
|
-
};
|
|
14
8
|
readonly "config-dir": {
|
|
15
9
|
readonly type: "string";
|
|
16
|
-
readonly description: "Override the global
|
|
10
|
+
readonly description: "Override the global config home used for opencode/ and vvoc/.";
|
|
17
11
|
};
|
|
18
12
|
readonly force: {
|
|
19
13
|
readonly type: "boolean";
|
|
@@ -24,5 +18,10 @@ declare const _default: import("citty").CommandDef<{
|
|
|
24
18
|
readonly default: true;
|
|
25
19
|
readonly description: "Create guardian.jsonc when missing.";
|
|
26
20
|
};
|
|
21
|
+
readonly "memory-config": {
|
|
22
|
+
readonly type: "boolean";
|
|
23
|
+
readonly default: true;
|
|
24
|
+
readonly description: "Create memory.jsonc when missing.";
|
|
25
|
+
};
|
|
27
26
|
}>;
|
|
28
27
|
export default _default;
|
package/dist/commands/install.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineCommand } from "citty";
|
|
2
|
-
import { describeWriteResult, ensurePackageInstalled, installGuardianConfig,
|
|
2
|
+
import { describeWriteResult, ensurePackageInstalled, installGuardianConfig, installMemoryConfig, resolvePaths, } from "../lib/opencode.js";
|
|
3
3
|
export default defineCommand({
|
|
4
4
|
meta: {
|
|
5
5
|
name: "install",
|
|
@@ -12,15 +12,9 @@ export default defineCommand({
|
|
|
12
12
|
default: "global",
|
|
13
13
|
description: "Write to global or project config.",
|
|
14
14
|
},
|
|
15
|
-
source: {
|
|
16
|
-
type: "enum",
|
|
17
|
-
options: ["local", "npm"],
|
|
18
|
-
default: "local",
|
|
19
|
-
description: "Install a local plugin shim or npm package reference.",
|
|
20
|
-
},
|
|
21
15
|
"config-dir": {
|
|
22
16
|
type: "string",
|
|
23
|
-
description: "Override the global
|
|
17
|
+
description: "Override the global config home used for opencode/ and vvoc/.",
|
|
24
18
|
},
|
|
25
19
|
force: {
|
|
26
20
|
type: "boolean",
|
|
@@ -31,6 +25,11 @@ export default defineCommand({
|
|
|
31
25
|
default: true,
|
|
32
26
|
description: "Create guardian.jsonc when missing.",
|
|
33
27
|
},
|
|
28
|
+
"memory-config": {
|
|
29
|
+
type: "boolean",
|
|
30
|
+
default: true,
|
|
31
|
+
description: "Create memory.jsonc when missing.",
|
|
32
|
+
},
|
|
34
33
|
},
|
|
35
34
|
async run({ args }) {
|
|
36
35
|
const scope = args.scope === "project" ? "project" : "global";
|
|
@@ -40,20 +39,21 @@ export default defineCommand({
|
|
|
40
39
|
cwd: process.cwd(),
|
|
41
40
|
configDir,
|
|
42
41
|
});
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
const opencode = await ensurePackageInstalled(paths);
|
|
43
|
+
console.log(`${opencode.changed ? "Updated" : "Kept"} ${opencode.path}`);
|
|
44
|
+
if (args["guardian-config"] === false) {
|
|
45
|
+
console.log(`Skipped ${paths.guardianConfigPath} (guardian config disabled)`);
|
|
46
46
|
}
|
|
47
47
|
else {
|
|
48
|
-
const
|
|
49
|
-
console.log(describeWriteResult(
|
|
48
|
+
const guardian = await installGuardianConfig(paths, { force: Boolean(args.force) });
|
|
49
|
+
console.log(describeWriteResult(guardian));
|
|
50
50
|
}
|
|
51
|
-
if (args["
|
|
52
|
-
console.log(`Skipped ${paths.
|
|
51
|
+
if (args["memory-config"] === false) {
|
|
52
|
+
console.log(`Skipped ${paths.memoryConfigPath} (memory config disabled)`);
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
|
-
const
|
|
56
|
-
console.log(describeWriteResult(
|
|
55
|
+
const memory = await installMemoryConfig(paths, { force: Boolean(args.force) });
|
|
56
|
+
console.log(describeWriteResult(memory));
|
|
57
57
|
},
|
|
58
58
|
});
|
|
59
59
|
//# sourceMappingURL=install.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,GAEb,MAAM,oBAAoB,CAAC;AAE5B,eAAe,aAAa,CAAC;IAC3B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,2CAA2C;KACzD;IACD,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;YAC9B,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,oCAAoC;SAClD;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,+DAA+D;SAC7E;QACD,KAAK,EAAE;YACL,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,4DAA4D;SAC1E;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,qCAAqC;SACnD;QACD,eAAe,EAAE;YACf,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,mCAAmC;SACjD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KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAChF,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -7,7 +7,7 @@ declare const _default: import("citty").CommandDef<{
|
|
|
7
7
|
};
|
|
8
8
|
readonly "config-dir": {
|
|
9
9
|
readonly type: "string";
|
|
10
|
-
readonly description: "Override the global
|
|
10
|
+
readonly description: "Override the global config home used for opencode/ and vvoc/.";
|
|
11
11
|
};
|
|
12
12
|
}>;
|
|
13
13
|
export default _default;
|
package/dist/commands/status.js
CHANGED
|
@@ -14,7 +14,7 @@ export default defineCommand({
|
|
|
14
14
|
},
|
|
15
15
|
"config-dir": {
|
|
16
16
|
type: "string",
|
|
17
|
-
description: "Override the global
|
|
17
|
+
description: "Override the global config home used for opencode/ and vvoc/.",
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
async run({ args }) {
|
|
@@ -29,13 +29,13 @@ export default defineCommand({
|
|
|
29
29
|
console.log(`Scope: ${inspection.scope}`);
|
|
30
30
|
console.log(`OpenCode config: ${inspection.opencode.path}`);
|
|
31
31
|
console.log(`OpenCode config exists: ${inspection.opencode.exists ? "yes" : "no"}`);
|
|
32
|
-
console.log(`Package configured
|
|
33
|
-
console.log(`Local plugin shim: ${inspection.localPlugin.path}`);
|
|
34
|
-
console.log(`Local plugin shim exists: ${inspection.localPlugin.exists ? "yes" : "no"}`);
|
|
35
|
-
console.log(`Local plugin shim managed by vvoc: ${inspection.localPlugin.managed ? "yes" : "no"}`);
|
|
32
|
+
console.log(`Package configured: ${inspection.opencode.pluginConfigured ? "yes" : "no"}`);
|
|
36
33
|
console.log(`Guardian config: ${inspection.guardian.path}`);
|
|
37
34
|
console.log(`Guardian config exists: ${inspection.guardian.exists ? "yes" : "no"}`);
|
|
38
35
|
console.log(`Guardian config managed by vvoc: ${inspection.guardian.managed ? "yes" : "no"}`);
|
|
36
|
+
console.log(`Memory config: ${inspection.memory.path}`);
|
|
37
|
+
console.log(`Memory config exists: ${inspection.memory.exists ? "yes" : "no"}`);
|
|
38
|
+
console.log(`Memory config managed by vvoc: ${inspection.memory.managed ? "yes" : "no"}`);
|
|
39
39
|
if (inspection.warnings.length > 0) {
|
|
40
40
|
console.log("Warnings:");
|
|
41
41
|
for (const warning of inspection.warnings) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAc,MAAM,oBAAoB,CAAC;AAEnF,eAAe,aAAa,CAAC;IAC3B,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,uCAAuC;KACrD;IACD,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;YAC9B,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,mCAAmC;SACjD;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAc,MAAM,oBAAoB,CAAC;AAEnF,eAAe,aAAa,CAAC;IAC3B,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,uCAAuC;KACrD;IACD,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;YAC9B,OAAO,EAAE,QAAQ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K,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QACpF,OAAO,CAAC,GAAG,CAAC,oCAAoC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9F,OAAO,CAAC,GAAG,CAAC,kBAAkB,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,yBAAyB,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAChF,OAAO,CAAC,GAAG,CAAC,kCAAkC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAE1F,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YACzB,KAAK,MAAM,OAAO,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;gBAC1C,OAAO,CAAC,GAAG,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
package/dist/commands/sync.d.ts
CHANGED
|
@@ -5,19 +5,13 @@ declare const _default: import("citty").CommandDef<{
|
|
|
5
5
|
readonly default: "global";
|
|
6
6
|
readonly description: "Sync global or project config.";
|
|
7
7
|
};
|
|
8
|
-
readonly source: {
|
|
9
|
-
readonly type: "enum";
|
|
10
|
-
readonly options: ["local", "npm"];
|
|
11
|
-
readonly default: "local";
|
|
12
|
-
readonly description: "Sync a local plugin shim or npm package reference.";
|
|
13
|
-
};
|
|
14
8
|
readonly "config-dir": {
|
|
15
9
|
readonly type: "string";
|
|
16
|
-
readonly description: "Override the global
|
|
10
|
+
readonly description: "Override the global config home used for opencode/ and vvoc/.";
|
|
17
11
|
};
|
|
18
12
|
readonly force: {
|
|
19
13
|
readonly type: "boolean";
|
|
20
|
-
readonly description: "Allow rewriting unmanaged
|
|
14
|
+
readonly description: "Allow rewriting unmanaged vvoc config files.";
|
|
21
15
|
};
|
|
22
16
|
}>;
|
|
23
17
|
export default _default;
|
package/dist/commands/sync.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineCommand } from "citty";
|
|
2
|
-
import { describeWriteResult, ensurePackageInstalled, resolvePaths, syncGuardianConfig,
|
|
2
|
+
import { describeWriteResult, ensurePackageInstalled, resolvePaths, syncGuardianConfig, syncMemoryConfig, } from "../lib/opencode.js";
|
|
3
3
|
export default defineCommand({
|
|
4
4
|
meta: {
|
|
5
5
|
name: "sync",
|
|
@@ -12,19 +12,13 @@ export default defineCommand({
|
|
|
12
12
|
default: "global",
|
|
13
13
|
description: "Sync global or project config.",
|
|
14
14
|
},
|
|
15
|
-
source: {
|
|
16
|
-
type: "enum",
|
|
17
|
-
options: ["local", "npm"],
|
|
18
|
-
default: "local",
|
|
19
|
-
description: "Sync a local plugin shim or npm package reference.",
|
|
20
|
-
},
|
|
21
15
|
"config-dir": {
|
|
22
16
|
type: "string",
|
|
23
|
-
description: "Override the global
|
|
17
|
+
description: "Override the global config home used for opencode/ and vvoc/.",
|
|
24
18
|
},
|
|
25
19
|
force: {
|
|
26
20
|
type: "boolean",
|
|
27
|
-
description: "Allow rewriting unmanaged
|
|
21
|
+
description: "Allow rewriting unmanaged vvoc config files.",
|
|
28
22
|
},
|
|
29
23
|
},
|
|
30
24
|
async run({ args }) {
|
|
@@ -35,15 +29,12 @@ export default defineCommand({
|
|
|
35
29
|
cwd: process.cwd(),
|
|
36
30
|
configDir,
|
|
37
31
|
});
|
|
38
|
-
const
|
|
39
|
-
? (() => ensurePackageInstalled(paths).then((opencode) => ({
|
|
40
|
-
action: opencode.changed ? "updated" : "kept",
|
|
41
|
-
path: opencode.path,
|
|
42
|
-
})))()
|
|
43
|
-
: syncLocalPlugin(paths, { force: Boolean(args.force) });
|
|
32
|
+
const opencode = await ensurePackageInstalled(paths);
|
|
44
33
|
const guardian = await syncGuardianConfig(paths, { force: Boolean(args.force) });
|
|
45
|
-
|
|
34
|
+
const memory = await syncMemoryConfig(paths, { force: Boolean(args.force) });
|
|
35
|
+
console.log(`${opencode.changed ? "Updated" : "Kept"} ${opencode.path}`);
|
|
46
36
|
console.log(describeWriteResult(guardian));
|
|
37
|
+
console.log(describeWriteResult(memory));
|
|
47
38
|
},
|
|
48
39
|
});
|
|
49
40
|
//# sourceMappingURL=sync.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,YAAY,EACZ,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,GAEjB,MAAM,oBAAoB,CAAC;AAE5B,eAAe,aAAa,CAAC;IAC3B,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,wCAAwC;KACtD;IACD,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;YAC9B,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,gCAAgC;SAC9C;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,+DAA+D;SAC7E;QACD,KAAK,EAAE;YACL,IAAI,EAAE,SAAS;YACf,WAA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