@osovv/vv-opencode 1.7.0 → 2.0.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 (98) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +22 -2
  3. package/dist/commands/preset.js +1 -1
  4. package/dist/commands/preset.js.map +1 -1
  5. package/dist/index.d.ts +7 -11
  6. package/dist/index.js +53 -20
  7. package/dist/index.js.map +1 -1
  8. package/dist/plugins/analytics/index.d.ts +2 -0
  9. package/dist/plugins/analytics/index.js +13 -2
  10. package/dist/plugins/analytics/index.js.map +1 -1
  11. package/dist/plugins/analytics/v2.d.ts +21 -0
  12. package/dist/plugins/analytics/v2.js +133 -0
  13. package/dist/plugins/analytics/v2.js.map +1 -0
  14. package/dist/plugins/guardian/index.d.ts +46 -0
  15. package/dist/plugins/guardian/index.js +21 -6
  16. package/dist/plugins/guardian/index.js.map +1 -1
  17. package/dist/plugins/guardian/v2.d.ts +13 -0
  18. package/dist/plugins/guardian/v2.js +161 -0
  19. package/dist/plugins/guardian/v2.js.map +1 -0
  20. package/dist/plugins/hashline-edit/index.d.ts +33 -1
  21. package/dist/plugins/hashline-edit/index.js +38 -14
  22. package/dist/plugins/hashline-edit/index.js.map +1 -1
  23. package/dist/plugins/hashline-edit/schemas.d.ts +7 -7
  24. package/dist/plugins/hashline-edit/v2.d.ts +12 -0
  25. package/dist/plugins/hashline-edit/v2.js +145 -0
  26. package/dist/plugins/hashline-edit/v2.js.map +1 -0
  27. package/dist/plugins/model-roles/index.d.ts +2 -0
  28. package/dist/plugins/model-roles/index.js +13 -2
  29. package/dist/plugins/model-roles/index.js.map +1 -1
  30. package/dist/plugins/model-roles/v2.d.ts +24 -0
  31. package/dist/plugins/model-roles/v2.js +274 -0
  32. package/dist/plugins/model-roles/v2.js.map +1 -0
  33. package/dist/plugins/peak-hours/index.d.ts +2 -0
  34. package/dist/plugins/peak-hours/index.js +13 -2
  35. package/dist/plugins/peak-hours/index.js.map +1 -1
  36. package/dist/plugins/peak-hours/v2.d.ts +12 -0
  37. package/dist/plugins/peak-hours/v2.js +95 -0
  38. package/dist/plugins/peak-hours/v2.js.map +1 -0
  39. package/dist/plugins/secrets-redaction/index.d.ts +7 -0
  40. package/dist/plugins/secrets-redaction/index.js +17 -4
  41. package/dist/plugins/secrets-redaction/index.js.map +1 -1
  42. package/dist/plugins/secrets-redaction/v2.d.ts +14 -0
  43. package/dist/plugins/secrets-redaction/v2.js +100 -0
  44. package/dist/plugins/secrets-redaction/v2.js.map +1 -0
  45. package/dist/plugins/spec-guard/index.d.ts +2 -0
  46. package/dist/plugins/spec-guard/index.js +13 -2
  47. package/dist/plugins/spec-guard/index.js.map +1 -1
  48. package/dist/plugins/spec-guard/v2.d.ts +12 -0
  49. package/dist/plugins/spec-guard/v2.js +139 -0
  50. package/dist/plugins/spec-guard/v2.js.map +1 -0
  51. package/dist/plugins/system-context-injection/agent-contexts.d.ts +5 -0
  52. package/dist/plugins/system-context-injection/agent-contexts.js +164 -0
  53. package/dist/plugins/system-context-injection/agent-contexts.js.map +1 -0
  54. package/dist/plugins/system-context-injection/index.d.ts +2 -0
  55. package/dist/plugins/system-context-injection/index.js +16 -146
  56. package/dist/plugins/system-context-injection/index.js.map +1 -1
  57. package/dist/plugins/system-context-injection/v2.d.ts +13 -0
  58. package/dist/plugins/system-context-injection/v2.js +60 -0
  59. package/dist/plugins/system-context-injection/v2.js.map +1 -0
  60. package/dist/plugins/tool-history-compaction/index.d.ts +2 -0
  61. package/dist/plugins/tool-history-compaction/index.js +13 -2
  62. package/dist/plugins/tool-history-compaction/index.js.map +1 -1
  63. package/dist/plugins/tool-history-compaction/v2.d.ts +11 -0
  64. package/dist/plugins/tool-history-compaction/v2.js +56 -0
  65. package/dist/plugins/tool-history-compaction/v2.js.map +1 -0
  66. package/dist/plugins/v2-runtime/config-watcher.d.ts +26 -0
  67. package/dist/plugins/v2-runtime/config-watcher.js +111 -0
  68. package/dist/plugins/v2-runtime/config-watcher.js.map +1 -0
  69. package/dist/plugins/v2-runtime/index.d.ts +50 -0
  70. package/dist/plugins/v2-runtime/index.js +114 -0
  71. package/dist/plugins/v2-runtime/index.js.map +1 -0
  72. package/dist/plugins/v2-runtime/location-config.d.ts +51 -0
  73. package/dist/plugins/v2-runtime/location-config.js +91 -0
  74. package/dist/plugins/v2-runtime/location-config.js.map +1 -0
  75. package/dist/plugins/v2-runtime/setup.d.ts +48 -0
  76. package/dist/plugins/v2-runtime/setup.js +174 -0
  77. package/dist/plugins/v2-runtime/setup.js.map +1 -0
  78. package/dist/plugins/web-tools/index.d.ts +2 -0
  79. package/dist/plugins/web-tools/index.js +13 -2
  80. package/dist/plugins/web-tools/index.js.map +1 -1
  81. package/dist/plugins/web-tools/v2.d.ts +11 -0
  82. package/dist/plugins/web-tools/v2.js +99 -0
  83. package/dist/plugins/web-tools/v2.js.map +1 -0
  84. package/dist/plugins/workflow/index.d.ts +2 -0
  85. package/dist/plugins/workflow/index.js +13 -2
  86. package/dist/plugins/workflow/index.js.map +1 -1
  87. package/dist/plugins/workflow/results.d.ts +16 -16
  88. package/dist/plugins/workflow/v2.d.ts +58 -0
  89. package/dist/plugins/workflow/v2.js +181 -0
  90. package/dist/plugins/workflow/v2.js.map +1 -0
  91. package/dist/tui.d.ts +1 -0
  92. package/dist/tui.js +41 -6
  93. package/dist/tui.js.map +1 -1
  94. package/package.json +13 -5
  95. package/schemas/vvoc/v3.json +1 -1
  96. package/server.js +7 -0
  97. package/templates/skills/vv-execute/references/tool-contracts.md +1 -1
  98. package/tui.js +7 -0
