@codemcp/workflows 6.5.0 → 6.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/package.json +2 -2
  2. package/packages/cli/package.json +1 -1
  3. package/packages/core/package.json +1 -1
  4. package/packages/docs/package.json +1 -1
  5. package/packages/mcp-server/package.json +1 -1
  6. package/packages/opencode-plugin/dist/index.d.ts +216 -5
  7. package/packages/opencode-plugin/dist/index.js +28616 -11
  8. package/packages/opencode-plugin/package.json +8 -5
  9. package/packages/opencode-plugin/resources/agents/architect.yaml +61 -0
  10. package/packages/opencode-plugin/resources/agents/business-analyst.yaml +60 -0
  11. package/packages/opencode-plugin/resources/agents/developer.yaml +61 -0
  12. package/packages/opencode-plugin/resources/templates/architecture/arc42/arc42-template-EN.md +1077 -0
  13. package/packages/opencode-plugin/resources/templates/architecture/arc42/images/01_2_iso-25010-topics-EN.drawio-2023.png +0 -0
  14. package/packages/opencode-plugin/resources/templates/architecture/arc42/images/01_2_iso-25010-topics-EN.drawio.png +0 -0
  15. package/packages/opencode-plugin/resources/templates/architecture/arc42/images/05_building_blocks-EN.png +0 -0
  16. package/packages/opencode-plugin/resources/templates/architecture/arc42/images/08-concepts-EN.drawio.png +0 -0
  17. package/packages/opencode-plugin/resources/templates/architecture/arc42/images/arc42-logo.png +0 -0
  18. package/packages/opencode-plugin/resources/templates/architecture/c4.md +224 -0
  19. package/packages/opencode-plugin/resources/templates/architecture/freestyle.md +53 -0
  20. package/packages/opencode-plugin/resources/templates/architecture/game.md +250 -0
  21. package/packages/opencode-plugin/resources/templates/architecture/none.md +17 -0
  22. package/packages/opencode-plugin/resources/templates/design/comprehensive.md +207 -0
  23. package/packages/opencode-plugin/resources/templates/design/freestyle.md +37 -0
  24. package/packages/opencode-plugin/resources/templates/design/game.md +66 -0
  25. package/packages/opencode-plugin/resources/templates/design/none.md +17 -0
  26. package/packages/opencode-plugin/resources/templates/requirements/ears.md +90 -0
  27. package/packages/opencode-plugin/resources/templates/requirements/freestyle.md +42 -0
  28. package/packages/opencode-plugin/resources/templates/requirements/game.md +162 -0
  29. package/packages/opencode-plugin/resources/templates/requirements/none.md +17 -0
  30. package/packages/opencode-plugin/resources/templates/skills/POWER.md +23 -0
  31. package/packages/opencode-plugin/resources/templates/skills/SKILL.md +19 -0
  32. package/packages/opencode-plugin/resources/workflows/adr.yaml +157 -0
  33. package/packages/opencode-plugin/resources/workflows/big-bang-conversion.yaml +592 -0
  34. package/packages/opencode-plugin/resources/workflows/boundary-testing.yaml +376 -0
  35. package/packages/opencode-plugin/resources/workflows/bugfix.yaml +178 -0
  36. package/packages/opencode-plugin/resources/workflows/business-analysis.yaml +597 -0
  37. package/packages/opencode-plugin/resources/workflows/c4-analysis.yaml +471 -0
  38. package/packages/opencode-plugin/resources/workflows/epcc.yaml +195 -0
  39. package/packages/opencode-plugin/resources/workflows/game-beginner.yaml +434 -0
  40. package/packages/opencode-plugin/resources/workflows/greenfield.yaml +217 -0
  41. package/packages/opencode-plugin/resources/workflows/minor.yaml +146 -0
  42. package/packages/opencode-plugin/resources/workflows/posts.yaml +193 -0
  43. package/packages/opencode-plugin/resources/workflows/sdd-bugfix-crowd.yaml +608 -0
  44. package/packages/opencode-plugin/resources/workflows/sdd-bugfix.yaml +381 -0
  45. package/packages/opencode-plugin/resources/workflows/sdd-feature-crowd.yaml +713 -0
  46. package/packages/opencode-plugin/resources/workflows/sdd-feature.yaml +471 -0
  47. package/packages/opencode-plugin/resources/workflows/sdd-greenfield-crowd.yaml +336 -0
  48. package/packages/opencode-plugin/resources/workflows/sdd-greenfield.yaml +463 -0
  49. package/packages/opencode-plugin/resources/workflows/skilled-bugfix.yaml +174 -0
  50. package/packages/opencode-plugin/resources/workflows/skilled-epcc.yaml +171 -0
  51. package/packages/opencode-plugin/resources/workflows/skilled-greenfield.yaml +207 -0
  52. package/packages/opencode-plugin/resources/workflows/slides.yaml +237 -0
  53. package/packages/opencode-plugin/resources/workflows/tdd.yaml +170 -0
  54. package/packages/opencode-plugin/resources/workflows/waterfall.yaml +225 -0
  55. package/packages/opencode-tui-plugin/package.json +1 -1
  56. package/packages/visualizer/package.json +1 -1
  57. package/packages/opencode-plugin/dist/index.js.map +0 -1
  58. package/packages/opencode-plugin/dist/opencode-logger.d.ts +0 -21
  59. package/packages/opencode-plugin/dist/opencode-logger.js +0 -104
  60. package/packages/opencode-plugin/dist/opencode-logger.js.map +0 -1
  61. package/packages/opencode-plugin/dist/plugin.d.ts +0 -23
  62. package/packages/opencode-plugin/dist/plugin.js +0 -395
  63. package/packages/opencode-plugin/dist/plugin.js.map +0 -1
  64. package/packages/opencode-plugin/dist/server-context.d.ts +0 -40
  65. package/packages/opencode-plugin/dist/server-context.js +0 -96
  66. package/packages/opencode-plugin/dist/server-context.js.map +0 -1
  67. package/packages/opencode-plugin/dist/tool-handlers/conduct-review.d.ts +0 -3
  68. package/packages/opencode-plugin/dist/tool-handlers/conduct-review.js +0 -37
  69. package/packages/opencode-plugin/dist/tool-handlers/conduct-review.js.map +0 -1
  70. package/packages/opencode-plugin/dist/tool-handlers/proceed-to-phase.d.ts +0 -3
  71. package/packages/opencode-plugin/dist/tool-handlers/proceed-to-phase.js +0 -74
  72. package/packages/opencode-plugin/dist/tool-handlers/proceed-to-phase.js.map +0 -1
  73. package/packages/opencode-plugin/dist/tool-handlers/reset-development.d.ts +0 -3
  74. package/packages/opencode-plugin/dist/tool-handlers/reset-development.js +0 -63
  75. package/packages/opencode-plugin/dist/tool-handlers/reset-development.js.map +0 -1
  76. package/packages/opencode-plugin/dist/tool-handlers/setup-project-docs.d.ts +0 -3
  77. package/packages/opencode-plugin/dist/tool-handlers/setup-project-docs.js +0 -74
  78. package/packages/opencode-plugin/dist/tool-handlers/setup-project-docs.js.map +0 -1
  79. package/packages/opencode-plugin/dist/tool-handlers/start-development.d.ts +0 -3
  80. package/packages/opencode-plugin/dist/tool-handlers/start-development.js +0 -69
  81. package/packages/opencode-plugin/dist/tool-handlers/start-development.js.map +0 -1
  82. package/packages/opencode-plugin/dist/tool-handlers/tool-helper.d.ts +0 -10
  83. package/packages/opencode-plugin/dist/tool-handlers/tool-helper.js +0 -7
  84. package/packages/opencode-plugin/dist/tool-handlers/tool-helper.js.map +0 -1
  85. package/packages/opencode-plugin/dist/types.d.ts +0 -193
  86. package/packages/opencode-plugin/dist/types.js +0 -8
  87. package/packages/opencode-plugin/dist/types.js.map +0 -1
  88. package/packages/opencode-plugin/dist/utils.d.ts +0 -14
  89. package/packages/opencode-plugin/dist/utils.js +0 -26
  90. package/packages/opencode-plugin/dist/utils.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows",
