@syntesseraai/opencode-feature-factory 0.2.21 → 0.2.22
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/bin/ff-deploy.js +35 -80
- package/package.json +1 -1
package/bin/ff-deploy.js
CHANGED
|
@@ -27,9 +27,27 @@ const SOURCE_AGENTS_DIR = join(PACKAGE_ROOT, 'agents');
|
|
|
27
27
|
// Check if running in interactive mode (has TTY)
|
|
28
28
|
const isInteractive = process.stdin.isTTY && process.stdout.isTTY;
|
|
29
29
|
|
|
30
|
-
//
|
|
31
|
-
const
|
|
32
|
-
|
|
30
|
+
// Default MCP configuration
|
|
31
|
+
const DEFAULT_MCP_SERVERS = {
|
|
32
|
+
'jina-ai': {
|
|
33
|
+
type: 'remote',
|
|
34
|
+
url: 'https://mcp.jina.ai/v1',
|
|
35
|
+
headers: {
|
|
36
|
+
Authorization: 'Bearer {env:JINAAI_API_KEY}',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
gh_grep: {
|
|
40
|
+
type: 'remote',
|
|
41
|
+
url: 'https://mcp.grep.app',
|
|
42
|
+
},
|
|
43
|
+
context7: {
|
|
44
|
+
type: 'remote',
|
|
45
|
+
url: 'https://mcp.context7.com/mcp',
|
|
46
|
+
headers: {
|
|
47
|
+
CONTEXT7_API_KEY: '{env:CONTEXT7_API_KEY}',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
33
51
|
|
|
34
52
|
async function ensureDir(dir) {
|
|
35
53
|
try {
|
|
@@ -94,92 +112,32 @@ async function updateMCPConfig() {
|
|
|
94
112
|
// No existing config, will create new
|
|
95
113
|
}
|
|
96
114
|
|
|
97
|
-
//
|
|
115
|
+
// Check which MCP servers need to be added
|
|
116
|
+
const existingMcp = existingConfig.mcp || {};
|
|
98
117
|
const serversToAdd = {};
|
|
99
118
|
let serversAdded = 0;
|
|
100
119
|
let serversSkipped = 0;
|
|
101
|
-
let serversMissingKey = 0;
|
|
102
|
-
|
|
103
|
-
// jina-ai: requires JINAAI_API_KEY
|
|
104
|
-
if (!existingConfig.mcp?.['jina-ai']) {
|
|
105
|
-
if (JINAAI_API_KEY) {
|
|
106
|
-
serversToAdd['jina-ai'] = {
|
|
107
|
-
type: 'remote',
|
|
108
|
-
url: 'https://mcp.jina.ai/v1',
|
|
109
|
-
headers: {
|
|
110
|
-
Authorization: 'Bearer {env:JINAAI_API_KEY}',
|
|
111
|
-
},
|
|
112
|
-
};
|
|
113
|
-
serversAdded++;
|
|
114
|
-
if (isInteractive) {
|
|
115
|
-
console.log(' ✅ jina-ai: added (JINAAI_API_KEY found)');
|
|
116
|
-
}
|
|
117
|
-
} else {
|
|
118
|
-
serversMissingKey++;
|
|
119
|
-
if (isInteractive) {
|
|
120
|
-
console.log(' ⏭️ jina-ai: skipped (JINAAI_API_KEY not set)');
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
} else {
|
|
124
|
-
serversSkipped++;
|
|
125
|
-
if (isInteractive) {
|
|
126
|
-
console.log(' ⏭️ jina-ai: already exists');
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
120
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
url: 'https://mcp.grep.app',
|
|
135
|
-
};
|
|
136
|
-
serversAdded++;
|
|
137
|
-
if (isInteractive) {
|
|
138
|
-
console.log(' ✅ gh_grep: added (no API key required)');
|
|
139
|
-
}
|
|
140
|
-
} else {
|
|
141
|
-
serversSkipped++;
|
|
142
|
-
if (isInteractive) {
|
|
143
|
-
console.log(' ⏭️ gh_grep: already exists');
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// context7: requires CONTEXT7_API_KEY
|
|
148
|
-
if (!existingConfig.mcp?.['context7']) {
|
|
149
|
-
if (CONTEXT7_API_KEY) {
|
|
150
|
-
serversToAdd['context7'] = {
|
|
151
|
-
type: 'remote',
|
|
152
|
-
url: 'https://mcp.context7.com/mcp',
|
|
153
|
-
headers: {
|
|
154
|
-
CONTEXT7_API_KEY: '{env:CONTEXT7_API_KEY}',
|
|
155
|
-
},
|
|
156
|
-
};
|
|
157
|
-
serversAdded++;
|
|
121
|
+
for (const [serverName, serverConfig] of Object.entries(DEFAULT_MCP_SERVERS)) {
|
|
122
|
+
if (existingMcp[serverName]) {
|
|
123
|
+
// Server already exists, skip
|
|
124
|
+
serversSkipped++;
|
|
158
125
|
if (isInteractive) {
|
|
159
|
-
console.log(
|
|
126
|
+
console.log(` ⏭️ ${serverName}: already exists, skipping`);
|
|
160
127
|
}
|
|
161
128
|
} else {
|
|
162
|
-
|
|
129
|
+
// Server doesn't exist, add it
|
|
130
|
+
serversToAdd[serverName] = serverConfig;
|
|
131
|
+
serversAdded++;
|
|
163
132
|
if (isInteractive) {
|
|
164
|
-
console.log(
|
|
133
|
+
console.log(` ✅ ${serverName}: will be added`);
|
|
165
134
|
}
|
|
166
135
|
}
|
|
167
|
-
} else {
|
|
168
|
-
serversSkipped++;
|
|
169
|
-
if (isInteractive) {
|
|
170
|
-
console.log(' ⏭️ context7: already exists');
|
|
171
|
-
}
|
|
172
136
|
}
|
|
173
137
|
|
|
174
138
|
if (serversAdded === 0) {
|
|
175
139
|
if (isInteractive) {
|
|
176
|
-
|
|
177
|
-
console.log('\n⚠️ No new MCP servers added. Set API keys to enable:');
|
|
178
|
-
console.log(' - JINAAI_API_KEY for jina-ai');
|
|
179
|
-
console.log(' - CONTEXT7_API_KEY for context7');
|
|
180
|
-
} else {
|
|
181
|
-
console.log('\n✅ All MCP servers already configured.');
|
|
182
|
-
}
|
|
140
|
+
console.log('\n✅ All MCP servers already configured. No changes needed.');
|
|
183
141
|
}
|
|
184
142
|
return;
|
|
185
143
|
}
|
|
@@ -198,7 +156,7 @@ async function updateMCPConfig() {
|
|
|
198
156
|
const updatedConfig = {
|
|
199
157
|
...existingConfig,
|
|
200
158
|
mcp: {
|
|
201
|
-
...
|
|
159
|
+
...existingMcp,
|
|
202
160
|
...serversToAdd,
|
|
203
161
|
},
|
|
204
162
|
};
|
|
@@ -212,9 +170,6 @@ async function updateMCPConfig() {
|
|
|
212
170
|
if (serversSkipped > 0) {
|
|
213
171
|
console.log(` Skipped ${serversSkipped} existing server(s)`);
|
|
214
172
|
}
|
|
215
|
-
if (serversMissingKey > 0) {
|
|
216
|
-
console.log(` Skipped ${serversMissingKey} server(s) due to missing API keys`);
|
|
217
|
-
}
|
|
218
173
|
console.log('\n📝 Note: Restart OpenCode to load new MCP configuration');
|
|
219
174
|
}
|
|
220
175
|
} catch (error) {
|
|
@@ -293,7 +248,7 @@ async function deploy() {
|
|
|
293
248
|
console.log(' - Use @ff-research to investigate external topics');
|
|
294
249
|
}
|
|
295
250
|
|
|
296
|
-
// Always update MCP config (no flag needed)
|
|
251
|
+
// Always update MCP config (no flag needed, no prompts)
|
|
297
252
|
await updateMCPConfig();
|
|
298
253
|
} catch (error) {
|
|
299
254
|
if (isInteractive) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@syntesseraai/opencode-feature-factory",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.22",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "OpenCode plugin for Feature Factory agents - provides sub-agents and skills for validation, review, security, and architecture assessment",
|
|
7
7
|
"license": "MIT",
|