@@ -0,0 +1,58 @@
1
+ import type { Plugin as V2Plugin } from "@opencode/plugin";
2
+ import type { V2AdapterContext } from "../v2-runtime/setup.js";
3
+ /**
4
+ * A v1-shaped client built on v2 domains. Session lookups map onto
5
+ * ctx.session, logging degrades to console, and the repair continuation
6
+ * prompt is unsupported under the v2 prompt shape and throws so the
7
+ * bounded continuation path fails closed exactly like a failed continuation.
8
+ */
9
+ export declare function createWorkflowClientShim(adapter: V2AdapterContext): {
10
+ app: {
11
+ log: () => Promise<void>;
12
+ };
13
+ session: {
14
+ get: (input: {
15
+ path: {
16
+ id: string;
17
+ };
18
+ }) => Promise<{
19
+ data: import("@opencode/client").SessionInfo;
20
+ }>;
21
+ message: (input: {
22
+ path: {
23
+ id: string;
24
+ messageID: string;
25
+ };
26
+ }) => Promise<{
27
+ data: {
28
+ id?: string;
29
+ };
30
+ error?: undefined;
31
+ } | {
32
+ data: undefined;
33
+ error: {
34
+ name: string;
35
+ };
36
+ }>;
37
+ prompt: (_input: unknown) => Promise<never>;
38
+ };
39
+ };
40
+ /**
41
+ * Map v2 subagent launch arguments onto the v1 task shape the launch
42
+ * validation consumes: agent becomes subagent_type, the v2 resume sessionID
43
+ * becomes task_id, and background passes through. The v1 reader fields stay
44
+ * authoritative so every eligibility rule applies unchanged.
45
+ */
46
+ export declare function adaptSubagentLaunchArgs(input: unknown): unknown;
47
+ /**
48
+ * Bridge the workflow surface onto the v2 runtime.
49
+ *
50
+ * The v1 factory runs once with the shimmed client; its returned hook object
51
+ * is routed onto v2 domains: tools publish with their strict JSON Schema
52
+ * inputs, before and after guards run as v2 tool hooks with the launcher
53
+ * renamed from task to subagent, and the profile guidance appends through
54
+ * the session context hook. Protocol parsing stays fail-closed: envelope
55
+ * shapes the shared parser does not recognize reject the attempt, never
56
+ * accept it.
57
+ */
58
+ export declare function setupWorkflowV2(adapter: V2AdapterContext): Promise<V2Plugin.Cleanup | void>;
@@ -0,0 +1,181 @@
1
+ // FILE: src/plugins/workflow/v2.ts
2
+ // VERSION: 1.0.0
3
+ // START_MODULE_CONTRACT
4
+ // PURPOSE: Run the complete workflow enforcement surface on the OpenCode v2 runtime by bridging the v1 plugin factory's hooks and tools onto v2 domains.
5
+ // SCOPE: v2 setup only: instantiate the v1 factory once with a shimmed client, register its five tools with their strict JSON Schema inputs through the tool transform, route execute.before and execute.after through v2 tool hooks with subagent-launch argument adaptation (v2 names the launcher subagent with agent and sessionID fields), append the profile guidance through the session context hook, and keep every fail-closed guarantee of the shared protocol unchanged.
6
+ // DEPENDS: [@opencode/plugin, src/lib/config-layers.ts, src/plugins/workflow/index.ts, src/plugins/v2-runtime/setup.ts]
7
+ // LINKS: [M-PLUGIN-WORKFLOW, V-M-PLUGIN-WORKFLOW, M-WORKFLOW-PROTOCOL, M-PLUGIN-V2-RUNTIME]
8
+ // ROLE: RUNTIME
9
+ // MAP_MODE: EXPORTS
10
+ // END_MODULE_CONTRACT
11
+ //
12
+ // START_MODULE_MAP
13
+ // setupWorkflowV2 - Bridge the full workflow surface onto one OpenCode v2 plugin context.
14
+ // createWorkflowClientShim - v1-shaped client over v2 domains for the workflow authorization and repair surfaces.
15
+ // adaptSubagentLaunchArgs - Map v2 subagent tool arguments onto the v1 task launch shape.
16
+ // END_MODULE_MAP
17
+ //
18
+ // START_CHANGE_SUMMARY
19
+ // LAST_CHANGE: [C-OPENCODE-V2-MIGRATION T-005 - Bridged the workflow enforcement surface onto v2 tool, session, and event domains.]
20
+ // END_CHANGE_SUMMARY
21
+ import { WorkflowPlugin } from "./index.js";
22
+ // START_BLOCK_CREATE_WORKFLOW_CLIENT_SHIM
23
+ /**
24
+ * A v1-shaped client built on v2 domains. Session lookups map onto
25
+ * ctx.session, logging degrades to console, and the repair continuation
26
+ * prompt is unsupported under the v2 prompt shape and throws so the
27
+ * bounded continuation path fails closed exactly like a failed continuation.
28
+ */
29
+ export function createWorkflowClientShim(adapter) {
30
+ return {
31
+ app: {
32
+ log: async () => { },
33
+ },
34
+ session: {
35
+ get: async (input) => {
36
+ const data = await adapter.ctx.session.get({ sessionID: input.path.id });
37
+ return { data };
38
+ },
39
+ message: async (input) => {
40
+ try {
41
+ const messages = await adapter.ctx.session.context({ sessionID: input.path.id });
42
+ const hit = messages.find((message) => message.id === input.path.messageID);
43
+ return hit ? { data: hit } : { data: undefined, error: { name: "NotFound" } };
44
+ }
45
+ catch {
46
+ return { data: undefined, error: { name: "NotFound" } };
47
+ }
48
+ },
49
+ prompt: async (_input) => {
50
+ throw new Error("workflow continuation prompt is not available on the v2 runtime");
51
+ },
52
+ },
53
+ };
54
+ }
55
+ // END_BLOCK_CREATE_WORKFLOW_CLIENT_SHIM
56
+ // START_BLOCK_ADAPT_SUBAGENT_LAUNCH_ARGS
57
+ /**
58
+ * Map v2 subagent launch arguments onto the v1 task shape the launch
59
+ * validation consumes: agent becomes subagent_type, the v2 resume sessionID
60
+ * becomes task_id, and background passes through. The v1 reader fields stay
61
+ * authoritative so every eligibility rule applies unchanged.
62
+ */
63
+ export function adaptSubagentLaunchArgs(input) {
64
+ if (!input || typeof input !== "object")
65
+ return input;
66
+ const record = input;
67
+ return {
68
+ ...record,
69
+ ...(typeof record.agent === "string" ? { subagent_type: record.agent } : {}),
70
+ ...(typeof record.sessionID === "string" ? { task_id: record.sessionID } : {}),
71
+ };
72
+ }
73
+ // END_BLOCK_ADAPT_SUBAGENT_LAUNCH_ARGS
74
+ // START_BLOCK_SETUP_WORKFLOW_V2
75
+ /**
76
+ * Bridge the workflow surface onto the v2 runtime.
77
+ *
78
+ * The v1 factory runs once with the shimmed client; its returned hook object
79
+ * is routed onto v2 domains: tools publish with their strict JSON Schema
80
+ * inputs, before and after guards run as v2 tool hooks with the launcher
81
+ * renamed from task to subagent, and the profile guidance appends through
82
+ * the session context hook. Protocol parsing stays fail-closed: envelope
83
+ * shapes the shared parser does not recognize reject the attempt, never
84
+ * accept it.
85
+ */
86
+ export async function setupWorkflowV2(adapter) {
87
+ const directory = adapter.ctx.location.directory;
88
+ const hooks = (await WorkflowPlugin({
89
+ client: createWorkflowClientShim(adapter),
90
+ project: { id: directory, directory },
91
+ directory,
92
+ worktree: directory,
93
+ experimental_workspace: { register: () => { } },
94
+ serverUrl: new URL("http://127.0.0.1:1"),
95
+ $: {},
96
+ }));
97
+ if (!hooks)
98
+ return undefined;
99
+ const cleanups = [];
100
+ // Tools: publish each v1 tool entry with its contract JSON Schema input.
101
+ const toolEntries = (hooks.tool ?? {});
102
+ const { workflowToolContracts } = await import("./input-validation.js");
103
+ const toolRegistration = await adapter.ctx.tool.transform((editor) => {
104
+ for (const [name, entry] of Object.entries(toolEntries)) {
105
+ const contract = workflowToolContracts.find((item) => item.toolId === name);
106
+ editor.add({
107
+ name,
108
+ description: entry.description,
109
+ input: (contract?.inputJsonSchema ?? { type: "object" }),
110
+ execute: (async (input, context) => {
111
+ const result = await entry.execute(input, {
112
+ sessionID: context.sessionID,
113
+ agent: context.agent,
114
+ abort: context.signal,
115
+ });
116
+ return { content: typeof result === "string" ? result : JSON.stringify(result) };
117
+ }),
118
+ });
119
+ }
120
+ });
121
+ cleanups.push(() => toolRegistration.dispose());
122
+ // Owned validation plus task-launch tracking on execute.before.
123
+ const beforeHook = await adapter.ctx.tool.hook("execute.before", (event) => {
124
+ const tool = String(event.tool) === "subagent" ? "task" : String(event.tool);
125
+ const args = String(event.tool) === "subagent" ? adaptSubagentLaunchArgs(event.input) : event.input;
126
+ const before = hooks["tool.execute.before"];
127
+ if (!before)
128
+ return;
129
+ return before({ tool, sessionID: event.sessionID, callID: event.id, agent: event.agent }, { args });
130
+ });
131
+ cleanups.push(() => beforeHook.dispose());
132
+ // Delegated result tracking on execute.after.
133
+ const afterHook = await adapter.ctx.tool.hook("execute.after", (event) => {
134
+ if (event.status !== "completed")
135
+ return;
136
+ const tool = String(event.tool) === "subagent" ? "task" : String(event.tool);
137
+ const args = String(event.tool) === "subagent" ? adaptSubagentLaunchArgs(event.input) : event.input;
138
+ const result = event.result;
139
+ const output = typeof result.content === "string"
140
+ ? result.content
141
+ : Array.isArray(result.content)
142
+ ? result.content.map((part) => part.text ?? "").join("\n")
143
+ : "";
144
+ const after = hooks["tool.execute.after"];
145
+ if (!after)
146
+ return;
147
+ return after({ tool, sessionID: event.sessionID, callID: event.id, agent: event.agent, args }, { output, metadata: {} });
148
+ });
149
+ cleanups.push(() => afterHook.dispose());
150
+ // Profile guidance through the session context hook.
151
+ const chatMessage = hooks["chat.message"];
152
+ if (chatMessage) {
153
+ const contextHook = await adapter.ctx.session.hook("context", (event) => {
154
+ const message = {
155
+ agent: event.agent,
156
+ system: event.system
157
+ .filter((part) => part.type === "text")
158
+ .map((part) => part.text)
159
+ .join("\n\n"),
160
+ };
161
+ const before = message.system;
162
+ const result = chatMessage({}, { message });
163
+ if (result instanceof Promise) {
164
+ return result.then(() => {
165
+ if (typeof message.system === "string" && message.system !== before) {
166
+ event.system.length = 0;
167
+ event.system.push({ type: "text", text: message.system });
168
+ }
169
+ });
170
+ }
171
+ return undefined;
172
+ });
173
+ cleanups.push(() => contextHook.dispose());
174
+ }
175
+ return async () => {
176
+ for (const dispose of cleanups.reverse())
177
+ await dispose();
178
+ };
179
+ }
180
+ // END_BLOCK_SETUP_WORKFLOW_V2
181
+ //# sourceMappingURL=v2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v2.js","sourceRoot":"","sources":["../../../src/plugins/workflow/v2.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,iBAAiB;AACjB,wBAAwB;AACxB,2JAA2J;AAC3J,udAAud;AACvd,0HAA0H;AAC1H,8FAA8F;AAC9F,kBAAkB;AAClB,sBAAsB;AACtB,sBAAsB;AACtB,EAAE;AACF,mBAAmB;AACnB,4FAA4F;AAC5F,oHAAoH;AACpH,4FAA4F;AAC5F,iBAAiB;AACjB,EAAE;AACF,uBAAuB;AACvB,sIAAsI;AACtI,qBAAqB;AAIrB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,0CAA0C;AAC1C;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAyB;IAChE,OAAO;QACL,GAAG,EAAE;YACH,GAAG,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;SACpB;QACD,OAAO,EAAE;YACP,GAAG,EAAE,KAAK,EAAE,KAA+B,EAAE,EAAE;gBAC7C,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,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C;YAC5C,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;gBAC9B,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;oBACtB,IAAI,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;wBACpE,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;wBACxB,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;oBAC5D,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,KAAK,IAAI,EAAE;QAChB,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE;YAAE,MAAM,OAAO,EAAE,CAAC;IAC5D,CAAC,CAAC;AACJ,CAAC;AACD,8BAA8B"}
package/dist/tui.d.ts CHANGED
@@ -3,5 +3,6 @@ import { ContextTuiPlugin } from "./tui/context/plugin.js";
3
3
  export { ContextTuiPlugin };
