repoball 0.1.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/README.md +46 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +151 -0
- package/dist/cli.js.map +1 -0
- package/dist/client.d.ts +27 -0
- package/dist/client.js +44 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -0
- package/dist/tools.d.ts +31 -0
- package/dist/tools.js +177 -0
- package/dist/tools.js.map +1 -0
- package/package.json +42 -0
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# RepoBall MCP Plugin
|
|
2
|
+
|
|
3
|
+
Connect AI coding agents from the [RepoBall](https://repoball.com) marketplace directly to your IDE via the Model Context Protocol (MCP).
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Install and connect an agent (replace <slug> with the agent's slug)
|
|
9
|
+
REPOBALL_API_KEY=<your-key> npx repoball connect <agent-slug>
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Then restart Cursor. The agent's tools will be available in chat.
|
|
13
|
+
|
|
14
|
+
## Getting Your API Key
|
|
15
|
+
|
|
16
|
+
1. Sign in at [repoball.com](https://repoball.com)
|
|
17
|
+
2. Go to **Dashboard > Settings**
|
|
18
|
+
3. Click **Copy Key**
|
|
19
|
+
|
|
20
|
+
## Commands
|
|
21
|
+
|
|
22
|
+
| Command | Description |
|
|
23
|
+
|---------|-------------|
|
|
24
|
+
| `repoball connect <slug>` | Configure Cursor to use an agent |
|
|
25
|
+
| `repoball disconnect` | Remove RepoBall from Cursor |
|
|
26
|
+
| `repoball status` | Show current connection status |
|
|
27
|
+
|
|
28
|
+
## MCP Tools
|
|
29
|
+
|
|
30
|
+
Once connected, these tools are available in your IDE:
|
|
31
|
+
|
|
32
|
+
- **ask_agent** — Ask the connected agent a coding question
|
|
33
|
+
- **browse_agents** — Search the marketplace for agents
|
|
34
|
+
- **list_my_agents** — List your purchased agents
|
|
35
|
+
|
|
36
|
+
## Environment Variables
|
|
37
|
+
|
|
38
|
+
| Variable | Default | Description |
|
|
39
|
+
|----------|---------|-------------|
|
|
40
|
+
| `REPOBALL_API_KEY` | — | Your JWT token (required) |
|
|
41
|
+
| `REPOBALL_API_URL` | `https://api.repoball.com/api/v1` | API server URL |
|
|
42
|
+
| `REPOBALL_DEFAULT_AGENT` | — | Default agent slug (set by `connect`) |
|
|
43
|
+
|
|
44
|
+
## License
|
|
45
|
+
|
|
46
|
+
MIT
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs";
|
|
3
|
+
import { join, dirname } from "path";
|
|
4
|
+
import { homedir } from "os";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = dirname(__filename);
|
|
8
|
+
const HELP = `
|
|
9
|
+
repoball — Connect AI coding agents to your IDE
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
repoball connect <agent-slug> Configure Cursor to use an agent
|
|
13
|
+
repoball disconnect Remove RepoBall from Cursor
|
|
14
|
+
repoball status Show current connection status
|
|
15
|
+
repoball help Show this help
|
|
16
|
+
|
|
17
|
+
Examples:
|
|
18
|
+
repoball connect ShakedNeeman-c-flight-system-expert
|
|
19
|
+
REPOBALL_API_KEY=eyJ... repoball connect my-agent
|
|
20
|
+
|
|
21
|
+
Environment:
|
|
22
|
+
REPOBALL_API_KEY Your JWT token (get it from the dashboard)
|
|
23
|
+
REPOBALL_API_URL API server URL (default: https://api.repoball.com/api/v1)
|
|
24
|
+
`;
|
|
25
|
+
function getCursorMcpPath() {
|
|
26
|
+
const cwd = process.cwd();
|
|
27
|
+
return join(cwd, ".cursor", "mcp.json");
|
|
28
|
+
}
|
|
29
|
+
function getGlobalCursorMcpPath() {
|
|
30
|
+
return join(homedir(), ".cursor", "mcp.json");
|
|
31
|
+
}
|
|
32
|
+
function readMcpConfig(path) {
|
|
33
|
+
if (!existsSync(path))
|
|
34
|
+
return {};
|
|
35
|
+
try {
|
|
36
|
+
return JSON.parse(readFileSync(path, "utf-8"));
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return {};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function writeMcpConfig(path, config) {
|
|
43
|
+
const dir = join(path, "..");
|
|
44
|
+
if (!existsSync(dir)) {
|
|
45
|
+
mkdirSync(dir, { recursive: true });
|
|
46
|
+
}
|
|
47
|
+
writeFileSync(path, JSON.stringify(config, null, 2) + "\n");
|
|
48
|
+
}
|
|
49
|
+
function connect(agentSlug) {
|
|
50
|
+
const apiKey = process.env.REPOBALL_API_KEY || "";
|
|
51
|
+
const apiUrl = process.env.REPOBALL_API_URL || "https://api.repoball.com/api/v1";
|
|
52
|
+
const mcpServerPath = join(__dirname, "index.js");
|
|
53
|
+
const nodePath = process.execPath;
|
|
54
|
+
const localPath = getCursorMcpPath();
|
|
55
|
+
const config = readMcpConfig(localPath);
|
|
56
|
+
if (!config.mcpServers) {
|
|
57
|
+
config.mcpServers = {};
|
|
58
|
+
}
|
|
59
|
+
config.mcpServers["repoball"] = {
|
|
60
|
+
command: nodePath,
|
|
61
|
+
args: [mcpServerPath],
|
|
62
|
+
env: {
|
|
63
|
+
REPOBALL_API_KEY: apiKey,
|
|
64
|
+
REPOBALL_API_URL: apiUrl,
|
|
65
|
+
REPOBALL_DEFAULT_AGENT: agentSlug,
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
writeMcpConfig(localPath, config);
|
|
69
|
+
console.log("");
|
|
70
|
+
console.log(" RepoBall connected to Cursor!");
|
|
71
|
+
console.log("");
|
|
72
|
+
console.log(` Agent: ${agentSlug}`);
|
|
73
|
+
console.log(` API URL: ${apiUrl}`);
|
|
74
|
+
console.log(` Config: ${localPath}`);
|
|
75
|
+
console.log(` API Key: ${apiKey ? "configured" : "NOT SET — set REPOBALL_API_KEY"}`);
|
|
76
|
+
console.log("");
|
|
77
|
+
if (!apiKey) {
|
|
78
|
+
console.log(" To set your API key:");
|
|
79
|
+
console.log(" 1. Log in at https://repoball.com (or http://localhost:3000 for local dev)");
|
|
80
|
+
console.log(" 2. Go to Dashboard > Settings and copy your API Key");
|
|
81
|
+
console.log(" 3. Run: REPOBALL_API_KEY=<token> repoball connect " + agentSlug);
|
|
82
|
+
console.log("");
|
|
83
|
+
}
|
|
84
|
+
console.log(" Restart Cursor to activate. Then use the agent:");
|
|
85
|
+
console.log(" - In chat: \"Ask my agent about linked lists\"");
|
|
86
|
+
console.log(" - Tool: ask_agent(agent: \"" + agentSlug + "\", question: \"...\")");
|
|
87
|
+
console.log("");
|
|
88
|
+
}
|
|
89
|
+
function disconnect() {
|
|
90
|
+
const localPath = getCursorMcpPath();
|
|
91
|
+
const config = readMcpConfig(localPath);
|
|
92
|
+
if (config.mcpServers?.["repoball"]) {
|
|
93
|
+
delete config.mcpServers["repoball"];
|
|
94
|
+
writeMcpConfig(localPath, config);
|
|
95
|
+
console.log("\n RepoBall disconnected from Cursor.\n");
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
console.log("\n RepoBall is not currently connected.\n");
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function status() {
|
|
102
|
+
const localPath = getCursorMcpPath();
|
|
103
|
+
const config = readMcpConfig(localPath);
|
|
104
|
+
const server = config.mcpServers?.["repoball"];
|
|
105
|
+
console.log("");
|
|
106
|
+
if (server) {
|
|
107
|
+
console.log(" RepoBall is connected");
|
|
108
|
+
console.log(` Config: ${localPath}`);
|
|
109
|
+
console.log(` Command: ${server.command} ${(server.args || []).join(" ")}`);
|
|
110
|
+
console.log(` Agent: ${server.env?.REPOBALL_DEFAULT_AGENT || "none"}`);
|
|
111
|
+
console.log(` API URL: ${server.env?.REPOBALL_API_URL || "default"}`);
|
|
112
|
+
console.log(` API Key: ${server.env?.REPOBALL_API_KEY ? "set" : "NOT SET"}`);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
console.log(" RepoBall is not connected.");
|
|
116
|
+
console.log(" Run: repoball connect <agent-slug>");
|
|
117
|
+
}
|
|
118
|
+
console.log("");
|
|
119
|
+
}
|
|
120
|
+
// ---- Main ----
|
|
121
|
+
const args = process.argv.slice(2);
|
|
122
|
+
const command = args[0];
|
|
123
|
+
switch (command) {
|
|
124
|
+
case "connect": {
|
|
125
|
+
const slug = args[1];
|
|
126
|
+
if (!slug) {
|
|
127
|
+
console.error("\n Error: agent slug is required\n");
|
|
128
|
+
console.error(" Usage: repoball connect <agent-slug>\n");
|
|
129
|
+
process.exit(1);
|
|
130
|
+
}
|
|
131
|
+
connect(slug);
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
case "disconnect":
|
|
135
|
+
disconnect();
|
|
136
|
+
break;
|
|
137
|
+
case "status":
|
|
138
|
+
status();
|
|
139
|
+
break;
|
|
140
|
+
case "help":
|
|
141
|
+
case "--help":
|
|
142
|
+
case "-h":
|
|
143
|
+
case undefined:
|
|
144
|
+
console.log(HELP);
|
|
145
|
+
break;
|
|
146
|
+
default:
|
|
147
|
+
console.error(`\n Unknown command: ${command}\n`);
|
|
148
|
+
console.log(HELP);
|
|
149
|
+
process.exit(1);
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EA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C;QAClB,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC;QACd,MAAM;IACR,CAAC;IACD,KAAK,YAAY;QACf,UAAU,EAAE,CAAC;QACb,MAAM;IACR,KAAK,QAAQ;QACX,MAAM,EAAE,CAAC;QACT,MAAM;IACR,KAAK,MAAM,CAAC;IACZ,KAAK,QAAQ,CAAC;IACd,KAAK,IAAI,CAAC;IACV,KAAK,SAAS;QACZ,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,MAAM;IACR;QACE,OAAO,CAAC,KAAK,CAAC,wBAAwB,OAAO,IAAI,CAAC,CAAC;QACnD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface AgentInfo {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
slug: string;
|
|
5
|
+
tagline: string;
|
|
6
|
+
category: string;
|
|
7
|
+
languages: string;
|
|
8
|
+
avg_rating: number;
|
|
9
|
+
}
|
|
10
|
+
export interface QueryResponse {
|
|
11
|
+
answer: string;
|
|
12
|
+
sources_used: number;
|
|
13
|
+
query: string;
|
|
14
|
+
context: string | null;
|
|
15
|
+
agent_name: string;
|
|
16
|
+
agent_expertise: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class RepoBallClient {
|
|
19
|
+
private baseUrl;
|
|
20
|
+
private apiKey;
|
|
21
|
+
constructor(baseUrl: string, apiKey: string);
|
|
22
|
+
private request;
|
|
23
|
+
getMyAgents(): Promise<AgentInfo[]>;
|
|
24
|
+
searchAgents(query: string): Promise<AgentInfo[]>;
|
|
25
|
+
queryAgent(agentId: string, question: string, mode?: string): Promise<QueryResponse>;
|
|
26
|
+
getAgentBySlug(slug: string): Promise<AgentInfo>;
|
|
27
|
+
}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export class RepoBallClient {
|
|
2
|
+
baseUrl;
|
|
3
|
+
apiKey;
|
|
4
|
+
constructor(baseUrl, apiKey) {
|
|
5
|
+
this.baseUrl = baseUrl;
|
|
6
|
+
this.apiKey = apiKey;
|
|
7
|
+
}
|
|
8
|
+
async request(path, options = {}) {
|
|
9
|
+
const headers = {
|
|
10
|
+
"Content-Type": "application/json",
|
|
11
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
12
|
+
...options.headers,
|
|
13
|
+
};
|
|
14
|
+
const response = await fetch(`${this.baseUrl}${path}`, {
|
|
15
|
+
...options,
|
|
16
|
+
headers,
|
|
17
|
+
});
|
|
18
|
+
if (!response.ok) {
|
|
19
|
+
const error = await response.json().catch(() => ({ detail: "Request failed" }));
|
|
20
|
+
throw new Error(error.detail || `HTTP ${response.status}`);
|
|
21
|
+
}
|
|
22
|
+
return response.json();
|
|
23
|
+
}
|
|
24
|
+
async getMyAgents() {
|
|
25
|
+
const purchases = await this.request("/purchases/mine");
|
|
26
|
+
return purchases
|
|
27
|
+
.filter((p) => p.status === "active" && p.agent)
|
|
28
|
+
.map((p) => p.agent);
|
|
29
|
+
}
|
|
30
|
+
async searchAgents(query) {
|
|
31
|
+
const data = await this.request(`/marketplace/search?query=${encodeURIComponent(query)}&limit=10`);
|
|
32
|
+
return data.agents || [];
|
|
33
|
+
}
|
|
34
|
+
async queryAgent(agentId, question, mode = "context") {
|
|
35
|
+
return this.request(`/knowledge/agents/${agentId}/query`, {
|
|
36
|
+
method: "POST",
|
|
37
|
+
body: JSON.stringify({ query: question, mode }),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
async getAgentBySlug(slug) {
|
|
41
|
+
return this.request(`/agents/slug/${slug}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],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,CAAC,YAAY,CAAC,KAAa;QAC9B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAC7B,6BAA6B,kBAAkB,CAAC,KAAK,CAAC,WAAW,CAClE,CAAC;QACF,OAAO,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,OAAe,EAAE,QAAgB,EAAE,OAAe,SAAS;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAgB,qBAAqB,OAAO,QAAQ,EAAE;YACvE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAChD,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,IAAY;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAY,gBAAgB,IAAI,EAAE,CAAC,CAAC;IACzD,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
+
import { RepoBallClient } from "./client.js";
|
|
6
|
+
import { ToolRegistry } from "./tools.js";
|
|
7
|
+
class RepoBallMCPServer {
|
|
8
|
+
server;
|
|
9
|
+
client;
|
|
10
|
+
tools;
|
|
11
|
+
constructor() {
|
|
12
|
+
this.server = new Server({ name: "repoball", version: "0.1.0" }, { capabilities: { tools: {}, resources: {} } });
|
|
13
|
+
const apiKey = process.env.REPOBALL_API_KEY || "";
|
|
14
|
+
const apiUrl = process.env.REPOBALL_API_URL || "https://api.repoball.com/api/v1";
|
|
15
|
+
const defaultAgent = process.env.REPOBALL_DEFAULT_AGENT || "";
|
|
16
|
+
this.client = new RepoBallClient(apiUrl, apiKey);
|
|
17
|
+
this.tools = new ToolRegistry(this.client, defaultAgent);
|
|
18
|
+
this.registerHandlers();
|
|
19
|
+
}
|
|
20
|
+
registerHandlers() {
|
|
21
|
+
this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
22
|
+
tools: this.tools.getToolDefinitions(),
|
|
23
|
+
}));
|
|
24
|
+
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
25
|
+
const { name, arguments: args } = request.params;
|
|
26
|
+
return this.tools.executeTool(name, args || {});
|
|
27
|
+
});
|
|
28
|
+
this.server.setRequestHandler(ListResourcesRequestSchema, async () => ({
|
|
29
|
+
resources: [
|
|
30
|
+
{
|
|
31
|
+
uri: "repoball://agents",
|
|
32
|
+
mimeType: "application/json",
|
|
33
|
+
name: "My Purchased Agents",
|
|
34
|
+
description: "List of agents you have purchased and can query",
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
}));
|
|
38
|
+
this.server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
39
|
+
const { uri } = request.params;
|
|
40
|
+
if (uri === "repoball://agents") {
|
|
41
|
+
const agents = await this.client.getMyAgents();
|
|
42
|
+
return {
|
|
43
|
+
contents: [
|
|
44
|
+
{
|
|
45
|
+
uri,
|
|
46
|
+
mimeType: "application/json",
|
|
47
|
+
text: JSON.stringify(agents, null, 2),
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
throw new Error(`Unknown resource: ${uri}`);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
async run() {
|
|
56
|
+
const transport = new StdioServerTransport();
|
|
57
|
+
await this.server.connect(transport);
|
|
58
|
+
console.error("RepoBall MCP server running on stdio");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const server = new RepoBallMCPServer();
|
|
62
|
+
server.run().catch(console.error);
|
|
63
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,iBAAiB;IACb,MAAM,CAAS;IACf,MAAM,CAAiB;IACvB,KAAK,CAAe;IAE5B;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CACtB,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EACtC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,CAC/C,CAAC;QAEF,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC;QAClD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,iCAAiC,CAAC;QACjF,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,EAAE,CAAC;QAE9D,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjD,IAAI,CAAC,KAAK,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QAEzD,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAEO,gBAAgB;QACtB,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,sBAAsB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;IAED,KAAK,CAAC,GAAG;QACP,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC7C,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACrC,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACxD,CAAC;CACF;AAED,MAAM,MAAM,GAAG,IAAI,iBAAiB,EAAE,CAAC;AACvC,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { RepoBallClient } from "./client.js";
|
|
2
|
+
interface ToolDefinition {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: Record<string, unknown>;
|
|
8
|
+
required?: string[];
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
interface ToolResult {
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
content: Array<{
|
|
14
|
+
type: "text";
|
|
15
|
+
text: string;
|
|
16
|
+
}>;
|
|
17
|
+
isError?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare class ToolRegistry {
|
|
20
|
+
private client;
|
|
21
|
+
private defaultAgent;
|
|
22
|
+
private handlers;
|
|
23
|
+
constructor(client: RepoBallClient, defaultAgent?: string);
|
|
24
|
+
getToolDefinitions(): ToolDefinition[];
|
|
25
|
+
executeTool(name: string, args: Record<string, unknown>): Promise<ToolResult>;
|
|
26
|
+
private registerAll;
|
|
27
|
+
private handleAskAgent;
|
|
28
|
+
private handleBrowseAgents;
|
|
29
|
+
private handleListMyAgents;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
package/dist/tools.js
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
export class ToolRegistry {
|
|
2
|
+
client;
|
|
3
|
+
defaultAgent;
|
|
4
|
+
handlers = new Map();
|
|
5
|
+
constructor(client, defaultAgent = "") {
|
|
6
|
+
this.client = client;
|
|
7
|
+
this.defaultAgent = defaultAgent;
|
|
8
|
+
this.registerAll();
|
|
9
|
+
}
|
|
10
|
+
getToolDefinitions() {
|
|
11
|
+
const defaultNote = this.defaultAgent
|
|
12
|
+
? ` If no agent is specified, defaults to '${this.defaultAgent}'.`
|
|
13
|
+
: "";
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
name: "ask_agent",
|
|
17
|
+
description: "Ask an AI coding agent a question. The agent has deep expertise " +
|
|
18
|
+
"from real production codebases — it knows patterns, architecture, and techniques " +
|
|
19
|
+
"that generic AI doesn't. It will NEVER expose the raw source code, but will " +
|
|
20
|
+
"explain concepts and give you code examples based on real working code." +
|
|
21
|
+
defaultNote,
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: "object",
|
|
24
|
+
properties: {
|
|
25
|
+
agent: {
|
|
26
|
+
type: "string",
|
|
27
|
+
description: `The agent slug (e.g., 'ShakedNeeman-c-flight-system-expert')${this.defaultAgent ? `. Default: '${this.defaultAgent}'` : ""}`,
|
|
28
|
+
},
|
|
29
|
+
question: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "Your coding question for the agent",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
required: ["question"],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "browse_agents",
|
|
39
|
+
description: "Search the RepoBall marketplace for available coding agents. " +
|
|
40
|
+
"Find agents by technology, language, or skill area.",
|
|
41
|
+
inputSchema: {
|
|
42
|
+
type: "object",
|
|
43
|
+
properties: {
|
|
44
|
+
query: {
|
|
45
|
+
type: "string",
|
|
46
|
+
description: "Search query (e.g., 'C programming', 'react animations', 'golang microservices')",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
required: ["query"],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "list_my_agents",
|
|
54
|
+
description: "List all agents you have purchased and can currently query.",
|
|
55
|
+
inputSchema: {
|
|
56
|
+
type: "object",
|
|
57
|
+
properties: {},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
async executeTool(name, args) {
|
|
63
|
+
const handler = this.handlers.get(name);
|
|
64
|
+
if (!handler) {
|
|
65
|
+
return {
|
|
66
|
+
content: [{ type: "text", text: `Unknown tool: ${name}` }],
|
|
67
|
+
isError: true,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
return await handler(args);
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
const message = error instanceof Error ? error.message : "Unknown error";
|
|
75
|
+
return {
|
|
76
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
77
|
+
isError: true,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
registerAll() {
|
|
82
|
+
this.handlers.set("ask_agent", this.handleAskAgent.bind(this));
|
|
83
|
+
this.handlers.set("browse_agents", this.handleBrowseAgents.bind(this));
|
|
84
|
+
this.handlers.set("list_my_agents", this.handleListMyAgents.bind(this));
|
|
85
|
+
}
|
|
86
|
+
async handleAskAgent(args) {
|
|
87
|
+
const agentSlug = String(args.agent || this.defaultAgent || "");
|
|
88
|
+
const question = String(args.question || "");
|
|
89
|
+
if (!agentSlug) {
|
|
90
|
+
return {
|
|
91
|
+
content: [{ type: "text", text: "Agent slug is required. Provide it or set a default with `repoball connect <slug>`." }],
|
|
92
|
+
isError: true,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
if (!question) {
|
|
96
|
+
return {
|
|
97
|
+
content: [{ type: "text", text: "'question' is required." }],
|
|
98
|
+
isError: true,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
const agent = await this.client.getAgentBySlug(agentSlug);
|
|
102
|
+
const response = await this.client.queryAgent(agent.id, question, "context");
|
|
103
|
+
if (response.context) {
|
|
104
|
+
const instructions = `You are acting as "${response.agent_name}", an expert coding agent.\n` +
|
|
105
|
+
`Expertise: ${response.agent_expertise}\n\n` +
|
|
106
|
+
`The user asked: "${question}"\n\n` +
|
|
107
|
+
`Below is PROPRIETARY code context from a real developer's production codebase.\n` +
|
|
108
|
+
`Use this code to give a highly specific, expert answer.\n\n` +
|
|
109
|
+
`RULES:\n` +
|
|
110
|
+
`- NEVER show the raw source code. It is proprietary and paid content.\n` +
|
|
111
|
+
`- Explain concepts, patterns, and architecture BASED on what you see.\n` +
|
|
112
|
+
`- Write NEW example code inspired by these patterns if the user needs code.\n` +
|
|
113
|
+
`- Reference file names and function names to show deep understanding.\n` +
|
|
114
|
+
`- Be much more specific than a generic AI — you have real code context.\n\n` +
|
|
115
|
+
`--- PROPRIETARY CODE CONTEXT (${response.sources_used} files) ---\n` +
|
|
116
|
+
response.context +
|
|
117
|
+
`\n--- END CODE CONTEXT ---\n\n` +
|
|
118
|
+
`Now answer the user's question based on this codebase.`;
|
|
119
|
+
return {
|
|
120
|
+
content: [{ type: "text", text: instructions }],
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
content: [
|
|
125
|
+
{
|
|
126
|
+
type: "text",
|
|
127
|
+
text: response.answer || "No relevant code found for this query.",
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
async handleBrowseAgents(args) {
|
|
133
|
+
const query = String(args.query || "");
|
|
134
|
+
const agents = await this.client.searchAgents(query);
|
|
135
|
+
if (agents.length === 0) {
|
|
136
|
+
return {
|
|
137
|
+
content: [{ type: "text", text: `No agents found for "${query}". Try a different search.` }],
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
const list = agents
|
|
141
|
+
.map((a) => `- **${a.name}** (\`${a.slug}\`) — ${a.tagline} | ${a.languages}`)
|
|
142
|
+
.join("\n");
|
|
143
|
+
return {
|
|
144
|
+
content: [
|
|
145
|
+
{
|
|
146
|
+
type: "text",
|
|
147
|
+
text: `Found ${agents.length} agents:\n\n${list}\n\nUse \`ask_agent\` with the agent slug to query one.`,
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
async handleListMyAgents(_args) {
|
|
153
|
+
const agents = await this.client.getMyAgents();
|
|
154
|
+
if (agents.length === 0) {
|
|
155
|
+
return {
|
|
156
|
+
content: [
|
|
157
|
+
{
|
|
158
|
+
type: "text",
|
|
159
|
+
text: "You haven't purchased any agents yet. Use `browse_agents` to find agents, then purchase them at repoball.com.",
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
const list = agents
|
|
165
|
+
.map((a) => `- **${a.name}** (\`${a.slug}\`) — ${a.category} | ${a.languages}`)
|
|
166
|
+
.join("\n");
|
|
167
|
+
return {
|
|
168
|
+
content: [
|
|
169
|
+
{
|
|
170
|
+
type: "text",
|
|
171
|
+
text: `Your agents:\n\n${list}\n\nUse \`ask_agent\` with the agent slug to query any of these.`,
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAoBA,MAAM,OAAO,YAAY;IACf,MAAM,CAAiB;IACvB,YAAY,CAAS;IACrB,QAAQ,GAA6B,IAAI,GAAG,EAAE,CAAC;IAEvD,YAAY,MAAsB,EAAE,eAAuB,EAAE;QAC3D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAED,kBAAkB;QAChB,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY;YACnC,CAAC,CAAC,2CAA2C,IAAI,CA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CAAC;IACJ,CAAC;CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "repoball",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "RepoBall MCP server — AI coding agents powered by real developer codebases",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"repoball": "dist/cli.js",
|
|
9
|
+
"repoball-mcp": "dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc",
|
|
13
|
+
"dev": "tsc --watch",
|
|
14
|
+
"start": "node dist/index.js",
|
|
15
|
+
"prepublishOnly": "npm run build"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/ShakedNeeman/repoball"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://repoball.com",
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public",
|
|
28
|
+
"registry": "https://registry.npmjs.org/"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "^22.10.0",
|
|
35
|
+
"typescript": "^5.7.0"
|
|
36
|
+
},
|
|
37
|
+
"keywords": ["mcp", "cursor", "claude", "ai-agents", "coding", "repoball", "marketplace"],
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=18"
|
|
41
|
+
}
|
|
42
|
+
}
|