@osovv/vv-opencode 2.0.1 → 2.1.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.
Files changed (296) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +87 -86
  3. package/dist/commands/completion.js +0 -1
  4. package/dist/commands/completion.js.map +1 -1
  5. package/dist/commands/doctor.js +6 -9
  6. package/dist/commands/doctor.js.map +1 -1
  7. package/dist/commands/init.d.ts +2 -1
  8. package/dist/commands/init.js +7 -12
  9. package/dist/commands/init.js.map +1 -1
  10. package/dist/commands/install.d.ts +4 -0
  11. package/dist/commands/install.js +40 -37
  12. package/dist/commands/install.js.map +1 -1
  13. package/dist/commands/launch.d.ts +2 -1
  14. package/dist/commands/launch.js +18 -14
  15. package/dist/commands/launch.js.map +1 -1
  16. package/dist/commands/patch-provider.d.ts +225 -307
  17. package/dist/commands/patch-provider.js +92 -296
  18. package/dist/commands/patch-provider.js.map +1 -1
  19. package/dist/commands/status.js +7 -10
  20. package/dist/commands/status.js.map +1 -1
  21. package/dist/commands/sync.d.ts +4 -0
  22. package/dist/commands/sync.js +38 -35
  23. package/dist/commands/sync.js.map +1 -1
  24. package/dist/index.d.ts +25 -5
  25. package/dist/index.js +73 -34
  26. package/dist/index.js.map +1 -1
  27. package/dist/lib/agent-tool-catalog.d.ts +1 -1
  28. package/dist/lib/agent-tool-catalog.js +3 -6
  29. package/dist/lib/agent-tool-catalog.js.map +1 -1
  30. package/dist/lib/agent-tool-contract.d.ts +22 -13
  31. package/dist/lib/agent-tool-contract.js +20 -20
  32. package/dist/lib/agent-tool-contract.js.map +1 -1
  33. package/dist/lib/analytics/types.d.ts +7 -1
  34. package/dist/lib/analytics/types.js +2 -2
  35. package/dist/lib/analytics/types.js.map +1 -1
  36. package/dist/lib/config-layers.d.ts +28 -6
  37. package/dist/lib/config-layers.js +268 -73
  38. package/dist/lib/config-layers.js.map +1 -1
  39. package/dist/lib/managed-agents.d.ts +24 -2
  40. package/dist/lib/managed-agents.js +45 -15
  41. package/dist/lib/managed-agents.js.map +1 -1
  42. package/dist/lib/model-roles.d.ts +5 -0
  43. package/dist/lib/model-roles.js +22 -1
  44. package/dist/lib/model-roles.js.map +1 -1
  45. package/dist/lib/opencode/agent-registrations.d.ts +4 -4
  46. package/dist/lib/opencode/agent-registrations.js +386 -197
  47. package/dist/lib/opencode/agent-registrations.js.map +1 -1
  48. package/dist/lib/opencode/inspection.d.ts +13 -13
  49. package/dist/lib/opencode/inspection.js +69 -106
  50. package/dist/lib/opencode/inspection.js.map +1 -1
  51. package/dist/lib/opencode/model-overrides.d.ts +2 -2
  52. package/dist/lib/opencode/model-overrides.js +192 -47
  53. package/dist/lib/opencode/model-overrides.js.map +1 -1
  54. package/dist/lib/opencode/paths.d.ts +6 -2
  55. package/dist/lib/opencode/paths.js +12 -11
  56. package/dist/lib/opencode/paths.js.map +1 -1
  57. package/dist/lib/opencode/plugin-registration.d.ts +10 -11
  58. package/dist/lib/opencode/plugin-registration.js +76 -138
  59. package/dist/lib/opencode/plugin-registration.js.map +1 -1
  60. package/dist/lib/opencode/shared-utils.d.ts +47 -3
  61. package/dist/lib/opencode/shared-utils.js +346 -15
  62. package/dist/lib/opencode/shared-utils.js.map +1 -1
  63. package/dist/lib/opencode.d.ts +5 -6
  64. package/dist/lib/opencode.js +10 -10
  65. package/dist/lib/opencode.js.map +1 -1
  66. package/dist/lib/vvoc-config.js +4 -4
  67. package/dist/lib/vvoc-config.js.map +1 -1
  68. package/dist/lib/vvoc-paths.d.ts +7 -0
  69. package/dist/lib/vvoc-paths.js +15 -1
  70. package/dist/lib/vvoc-paths.js.map +1 -1
  71. package/dist/lib/vvoc-preset-registry.d.ts +38 -50
  72. package/dist/lib/vvoc-preset-registry.js +38 -48
  73. package/dist/lib/vvoc-preset-registry.js.map +1 -1
  74. package/dist/plugins/analytics/index.d.ts +20 -14
  75. package/dist/plugins/analytics/index.js +281 -133
  76. package/dist/plugins/analytics/index.js.map +1 -1
  77. package/dist/plugins/guardian/index.d.ts +63 -42
  78. package/dist/plugins/guardian/index.js +217 -759
  79. package/dist/plugins/guardian/index.js.map +1 -1
  80. package/dist/plugins/hashline-edit/index.d.ts +145 -31
  81. package/dist/plugins/hashline-edit/index.js +679 -244
  82. package/dist/plugins/hashline-edit/index.js.map +1 -1
  83. package/dist/plugins/hashline-edit/schemas.d.ts +1 -1
  84. package/dist/plugins/hashline-edit/schemas.js +3 -3
  85. package/dist/plugins/hashline-edit/schemas.js.map +1 -1
  86. package/dist/plugins/model-roles/index.d.ts +18 -4
  87. package/dist/plugins/model-roles/index.js +44 -181
  88. package/dist/plugins/model-roles/index.js.map +1 -1
  89. package/dist/plugins/peak-hours/index.d.ts +23 -23
  90. package/dist/plugins/peak-hours/index.js +211 -180
  91. package/dist/plugins/peak-hours/index.js.map +1 -1
  92. package/dist/plugins/secrets-redaction/deep.js +35 -51
  93. package/dist/plugins/secrets-redaction/deep.js.map +1 -1
  94. package/dist/plugins/secrets-redaction/index.d.ts +96 -8
  95. package/dist/plugins/secrets-redaction/index.js +290 -102
  96. package/dist/plugins/secrets-redaction/index.js.map +1 -1
  97. package/dist/plugins/secrets-redaction/session.d.ts +9 -0
  98. package/dist/plugins/secrets-redaction/session.js +21 -4
  99. package/dist/plugins/secrets-redaction/session.js.map +1 -1
  100. package/dist/plugins/secrets-redaction/stream.d.ts +92 -0
  101. package/dist/plugins/secrets-redaction/stream.js +772 -0
  102. package/dist/plugins/secrets-redaction/stream.js.map +1 -0
  103. package/dist/plugins/spec-guard/index.d.ts +49 -18
  104. package/dist/plugins/spec-guard/index.js +231 -129
  105. package/dist/plugins/spec-guard/index.js.map +1 -1
  106. package/dist/plugins/system-context-injection/index.d.ts +10 -4
  107. package/dist/plugins/system-context-injection/index.js +271 -78
  108. package/dist/plugins/system-context-injection/index.js.map +1 -1
  109. package/dist/plugins/tool-history-compaction/index.d.ts +26 -4
  110. package/dist/plugins/tool-history-compaction/index.js +170 -32
  111. package/dist/plugins/tool-history-compaction/index.js.map +1 -1
  112. package/dist/plugins/tool-history-compaction/transform.d.ts +47 -16
  113. package/dist/plugins/tool-history-compaction/transform.js +173 -55
  114. package/dist/plugins/tool-history-compaction/transform.js.map +1 -1
  115. package/dist/plugins/web-tools/fetch-service.d.ts +51 -13
  116. package/dist/plugins/web-tools/fetch-service.js +106 -75
  117. package/dist/plugins/web-tools/fetch-service.js.map +1 -1
  118. package/dist/plugins/web-tools/index.d.ts +58 -16
  119. package/dist/plugins/web-tools/index.js +202 -91
  120. package/dist/plugins/web-tools/index.js.map +1 -1
  121. package/dist/plugins/web-tools/media-loader.d.ts +3 -3
  122. package/dist/plugins/web-tools/media-loader.js +3 -3
  123. package/dist/plugins/web-tools/media-loader.js.map +1 -1
  124. package/dist/plugins/web-tools/providers/native-fetch.d.ts +2 -2
  125. package/dist/plugins/web-tools/providers/native-fetch.js +1 -1
  126. package/dist/plugins/web-tools/providers/native-fetch.js.map +1 -1
  127. package/dist/plugins/web-tools/providers/spider.d.ts +2 -2
  128. package/dist/plugins/web-tools/providers/spider.js +1 -1
  129. package/dist/plugins/web-tools/providers/spider.js.map +1 -1
  130. package/dist/plugins/web-tools/providers/zai.d.ts +2 -2
  131. package/dist/plugins/web-tools/providers/zai.js +1 -1
  132. package/dist/plugins/web-tools/providers/zai.js.map +1 -1
  133. package/dist/plugins/web-tools/schemas.d.ts +1 -1
  134. package/dist/plugins/web-tools/schemas.js +3 -3
  135. package/dist/plugins/web-tools/schemas.js.map +1 -1
  136. package/dist/plugins/web-tools/search-service.d.ts +81 -12
  137. package/dist/plugins/web-tools/search-service.js +104 -57
  138. package/dist/plugins/web-tools/search-service.js.map +1 -1
  139. package/dist/plugins/workflow/authorization.d.ts +44 -10
  140. package/dist/plugins/workflow/authorization.js +113 -73
  141. package/dist/plugins/workflow/authorization.js.map +1 -1
  142. package/dist/plugins/workflow/cancellation.d.ts +86 -0
  143. package/dist/plugins/workflow/cancellation.js +202 -0
  144. package/dist/plugins/workflow/cancellation.js.map +1 -0
  145. package/dist/plugins/workflow/checkpoints.d.ts +7 -1
  146. package/dist/plugins/workflow/checkpoints.js +141 -21
  147. package/dist/plugins/workflow/checkpoints.js.map +1 -1
  148. package/dist/plugins/workflow/delegated.d.ts +14 -0
  149. package/dist/plugins/workflow/delegated.js +6 -5
  150. package/dist/plugins/workflow/delegated.js.map +1 -1
  151. package/dist/plugins/workflow/host.d.ts +81 -0
  152. package/dist/plugins/workflow/host.js +189 -0
  153. package/dist/plugins/workflow/host.js.map +1 -0
  154. package/dist/plugins/workflow/index.d.ts +69 -4
  155. package/dist/plugins/workflow/index.js +1391 -1026
  156. package/dist/plugins/workflow/index.js.map +1 -1
  157. package/dist/plugins/workflow/recovery.d.ts +3 -5
  158. package/dist/plugins/workflow/recovery.js +18 -33
  159. package/dist/plugins/workflow/recovery.js.map +1 -1
  160. package/dist/plugins/workflow/repair.d.ts +31 -5
  161. package/dist/plugins/workflow/repair.js +116 -48
  162. package/dist/plugins/workflow/repair.js.map +1 -1
  163. package/dist/plugins/workflow/results.d.ts +31 -31
  164. package/dist/plugins/workflow/results.js +4 -4
  165. package/dist/plugins/workflow/results.js.map +1 -1
  166. package/dist/plugins/workflow/schemas.d.ts +3 -3
  167. package/dist/plugins/workflow/schemas.js +5 -5
  168. package/dist/plugins/workflow/schemas.js.map +1 -1
  169. package/dist/plugins/workflow/system-instruction.md +4 -0
  170. package/dist/plugins/workflow/tooling.d.ts +6 -0
  171. package/dist/plugins/workflow/tooling.js +3 -1
  172. package/dist/plugins/workflow/tooling.js.map +1 -1
  173. package/dist/runtime/auxiliary.d.ts +13 -0
  174. package/dist/runtime/auxiliary.js +108 -0
  175. package/dist/runtime/auxiliary.js.map +1 -0
  176. package/dist/runtime/client.d.ts +88 -0
  177. package/dist/runtime/client.js +174 -0
  178. package/dist/runtime/client.js.map +1 -0
  179. package/dist/runtime/context-inspection-contract.d.ts +397 -0
  180. package/dist/runtime/context-inspection-contract.js +622 -0
  181. package/dist/runtime/context-inspection-contract.js.map +1 -0
  182. package/dist/runtime/context-inspection.d.ts +52 -0
  183. package/dist/runtime/context-inspection.js +324 -0
  184. package/dist/runtime/context-inspection.js.map +1 -0
  185. package/dist/runtime/context.d.ts +192 -0
  186. package/dist/runtime/context.js +1246 -0
  187. package/dist/runtime/context.js.map +1 -0
  188. package/dist/runtime/coordination.d.ts +40 -0
  189. package/dist/runtime/coordination.js +87 -0
  190. package/dist/runtime/coordination.js.map +1 -0
  191. package/dist/runtime/model-registry.d.ts +34 -0
  192. package/dist/runtime/model-registry.js +227 -0
  193. package/dist/runtime/model-registry.js.map +1 -0
  194. package/dist/runtime/permissions.d.ts +20 -0
  195. package/dist/runtime/permissions.js +250 -0
  196. package/dist/runtime/permissions.js.map +1 -0
  197. package/dist/runtime/snapshot-config.d.ts +80 -0
  198. package/dist/runtime/snapshot-config.js +268 -0
  199. package/dist/runtime/snapshot-config.js.map +1 -0
  200. package/dist/runtime/snapshot-store.d.ts +25 -0
  201. package/dist/runtime/snapshot-store.js +519 -0
  202. package/dist/runtime/snapshot-store.js.map +1 -0
  203. package/dist/runtime/snapshots.d.ts +59 -0
  204. package/dist/runtime/snapshots.js +721 -0
  205. package/dist/runtime/snapshots.js.map +1 -0
  206. package/dist/runtime/types.d.ts +713 -0
  207. package/dist/runtime/types.js +190 -0
  208. package/dist/runtime/types.js.map +1 -0
  209. package/dist/tui/analytics/indicator.d.ts +25 -26
  210. package/dist/tui/analytics/indicator.js +66 -74
  211. package/dist/tui/analytics/indicator.js.map +1 -1
  212. package/dist/tui/branding/footer.d.ts +7 -12
  213. package/dist/tui/branding/footer.js +16 -24
  214. package/dist/tui/branding/footer.js.map +1 -1
  215. package/dist/tui/context/analyze.d.ts +20 -9
  216. package/dist/tui/context/analyze.js +295 -257
  217. package/dist/tui/context/analyze.js.map +1 -1
  218. package/dist/tui/context/collect.d.ts +29 -3
  219. package/dist/tui/context/collect.js +450 -66
  220. package/dist/tui/context/collect.js.map +1 -1
  221. package/dist/tui/context/plugin.d.ts +21 -7
  222. package/dist/tui/context/plugin.js +65 -70
  223. package/dist/tui/context/plugin.js.map +1 -1
  224. package/dist/tui/context/types.d.ts +174 -43
  225. package/dist/tui/context/types.js +25 -19
  226. package/dist/tui/context/types.js.map +1 -1
  227. package/dist/tui/context/view.d.ts +33 -7
  228. package/dist/tui/context/view.js +136 -81
  229. package/dist/tui/context/view.js.map +1 -1
  230. package/dist/tui/peak-hours/banner.d.ts +13 -11
  231. package/dist/tui/peak-hours/banner.js +48 -80
  232. package/dist/tui/peak-hours/banner.js.map +1 -1
  233. package/dist/tui/policy.d.ts +69 -0
  234. package/dist/tui/policy.js +169 -0
  235. package/dist/tui/policy.js.map +1 -0
  236. package/dist/tui.d.ts +3 -8
  237. package/dist/tui.js +72 -68
  238. package/dist/tui.js.map +1 -1
  239. package/package.json +19 -15
  240. package/schemas/vvoc/v3.json +1 -1
  241. package/server.js +3 -5
  242. package/templates/agents/enhancer.md +10 -5
  243. package/templates/agents/guardian.md +10 -4
  244. package/templates/agents/investigator.md +4 -2
  245. package/templates/agents/vv-code-reviewer.md +4 -2
  246. package/templates/agents/vv-spec-reviewer.md +4 -2
  247. package/templates/skills/vv-execute/references/tool-contracts.md +1 -1
  248. package/tui.js +3 -5
  249. package/dist/plugins/analytics/v2.d.ts +0 -21
  250. package/dist/plugins/analytics/v2.js +0 -133
  251. package/dist/plugins/analytics/v2.js.map +0 -1
  252. package/dist/plugins/guardian/v2.d.ts +0 -13
  253. package/dist/plugins/guardian/v2.js +0 -204
  254. package/dist/plugins/guardian/v2.js.map +0 -1
  255. package/dist/plugins/hashline-edit/v2.d.ts +0 -12
  256. package/dist/plugins/hashline-edit/v2.js +0 -145
  257. package/dist/plugins/hashline-edit/v2.js.map +0 -1
  258. package/dist/plugins/model-roles/v2.d.ts +0 -24
  259. package/dist/plugins/model-roles/v2.js +0 -274
  260. package/dist/plugins/model-roles/v2.js.map +0 -1
  261. package/dist/plugins/peak-hours/v2.d.ts +0 -12
  262. package/dist/plugins/peak-hours/v2.js +0 -99
  263. package/dist/plugins/peak-hours/v2.js.map +0 -1
  264. package/dist/plugins/secrets-redaction/v2.d.ts +0 -19
  265. package/dist/plugins/secrets-redaction/v2.js +0 -138
  266. package/dist/plugins/secrets-redaction/v2.js.map +0 -1
  267. package/dist/plugins/spec-guard/v2.d.ts +0 -12
  268. package/dist/plugins/spec-guard/v2.js +0 -139
  269. package/dist/plugins/spec-guard/v2.js.map +0 -1
  270. package/dist/plugins/system-context-injection/agent-contexts.d.ts +0 -5
  271. package/dist/plugins/system-context-injection/agent-contexts.js +0 -164
  272. package/dist/plugins/system-context-injection/agent-contexts.js.map +0 -1
  273. package/dist/plugins/system-context-injection/v2.d.ts +0 -13
  274. package/dist/plugins/system-context-injection/v2.js +0 -60
  275. package/dist/plugins/system-context-injection/v2.js.map +0 -1
  276. package/dist/plugins/tool-history-compaction/v2.d.ts +0 -11
  277. package/dist/plugins/tool-history-compaction/v2.js +0 -56
  278. package/dist/plugins/tool-history-compaction/v2.js.map +0 -1
  279. package/dist/plugins/v2-runtime/config-watcher.d.ts +0 -26
  280. package/dist/plugins/v2-runtime/config-watcher.js +0 -111
  281. package/dist/plugins/v2-runtime/config-watcher.js.map +0 -1
  282. package/dist/plugins/v2-runtime/index.d.ts +0 -50
  283. package/dist/plugins/v2-runtime/index.js +0 -114
  284. package/dist/plugins/v2-runtime/index.js.map +0 -1
  285. package/dist/plugins/v2-runtime/location-config.d.ts +0 -51
  286. package/dist/plugins/v2-runtime/location-config.js +0 -91
  287. package/dist/plugins/v2-runtime/location-config.js.map +0 -1
  288. package/dist/plugins/v2-runtime/setup.d.ts +0 -48
  289. package/dist/plugins/v2-runtime/setup.js +0 -174
  290. package/dist/plugins/v2-runtime/setup.js.map +0 -1
  291. package/dist/plugins/web-tools/v2.d.ts +0 -11
  292. package/dist/plugins/web-tools/v2.js +0 -99
  293. package/dist/plugins/web-tools/v2.js.map +0 -1
  294. package/dist/plugins/workflow/v2.d.ts +0 -76
  295. package/dist/plugins/workflow/v2.js +0 -283
  296. package/dist/plugins/workflow/v2.js.map +0 -1