4
4
  declare const plugin: TuiPluginModule & {
5
5
  id: string;
6
+ setup?: (context: unknown) => Promise<void> | void;
6
7
  };
7
8
  export default plugin;
package/dist/tui.js CHANGED
@@ -1,21 +1,21 @@
1
1
  // FILE: src/tui.tsx
2
- // VERSION: 1.2.0
2
+ // VERSION: 2.0.0
3
3
  // START_MODULE_CONTRACT
4
- // PURPOSE: Publish the default @osovv/vv-opencode/tui module containing the managed context inspector, analytics indicator, branding footer, and peak-hours banner.
5
- // SCOPE: Stable TUI package entrypoint and module identity only.
6
- // DEPENDS: [@opencode-ai/plugin/tui, @opencode-ai/plugin, src/tui/context/plugin.ts, src/tui/analytics/indicator.tsx, src/tui/branding/footer.tsx, src/tui/peak-hours/banner.tsx]
4
+ // PURPOSE: Publish the dual-runtime TUI entrypoint: the full v1 context inspector, analytics indicator, branding footer, and peak-hours banner through tui(), and the v2 CLI plugin registration for /context through setup().
5
+ // SCOPE: Stable TUI package entrypoint and dual runtime identity only; feature registration stays in the focused modules.
6
+ // DEPENDS: [@opencode-ai/plugin/tui, @opencode/plugin/tui, src/tui/context/plugin.ts, src/tui/analytics/indicator.tsx, src/tui/branding/footer.tsx, src/tui/peak-hours/banner.tsx]
7
7
  // LINKS: [M-PLUGIN-CONTEXT-TUI, M-TUI-ANALYTICS-INDICATOR, M-TUI-BRANDING-FOOTER, M-TUI-PEAK-HOURS-BANNER, V-M-PLUGIN-CONTEXT-TUI]
