@codemcp/workflows 6.20.0 → 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 +2 -2
- package/packages/cli/package.json +1 -1
- package/packages/core/package.json +1 -1
- package/packages/docs/.vitepress/dist/404.html +1 -1
- package/packages/docs/.vitepress/dist/assets/{style.CuNDUwrv.css → style.7CpfO9Xx.css} +1 -1
- package/packages/docs/.vitepress/dist/dev/ARCHITECTURE.html +1 -1
- package/packages/docs/.vitepress/dist/dev/DEVELOPMENT.html +1 -1
- package/packages/docs/.vitepress/dist/dev/LOGGING.html +1 -1
- package/packages/docs/.vitepress/dist/dev/PUBLISHING.html +1 -1
- package/packages/docs/.vitepress/dist/index.html +1 -1
- package/packages/docs/.vitepress/dist/user/advanced-engineering.html +1 -1
- package/packages/docs/.vitepress/dist/user/agent-setup.html +1 -1
- package/packages/docs/.vitepress/dist/user/beads-integration.html +1 -1
- package/packages/docs/.vitepress/dist/user/crowd-mcp-integration.html +1 -1
- package/packages/docs/.vitepress/dist/user/custom-workflows.html +1 -1
- package/packages/docs/.vitepress/dist/user/git-commit-feature.html +1 -1
- package/packages/docs/.vitepress/dist/user/how-it-works.html +1 -1
- package/packages/docs/.vitepress/dist/user/long-term-memory.html +1 -1
- package/packages/docs/.vitepress/dist/user/packaged-workflows.html +1 -1
- package/packages/docs/.vitepress/dist/user/tutorial.html +1 -1
- package/packages/docs/.vitepress/dist/user/workflow-selection.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/adr.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/big-bang-conversion.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/boundary-testing.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/bugfix.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/business-analysis.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/c4-analysis.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/epcc.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/game-beginner.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/greenfield.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/minor.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/posts.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/pr-review.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/qrspi.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/sdd-bugfix-crowd.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/sdd-bugfix.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/sdd-feature-crowd.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/sdd-feature.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/sdd-greenfield-crowd.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/sdd-greenfield.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/skilled-bugfix.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/skilled-epcc.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/skilled-greenfield.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/slides.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/tdd.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/waterfall.html +1 -1
- package/packages/docs/.vitepress/dist/workflows.html +1 -1
- package/packages/docs/package.json +1 -1
- package/packages/mcp-server/package.json +1 -1
- package/packages/opencode-plugin/dist/index.d.ts +8 -192
- package/packages/opencode-plugin/dist/index.js +9 -1
- package/packages/opencode-plugin/package.json +6 -1
- package/packages/opencode-tui-plugin/package.json +1 -1
- package/packages/visualizer/dist/WorkflowVisualizer.vue +7 -2
- package/packages/visualizer/package.json +1 -1
|
@@ -1,72 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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
|
-
*
|
|
8
|
-
*
|
|
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
|
|
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
|
|
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.
|
|
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
|
}
|
|
@@ -1012,8 +1012,13 @@ onUnmounted(() => {
|
|
|
1012
1012
|
}
|
|
1013
1013
|
|
|
1014
1014
|
#workflow-visualizer-app .code-block ul,
|
|
1015
|
-
#workflow-visualizer-app .code-block ol
|
|
1016
|
-
|
|
1015
|
+
#workflow-visualizer-app .code-block ol {
|
|
1016
|
+
padding: 0;
|
|
1017
|
+
margin: 0 0 0 1rem;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
#workflow-visualizer-app .code-block li,
|
|
1021
|
+
#workflow-visualizer-app .code-block p {
|
|
1017
1022
|
line-height: 1.25rem;
|
|
1018
1023
|
padding: 0;
|
|
1019
1024
|
margin: 0;
|