@@ -11,13 +11,14 @@
11
11
  //
12
12
  // START_MODULE_MAP
13
13
  // default - Sync command definition for vvoc-managed config files.
14
+ // runSync - Testable sync flow with injectable native host verification.
14
15
  // END_MODULE_MAP
15
16
  //
16
17
  // START_CHANGE_SUMMARY
17
- // LAST_CHANGE: [v0.5.0 - Added a preflight readVvocConfig validation so an invalid existing vvoc.json fails loudly before any sync mutation instead of after a partial write.]
18
+ // LAST_CHANGE: [C-OPENCODE-V2-NATIVE T-007 - Added a fail-closed native host window preflight and extracted an injectable runSync flow.]
18
19
  // END_CHANGE_SUMMARY
19
20
  import { defineCommand } from "citty";
20
- import { describeWriteResult, ensureManagedSkillSymlink, ensurePackageInstalled, ensureTuiPackageInstalled, resolvePaths, readVvocConfig, syncManagedAgentPrompts, syncManagedAgentRegistrations, syncVvocConfig, syncManagedSkillFiles, } from "../lib/opencode.js";
21
+ import { assertSupportedOpenCodeRuntime, describeWriteResult, ensureManagedSkillSymlink, ensurePackageInstalled, resolvePaths, readVvocConfig, syncManagedAgentPrompts, syncManagedAgentRegistrations, syncVvocConfig, syncManagedSkillFiles, } from "../lib/opencode.js";
21
22
  export default defineCommand({
22
23
  meta: {
23
24
  name: "sync",
@@ -40,39 +41,41 @@ export default defineCommand({
40
41
  },
41
42
  },
42
43
  async run({ args }) {
43
- // START_BLOCK_APPLY_SYNC_COMMAND
44
- const scope = args.scope === "project" ? "project" : "global";
45
- const configDir = typeof args["config-dir"] === "string" ? args["config-dir"] : undefined;
46
- const paths = await resolvePaths({
47
- scope: scope,
48
- cwd: process.cwd(),
49
- configDir,
50
- });
51
- // Preflight: strictly validate any existing vvoc.json before mutating
52
- // anything, so an invalid config fails loudly up front instead of after a
53
- // partial sync.
54
- await readVvocConfig(paths);
55
- const opencode = await ensurePackageInstalled(paths);
56
- const tui = await ensureTuiPackageInstalled(paths);
57
- const managedAgents = await syncManagedAgentRegistrations(paths);
58
- const managedPrompts = await syncManagedAgentPrompts(paths, { force: Boolean(args.force) });
59
- const managedSkills = await syncManagedSkillFiles(paths, { force: Boolean(args.force) });
60
- const vvocConfig = await syncVvocConfig(paths);
61
- console.log(`${opencode.changed ? "Updated" : "Kept"} ${opencode.path}`);
62
- console.log(describeWriteResult(tui));
63
- console.log(`${managedAgents.changed ? "Updated" : "Kept"} ${managedAgents.path} (managed agents)`);
64
- for (const result of managedPrompts) {
65
- console.log(describeWriteResult(result));
66
- }
67
- for (const result of managedSkills) {
68
- console.log(describeWriteResult(result));
69
- }
70
- console.log(describeWriteResult(vvocConfig));
71
- if (paths.scope === "global") {
72
- const symlinkResult = await ensureManagedSkillSymlink(configDir);
73
- console.log(describeWriteResult(symlinkResult));
74
- }
75
- // END_BLOCK_APPLY_SYNC_COMMAND
44
+ await runSync(args);
76
45
  },
77
46
  });
47
+ export async function runSync(args, options = {}) {
48
+ // START_BLOCK_APPLY_SYNC_COMMAND
49
+ const scope = args.scope === "project" ? "project" : "global";
50
+ const configDir = typeof args["config-dir"] === "string" ? args["config-dir"] : undefined;
51
+ const paths = await resolvePaths({
52
+ scope: scope,
53
+ cwd: process.cwd(),
54
+ configDir,
55
+ });
56
+ // Preflight: fail closed on an unverifiable or out-of-window host, and
57
+ // strictly validate any existing vvoc.json, before mutating anything so the
58
+ // command fails loudly up front instead of after a partial sync.
59
+ await assertSupportedOpenCodeRuntime(options.inspectRuntime);
60
+ await readVvocConfig(paths);
61
+ const opencode = await ensurePackageInstalled(paths);
62
+ const managedAgents = await syncManagedAgentRegistrations(paths);
63
+ const managedPrompts = await syncManagedAgentPrompts(paths, { force: Boolean(args.force) });
64
+ const managedSkills = await syncManagedSkillFiles(paths, { force: Boolean(args.force) });
65
+ const vvocConfig = await syncVvocConfig(paths);
66
+ console.log(`${opencode.changed ? "Updated" : "Kept"} ${opencode.path}`);
67
+ console.log(`${managedAgents.changed ? "Updated" : "Kept"} ${managedAgents.path} (managed agents)`);
68
+ for (const result of managedPrompts) {
69
+ console.log(describeWriteResult(result));
70
+ }
71
+ for (const result of managedSkills) {
72
+ console.log(describeWriteResult(result));
73
+ }
74
+ console.log(describeWriteResult(vvocConfig));
75
+ if (paths.scope === "global") {
76
+ const symlinkResult = await ensureManagedSkillSymlink(configDir);
77
+ console.log(describeWriteResult(symlinkResult));
78
+ }
79
+ // END_BLOCK_APPLY_SYNC_COMMAND
80
+ }
78
81
  //# sourceMappingURL=sync.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,iBAAiB;AACjB,wBAAwB;AACxB,iIAAiI;AACjI,mMAAmM;AACnM,0CAA0C;AAC1C,0CAA0C;AAC1C,kBAAkB;AAClB,sBAAsB;AACtB,sBAAsB;AACtB,EAAE;AACF,mBAAmB;AACnB,qEAAqE;AACrE,iBAAiB;AACjB,EAAE;AACF,uBAAuB;AACvB,iLAAiL;AACjL,qBAAqB;AAErB,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,yBAAyB,EACzB,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,6BAA6B,EAC7B,cAAc,EACd,qBAAqB,GAEtB,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;Y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,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC,CAAC;IAClD,CAAC;IACD,+BAA+B;AACjC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,27 @@
1
+ import { Plugin } from "@opencode/plugin";
2
+ export { GuardianPlugin } from "./plugins/guardian/index.js";
3
+ export { HashlineEditPlugin } from "./plugins/hashline-edit/index.js";
4
+ export { ModelRolesPlugin } from "./plugins/model-roles/index.js";
5
+ export { SystemContextInjectionPlugin } from "./plugins/system-context-injection/index.js";
6
+ export { WorkflowPlugin } from "./plugins/workflow/index.js";
7
+ export { SecretsRedactionPlugin } from "./plugins/secrets-redaction.js";
8
+ export { WebToolsPlugin } from "./plugins/web-tools/index.js";
9
+ export { ToolHistoryCompactionPlugin } from "./plugins/tool-history-compaction/index.js";
10
+ export { AnalyticsPlugin } from "./plugins/analytics/index.js";
11
+ export { PeakHoursPlugin } from "./plugins/peak-hours/index.js";
12
+ export { SpecGuardPlugin } from "./plugins/spec-guard/index.js";
1
13
  /**
2
- * v1 plugin factories in the historical named-export load order from the
3
- * pre-migration root module, so hook trigger order stays deterministic.
14
+ * The eleven native server plugins in deterministic setup order. Model roles is
15
+ * first so the shared snapshot runtime exists before every consumer acquires it;
16
+ * every plugin still tolerates being set up standalone.
4
17
  */
5
- export declare const V1_PLUGIN_ORDER: import("@opencode-ai/plugin").Plugin[];
6
- declare const _default: import("./plugins/v2-runtime/index.js").DualPlugin;
7
- export default _default;
18
+ export declare const VVOC_SERVER_PLUGINS: readonly Plugin.Plugin[];
19
+ /**
20
+ * Native aggregate server plugin. Every plugin is set up against the exact same
21
+ * Context so the shared runtime is keyed once. A partial setup failure disposes
22
+ * the already-registered cleanups in reverse order before rethrowing the original
23
+ * error; a successful setup tears everything down in reverse order on cleanup.
24
+ */
25
+ declare const VvocPlugin: Plugin.Plugin;
26
+ export { VvocPlugin };
27
+ export default VvocPlugin;
package/dist/index.js CHANGED
@@ -1,63 +1,102 @@
1
1
  // FILE: src/index.ts
2
- // VERSION: 2.0.0
2
+ // VERSION: 1.1.0
3
3
  // START_MODULE_CONTRACT
4
- // PURPOSE: Publish the dual-runtime vv-opencode package entrypoint that loads under OpenCode v1 (>= 1.18.29 via server()) and OpenCode v2 (>= 2.0.18 via setup()).
5
- // SCOPE: Package-root default export aggregating the eleven vvoc server plugins for the v1 runtime and delegating to the v2 runtime adapter for the v2 runtime; no named plugin exports remain at the root so neither runtime can double-register.
6
- // DEPENDS: [src/plugins/v2-runtime/index.ts, src/plugins/guardian/index.ts, src/plugins/hashline-edit/index.ts, src/plugins/model-roles/index.ts, src/plugins/system-context-injection/index.ts, src/plugins/workflow/index.ts, src/plugins/secrets-redaction/index.ts, src/plugins/web-tools/index.ts, src/plugins/tool-history-compaction/index.ts, src/plugins/analytics/index.ts, src/plugins/peak-hours/index.ts, src/plugins/spec-guard/index.ts]
7
- // LINKS: [M-PLUGIN-V2-RUNTIME, M-PLUGIN-GUARDIAN, M-PLUGIN-HASHLINE-EDIT, M-PLUGIN-MODEL-ROLES, M-PLUGIN-SYSTEM-CONTEXT-INJECTION, M-PLUGIN-WORKFLOW, M-PLUGIN-SECRETS-REDACTION, M-PLUGIN-WEB-TOOLS, M-PLUGIN-TOOL-HISTORY-COMPACTION, M-PLUGIN-ANALYTICS, M-PLUGIN-PEAK-HOURS, M-PLUGIN-SPEC-GUARD]
8
- // ROLE: RUNTIME
9
- // MAP_MODE: EXPORTS
4
+ // PURPOSE: Re-export the public vv-opencode plugin entrypoints from the package root and assemble them into one native aggregate server plugin.
5
+ // SCOPE: Package-root exports for GuardianPlugin, HashlineEditPlugin, ModelRolesPlugin, SystemContextInjectionPlugin, WorkflowPlugin, SecretsRedactionPlugin, WebToolsPlugin, ToolHistoryCompactionPlugin, AnalyticsPlugin, PeakHoursPlugin, and SpecGuardPlugin, plus the native default definition that sets all eleven up against one shared Context with complete reverse-order teardown and partial-setup rollback.
6
+ // DEPENDS: [@opencode/plugin, src/plugins/guardian/index.ts, src/plugins/hashline-edit/index.ts, src/plugins/model-roles/index.ts, src/plugins/system-context-injection/index.ts, src/plugins/workflow/index.ts, src/plugins/secrets-redaction.ts, src/plugins/web-tools/index.ts, src/plugins/tool-history-compaction/index.ts, src/plugins/analytics/index.ts, src/plugins/peak-hours/index.ts, src/plugins/spec-guard/index.ts]
7
+ // LINKS: [M-PLUGIN-GUARDIAN, M-PLUGIN-HASHLINE-EDIT, M-PLUGIN-MODEL-ROLES, M-PLUGIN-SYSTEM-CONTEXT-INJECTION, M-PLUGIN-WORKFLOW, M-PLUGIN-SECRETS-REDACTION, M-PLUGIN-WEB-TOOLS, M-PLUGIN-TOOL-HISTORY-COMPACTION, M-PLUGIN-ANALYTICS, M-PLUGIN-PEAK-HOURS, M-PLUGIN-SPEC-GUARD]
8
+ // ROLE: BARREL
9
+ // MAP_MODE: SUMMARY
10
10
  // END_MODULE_CONTRACT
11
11
  //
12
12
  // START_MODULE_MAP
13
- // default - Dual-runtime vvoc plugin entrypoint: v2 setup() through the v2 runtime adapter, v1 server() aggregating all server plugins.
14
- // V1_PLUGIN_ORDER - Registration order of the v1 plugin factories, preserving the pre-migration named-export load order.
13
+ // GuardianPlugin, HashlineEditPlugin, ModelRolesPlugin, SystemContextInjectionPlugin, WorkflowPlugin, SecretsRedactionPlugin, WebToolsPlugin, ToolHistoryCompactionPlugin, AnalyticsPlugin, PeakHoursPlugin, SpecGuardPlugin - Public plugin exports available from @osovv/vv-opencode.
14
+ // VVOC_SERVER_PLUGINS - The eleven native server plugins in deterministic setup order (model roles first so the shared snapshot runtime exists before consumers).
15
+ // VvocPlugin - Native aggregate server plugin that sets up all eleven plugins on one Context and tears them down in reverse order.
16
+ // default - Native default server plugin definition loaded by OpenCode from the package or a local directory.
15
17
  // END_MODULE_MAP
16
18
  //
17
19
  // START_CHANGE_SUMMARY
18
- // LAST_CHANGE: [C-OPENCODE-V2-MIGRATION - Replaced the eleven named root plugin exports with one dual-runtime default export; per-plugin factories remain available through their ./plugins/* subpath dual entrypoints.]
20
+ // LAST_CHANGE: [C-OPENCODE-V2-NATIVE T-009 - Added the native aggregate default that sets up all eleven plugins on one shared Context with reverse-order teardown and partial-setup rollback.]
21
+ // PREVIOUS: [C-SPEC-IDENTITY-LINT - Added SpecGuardPlugin to the package-root exports.]
19
22
  // END_CHANGE_SUMMARY
20
- import { aggregateV1Plugins, defineDualPlugin } from "./plugins/v2-runtime/index.js";
23
+ import { Plugin } from "@opencode/plugin";
24
+ import { AnalyticsPlugin } from "./plugins/analytics/index.js";
21
25
  import { GuardianPlugin } from "./plugins/guardian/index.js";
22
26
  import { HashlineEditPlugin } from "./plugins/hashline-edit/index.js";
23
27
  import { ModelRolesPlugin } from "./plugins/model-roles/index.js";
24
- import { SystemContextInjectionPlugin } from "./plugins/system-context-injection/index.js";
25
- import { WorkflowPlugin } from "./plugins/workflow/index.js";
26
- import { SecretsRedactionPlugin } from "./plugins/secrets-redaction/index.js";
27
- import { WebToolsPlugin } from "./plugins/web-tools/index.js";
28
- import { ToolHistoryCompactionPlugin } from "./plugins/tool-history-compaction/index.js";
29
- import { AnalyticsPlugin } from "./plugins/analytics/index.js";
30
28
  import { PeakHoursPlugin } from "./plugins/peak-hours/index.js";
29
+ import { SecretsRedactionPlugin } from "./plugins/secrets-redaction.js";
31
30
  import { SpecGuardPlugin } from "./plugins/spec-guard/index.js";
32
- import { setupV2Plugins } from "./plugins/v2-runtime/setup.js";
33
- // START_BLOCK_V1_PLUGIN_ORDER
31
+ import { SystemContextInjectionPlugin } from "./plugins/system-context-injection/index.js";
32
+ import { ToolHistoryCompactionPlugin } from "./plugins/tool-history-compaction/index.js";
33
+ import { WebToolsPlugin } from "./plugins/web-tools/index.js";
34
+ import { WorkflowPlugin } from "./plugins/workflow/index.js";
35
+ export { GuardianPlugin } from "./plugins/guardian/index.js";
36
+ export { HashlineEditPlugin } from "./plugins/hashline-edit/index.js";
37
+ export { ModelRolesPlugin } from "./plugins/model-roles/index.js";
38
+ export { SystemContextInjectionPlugin } from "./plugins/system-context-injection/index.js";
39
+ export { WorkflowPlugin } from "./plugins/workflow/index.js";
40
+ export { SecretsRedactionPlugin } from "./plugins/secrets-redaction.js";
41
+ export { WebToolsPlugin } from "./plugins/web-tools/index.js";
42
+ export { ToolHistoryCompactionPlugin } from "./plugins/tool-history-compaction/index.js";
43
+ export { AnalyticsPlugin } from "./plugins/analytics/index.js";
44
+ export { PeakHoursPlugin } from "./plugins/peak-hours/index.js";
45
+ export { SpecGuardPlugin } from "./plugins/spec-guard/index.js";
46
+ // START_BLOCK_AGGREGATE
34
47
  /**
35
- * v1 plugin factories in the historical named-export load order from the
36
- * pre-migration root module, so hook trigger order stays deterministic.
48
+ * The eleven native server plugins in deterministic setup order. Model roles is
49
+ * first so the shared snapshot runtime exists before every consumer acquires it;
50
+ * every plugin still tolerates being set up standalone.
37
51
  */
38
- export const V1_PLUGIN_ORDER = [
52
+ export const VVOC_SERVER_PLUGINS = [
53
+ ModelRolesPlugin,
54
+ SecretsRedactionPlugin,
39
55
  GuardianPlugin,
40
56
  HashlineEditPlugin,
41
- ModelRolesPlugin,
57
+ WebToolsPlugin,
42
58
  SystemContextInjectionPlugin,
43
59
  WorkflowPlugin,
44
- SecretsRedactionPlugin,
45
- WebToolsPlugin,
46
60
  ToolHistoryCompactionPlugin,
47
61
  AnalyticsPlugin,
48
62
  PeakHoursPlugin,
49
63
  SpecGuardPlugin,
50
64
  ];
51
- // END_BLOCK_V1_PLUGIN_ORDER
52
- // START_BLOCK_DUAL_ROOT_ENTRY
53
- export default defineDualPlugin({
65
+ /**
66
+ * Native aggregate server plugin. Every plugin is set up against the exact same
67
+ * Context so the shared runtime is keyed once. A partial setup failure disposes
68
+ * the already-registered cleanups in reverse order before rethrowing the original
69
+ * error; a successful setup tears everything down in reverse order on cleanup.
70
+ */
71
+ const VvocPlugin = Plugin.define({
54
72
  id: "vvoc",
55
- async v1(input, options) {
56
- return aggregateV1Plugins(V1_PLUGIN_ORDER, input, options, (error, index) => {
57
- console.error(`[vvoc][v1-runtime] plugin ${V1_PLUGIN_ORDER[index]?.name ?? `#${index}`} failed to load: ${String(error)}`);
58
- });
73
+ async setup(ctx) {
74
+ const cleanups = [];
75
+ for (const plugin of VVOC_SERVER_PLUGINS) {
76
+ try {
77
+ const cleanup = await plugin.setup(ctx);
78
+ if (typeof cleanup === "function")
79
+ cleanups.push(cleanup);
80
+ }
81
+ catch (error) {
82
+ for (const cleanup of cleanups.reverse()) {
83
+ try {
84
+ await cleanup();
85
+ }
86
+ catch {
87
+ // Preserve the original setup failure; every cleanup is still attempted.
88
+ }
89
+ }
90
+ throw error;
91
+ }
92
+ }
93
+ return async () => {
94
+ for (const cleanup of cleanups.reverse())
95
+ await cleanup();
96
+ };
59
97
  },
60
- v2: setupV2Plugins,
61
98
  });
62
- // END_BLOCK_DUAL_ROOT_ENTRY
99
+ export { VvocPlugin };
100
+ export default VvocPlugin;
101
+ // END_BLOCK_AGGREGATE
63
102
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,iBAAiB;AACjB,wBAAwB;AACxB,qKAAqK;AACrK,qPAAqP;AACrP,0bAA0b;AAC1b,wSAAwS;AACxS,kBAAkB;AAClB,sBAAsB;AACtB,sBAAsB;AACtB,EAAE;AACF,mBAAmB;AACnB,0IAA0I;AAC1I,2HAA2H;AAC3H,iBAAiB;AACjB,EAAE;AACF,uBAAuB;AACvB,2NAA2N;AAC3N,qBAAqB;AAErB,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,4BAA4B,EA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M,OAAO,EAAE,CAAC;QAC5D,CAAC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,eAAe,UAAU,CAAC;AAC1B,sBAAsB"}
@@ -1,4 +1,4 @@
1
- import type { ZodRawShape, ZodType } from "zod";
1
+ import { type ZodRawShape, type ZodType } from "zod";
2
2
  import { type ContractIssue, type OwnedToolContract } from "./agent-tool-contract.js";
3
3
  /** One checked positive/negative input fixture with independent coverage metadata. */
4
4
  export interface CatalogOperation {
@@ -3,7 +3,7 @@
3
3
  // START_MODULE_CONTRACT
4
4
  // PURPOSE: Own the pure nine-tool agent-tool catalog: one entry per vvoc-owned registered tool aggregating its descriptor contract, model-facing vocabularies, checked positive/negative operation fixtures, execute-time defaults, state/host prerequisites, conditional requirements, path kinds, result variants, representative errors, a deterministic generated reference renderer, a fixture runner over the actual exported validators/result schemas, and the recorded contract-size baseline.
5
5
  // SCOPE: Catalog aggregation and reference generation only. Imports descriptor modules (workflow input-validation/results, edit schemas, web schemas) and shared contract primitives; never imports plugin factories, config, stores, filesystem, network, or workflow state, so no catalog-to-runtime cycle exists. Fixtures are pure synthetic data validated through the owning runtime validators; the catalog grants no permission, state eligibility, or acceptance.
6
- // DEPENDS: [@opencode-ai/plugin, src/lib/agent-tool-contract.ts, src/plugins/workflow/input-validation.ts, src/plugins/workflow/results.ts, src/plugins/hashline-edit/schemas.ts, src/plugins/web-tools/schemas.ts, zod (types)]
6
+ // DEPENDS: [src/lib/agent-tool-contract.ts, src/plugins/workflow/input-validation.ts, src/plugins/workflow/results.ts, src/plugins/hashline-edit/schemas.ts, src/plugins/web-tools/schemas.ts, zod (types)]
7
7
  // LINKS: [M-AGENT-TOOL-CONTRACT, M-WORKFLOW-TOOLING, M-PLUGIN-HASHLINE-EDIT, M-PLUGIN-WEB-TOOLS]
8
8
  // ROLE: RUNTIME
9
9
  // MAP_MODE: EXPORTS
@@ -37,7 +37,7 @@
37
37
  // START_CHANGE_SUMMARY
38
38
  // LAST_CHANGE: [C-AGENT-TOOL-CONTRACTS T-008 correction r2 - Array-element traversal with finite-primitive (boolean/number) literal discriminators so batch item and nested provider families are coverage-checked; added the batch-failure fixture and the per-operation/branch negative fixtures for review_only, generic open paths, request_changes/rework, verify/review/bind/amend/record_approval/revoke_authority, delete/rename/replace/prepend, and every freshness/format branch. Prior: honest hashline text+metadata aggregate, nested provider coverage, closed-schema scanning, outcome-validated reference examples.]
39
39
  // END_CHANGE_SUMMARY
40
- import { tool } from "@opencode-ai/plugin";
40
+ import { z } from "zod";
41
41
  import { AGENT_TOOL_CONTRACT_REVISION, PACKAGE_NAME, PACKAGE_VERSION, } from "./agent-tool-contract.js";
42
42
  import { validateWorkflowToolInput, workflowToolContracts, } from "../plugins/workflow/input-validation.js";
43
43
  import { workflowToolResultSchemas } from "../plugins/workflow/results.js";
@@ -1298,10 +1298,7 @@ const workflowEntries = [
1298
1298
  * The metadata object is never presented as the registered return value. Composed
1299
1299
  * here from the existing descriptor schemas so no runtime producer changes.
1300
1300
  */
1301
- const hashlineEditResultSchema = tool.schema.union([
1302
- tool.schema.string(),
1303
- hashlineEditMetadataSchema,
1304
- ]);
1301
+ const hashlineEditResultSchema = z.union([z.string(), hashlineEditMetadataSchema]);
1305
1302
  const editEntries = [
1306
1303
  {
1307
1304
  toolId: HASHLINE_EDIT_TOOL_ID,