8
8
  // ROLE: BARREL
9
9
  // MAP_MODE: SUMMARY
10
10
  // END_MODULE_CONTRACT
11
11
  //
12
12
  // START_MODULE_MAP
13
- // default - OpenCode TUI plugin module registering /context, the analytics indicator, the branding footer, and the peak-hours banner.
13
+ // default - Dual TUI entrypoint: v2 setup() registers the /context command, v1 tui() registers the full inspector, indicator, footer, and banner.
14
14
  // ContextTuiPlugin - Named TUI plugin factory for direct consumers and tests.
15
15
  // END_MODULE_MAP
16
16
  //
17
17
  // START_CHANGE_SUMMARY
18
- // LAST_CHANGE: [C-PLUGIN-PEAK-HOURS - Registered the app_bottom peak-hours banner alongside the indicator and footer.]
18
+ // LAST_CHANGE: [C-OPENCODE-V2-MIGRATION T-007 - Added the v2 CLI plugin setup registering /context beside the unchanged v1 TUI module.]
19
19
  // END_CHANGE_SUMMARY
20
20
  import { ContextTuiPlugin } from "./tui/context/plugin.js";
21
21
  import { registerAnalyticsIndicator } from "./tui/analytics/indicator.js";
@@ -46,6 +46,41 @@ const plugin = {
46
46
  // Fail-soft: banner unavailable for this session.
47
47
  }