3
- "version": "6.5.0",
3
+ "version": "6.5.1",
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.5.0"
54
+ "@codemcp/workflows-core": "6.5.1"
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.5.0",
3
+ "version": "6.5.1",
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.5.0",
3
+ "version": "6.5.1",
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.5.0",
3
+ "version": "6.5.1",
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.5.0",
3
+ "version": "6.5.1",
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,9 +1,220 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * OpenCode Plugin Types
5
+ *
6
+ * Minimal type definitions needed for the plugin.
7
+ * Based on @opencode-ai/plugin package types.
8
+ */
9
+
10
+ type Part = {
11
+ type: 'text' | 'image' | 'file' | 'tool_use' | 'tool_result';
12
+ text?: string;
13
+ [key: string]: unknown;
14
+ };
15
+ type UserMessage = {
16
+ id: string;
17
+ sessionID: string;
18
+ role: 'user';
19
+ [key: string]: unknown;
20
+ };
21
+ type Message = {
22
+ id: string;
23
+ sessionID: string;
24
+ role: 'user' | 'assistant';
25
+ [key: string]: unknown;
26
+ };
27
+ type Model = {
28
+ providerID: string;
29
+ modelID: string;
30
+ [key: string]: unknown;
31
+ };
32
+ type Project = {
33
+ id: string;
34
+ path: string;
35
+ [key: string]: unknown;
36
+ };
37
+ type PluginInput = {
38
+ client: unknown;
39
+ project: Project;
40
+ directory: string;
41
+ worktree: string;
42
+ serverUrl: URL;
43
+ $: unknown;
44
+ };
45
+ type ToolContext = {
46
+ sessionID: string;
47
+ messageID: string;
48
+ agent: string;
49
+ directory: string;
50
+ worktree: string;
51
+ abort: AbortSignal;
52
+ metadata(input: {
53
+ title?: string;
54
+ metadata?: Record<string, unknown>;
55
+ }): void;
56
+ ask(input: {
57
+ permission: string;
58
+ patterns: string[];
59
+ always: string[];
60
+ metadata: Record<string, unknown>;
61
+ }): Promise<void>;
62
+ };
63
+ type ToolDefinition = {
64
+ description: string;
65
+ args: z.ZodRawShape;
66
+ execute(args: unknown, context: ToolContext): Promise<string>;
67
+ };
68
+ interface Hooks {
69
+ event?: (input: {
70
+ event: unknown;
71
+ }) => Promise<void>;
72
+ config?: (input: unknown) => Promise<void>;
73
+ tool?: {
74
+ [key: string]: ToolDefinition;
75
+ };
76
+ auth?: unknown;
77
+ /**
78
+ * Called when a new message is received
79
+ */
80
+ 'chat.message'?: (input: {
81
+ sessionID: string;
82
+ agent?: string;
83
+ model?: {
84
+ providerID: string;
85
+ modelID: string;
86
+ };
87
+ messageID?: string;
88
+ variant?: string;
89
+ }, output: {
90
+ message: UserMessage;
91
+ parts: Part[];
92
+ }) => Promise<void>;
93
+ /**
94
+ * Modify parameters sent to LLM
95
+ */
96
+ 'chat.params'?: (input: {
97
+ sessionID: string;
98
+ agent: string;
99
+ model: Model;
100
+ provider: unknown;
101
+ message: UserMessage;
102
+ }, output: {
103
+ temperature: number;
104
+ topP: number;
105
+ topK: number;
106
+ options: Record<string, unknown>;
107
+ }) => Promise<void>;
108
+ 'chat.headers'?: (input: {
109
+ sessionID: string;
110
+ agent: string;
111
+ model: Model;
112
+ provider: unknown;
113
+ message: UserMessage;
114
+ }, output: {
115
+ headers: Record<string, string>;
116
+ }) => Promise<void>;
117
+ 'permission.ask'?: (input: unknown, output: {
118
+ status: 'ask' | 'deny' | 'allow';
119
+ }) => Promise<void>;
120
+ 'command.execute.before'?: (input: {
121
+ command: string;
122
+ sessionID: string;
123
+ arguments: string;
124
+ }, output: {
125
+ parts: Part[];
126
+ }) => Promise<void>;
127
+ 'tool.execute.before'?: (input: {
128
+ tool: string;
129
+ sessionID: string;
130
+ callID: string;
131
+ }, output: {
132
+ args: Record<string, unknown>;
133
+ }) => Promise<void>;
134
+ 'shell.env'?: (input: {
135
+ cwd: string;
136
+ sessionID?: string;
137
+ callID?: string;
138
+ }, output: {
139
+ env: Record<string, string>;
140
+ }) => Promise<void>;
141
+ 'tool.execute.after'?: (input: {
142
+ tool: string;
143
+ sessionID: string;
144
+ callID: string;
145
+ args: unknown;
146
+ }, output: {
147
+ title: string;
148
+ output: string;
149
+ metadata: unknown;
150
+ }) => Promise<void>;
151
+ 'experimental.chat.messages.transform'?: (input: Record<string, never>, output: {
152
+ messages: {
153
+ info: Message;
154
+ parts: Part[];
155
+ }[];
156
+ }) => Promise<void>;
157
+ 'experimental.chat.system.transform'?: (input: {
158
+ sessionID?: string;
159
+ model: Model;
160
+ }, output: {
161
+ system: string[];
162
+ }) => Promise<void>;
163
+ /**
164
+ * Called before session compaction starts. Allows plugins to customize
165
+ * the compaction prompt.
166
+ */
167
+ 'experimental.session.compacting'?: (input: {
168
+ sessionID: string;
169
+ }, output: {
170
+ context: string[];
171
+ prompt?: string;
172
+ }) => Promise<void>;
173
+ 'experimental.text.complete'?: (input: {
174
+ sessionID: string;
175
+ messageID: string;
176
+ partID: string;
177
+ }, output: {
178
+ text: string;
179
+ }) => Promise<void>;
180
+ /**
181
+ * Modify tool definitions (description and parameters) sent to LLM
182
+ */
183
+ 'tool.definition'?: (input: {
184
+ toolID: string;
185
+ }, output: {
186
+ description: string;
187
+ parameters: unknown;
188
+ }) => Promise<void>;
189
+ }
190
+ type Plugin = (input: PluginInput) => Promise<Hooks>;
191
+ type PluginModule = {
192
+ id?: string;
193
+ server: Plugin;
194
+ tui?: never;
195
+ };
196
+
1
197
  /**
2
198
  * OpenCode Workflows Plugin
3
199
  *
4
- * Structured development workflows for OpenCode.
5
- * Replaces the MCP server with native OpenCode integration.
200
+ * Integrates workflows-core state management with OpenCode hooks to provide
201
+ * phase-aware development guidance and file edit restrictions.
202
+ *
203
+ * Hooks implemented:
204
+ * 1. chat.message - Add synthetic part with phase instructions after each user message
205
+ * 2. tool.execute.before - Block editing of certain files based on phase
206
+ * 3. experimental.session.compacting - Inject workflow state into compaction context
207
+ *
208
+ * Logs are sent via OpenCode SDK's client.app.log() API
209
+ */
210
+
211
+ /**
212
+ * Main plugin export
6
213
  */
7
- export { WorkflowsPlugin } from './plugin.js';
8
- export * from './types.js';
9
- export { default } from './plugin.js';
214
+ declare const WorkflowsPlugin: Plugin;
215
+ declare const _default: {
216
+ id: string;
217
+ server: Plugin;
218
+ };
219
+
220
+ export { type Hooks, type Message, type Model, type Part, type Plugin, type PluginInput, type PluginModule, type Project, type ToolContext, type ToolDefinition, type UserMessage, WorkflowsPlugin, _default as default };