@rotifer/mcp-server 0.8.2 → 0.8.6

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 CHANGED
@@ -1,6 +1,20 @@
1
+ <div align="center">
2
+
1
3
  # @rotifer/mcp-server
2
4
 
3
- MCP (Model Context Protocol) server for the [Rotifer Protocol](https://rotifer.dev) Gene ecosystem. Lets AI agents search, inspect, compare, and rank Genes directly from any MCP-compatible IDE.
5
+ [![npm](https://img.shields.io/npm/v/@rotifer/mcp-server)](https://www.npmjs.com/package/@rotifer/mcp-server)
6
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](LICENSE)
7
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D20-brightgreen)](https://nodejs.org/)
8
+ [![MCP](https://img.shields.io/badge/MCP-Compatible-indigo)](https://modelcontextprotocol.io)
9
+
10
+ **Build, compose, and run AI agents — directly from your IDE.**
11
+
12
+ Search genes, create agents with composable genomes, run pipelines in a WASM sandbox, and compete in the Arena.
13
+ Zero config. Works with Cursor, Claude Desktop, Windsurf, and any MCP-compatible client.
14
+
15
+ </div>
16
+
17
+ ---
4
18
 
5
19
  ## Quick Start
6
20
 
@@ -13,7 +27,7 @@ Add to `.cursor/mcp.json`:
13
27
  "mcpServers": {
14
28
  "rotifer": {
15
29
  "command": "npx",
16
- "args": ["-y", "@rotifer/mcp-server"]
30
+ "args": ["@rotifer/mcp-server"]
17
31
  }
18
32
  }
19
33
  }
@@ -28,7 +42,7 @@ Add to `claude_desktop_config.json`:
28
42
  "mcpServers": {
29
43
  "rotifer": {
30
44
  "command": "npx",
31
- "args": ["-y", "@rotifer/mcp-server"]
45
+ "args": ["@rotifer/mcp-server"]
32
46
  }
33
47
  }
34
48
  }
@@ -38,20 +52,100 @@ Add to `claude_desktop_config.json`:
38
52
 
39
53
  Use the same `npx` command — any client that supports MCP stdio transport will work.
40
54
 
41
- ## Tools
55
+ ## What Can It Do?
56
+
57
+ ### Create and run an agent in one conversation
58
+
59
+ ```
60
+ You: "Build me an agent for code security scanning"
61
+ AI: → create_agent({ agent_name: "sec-bot", gene_ids: ["security-scanner", "genesis-code-format"],
62
+ composition: "Seq" })
63
+ Agent 'sec-bot' created with 2-gene Seq genome.
64
+
65
+ You: "Run it on my project"
66
+ AI: → agent_run({ agent_name: "sec-bot", input: "{\"path\":\"./src\"}" })
67
+ Pipeline complete — 3 findings, 0 critical.
68
+ ```
69
+
70
+ ### Search, compare, and compose genes
71
+
72
+ ```
73
+ You: "Find the best gene for web search"
74
+ AI: → search_genes({ query: "web search" })
75
+ Found 8 genes. Top match: genesis-web-search (F(g) = 0.87, Native)
76
+
77
+ You: "Compare it against the lite version"
78
+ AI: → compare_genes({ gene_ids: ["...", "..."] })
79
+ Side-by-side: success rate, latency, fitness breakdown
80
+ ```
81
+
82
+ ### Full gene lifecycle from your IDE
42
83
 
43
- | Tool | Description |
44
- |------|-------------|
45
- | `search_genes` | Search the Gene ecosystem by name, domain, or description |
46
- | `get_gene_detail` | Get detailed info about a specific Gene (phenotype, fitness, metadata) |
47
- | `get_arena_rankings` | Get Arena rankings for a domain, sorted by F(g) fitness score |
48
- | `compare_genes` | Side-by-side fitness comparison of 2–5 Genes |
49
- | `get_gene_stats` | Download statistics for a Gene (total, 7d, 30d, 90d) |
50
- | `get_leaderboard` | Developer reputation leaderboard |
51
- | `get_developer_profile` | Developer public profile and reputation data |
52
- | `list_local_genes` | Scan local workspace for installed Genes |
84
+ ```
85
+ You: "Wrap my function as a gene"
86
+ AI: → wrap_gene({ gene_name: "my-search", domain: "search.web", fidelity: "Wrapped" })
87
+ compile_gene({ gene_name: "my-search" })
88
+ test_gene({ gene_name: "my-search", compliance: true })
89
+ publish_gene({ gene_name: "my-search", changelog: "Initial release" })
90
+ ```
53
91
 
54
- ## Resources
92
+ ## Tools (29)
93
+
94
+ ### Discovery & Analytics
95
+
96
+ | Tool | Description | Key Parameters |
97
+ |------|-------------|----------------|
98
+ | `search_genes` | Search the Gene ecosystem by name, domain, or description | `query`, `domain`, `fidelity`, `sort` (`relevance`/`newest`/`popular`/`fitness`), `page`, `per_page` |
99
+ | `get_gene_detail` | Get detailed info about a Gene (phenotype, fitness, metadata) | `gene_id`, `content_hash` (either identifies the gene) |
100
+ | `get_arena_rankings` | Arena rankings for a domain, sorted by F(g) fitness | `domain`, `page`, `per_page` |
101
+ | `compare_genes` | Side-by-side fitness comparison of 2–5 Genes | `gene_ids` (array) |
102
+ | `get_gene_stats` | Download statistics (total, 7d, 30d, 90d) | `gene_id` |
103
+ | `get_leaderboard` | Creator reputation leaderboard | `limit` |
104
+ | `get_developer_profile` | Creator public profile and reputation | `username` |
105
+ | `get_gene_reputation` | Detailed reputation breakdown (Arena, Usage, Stability) | `gene_id` |
106
+ | `list_gene_versions` | Version history chain with changelogs | `owner`, `gene_name` |
107
+ | `suggest_domain` | Suggest matching domains from the registry | `description` |
108
+
109
+ ### Local Workspace
110
+
111
+ | Tool | Description | Key Parameters |
112
+ |------|-------------|----------------|
113
+ | `list_local_genes` | Scan local workspace for installed Genes | `project_root`, `domain`, `fidelity` |
114
+ | `list_local_agents` | List Agents in the local workspace | `project_root`, `state` |
115
+
116
+ ### Gene Lifecycle
117
+
118
+ | Tool | Description | Key Parameters |
119
+ |------|-------------|----------------|
120
+ | `init_gene` | Initialize a new Gene project with starter files | `gene_name`, `fidelity`, `domain`, `no_genesis` |
121
+ | `scan_genes` | Scan for candidate functions or SKILL.md files | `path`, `skills`, `skills_path` |
122
+ | `wrap_gene` | Wrap a function/skill as a Gene | `gene_name`, `domain`, `fidelity`, `from_skill`, `from_clawhub` |
123
+ | `test_gene` | Test a Gene (schema validation + sandbox) | `gene_name`, `verbose`, `compliance` |
124
+ | `compile_gene` | Compile a Gene to WASM IR | `gene_name`, `check`, `wasm_path`, `lang` |
125
+ | `run_gene` | Execute a local Gene | `gene_name`, `input`, `verbose`, `no_sandbox`, `trust_unsigned` |
126
+ | `publish_gene` | Publish to Rotifer Cloud | `gene_name`, `all`, `description`, `changelog`, `skip_arena`, `skip_security` |
127
+ | `install_gene` | Install a Gene from Cloud Registry | `gene_id`, `project_root`, `force` |
128
+ | `vg_scan` | V(g) security scan — static analysis for Gene/Skill code safety | `path`, `gene_id`, `all`, `project_root` |
129
+ | `arena_submit` | Submit to Arena with 5D fitness scores | `gene_id`, `fitness_value`, `safety_score`, `success_rate`, `latency_score`, `resource_efficiency` |
130
+
131
+ ### Agent Composition
132
+
133
+ | Tool | Description | Key Parameters |
134
+ |------|-------------|----------------|
135
+ | `create_agent` | Create an Agent composing multiple Genes | `agent_name`, `gene_ids`, `composition` (`Seq`/`Par`/`Cond`/`Try`/`TryPool`), `domain`, `top`, `strategy`, `par_merge` |
136
+ | `agent_run` | Run a local Agent by name | `agent_name`, `input`, `verbose`, `no_sandbox` |
137
+
138
+ ### Authentication & Analytics
139
+
140
+ | Tool | Description | Key Parameters |
141
+ |------|-------------|----------------|
142
+ | `auth_status` | Check login status | — |
143
+ | `login` | OAuth login (GitHub/GitLab) | `provider`, `endpoint` |
144
+ | `logout` | Clear credentials | — |
145
+ | `get_mcp_stats` | MCP call analytics | `days` |
146
+ | `get_my_reputation` | Current user's reputation | — |
147
+
148
+ ## Resources (7)
55
149
 
56
150
  MCP Resources let AI clients reference Rotifer data as context:
57
151
 
@@ -59,31 +153,61 @@ MCP Resources let AI clients reference Rotifer data as context:
59
153
  |---|---|
60
154
  | `rotifer://genes/{gene_id}/stats` | Gene download statistics |
61
155
  | `rotifer://genes/{gene_id}` | Gene detail + phenotype |
62
- | `rotifer://developers/{username}` | Developer profile + reputation |
63
- | `rotifer://leaderboard` | Top developers by reputation score |
156
+ | `rotifer://developers/{username}` | Creator profile + reputation |
157
+ | `rotifer://leaderboard` | Top creators by reputation score |
64
158
  | `rotifer://local/genes` | Local Gene inventory |
159
+ | `rotifer://local/agents` | Local Agent registry |
160
+ | `rotifer://version` | MCP Server version and update availability |
65
161
 
66
- ### Examples
67
-
68
- **Search for web search genes:**
69
-
70
- > "Search for genes in the search.web domain"
71
-
72
- **Find the best gene for a task:**
73
-
74
- > "Show me Arena rankings for code.format"
162
+ ## Prompts (4)
75
163
 
76
- **Compare two genes:**
164
+ MCP Prompts give AI clients guided workflows for common tasks:
77
165
 
78
- > "Compare these two genes: [id-1] vs [id-2]"
166
+ | Prompt | Description | Key Arguments |
167
+ |--------|-------------|---------------|
168
+ | `rotifer-hello` | Interactive agent creation — pick a template and run immediately | `template`, `input` |
169
+ | `rotifer-guide` | Understand Rotifer Protocol — genes, agents, Arena, fidelity model | — |
170
+ | `rotifer-architect` | Design an Agent — task-driven gene search + composition planning | `task` |
171
+ | `rotifer-challenge` | Arena evaluation — submit a gene, compare with competitors | `gene` |
79
172
 
80
- **Check download trends:**
173
+ Try asking your AI: *"Use the rotifer-hello prompt to build me an agent"* or *"Use rotifer-architect to design an agent for document Q&A"*.
81
174
 
82
- > "Show me download stats for this gene"
175
+ ---
83
176
 
84
- **Explore local workspace:**
177
+ ## Architecture
85
178
 
86
- > "What genes are installed locally?"
179
+ ```
180
+ ┌─────────────────────────────────────────────────┐
181
+ │ AI IDE (Cursor / Claude / Windsurf) │
182
+ │ │
183
+ │ "Find genes for code formatting" │
184
+ │ │ │
185
+ │ ▼ │
186
+ │ ┌─────────────────────┐ │
187
+ │ │ MCP Client │ │
188
+ │ │ (stdio transport) │ │
189
+ │ └────────┬────────────┘ │
190
+ └───────────┼─────────────────────────────────────┘
191
+ │ MCP Protocol
192
+
193
+ ┌─────────────────────────────────────────────────┐
194
+ │ @rotifer/mcp-server │
195
+ │ │
196
+ │ 29 Tools 7 Resources 4 Prompts Local Scanner│
197
+ │ ┌──────────┐ ┌───────────┐ ┌────────────┐ │
198
+ │ │ discover │ │rotifer:// │ │ ./genes/ │ │
199
+ │ │ lifecycle│ │genes/stats│ │ phenotype │ │
200
+ │ │ agents │ │developers │ │ agents │ │
201
+ │ │ auth │ │leaderboard│ └────────────┘ │
202
+ │ └────┬─────┘ └─────┬─────┘ │ │
203
+ └───────┼──────────────┼────────────────┼─────────┘
204
+ │ │ │
205
+ ▼ ▼ ▼
206
+ ┌─────────────────────────────────────────────────┐
207
+ │ Rotifer Cloud API Local File System │
208
+ │ (Supabase) (genes/, .rotifer/) │
209
+ └─────────────────────────────────────────────────┘
210
+ ```
87
211
 
88
212
  ## Configuration
89
213
 
@@ -109,12 +233,23 @@ ROTIFER_CLOUD_ANON_KEY=your-anon-key
109
233
 
110
234
  - Node.js >= 20
111
235
 
236
+ ## Pair with the CLI
237
+
238
+ This MCP server works best alongside the [Rotifer CLI](https://github.com/rotifer-protocol/rotifer-playground). The CLI provides the local runtime (WASM sandbox, Arena engine, IR compiler) while the MCP server exposes it all to your AI assistant:
239
+
240
+ ```bash
241
+ npm install -g @rotifer/playground
242
+ rotifer init my-project && cd my-project
243
+ rotifer hello # your first agent in 30 seconds
244
+ ```
245
+
112
246
  ## Links
113
247
 
114
- - [Rotifer Protocol](https://rotifer.dev)
115
- - [MCP Setup Guide](https://rotifer.dev/docs/guides/mcp-setup)
116
- - [Gene Marketplace](https://rotifer.ai)
117
- - [Protocol Specification](https://github.com/rotifer-protocol/rotifer-spec)
248
+ - [Rotifer Protocol](https://rotifer.dev) — Main site
249
+ - [MCP Setup Guide](https://rotifer.dev/docs/guides/mcp-setup) — Step-by-step setup
250
+ - [Gene Marketplace](https://rotifer.ai) — Browse and discover Genes
251
+ - [CLI Playground](https://github.com/rotifer-protocol/rotifer-playground) — Build and test Genes locally
252
+ - [Protocol Specification](https://github.com/rotifer-protocol/rotifer-spec) — Formal spec
118
253
 
119
254
  ## License
120
255
 
package/dist/auth.d.ts CHANGED
@@ -18,7 +18,11 @@ export declare function clearCredentials(): void;
18
18
  export declare function generateCodeVerifier(): string;
19
19
  export declare function generateCodeChallenge(verifier: string): string;
20
20
  /**
21
- * Start a local HTTP server to receive the OAuth callback.
22
- * Handles both PKCE flow (?code=...) and implicit flow (#access_token=...).
21
+ * Start a local OAuth callback server on a random port (127.0.0.1:0).
22
+ * Returns the bound port immediately so the caller can construct the auth URL,
23
+ * plus a promise that resolves when the callback arrives.
23
24
  */
24
- export declare function waitForOAuthCallback(port?: number): Promise<string>;
25
+ export declare function startOAuthCallbackServer(): Promise<{
26
+ port: number;
27
+ waitForCallback: Promise<string>;
28
+ }>;
package/dist/auth.js CHANGED
@@ -1,4 +1,4 @@
1
- import { readFileSync, writeFileSync, existsSync, mkdirSync } from "node:fs";
1
+ import { readFileSync, writeFileSync, existsSync, mkdirSync, unlinkSync } from "node:fs";
2
2
  import { join } from "node:path";
3
3
  import { createServer } from "node:http";
4
4
  import { randomBytes, createHash } from "node:crypto";
@@ -34,7 +34,6 @@ export function saveCredentials(creds) {
34
34
  export function clearCredentials() {
35
35
  const path = credentialsPath();
36
36
  if (existsSync(path)) {
37
- const { unlinkSync } = require("node:fs");
38
37
  unlinkSync(path);
39
38
  }
40
39
  }
@@ -45,13 +44,21 @@ export function generateCodeChallenge(verifier) {
45
44
  return createHash("sha256").update(verifier).digest("base64url");
46
45
  }
47
46
  /**
48
- * Start a local HTTP server to receive the OAuth callback.
49
- * Handles both PKCE flow (?code=...) and implicit flow (#access_token=...).
47
+ * Start a local OAuth callback server on a random port (127.0.0.1:0).
48
+ * Returns the bound port immediately so the caller can construct the auth URL,
49
+ * plus a promise that resolves when the callback arrives.
50
50
  */
51
- export function waitForOAuthCallback(port = 9876) {
51
+ export async function startOAuthCallbackServer() {
52
52
  return new Promise((resolve, reject) => {
53
+ let callbackResolve;
54
+ let callbackReject;
55
+ const waitForCallback = new Promise((res, rej) => {
56
+ callbackResolve = res;
57
+ callbackReject = rej;
58
+ });
53
59
  const server = createServer((req, res) => {
54
- const url = new URL(req.url || "/", `http://localhost:${port}`);
60
+ const boundPort = server.address()?.port || 0;
61
+ const url = new URL(req.url || "/", `http://localhost:${boundPort}`);
55
62
  if (url.pathname === "/callback/token") {
56
63
  const token = url.searchParams.get("access_token");
57
64
  const refresh = url.searchParams.get("refresh_token");
@@ -61,7 +68,7 @@ export function waitForOAuthCallback(port = 9876) {
61
68
  "<p>You can close this window and return to the terminal.</p>" +
62
69
  "</body></html>");
63
70
  server.close();
64
- resolve(`implicit:${token}:${refresh || ""}`);
71
+ callbackResolve(`implicit:${token}:${refresh || ""}`);
65
72
  return;
66
73
  }
67
74
  }
@@ -72,7 +79,7 @@ export function waitForOAuthCallback(port = 9876) {
72
79
  "<p>You can close this window and return to the terminal.</p>" +
73
80
  "</body></html>");
74
81
  server.close();
75
- resolve(code);
82
+ callbackResolve(code);
76
83
  }
77
84
  else {
78
85
  res.writeHead(200, { "Content-Type": "text/html" });
@@ -92,15 +99,16 @@ if (window.location.hash) {
92
99
  </script><noscript>Enable JavaScript to complete login.</noscript></body></html>`);
93
100
  }
94
101
  });
95
- server.listen(port, () => {
96
- // Server ready
102
+ server.listen(0, "127.0.0.1", () => {
103
+ const addr = server.address();
104
+ resolve({ port: addr.port, waitForCallback });
97
105
  });
98
106
  server.on("error", (err) => {
99
107
  reject(new Error(`Failed to start callback server: ${err.message}`));
100
108
  });
101
109
  setTimeout(() => {
102
110
  server.close();
103
- reject(new Error("Login timed out after 120 seconds"));
111
+ callbackReject(new Error("Login timed out after 120 seconds"));
104
112
  }, 120_000);
105
113
  });
106
114
  }
package/dist/auth.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,YAAY,GAAG,IAAI,CACvB,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,MAAM,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,CAAC;YACf,cAAc,CAAC,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC,CAAC;QACjE,CAAC,EAAE,OAAO,CAAC,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
package/dist/cloud.d.ts CHANGED
@@ -11,13 +11,13 @@ export interface Gene {
11
11
  version: string;
12
12
  fidelity: string;
13
13
  description: string;
14
- wasm_size: number;
14
+ wasmSize: number;
15
15
  downloads: number;
16
- reputation_score: number | null;
17
- previous_version_id: string | null;
16
+ reputationScore: number | null;
17
+ previousVersionId: string | null;
18
18
  changelog: string | null;
19
- created_at: string;
20
- updated_at: string;
19
+ createdAt: string;
20
+ updatedAt: string;
21
21
  phenotype?: Record<string, unknown>;
22
22
  }
23
23
  export interface GeneListResult {
@@ -25,6 +25,7 @@ export interface GeneListResult {
25
25
  total: number;
26
26
  page: number;
27
27
  per_page: number;
28
+ has_more: boolean;
28
29
  }
29
30
  export declare function listGenes(options: {
30
31
  domain?: string;
@@ -34,28 +35,34 @@ export declare function listGenes(options: {
34
35
  page?: number;
35
36
  perPage?: number;
36
37
  }): Promise<GeneListResult>;
37
- export declare function getGene(id: string): Promise<Gene & {
38
+ export declare function getGene(idOrName: string): Promise<Gene & {
39
+ phenotype: Record<string, unknown>;
40
+ }>;
41
+ export declare function getGeneByContentHash(hash: string): Promise<Gene & {
38
42
  phenotype: Record<string, unknown>;
39
43
  }>;
40
44
  export interface ArenaEntry {
41
45
  rank: number;
42
- gene_id: string;
43
- gene_name: string;
46
+ geneId: string;
47
+ geneName: string;
44
48
  owner: string;
45
49
  domain: string;
46
50
  fidelity: string;
47
51
  fitness: number;
48
52
  safety: number;
49
- success_rate: number;
50
- latency_score: number;
51
- resource_efficiency: number;
52
- reputation_score: number | null;
53
- total_calls: number;
54
- last_evaluated: string;
53
+ successRate: number;
54
+ latencyScore: number;
55
+ resourceEfficiency: number;
56
+ reputationScore: number | null;
57
+ totalCalls: number;
58
+ lastEvaluated: string;
55
59
  }
56
60
  export interface ArenaRankingsResult {
57
61
  rankings: ArenaEntry[];
58
62
  total: number;
63
+ page: number;
64
+ per_page: number;
65
+ has_more: boolean;
59
66
  domain: string | null;
60
67
  }
61
68
  export declare function getArenaRankings(options: {
@@ -65,31 +72,31 @@ export declare function getArenaRankings(options: {
65
72
  }): Promise<ArenaRankingsResult>;
66
73
  export interface GeneStats {
67
74
  total: number;
68
- last_7d: number;
69
- last_30d: number;
70
- last_90d: number;
75
+ last7d: number;
76
+ last30d: number;
77
+ last90d: number;
71
78
  }
72
79
  export declare function getGeneStatsRpc(geneId: string): Promise<GeneStats>;
73
80
  export interface LeaderboardEntry {
74
- user_id: string;
81
+ userId: string;
75
82
  username: string;
76
- avatar_url: string | null;
83
+ avatarUrl: string | null;
77
84
  score: number;
78
- genes_published: number;
79
- total_downloads: number;
80
- arena_wins: number;
85
+ genesPublished: number;
86
+ totalDownloads: number;
87
+ arenaWins: number;
81
88
  }
82
89
  export declare function getReputationLeaderboard(limit?: number): Promise<LeaderboardEntry[]>;
83
90
  export interface DeveloperProfile {
84
- user_id: string;
91
+ userId: string;
85
92
  username: string;
86
- avatar_url: string | null;
87
- created_at: string;
93
+ avatarUrl: string | null;
94
+ createdAt: string;
88
95
  reputation: {
89
96
  score: number;
90
- genes_published: number;
91
- total_downloads: number;
92
- arena_wins: number;
97
+ genesPublished: number;
98
+ totalDownloads: number;
99
+ arenaWins: number;
93
100
  } | null;
94
101
  }
95
102
  export declare function getDeveloperProfile(username: string): Promise<DeveloperProfile>;
@@ -97,18 +104,18 @@ export interface GeneVersionEntry {
97
104
  id: string;
98
105
  version: string;
99
106
  changelog: string | null;
100
- previous_version_id: string | null;
101
- created_at: string;
107
+ previousVersionId: string | null;
108
+ createdAt: string;
102
109
  }
103
110
  export declare function listGeneVersions(ownerName: string, geneName: string): Promise<GeneVersionEntry[]>;
104
111
  export interface ArenaSubmitResult {
105
- gene_id: string;
112
+ geneId: string;
106
113
  domain: string;
107
- fitness_value: number;
108
- safety_score: number;
109
- success_rate: number;
110
- latency_score: number;
111
- resource_efficiency: number;
114
+ fitnessValue: number;
115
+ safetyScore: number;
116
+ successRate: number;
117
+ latencyScore: number;
118
+ resourceEfficiency: number;
112
119
  }
113
120
  export declare function arenaSubmitCloud(geneId: string, fitness: {
114
121
  value: number;
@@ -118,29 +125,29 @@ export declare function arenaSubmitCloud(geneId: string, fitness: {
118
125
  resource_efficiency: number;
119
126
  }): Promise<ArenaSubmitResult>;
120
127
  export interface GeneReputationResult {
121
- gene_id: string;
122
- gene_name: string;
128
+ geneId: string;
129
+ geneName: string;
123
130
  score: number;
124
- arena_score: number;
125
- usage_score: number;
126
- stability_score: number;
131
+ arenaScore: number;
132
+ usageScore: number;
133
+ stabilityScore: number;
127
134
  epoch: number;
128
- computed_at: string;
135
+ computedAt: string;
129
136
  }
130
137
  export declare function getGeneReputation(geneId: string): Promise<GeneReputationResult>;
131
138
  export interface MyReputationResult {
132
139
  username: string;
133
140
  score: number;
134
- genes_published: number;
135
- total_downloads: number;
136
- arena_wins: number;
137
- community_bonus: number;
141
+ genesPublished: number;
142
+ totalDownloads: number;
143
+ arenaWins: number;
144
+ communityBonus: number;
138
145
  }
139
146
  export declare function getMyReputation(): Promise<MyReputationResult>;
140
147
  export interface DomainSuggestion {
141
148
  domain: string;
142
149
  description: string | null;
143
- gene_count: number;
150
+ geneCount: number;
144
151
  }
145
152
  export declare function suggestDomain(description: string): Promise<DomainSuggestion[]>;
146
153
  export declare function logMcpCall(entry: {
@@ -152,25 +159,25 @@ export declare function logMcpCall(entry: {
152
159
  }): void;
153
160
  export interface McpStatsResult {
154
161
  period: string;
155
- total_calls: number;
156
- success_rate: number;
157
- avg_latency_ms: number;
158
- top_tools: Array<{
159
- tool_name: string;
162
+ totalCalls: number;
163
+ successRate: number;
164
+ avgLatencyMs: number;
165
+ topTools: Array<{
166
+ toolName: string;
160
167
  count: number;
161
168
  }>;
162
- top_genes: Array<{
163
- gene_id: string;
169
+ topGenes: Array<{
170
+ geneId: string;
164
171
  count: number;
165
172
  }>;
166
173
  }
167
174
  export declare function getMcpStats(days?: number): Promise<McpStatsResult>;
168
175
  export interface InstallResult {
169
- gene_id: string;
176
+ geneId: string;
170
177
  name: string;
171
178
  domain: string;
172
179
  fidelity: string;
173
- installed_to: string;
180
+ installedTo: string;
174
181
  }
175
- export declare function installGene(geneId: string, projectRoot: string): Promise<InstallResult>;
182
+ export declare function installGene(geneId: string, projectRoot: string, shouldForce?: boolean): Promise<InstallResult>;
176
183
  export {};