48
48
  },
49
+ // START_BLOCK_V2_TUI_SETUP
50
+ // OpenCode v2 loads the same entrypoint through setup() with the CLI plugin
51
+ // context. The v2 surface registers the /context slash command; the full
52
+ // inspector components port onto the v2 dialog and router surfaces in a
53
+ // follow-up release and this command keeps the entry point honest.
54
+ async setup(context) {
55
+ const ctx = context;
56
+ try {
57
+ ctx.keymap.layer(() => ({
58
+ mode: "global",
59
+ commands: [
60
+ {
61
+ id: "vvoc.context",
62
+ title: "vvoc context inspector",
63
+ slash: { name: "context" },
64
+ palette: true,
65
+ run: async () => {
66
+ const directory = ctx.data?.location?.default?.()?.directory ?? "unknown location";
67
+ await ctx.ui.dialog.alert({
68
+ title: "vvoc /context",
69
+ message: `OpenCode v2 runtime (host ${ctx.app?.version ?? "unknown"}).\n` +
70
+ `Location: ${directory}\n` +
71
+ "The full v2 context inspector ships in the next vvoc release; " +
72
+ "server-side analytics, model roles, and guidance stay active.",
73
+ });
74
+ },
75
+ },
76
+ ],
77
+ }));
78
+ }
79
+ catch {
80
+ // Fail-soft: the v2 TUI host may not expose keymap layers yet.
81
+ }
82
+ },
83
+ // END_BLOCK_V2_TUI_SETUP
49
84
  };
