@codemcp/workflows 6.20.1 → 6.20.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows",
3
- "version": "6.20.1",
3
+ "version": "6.20.2",
4
4
  "description": "A Model Context Protocol server that acts as an intelligent conversation state manager and development guide for LLMs, featuring comprehensive long-term memory with persistent project artifacts",
5
5
  "type": "module",
6
6
  "main": "packages/cli/dist/index.js",
@@ -51,7 +51,7 @@
51
51
  "typescript": "^5.9.3",
52
52
  "vitepress": "^1.6.4",
53
53
  "vitest": "4.0.18",
54
- "@codemcp/workflows-core": "6.20.1"
54
+ "@codemcp/workflows-core": "6.20.2"
55
55
  },
56
56
  "lint-staged": {
57
57
  "*.{ts,js,mts,cts,tsx,jsx}": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows-cli",
3
- "version": "6.20.1",
3
+ "version": "6.20.2",
4
4
  "description": "CLI tools for responsible-vibe development workflows",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows-core",
3
- "version": "6.20.1",
3
+ "version": "6.20.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows-docs",
3
- "version": "6.20.1",
3
+ "version": "6.20.2",
4
4
  "description": "Documentation site for Responsible Vibe MCP",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows-server",
3
- "version": "6.20.1",
3
+ "version": "6.20.2",
4
4
  "description": "MCP server for responsible-vibe development workflows - provides structured workflow guidance",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,72 +1,16 @@
1
- import { z } from 'zod';
2
- import { Effect } from 'effect';
1
+ import { Plugin } from '@opencode-ai/plugin';
2
+ export { Hooks, Plugin, PluginInput, PluginModule, ToolContext, ToolDefinition } from '@opencode-ai/plugin';
3
3
 
4
4
  /**
5
5
  * OpenCode Plugin Types
6
6
  *
7
- * Minimal type definitions needed for the plugin.
8
- * Based on @opencode-ai/plugin package types.
7
+ * Re-exports the types we need directly from the official @opencode-ai/plugin
8
+ * SDK so that any change to the SDK's type signatures (e.g. ToolContext.ask)
9
+ * is caught at compile time rather than silently breaking at runtime.
10
+ *
11
+ * Only types that are NOT exported by the SDK are defined here.
9
12
  */
10
13
 
11
- type Part = {
12
- type: 'text' | 'image' | 'file' | 'tool_use' | 'tool_result';
13
- text?: string;
14
- [key: string]: unknown;
15
- };
16
- type UserMessage = {
17
- id: string;
18
- sessionID: string;
19
- role: 'user';
20
- [key: string]: unknown;
21
- };
22
- type Message = {
23
- id: string;
24
- sessionID: string;
25
- role: 'user' | 'assistant';
26
- [key: string]: unknown;
27
- };
28
- type Model = {
29
- providerID: string;
30
- modelID: string;
31
- [key: string]: unknown;
32
- };
33
- type Project = {
34
- id: string;
35
- path: string;
36
- [key: string]: unknown;
37
- };
38
- type PluginInput = {
39
- client: unknown;
40
- project: Project;
41
- directory: string;
42
- worktree: string;
43
- serverUrl: URL;
44
- $: unknown;
45
- };
46
-
47
- type ToolContext = {
48
- sessionID: string;
49
- messageID: string;
50
- agent: string;
51
- directory: string;
52
- worktree: string;
53
- abort: AbortSignal;
54
- metadata(input: {
55
- title?: string;
56
- metadata?: Record<string, unknown>;
57
- }): void;
58
- ask(input: {
59
- permission: string;
60
- patterns: string[];
61
- always: string[];
62
- metadata: Record<string, unknown>;
63
- }): Effect.Effect<void>;
64
- };
65
- type ToolDefinition = {
66
- description: string;
67
- args: z.ZodRawShape;
68
- execute(args: unknown, context: ToolContext): Promise<string>;
69
- };
70
14
  type SessionCompactedEvent = {
71
15
  type: 'session.compacted';
72
16
  properties: {
@@ -84,134 +28,6 @@ type OtherEvent = {
84
28
  properties: Record<string, unknown>;
85
29
  };
86
30
  type BusEvent = SessionCompactedEvent | SessionIdleEvent | OtherEvent;
87
- interface Hooks {
88
- event?: (input: {
89
- event: BusEvent;
90
- }) => Promise<void>;
91
- config?: (input: unknown) => Promise<void>;
92
- tool?: {
93
- [key: string]: ToolDefinition;
94
- };
95
- auth?: unknown;
96
- /**
97
- * Called when a new message is received
98
- */
99
- 'chat.message'?: (input: {
100
- sessionID: string;
101
- agent?: string;
102
- model?: {
103
- providerID: string;
104
- modelID: string;
105
- };
106
- messageID?: string;
107
- variant?: string;
108
- }, output: {
109
- message: UserMessage;
110
- parts: Part[];
111
- }) => Promise<void>;
112
- /**
113
- * Modify parameters sent to LLM
114
- */
115
- 'chat.params'?: (input: {
116
- sessionID: string;
117
- agent: string;
118
- model: Model;
119
- provider: unknown;
120
- message: UserMessage;
121
- }, output: {
122
- temperature: number;
123
- topP: number;
124
- topK: number;
125
- options: Record<string, unknown>;
126
- }) => Promise<void>;
127
- 'chat.headers'?: (input: {
128
- sessionID: string;
129
- agent: string;
130
- model: Model;
131
- provider: unknown;
132
- message: UserMessage;
133
- }, output: {
134
- headers: Record<string, string>;
135
- }) => Promise<void>;
136
- 'permission.ask'?: (input: unknown, output: {
137
- status: 'ask' | 'deny' | 'allow';
138
- }) => Promise<void>;
139
- 'command.execute.before'?: (input: {
140
- command: string;
141
- sessionID: string;
142
- arguments: string;
143
- }, output: {
144
- parts: Part[];
145
- }) => Promise<void>;
146
- 'tool.execute.before'?: (input: {
147
- tool: string;
148
- sessionID: string;
149
- callID: string;
150
- }, output: {
151
- args: Record<string, unknown>;
152
- }) => Promise<void>;
153
- 'shell.env'?: (input: {
154
- cwd: string;
155
- sessionID?: string;
156
- callID?: string;
157
- }, output: {
158
- env: Record<string, string>;
159
- }) => Promise<void>;
160
- 'tool.execute.after'?: (input: {
161
- tool: string;
162
- sessionID: string;
163
- callID: string;
164
- args: unknown;
165
- }, output: {
166
- title: string;
167
- output: string;
168
- metadata: unknown;
169
- }) => Promise<void>;
170
- 'experimental.chat.messages.transform'?: (input: Record<string, never>, output: {
171
- messages: {
172
- info: Message;
173
- parts: Part[];
174
- }[];
175
- }) => Promise<void>;
176
- 'experimental.chat.system.transform'?: (input: {
177
- sessionID?: string;
178
- model: Model;
179
- }, output: {
180
- system: string[];
181
- }) => Promise<void>;
182
- /**
183
- * Called before session compaction starts. Allows plugins to customize
184
- * the compaction prompt.
185
- */
186
- 'experimental.session.compacting'?: (input: {
187
- sessionID: string;
188
- }, output: {
189
- context: string[];
190
- prompt?: string;
191
- }) => Promise<void>;
192
- 'experimental.text.complete'?: (input: {
193
- sessionID: string;
194
- messageID: string;
195
- partID: string;
196
- }, output: {
197
- text: string;
198
- }) => Promise<void>;
199
- /**
200
- * Modify tool definitions (description and parameters) sent to LLM
201
- */
202
- 'tool.definition'?: (input: {
203
- toolID: string;
204
- }, output: {
205
- description: string;
206
- parameters: unknown;
207
- }) => Promise<void>;
208
- }
209
- type Plugin = (input: PluginInput) => Promise<Hooks>;
210
- type PluginModule = {
211
- id?: string;
212
- server: Plugin;
213
- tui?: never;
214
- };
215
31
 
216
32
  /**
217
33
  * OpenCode Workflows Plugin
@@ -236,4 +52,4 @@ declare const _default: {
236
52
  server: Plugin;
237
53
  };
238
54
 
239
- export { type BusEvent, type Hooks, type Message, type Model, type OtherEvent, type Part, type Plugin, type PluginInput, type PluginModule, type Project, type SessionCompactedEvent, type SessionIdleEvent, type ToolContext, type ToolDefinition, type UserMessage, WorkflowsPlugin, _default as default };
55
+ export { type BusEvent, type OtherEvent, type SessionCompactedEvent, type SessionIdleEvent, WorkflowsPlugin, _default as default };
@@ -28815,6 +28815,14 @@ function createOpenCodeLogger(client) {
28815
28815
  }
28816
28816
 
28817
28817
  // src/plugin.ts
28818
+ var EFFECT_TYPE_ID = "~effect/Effect";
28819
+ async function runAsk(askResult) {
28820
+ if (askResult !== null && typeof askResult === "object" && EFFECT_TYPE_ID in askResult) {
28821
+ await Effect_exports.runPromise(askResult);
28822
+ } else {
28823
+ await askResult;
28824
+ }
28825
+ }
28818
28826
  function matchGlobPattern(filePath, pattern) {
28819
28827
  const normalised = filePath.replace(/\\/g, "/");
28820
28828
  const baseName = normalised.split("/").pop() ?? "";
@@ -29277,7 +29285,7 @@ ${phaseInstructions}`
29277
29285
  `Workflows are not enabled for this agent (${agent}). Set WORKFLOW_AGENTS environment variable to include this agent, or use a different agent.`
29278
29286
  );
29279
29287
  }
29280
- await Effect_exports.runPromise(
29288
+ await runAsk(
29281
29289
  ctx.ask({
29282
29290
  permission: toolName,
29283
29291
  patterns: buildPermissionPatterns(
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows-opencode",
3
- "version": "6.20.1",
3
+ "version": "6.20.2",
4
4
  "description": "OpenCode plugin for structured development workflows",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -29,18 +29,23 @@
29
29
  "devDependencies": {
30
30
  "@codemcp/workflows-core": "workspace:*",
31
31
  "@codemcp/workflows-server": "workspace:*",
32
+ "@opencode-ai/plugin": "*",
32
33
  "rimraf": "^6.0.1",
33
34
  "tsup": "^8.0.0",
34
35
  "vitest": "4.0.18"
35
36
  },
36
37
  "peerDependencies": {
37
38
  "@anthropic-ai/sdk": "*",
39
+ "@opencode-ai/plugin": "*",
38
40
  "zod": ">=4.1.8"
39
41
  },
40
42
  "peerDependenciesMeta": {
41
43
  "@anthropic-ai/sdk": {
42
44
  "optional": true
43
45
  },
46
+ "@opencode-ai/plugin": {
47
+ "optional": false
48
+ },
44
49
  "zod": {
45
50
  "optional": false
46
51
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows-opencode-tui",
3
- "version": "6.20.1",
3
+ "version": "6.20.2",
4
4
  "description": "OpenCode TUI sidebar plugin that displays the current responsible-vibe workflow phase and name",
5
5
  "main": "workflows-phase.tsx",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows-visualizer",
3
- "version": "6.20.1",
3
+ "version": "6.20.2",
4
4
  "type": "module",
5
5
  "main": "dist/index.ts",
6
6
  "module": "dist/index.ts",