@codemcp/workflows-opencode 6.5.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.
- package/LICENSE +674 -0
- package/README.md +85 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/opencode-logger.d.ts +21 -0
- package/dist/opencode-logger.js +104 -0
- package/dist/opencode-logger.js.map +1 -0
- package/dist/plugin.d.ts +23 -0
- package/dist/plugin.js +395 -0
- package/dist/plugin.js.map +1 -0
- package/dist/server-context.d.ts +40 -0
- package/dist/server-context.js +96 -0
- package/dist/server-context.js.map +1 -0
- package/dist/tool-handlers/conduct-review.d.ts +3 -0
- package/dist/tool-handlers/conduct-review.js +37 -0
- package/dist/tool-handlers/conduct-review.js.map +1 -0
- package/dist/tool-handlers/proceed-to-phase.d.ts +3 -0
- package/dist/tool-handlers/proceed-to-phase.js +74 -0
- package/dist/tool-handlers/proceed-to-phase.js.map +1 -0
- package/dist/tool-handlers/reset-development.d.ts +3 -0
- package/dist/tool-handlers/reset-development.js +63 -0
- package/dist/tool-handlers/reset-development.js.map +1 -0
- package/dist/tool-handlers/setup-project-docs.d.ts +3 -0
- package/dist/tool-handlers/setup-project-docs.js +74 -0
- package/dist/tool-handlers/setup-project-docs.js.map +1 -0
- package/dist/tool-handlers/start-development.d.ts +3 -0
- package/dist/tool-handlers/start-development.js +69 -0
- package/dist/tool-handlers/start-development.js.map +1 -0
- package/dist/tool-handlers/tool-helper.d.ts +10 -0
- package/dist/tool-handlers/tool-helper.js +7 -0
- package/dist/tool-handlers/tool-helper.js.map +1 -0
- package/dist/types.d.ts +193 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +14 -0
- package/dist/utils.js +26 -0
- package/dist/utils.js.map +1 -0
- package/package.json +52 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenCode Plugin Types
|
|
3
|
+
*
|
|
4
|
+
* Minimal type definitions needed for the plugin.
|
|
5
|
+
* Based on @opencode-ai/plugin package types.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
export type Part = {
|
|
9
|
+
type: 'text' | 'image' | 'file' | 'tool_use' | 'tool_result';
|
|
10
|
+
text?: string;
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
};
|
|
13
|
+
export type UserMessage = {
|
|
14
|
+
id: string;
|
|
15
|
+
sessionID: string;
|
|
16
|
+
role: 'user';
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
};
|
|
19
|
+
export type Message = {
|
|
20
|
+
id: string;
|
|
21
|
+
sessionID: string;
|
|
22
|
+
role: 'user' | 'assistant';
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
};
|
|
25
|
+
export type Model = {
|
|
26
|
+
providerID: string;
|
|
27
|
+
modelID: string;
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
};
|
|
30
|
+
export type Project = {
|
|
31
|
+
id: string;
|
|
32
|
+
path: string;
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
};
|
|
35
|
+
export type PluginInput = {
|
|
36
|
+
client: unknown;
|
|
37
|
+
project: Project;
|
|
38
|
+
directory: string;
|
|
39
|
+
worktree: string;
|
|
40
|
+
serverUrl: URL;
|
|
41
|
+
$: unknown;
|
|
42
|
+
};
|
|
43
|
+
export type ToolContext = {
|
|
44
|
+
sessionID: string;
|
|
45
|
+
messageID: string;
|
|
46
|
+
agent: string;
|
|
47
|
+
directory: string;
|
|
48
|
+
worktree: string;
|
|
49
|
+
abort: AbortSignal;
|
|
50
|
+
metadata(input: {
|
|
51
|
+
title?: string;
|
|
52
|
+
metadata?: Record<string, unknown>;
|
|
53
|
+
}): void;
|
|
54
|
+
ask(input: {
|
|
55
|
+
permission: string;
|
|
56
|
+
patterns: string[];
|
|
57
|
+
always: string[];
|
|
58
|
+
metadata: Record<string, unknown>;
|
|
59
|
+
}): Promise<void>;
|
|
60
|
+
};
|
|
61
|
+
export type ToolDefinition = {
|
|
62
|
+
description: string;
|
|
63
|
+
args: z.ZodRawShape;
|
|
64
|
+
execute(args: unknown, context: ToolContext): Promise<string>;
|
|
65
|
+
};
|
|
66
|
+
export interface Hooks {
|
|
67
|
+
event?: (input: {
|
|
68
|
+
event: unknown;
|
|
69
|
+
}) => Promise<void>;
|
|
70
|
+
config?: (input: unknown) => Promise<void>;
|
|
71
|
+
tool?: {
|
|
72
|
+
[key: string]: ToolDefinition;
|
|
73
|
+
};
|
|
74
|
+
auth?: unknown;
|
|
75
|
+
/**
|
|
76
|
+
* Called when a new message is received
|
|
77
|
+
*/
|
|
78
|
+
'chat.message'?: (input: {
|
|
79
|
+
sessionID: string;
|
|
80
|
+
agent?: string;
|
|
81
|
+
model?: {
|
|
82
|
+
providerID: string;
|
|
83
|
+
modelID: string;
|
|
84
|
+
};
|
|
85
|
+
messageID?: string;
|
|
86
|
+
variant?: string;
|
|
87
|
+
}, output: {
|
|
88
|
+
message: UserMessage;
|
|
89
|
+
parts: Part[];
|
|
90
|
+
}) => Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* Modify parameters sent to LLM
|
|
93
|
+
*/
|
|
94
|
+
'chat.params'?: (input: {
|
|
95
|
+
sessionID: string;
|
|
96
|
+
agent: string;
|
|
97
|
+
model: Model;
|
|
98
|
+
provider: unknown;
|
|
99
|
+
message: UserMessage;
|
|
100
|
+
}, output: {
|
|
101
|
+
temperature: number;
|
|
102
|
+
topP: number;
|
|
103
|
+
topK: number;
|
|
104
|
+
options: Record<string, unknown>;
|
|
105
|
+
}) => Promise<void>;
|
|
106
|
+
'chat.headers'?: (input: {
|
|
107
|
+
sessionID: string;
|
|
108
|
+
agent: string;
|
|
109
|
+
model: Model;
|
|
110
|
+
provider: unknown;
|
|
111
|
+
message: UserMessage;
|
|
112
|
+
}, output: {
|
|
113
|
+
headers: Record<string, string>;
|
|
114
|
+
}) => Promise<void>;
|
|
115
|
+
'permission.ask'?: (input: unknown, output: {
|
|
116
|
+
status: 'ask' | 'deny' | 'allow';
|
|
117
|
+
}) => Promise<void>;
|
|
118
|
+
'command.execute.before'?: (input: {
|
|
119
|
+
command: string;
|
|
120
|
+
sessionID: string;
|
|
121
|
+
arguments: string;
|
|
122
|
+
}, output: {
|
|
123
|
+
parts: Part[];
|
|
124
|
+
}) => Promise<void>;
|
|
125
|
+
'tool.execute.before'?: (input: {
|
|
126
|
+
tool: string;
|
|
127
|
+
sessionID: string;
|
|
128
|
+
callID: string;
|
|
129
|
+
}, output: {
|
|
130
|
+
args: Record<string, unknown>;
|
|
131
|
+
}) => Promise<void>;
|
|
132
|
+
'shell.env'?: (input: {
|
|
133
|
+
cwd: string;
|
|
134
|
+
sessionID?: string;
|
|
135
|
+
callID?: string;
|
|
136
|
+
}, output: {
|
|
137
|
+
env: Record<string, string>;
|
|
138
|
+
}) => Promise<void>;
|
|
139
|
+
'tool.execute.after'?: (input: {
|
|
140
|
+
tool: string;
|
|
141
|
+
sessionID: string;
|
|
142
|
+
callID: string;
|
|
143
|
+
args: unknown;
|
|
144
|
+
}, output: {
|
|
145
|
+
title: string;
|
|
146
|
+
output: string;
|
|
147
|
+
metadata: unknown;
|
|
148
|
+
}) => Promise<void>;
|
|
149
|
+
'experimental.chat.messages.transform'?: (input: Record<string, never>, output: {
|
|
150
|
+
messages: {
|
|
151
|
+
info: Message;
|
|
152
|
+
parts: Part[];
|
|
153
|
+
}[];
|
|
154
|
+
}) => Promise<void>;
|
|
155
|
+
'experimental.chat.system.transform'?: (input: {
|
|
156
|
+
sessionID?: string;
|
|
157
|
+
model: Model;
|
|
158
|
+
}, output: {
|
|
159
|
+
system: string[];
|
|
160
|
+
}) => Promise<void>;
|
|
161
|
+
/**
|
|
162
|
+
* Called before session compaction starts. Allows plugins to customize
|
|
163
|
+
* the compaction prompt.
|
|
164
|
+
*/
|
|
165
|
+
'experimental.session.compacting'?: (input: {
|
|
166
|
+
sessionID: string;
|
|
167
|
+
}, output: {
|
|
168
|
+
context: string[];
|
|
169
|
+
prompt?: string;
|
|
170
|
+
}) => Promise<void>;
|
|
171
|
+
'experimental.text.complete'?: (input: {
|
|
172
|
+
sessionID: string;
|
|
173
|
+
messageID: string;
|
|
174
|
+
partID: string;
|
|
175
|
+
}, output: {
|
|
176
|
+
text: string;
|
|
177
|
+
}) => Promise<void>;
|
|
178
|
+
/**
|
|
179
|
+
* Modify tool definitions (description and parameters) sent to LLM
|
|
180
|
+
*/
|
|
181
|
+
'tool.definition'?: (input: {
|
|
182
|
+
toolID: string;
|
|
183
|
+
}, output: {
|
|
184
|
+
description: string;
|
|
185
|
+
parameters: unknown;
|
|
186
|
+
}) => Promise<void>;
|
|
187
|
+
}
|
|
188
|
+
export type Plugin = (input: PluginInput) => Promise<Hooks>;
|
|
189
|
+
export type PluginModule = {
|
|
190
|
+
id?: string;
|
|
191
|
+
server: Plugin;
|
|
192
|
+
tui?: never;
|
|
193
|
+
};
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format a date as YYYY-MM-DD
|
|
3
|
+
*/
|
|
4
|
+
export declare function formatDate(date: Date): string;
|
|
5
|
+
/**
|
|
6
|
+
* Get the current git branch for a project
|
|
7
|
+
*/
|
|
8
|
+
export declare function getCurrentGitBranch(projectPath: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Strip whats_next() references from instructions.
|
|
11
|
+
* The plugin auto-injects instructions via chat.message hook,
|
|
12
|
+
* so users don't need to call whats_next() manually.
|
|
13
|
+
*/
|
|
14
|
+
export declare function stripWhatsNextReferences(text: string): string;
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { GitManager } from '@codemcp/workflows-core';
|
|
2
|
+
/**
|
|
3
|
+
* Format a date as YYYY-MM-DD
|
|
4
|
+
*/
|
|
5
|
+
export function formatDate(date) {
|
|
6
|
+
return date.toISOString().split('T')[0];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Get the current git branch for a project
|
|
10
|
+
*/
|
|
11
|
+
export function getCurrentGitBranch(projectPath) {
|
|
12
|
+
return GitManager.getCurrentBranch(projectPath);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Strip whats_next() references from instructions.
|
|
16
|
+
* The plugin auto-injects instructions via chat.message hook,
|
|
17
|
+
* so users don't need to call whats_next() manually.
|
|
18
|
+
*/
|
|
19
|
+
export function stripWhatsNextReferences(text) {
|
|
20
|
+
return text
|
|
21
|
+
.split('\n')
|
|
22
|
+
.filter(line => !line.toLowerCase().includes('whats_next'))
|
|
23
|
+
.join('\n')
|
|
24
|
+
.replace(/\n{3,}/g, '\n\n'); // Collapse multiple blank lines
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAU;IACnC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,WAAmB;IACrD,OAAO,UAAU,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAY;IACnD,OAAO,IAAI;SACR,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;SAC1D,IAAI,CAAC,IAAI,CAAC;SACV,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,gCAAgC;AACjE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@codemcp/workflows-opencode",
|
|
3
|
+
"version": "6.5.0",
|
|
4
|
+
"description": "OpenCode plugin for structured development workflows",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/**/*"
|
|
10
|
+
],
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"zod": "^4.1.8",
|
|
16
|
+
"@codemcp/workflows-core": "6.5.0",
|
|
17
|
+
"@codemcp/workflows-server": "6.5.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"rimraf": "^6.0.1",
|
|
21
|
+
"vitest": "4.0.18"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"@anthropic-ai/sdk": "*"
|
|
25
|
+
},
|
|
26
|
+
"peerDependenciesMeta": {
|
|
27
|
+
"@anthropic-ai/sdk": {
|
|
28
|
+
"optional": true
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"opencode",
|
|
33
|
+
"plugin",
|
|
34
|
+
"workflows",
|
|
35
|
+
"development"
|
|
36
|
+
],
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "https://github.com/mrsimpson/responsible-vibe-mcp"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsc -p tsconfig.build.json",
|
|
44
|
+
"dev": "tsc --watch",
|
|
45
|
+
"clean:build": "rimraf ./dist",
|
|
46
|
+
"test": "vitest --run",
|
|
47
|
+
"lint": "oxlint .",
|
|
48
|
+
"lint:fix": "oxlint --fix .",
|
|
49
|
+
"format:check": "prettier --check .",
|
|
50
|
+
"format": "prettier --write ."
|
|
51
|
+
}
|
|
52
|
+
}
|