50
85
  // END_BLOCK_TUI_MODULE
51
86
  export default plugin;
package/dist/tui.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tui.js","sourceRoot":"","sources":["../src/tui.tsx"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,iBAAiB;AACjB,wBAAwB;AACxB,sKAAsK;AACtK,mEAAmE;AACnE,oLAAoL;AACpL,qIAAqI;AACrI,iBAAiB;AACjB,sBAAsB;AACtB,sBAAsB;AACtB,EAAE;AACF,mBAAmB;AACnB,wIAAwI;AACxI,gFAAgF;AAChF,iBAAiB;AACjB,EAAE;AACF,uBAAuB;AACvB,yHAAyH;AACzH,qBAAqB;AAGrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAA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M,CAAC,KAAK,CAAC;gCACxB,KAAK,EAAE,eAAe;gCACtB,OAAO,EACL,6BAA6B,GAAG,CAAC,GAAG,EAAE,OAAO,IAAI,SAAS,MAAM;oCAChE,aAAa,SAAS,IAAI;oCAC1B,gEAAgE;oCAChE,+DAA+D;6BAClE,CAAC,CAAC;wBACL,CAAC;qBACF;iBACF;aACF,CAAC,CAAC,CAAC;QACN,CAAC;QAAC,MAAM,CAAC;YACP,+DAA+D;QACjE,CAAC;IACH,CAAC;IACD,yBAAyB;CAC1B,CAAC;AACJ,uBAAuB;AAEvB,eAAe,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osovv/vv-opencode",
3
- "version": "1.7.0",
3
+ "version": "2.0.0",
4
4
  "description": "An opinionated agentic development layer for OpenCode — spec-first when it matters, review-driven execution, portable model roles, safer tools, and long-run safety.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -34,6 +34,8 @@
