@splicr/mcp-server 0.14.0 → 0.14.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.
- package/dist/cli.js +57 -0
- package/dist/lib/api-client.d.ts +5 -0
- package/dist/lib/api-client.js +7 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -198,6 +198,9 @@ async function main() {
|
|
|
198
198
|
case 'index':
|
|
199
199
|
await runIndex();
|
|
200
200
|
break;
|
|
201
|
+
case 'webhook':
|
|
202
|
+
await webhookCommand();
|
|
203
|
+
break;
|
|
201
204
|
case 'dashboard':
|
|
202
205
|
case 'open': {
|
|
203
206
|
const url = 'https://splicr.dev/dashboard';
|
|
@@ -1145,6 +1148,59 @@ function printManualConfig() {
|
|
|
1145
1148
|
console.error(' }');
|
|
1146
1149
|
console.error(' }\n');
|
|
1147
1150
|
}
|
|
1151
|
+
// ─── splicr webhook ───
|
|
1152
|
+
async function webhookCommand() {
|
|
1153
|
+
const { hasAuth } = await import('./auth.js');
|
|
1154
|
+
if (!hasAuth()) {
|
|
1155
|
+
console.error('Not authenticated. Run: splicr setup');
|
|
1156
|
+
process.exit(1);
|
|
1157
|
+
}
|
|
1158
|
+
if (subCommand !== 'setup') {
|
|
1159
|
+
console.error(`
|
|
1160
|
+
Splicr Webhooks
|
|
1161
|
+
|
|
1162
|
+
Commands:
|
|
1163
|
+
webhook setup Generate webhook secret + show GitHub config instructions
|
|
1164
|
+
|
|
1165
|
+
Auto-extracts patterns from PR review comments.
|
|
1166
|
+
When a reviewer says "use X, not Y", Splicr registers it as a team pattern.
|
|
1167
|
+
`);
|
|
1168
|
+
return;
|
|
1169
|
+
}
|
|
1170
|
+
const { listTeams, setupWebhook } = await import('./lib/api-client.js');
|
|
1171
|
+
// Get user's teams
|
|
1172
|
+
let teams;
|
|
1173
|
+
try {
|
|
1174
|
+
teams = await listTeams();
|
|
1175
|
+
}
|
|
1176
|
+
catch {
|
|
1177
|
+
console.error('Failed to load teams.');
|
|
1178
|
+
process.exit(1);
|
|
1179
|
+
}
|
|
1180
|
+
if (!teams || teams.length === 0) {
|
|
1181
|
+
console.error('You need a team first. Create one:');
|
|
1182
|
+
console.error(' splicr team create "My Team"');
|
|
1183
|
+
process.exit(1);
|
|
1184
|
+
}
|
|
1185
|
+
const team = teams[0];
|
|
1186
|
+
console.error(`Setting up GitHub webhook for team "${team.name}"...\n`);
|
|
1187
|
+
try {
|
|
1188
|
+
const result = await setupWebhook(team.id);
|
|
1189
|
+
console.error('Webhook secret generated. Configure GitHub:\n');
|
|
1190
|
+
console.error(` 1. Go to your repo -> Settings -> Webhooks -> Add webhook`);
|
|
1191
|
+
console.error(` 2. Payload URL: ${result.webhook_url}`);
|
|
1192
|
+
console.error(` 3. Content type: application/json`);
|
|
1193
|
+
console.error(` 4. Secret: ${result.webhook_secret}`);
|
|
1194
|
+
console.error(` 5. Events: Select "Pull request review comments"`);
|
|
1195
|
+
console.error(` 6. Click "Add webhook"\n`);
|
|
1196
|
+
console.error('Once configured, Splicr auto-extracts patterns from PR reviews.');
|
|
1197
|
+
console.error('Every agent on the team will follow these patterns.\n');
|
|
1198
|
+
}
|
|
1199
|
+
catch (err) {
|
|
1200
|
+
console.error(`Failed: ${err.message}`);
|
|
1201
|
+
process.exit(1);
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1148
1204
|
// ─── splicr index ───
|
|
1149
1205
|
async function runIndex() {
|
|
1150
1206
|
const target = process.argv[3];
|
|
@@ -1346,6 +1402,7 @@ function printHelp() {
|
|
|
1346
1402
|
team join <code> Join a team by invite code
|
|
1347
1403
|
index <path> Index local files into your knowledge base
|
|
1348
1404
|
index <dir> Index all supported files in a directory
|
|
1405
|
+
webhook setup Set up GitHub PR webhook (auto-extract patterns from reviews)
|
|
1349
1406
|
dashboard Open knowledge dashboard in browser
|
|
1350
1407
|
uninstall Remove Splicr from all coding agents
|
|
1351
1408
|
|
package/dist/lib/api-client.d.ts
CHANGED
|
@@ -50,6 +50,11 @@ export declare function indexFile(params: {
|
|
|
50
50
|
title: string;
|
|
51
51
|
status: 'created' | 'updated';
|
|
52
52
|
}>;
|
|
53
|
+
export declare function listTeams(): Promise<any[]>;
|
|
54
|
+
export declare function setupWebhook(teamId: string): Promise<{
|
|
55
|
+
webhook_secret: string;
|
|
56
|
+
webhook_url: string;
|
|
57
|
+
}>;
|
|
53
58
|
export declare function resolveProject(params: {
|
|
54
59
|
local_path?: string;
|
|
55
60
|
git_remote_url?: string;
|
package/dist/lib/api-client.js
CHANGED
|
@@ -61,6 +61,13 @@ export async function saveFromAgent(params) {
|
|
|
61
61
|
export async function indexFile(params) {
|
|
62
62
|
return await apiRequest('POST', '/mcp/index', params);
|
|
63
63
|
}
|
|
64
|
+
export async function listTeams() {
|
|
65
|
+
const data = await apiRequest('GET', '/teams');
|
|
66
|
+
return data ?? [];
|
|
67
|
+
}
|
|
68
|
+
export async function setupWebhook(teamId) {
|
|
69
|
+
return await apiRequest('POST', `/teams/${teamId}/webhook`, {});
|
|
70
|
+
}
|
|
64
71
|
export async function resolveProject(params) {
|
|
65
72
|
return await apiRequest('POST', '/mcp/resolve-project', params);
|
|
66
73
|
}
|