openzoo 0.35.0 → 0.35.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.
Files changed (2) hide show
  1. package/lib/mcp.js +41 -0
  2. package/package.json +1 -1
package/lib/mcp.js CHANGED
@@ -292,6 +292,47 @@ export function buildMcpServer() {
292
292
  }
293
293
  });
294
294
 
295
+ // leCore's own catalog — leCore docs/ZOO.md §1. Rule-0 for the model: ask the
296
+ // engine whether a faculty exists BEFORE writing the algorithm yourself.
297
+ // 3,214 capabilities; a curated tools/list would hide almost all of them, so
298
+ // discovery is a search and execution is one generic tool, exactly as leCore
299
+ // ships it over its own MCP.
300
+ server.registerTool('zoo_lecore_find', {
301
+ description:
302
+ 'BEFORE implementing any algorithm, search leCore for it — 3,214 verified capabilities '
303
+ + '(nearest-neighbour search, float compression, mesh ops, certified image operators, physics '
304
+ + 'stepping, forecasting, corpus QA, bootstrap CIs, void/discovery, program-to-weights). '
305
+ + 'Hand-rolling what this returns is wasted tokens and worse code. Free, no payment.',
306
+ inputSchema: {
307
+ query: z.string().describe('What you are trying to do, in plain words: "nearest neighbour search", "compress floats".'),
308
+ top: z.number().int().positive().optional().describe('How many hits. Default 8.'),
309
+ },
310
+ }, async ({ query, top }) => {
311
+ const r = await fetch(`${config.apiBase}/v1/lecore/find`, {
312
+ method: 'POST', headers: withNamespace({ 'content-type': 'application/json' }),
313
+ body: JSON.stringify({ query, top: top ?? 8 }),
314
+ });
315
+ return text(await r.json());
316
+ });
317
+
318
+ server.registerTool('zoo_lecore_invoke', {
319
+ description:
320
+ 'Run any leCore capability by name (find it first with zoo_lecore_find). Returns the result plus '
321
+ + 'measured cost {elapsed_ms, payload_bytes} and a determinism receipt {input_sha256, output_sha256} — '
322
+ + 'the same call with the same args always produces the same output hash, so results are verifiable '
323
+ + 'and cacheable. Free, no payment.',
324
+ inputSchema: {
325
+ name: z.string().describe('Capability name exactly as zoo_lecore_find returned it.'),
326
+ args: z.record(z.any()).optional().describe('Arguments object for the capability.'),
327
+ },
328
+ }, async ({ name, args }) => {
329
+ const r = await fetch(`${config.apiBase}/v1/lecore/invoke`, {
330
+ method: 'POST', headers: withNamespace({ 'content-type': 'application/json' }),
331
+ body: JSON.stringify({ name, args: args || {} }),
332
+ });
333
+ return text(await r.json());
334
+ });
335
+
295
336
  server.registerTool('zoo_contexts', {
296
337
  description: 'List corpora already bound to the zoo\'s holographic memory (local manifest). A listed corpus is never re-uploaded — asks against it are near-free.',
297
338
  inputSchema: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.35.0",
3
+ "version": "0.35.1",
4
4
  "description": "Local x402-paying proxy + MCP server for openzoo.fun — point any OpenAI-compatible harness (Cursor, Claude Code, aider, SDKs) at localhost and it pays per call from a local burner wallet. Solana and Base rails live; Robinhood experimental.",
5
5
  "license": "MIT",
6
6
  "type": "module",