34
34
  "dist",
35
35
  "schemas",
36
36
  "templates",
37
+ "server.js",
38
+ "tui.js",
37
39
  "README.md",
38
40
  "CHANGELOG.md"
39
41
  ],
@@ -42,6 +44,10 @@
42
44
  "types": "./dist/index.d.ts",
43
45
  "import": "./dist/index.js"
44
46
  },
47
+ "./server": {
48
+ "types": "./dist/index.d.ts",
49
+ "import": "./dist/index.js"
50
+ },
45
51
  "./tui": {
46
52
  "types": "./dist/tui.d.ts",
47
53
  "import": "./dist/tui.js"
@@ -104,16 +110,18 @@
104
110
  "contracts:host": "bun scripts/check-tool-contracts-host.ts",
105
111
  "test": "bun test",
106
112
  "check": "bun run typecheck && bun run lint && bun run fmt:check && bun run grace:check && bun run contracts:check && bun test",
107
- "pack:check": "bun run build && bun -e \"const root = await import('./dist/index.js'); if (!('GuardianPlugin' in root)) throw new Error('dist root export missing GuardianPlugin'); if (!('HashlineEditPlugin' in root)) throw new Error('dist root export missing HashlineEditPlugin'); if (!('ModelRolesPlugin' in root)) throw new Error('dist root export missing ModelRolesPlugin'); if (!('SystemContextInjectionPlugin' in root)) throw new Error('dist root export missing SystemContextInjectionPlugin'); if (!('WorkflowPlugin' in root)) throw new Error('dist root export missing WorkflowPlugin'); if (!('SecretsRedactionPlugin' in root)) throw new Error('dist root export missing SecretsRedactionPlugin'); if (!('WebToolsPlugin' in root)) throw new Error('dist root export missing WebToolsPlugin'); if (!('AnalyticsPlugin' in root)) throw new Error('dist root export missing AnalyticsPlugin'); if (!('PeakHoursPlugin' in root)) throw new Error('dist root export missing PeakHoursPlugin'); if (!('SpecGuardPlugin' in root)) throw new Error('dist root export missing SpecGuardPlugin'); const tui = await import('./dist/tui.js'); if (!tui.default || typeof tui.default.tui !== 'function') throw new Error('dist TUI export missing default tui module'); await import('./dist/plugins/guardian/index.js'); await import('./dist/plugins/hashline-edit/index.js'); await import('./dist/plugins/model-roles/index.js'); await import('./dist/plugins/system-context-injection/index.js'); await import('./dist/plugins/workflow/index.js'); await import('./dist/plugins/secrets-redaction/index.js'); await import('./dist/plugins/web-tools/index.js'); await import('./dist/plugins/analytics/index.js'); await import('./dist/plugins/peak-hours/index.js'); await import('./dist/plugins/spec-guard/index.js')\" && bun scripts/check-tool-contracts.ts --packed",
113
+ "pack:check": "bun run build && bun -e \"const root = await import('./dist/index.js'); const d = root.default; if (!d || d.id !== 'vvoc' || typeof d.setup !== 'function' || typeof d.server !== 'function') throw new Error('dist root export missing dual default entrypoint (id/setup/server)'); const pluginIds = ['vvoc.guardian','vvoc.hashline-edit','vvoc.model-roles','vvoc.system-context-injection','vvoc.workflow','vvoc.secrets-redaction','vvoc.web-tools','vvoc.tool-history-compaction','vvoc.analytics','vvoc.peak-hours','vvoc.spec-guard']; const subpaths = ['guardian','hashline-edit','model-roles','system-context-injection','workflow','secrets-redaction','web-tools','tool-history-compaction','analytics','peak-hours','spec-guard']; for (const s of subpaths) { const m = await import('./dist/plugins/' + s + '/index.js'); const e = m.default; if (!e || typeof e.id !== 'string' || typeof e.setup !== 'function' || typeof e.server !== 'function') throw new Error('dist subpath ' + s + ' missing dual default entrypoint'); if (!pluginIds.includes(e.id)) throw new Error('dist subpath ' + s + ' has unexpected id ' + e.id); } const tui = await import('./dist/tui.js'); if (!tui.default || typeof tui.default.tui !== 'function') throw new Error('dist TUI export missing default tui module')\" && bun scripts/check-tool-contracts.ts --packed",
108
114
  "tui:local": "bun scripts/tui-local.ts",
115
+ "e2e:v2": "bun scripts/e2e-v2.ts",
109
116
  "release:check": "bun scripts/release-check.ts",
110
117
  "release:bump": "bun scripts/release-bump.ts",
111
118
  "prepare": "lefthook install --force"
112
119
  },
