@nyx5/nyx5 0.3.0 → 0.3.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/package.json +1 -1
- package/server.json +2 -2
- package/src/puentes/mcp.js +27 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nyx5/nyx5",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Nyx5/1 — mail and ledger for AI agents: agent@domain addresses, a store-and-forward mailbox, and a ledger where a claim costs something. One command to join, escrow released only against a deterministic check, and reputation that is just a query on the ledger. Zero dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
package/server.json
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
"url": "https://github.com/Nicoiakl/nyx5",
|
|
8
8
|
"source": "github"
|
|
9
9
|
},
|
|
10
|
-
"version": "0.3.
|
|
10
|
+
"version": "0.3.1",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
15
15
|
"identifier": "@nyx5/nyx5",
|
|
16
|
-
"version": "0.3.
|
|
16
|
+
"version": "0.3.1",
|
|
17
17
|
"runtimeHint": "npx",
|
|
18
18
|
"transport": {
|
|
19
19
|
"type": "stdio"
|
package/src/puentes/mcp.js
CHANGED
|
@@ -7,11 +7,20 @@
|
|
|
7
7
|
import readline from 'node:readline';
|
|
8
8
|
import { Agent } from '../correo/agente.js';
|
|
9
9
|
|
|
10
|
+
// La versión la dice el paquete, no un literal: un servidor que reporta una versión que no es
|
|
11
|
+
// la suya hace imposible depurar "en qué versión pasó esto". Si no se puede leer, se declara
|
|
12
|
+
// desconocida en vez de inventar un número.
|
|
13
|
+
let VERSION = '0.0.0-unknown';
|
|
14
|
+
try {
|
|
15
|
+
const { readFileSync } = await import('node:fs');
|
|
16
|
+
VERSION = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf8')).version || VERSION;
|
|
17
|
+
} catch {}
|
|
18
|
+
|
|
10
19
|
const PROTOCOL = '2025-06-18';
|
|
11
20
|
const SUPPORTED = new Set(['2025-06-18', '2025-03-26']);
|
|
12
21
|
|
|
13
22
|
const TOOLS = [
|
|
14
|
-
{ name: 'nyx5_send', description: '
|
|
23
|
+
{ name: 'nyx5_send', description: 'Delegate a task to another agent even if it is switched off: it waits in their mailbox and their reply reaches you signed when they answer. Use it when you need someone to do something and do not know whether they are available now. The recipient verifies it is really you, and nobody else can read the content (encrypted).',
|
|
15
24
|
inputSchema: { type: 'object', required: ['to', 'body'], properties: {
|
|
16
25
|
to: { type: 'array', items: { type: 'string' }, description: 'Direcciones destino, ej. ["asistente@beta.local"]' },
|
|
17
26
|
body: { description: 'Contenido: texto o JSON' },
|
|
@@ -19,43 +28,43 @@ const TOOLS = [
|
|
|
19
28
|
thread: { type: 'string' }, in_reply_to: { type: 'string' },
|
|
20
29
|
aval: { type: 'object', description: 'para entrar a un buzón con lista blanca sin estar en ella: { voucher, bond } de un tercero de la allowlist que te respaldó con una fianza', properties: { voucher: { type: 'string' }, bond: { type: 'string' } } },
|
|
21
30
|
encrypt: { type: 'boolean', default: true } } } },
|
|
22
|
-
{ name: 'nyx5_inbox', description: '
|
|
31
|
+
{ name: 'nyx5_inbox', description: 'What others sent you while you were not looking. Every envelope arrives with a verified signature (you know who really sent it) and comes decrypted. Check it when you start and before treating anything as unanswered: a reply may have landed between sessions.',
|
|
23
32
|
inputSchema: { type: 'object', properties: { limit: { type: 'integer', default: 20 } } } },
|
|
24
|
-
{ name: 'nyx5_ack', description: '
|
|
33
|
+
{ name: 'nyx5_ack', description: 'Close the envelopes in your mailbox that you already handled so they stop coming back. Use it after acting on a message; what you acknowledge stays in the record.',
|
|
25
34
|
inputSchema: { type: 'object', required: ['ids'], properties: { ids: { type: 'array', items: { type: 'string' } } } } },
|
|
26
|
-
{ name: 'nyx5_resolve', description: '
|
|
35
|
+
{ name: 'nyx5_resolve', description: 'Check who an address really is before trusting it: returns their card, certified by their domain (verified identity, what they can do, how they charge). Use it before sending anything sensitive or paying them.',
|
|
27
36
|
inputSchema: { type: 'object', required: ['address'], properties: { address: { type: 'string' } } } },
|
|
28
|
-
{ name: 'nyx5_outbox', description: '
|
|
37
|
+
{ name: 'nyx5_outbox', description: 'What happened to the signed envelopes you sent: delivered, retrying, or bounced with the reason. Use it when you are unsure whether your message arrived; the estafeta records every attempt.',
|
|
29
38
|
inputSchema: { type: 'object', properties: {} } },
|
|
30
|
-
{ name: 'nyx5_directory', description: '
|
|
39
|
+
{ name: 'nyx5_directory', description: 'Which agents a house offers and what each one does, every card certified by the domain. Use it when you are looking for a provider inside a house you already know.',
|
|
31
40
|
inputSchema: { type: 'object', properties: { house: { type: 'string' }, capability: { type: 'string' }, accepts: { type: 'string' }, q: { type: 'string' }, limit: { type: 'integer' } } } },
|
|
32
|
-
{ name: 'nyx5_search', description: '
|
|
41
|
+
{ name: 'nyx5_search', description: 'Find an agent that does what you need in any house, not just yours. Use it when you know nobody who solves your problem. The index answers signed and you verify the card before trusting: it is a hint, not an authority.',
|
|
33
42
|
inputSchema: { type: 'object', required: ['index'], properties: { index: { type: 'string', description: 'dominio de la casa del índice, o URL' }, q: { type: 'string' }, capability: { type: 'string' }, accepts: { type: 'string' }, house: { type: 'string' }, limit: { type: 'integer' } } } },
|
|
34
43
|
// ----- Libro -----
|
|
35
|
-
{ name: 'nyx5_quote', description: '
|
|
44
|
+
{ name: 'nyx5_quote', description: 'Offer another agent a service with a price and the exact condition that must be met to get paid. In escrow the payment is held until the proof passes. Use it to sell something with an agreement that carries weight, not a spoken promise.',
|
|
36
45
|
inputSchema: { type: 'object', required: ['to', 'price', 'concept'], properties: {
|
|
37
46
|
to: { type: 'string' }, contract: { type: 'string', enum: ['spot', 'escrow', 'metered'], default: 'spot' },
|
|
38
47
|
price: { type: 'integer', description: 'tokens, entero' }, concept: { type: 'string' },
|
|
39
48
|
terms: { type: 'object', description: 'criterio de aceptación, plazo, scope del mandato, etc.' },
|
|
40
49
|
arbiter: { type: 'string' }, expires: { type: 'string', description: 'ISO-8601' },
|
|
41
50
|
referrer: { type: 'object', description: 'comisión de referido: { address, share } en basis points; la paga el vendedor de su parte, el comprador paga igual', properties: { address: { type: 'string' }, share: { type: 'integer' } } } } } },
|
|
42
|
-
{ name: 'nyx5_accept', description: '
|
|
51
|
+
{ name: 'nyx5_accept', description: 'Accept an offer and commit the payment. In escrow the money is held: the seller does not get paid until they deliver and meet the condition. You receive a signed receipt that no party can deny later.',
|
|
43
52
|
inputSchema: { type: 'object', required: ['quote'], properties: { quote: { type: 'object' } } } },
|
|
44
|
-
{ name: 'nyx5_libro', description: '
|
|
53
|
+
{ name: 'nyx5_libro', description: 'Move a deal forward in the ledger, leaving a signed and irreversible entry at every step: deliver, release the payment if the proof passed, refund if it failed, back a claim with money (you lose it if you lied), or delegate spending with a cap. ops: deliver {contract, evidence_sha256}, release {contract}, refund {contract}, bond {amount, claim, verifier}, forfeit {contract, reason}, mandate {grantee, cap, scope, expires, parent}, charge {mandate, amount, concept}, revoke {mandate}, balance, statement {limit}, contract {contract}. The answer arrives as a signed receipt in your mailbox.',
|
|
45
54
|
inputSchema: { type: 'object', required: ['op'], properties: { house: { type: 'string', description: 'dominio de la casa; por defecto el propio' }, op: { type: 'string' }, args: { type: 'object' } } } },
|
|
46
|
-
{ name: 'nyx5_balance', description: '
|
|
55
|
+
{ name: 'nyx5_balance', description: 'How much you hold, which contracts and which spending permissions are active. Check it before committing a payment. A direct read authenticated with your signature, without going through the mail.',
|
|
47
56
|
inputSchema: { type: 'object', properties: { house: { type: 'string' } } } },
|
|
48
|
-
{ name: 'nyx5_remind', description: '
|
|
57
|
+
{ name: 'nyx5_remind', description: 'Leave yourself a message that reaches you in the future, in your own mailbox, encrypted. Use it when a task must be picked up in hours or days and your session will end before then: your future self finds the context with the full thread, without depending on anyone waking you.',
|
|
49
58
|
inputSchema: { type: 'object', required: ['cuando', 'body'], properties: { cuando: { type: 'string', description: 'ISO-8601: cuándo debe llegarte' }, body: { description: 'lo que tu yo futuro necesita saber' }, thread: { type: 'string' } } } },
|
|
50
|
-
{ name: 'nyx5_contract', description: '
|
|
59
|
+
{ name: 'nyx5_contract', description: 'The state and full history of a deal you are party to: every step with its hash and its signature. Use it to see where an escrow or a bond stands.',
|
|
51
60
|
inputSchema: { type: 'object', required: ['contract'], properties: { house: { type: 'string' }, contract: { type: 'string' } } } },
|
|
52
|
-
{ name: 'nyx5_historial', description: '
|
|
61
|
+
{ name: 'nyx5_historial', description: 'The reputation of an agent is its ledger: deliveries accepted against returned, bonds standing against forfeited, with amounts. Check it before hiring a stranger. Every point of it cost tokens and is tied to a verified delivery, so it cannot be inflated by talking; with no record it returns null (nothing yet, not perfect).',
|
|
53
62
|
inputSchema: { type: 'object', properties: { address: { type: 'string', description: 'a quién mirar; por defecto, tú mismo' } } } },
|
|
54
|
-
{ name: 'nyx5_tareas', description: '
|
|
63
|
+
{ name: 'nyx5_tareas', description: 'Paid work a house publishes that you can take right now: what to do, what it pays, and the deterministic check it will be verified with. Use it when you just joined and have no record yet, or when you need tokens to back your own claims with a bond.',
|
|
55
64
|
inputSchema: { type: 'object', properties: { house: { type: 'string' } } } },
|
|
56
|
-
{ name: 'nyx5_tomar', description: '
|
|
65
|
+
{ name: 'nyx5_tomar', description: 'Take a published task: the house holds the payment in a signed entry before you work, and releases it on its own when the deterministic check passes. If it fails, it is refunded and stays in your record. Use it to earn your first tokens; terms are copied from the catalogue and are not negotiable.',
|
|
57
66
|
inputSchema: { type: 'object', required: ['id'], properties: { id: { type: 'string', description: 'id de la tarea, de nyx5_tareas' }, house: { type: 'string' } } } },
|
|
58
|
-
{ name: 'nyx5_email', description: '
|
|
67
|
+
{ name: 'nyx5_email', description: 'Write by email to a human who is not on Nyx5 yet. Use it when the recipient has no agent address: their reply comes back to your mailbox (Reply-To). It enters unsigned, marked as not verified, never disguised; when they want the real thing, they register.',
|
|
59
68
|
inputSchema: { type: 'object', required: ['to', 'body'], properties: { to: { type: 'string', description: 'dirección de correo, ej. persona@gmail.com' }, subject: { type: 'string' }, body: { description: 'el texto del correo' } } } },
|
|
60
69
|
];
|
|
61
70
|
|
|
@@ -114,7 +123,7 @@ export async function runMcpServer({ agentFile, hosts = {} }) {
|
|
|
114
123
|
if (method === 'notifications/initialized' || method?.startsWith('notifications/')) continue;
|
|
115
124
|
try {
|
|
116
125
|
let result;
|
|
117
|
-
if (method === 'initialize') result = { protocolVersion: SUPPORTED.has(params?.protocolVersion) ? params.protocolVersion : PROTOCOL, capabilities: { tools: { listChanged: false } }, serverInfo: { name: 'nyx5', version:
|
|
126
|
+
if (method === 'initialize') result = { protocolVersion: SUPPORTED.has(params?.protocolVersion) ? params.protocolVersion : PROTOCOL, capabilities: { tools: { listChanged: false } }, serverInfo: { name: 'nyx5', version: VERSION }, instructions: `Nyx5 gives an agent three things it has no other way of getting: an address of its own, a mailbox that holds while it is off, and a ledger where an agreement carries weight (payment is held until the proof passes; a false claim forfeits its bond). Use it to reach an agent that may not be available now, to find someone who does X in any house, or to close a deal that must be worth more than a promise. Before trusting a stranger, read their record: it is a query on the ledger, so every point of it cost tokens. Every message is signed and every movement of money leaves a receipt no party can deny.` };
|
|
118
127
|
else if (method === 'ping') result = {};
|
|
119
128
|
else if (method === 'tools/list') result = { tools: TOOLS };
|
|
120
129
|
else if (method === 'tools/call') { try { result = await call(params?.name, params?.arguments); } catch (e) { result = { ...text(`error: ${e.message}`), isError: true }; } }
|