113
120
  "dependencies": {
114
121
  "@clack/prompts": "^1.2.0",
115
- "@opencode-ai/plugin": "1.18.2",
116
- "@opencode-ai/sdk": "1.18.2",
122
+ "@opencode-ai/plugin": "1.18.32",
123
+ "@opencode-ai/sdk": "1.18.32",
124
+ "@opencode/plugin": "2.0.18",
117
125
  "ajv": "^8.17.1",
118
126
  "citty": "0.2.2",
119
127
  "htmlparser2": "^12.0.0",
@@ -144,7 +152,7 @@
144
152
  },
145
153
  "engines": {
146
154
  "bun": ">=1.3.8",
147
- "opencode": ">=1.18.2"
155
+ "opencode": ">=1.18.29"
148
156
  },
149
157
  "packageManager": "bun@1.3.8",
150
158
  "repository": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://cdn.jsdelivr.net/npm/@osovv/vv-opencode@1.7.0/schemas/vvoc/v3.json",
3
+ "$id": "https://cdn.jsdelivr.net/npm/@osovv/vv-opencode@2.0.0/schemas/vvoc/v3.json",
4
4
  "title": "vvoc config",
5
5
  "description": "Canonical vvoc configuration document.",
6
6
  "type": "object",
package/server.js ADDED
@@ -0,0 +1,7 @@
1
+ // FILE: server.js
2
+ // VERSION: 1.0.0
3
+ // OpenCode v2 resolves directory-scoped plugin targets through a literal
4
+ // `server` module next to the package manifest before consulting the exports
5
+ // map. This shim re-exports the dual-runtime default entrypoint so both the
6
+ // file-path and npm-specifier loading styles reach the same plugin.
7
+ export { default } from "./dist/index.js";
@@ -2,7 +2,7 @@
2
2
 
3
3
  Generated from the pure tool catalog. Do not edit by hand; run `bun run contracts:generate`.
4
4
 
5
- - Package: `@osovv/vv-opencode@1.7.0`
5
+ - Package: `@osovv/vv-opencode@2.0.0`
6
6
  - Tool contract revision: `1`
7
7
  - Reference path: `templates/skills/vv-execute/references/tool-contracts.md`
8
8
  - Current model-facing size: descriptions 8794 bytes, published input schemas 22572 bytes
package/tui.js ADDED
@@ -0,0 +1,7 @@
1
+ // FILE: tui.js
2
+ // VERSION: 1.0.0
3
+ // OpenCode v2 resolves the CLI/TUI plugin entrypoint of directory-scoped
4
+ // plugin targets through a literal `tui` module next to the package manifest.
5
+ // This shim re-exports the dual-runtime default TUI entrypoint so the
6
+ // file-path and npm-specifier loading styles stay equivalent.
7
+ export { default } from "./dist/tui.js";