panal-mcp 0.3.2 → 0.4.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.
Files changed (2) hide show
  1. package/dist/server.js +31 -0
  2. package/package.json +2 -2
package/dist/server.js CHANGED
@@ -91,12 +91,43 @@ function writesBlockedReason() {
91
91
  function symbolOf(currency) {
92
92
  return currency.toLowerCase() === NATIVE_CURRENCY.toLowerCase() ? 'MON' : '$PANAL';
93
93
  }
94
+ /** Días desde un timestamp en segundos. */
95
+ function daysSince(ts) {
96
+ return Math.max(0, Math.floor(Date.now() / 1000 - ts) / 86_400);
97
+ }
98
+ /**
99
+ * Lo que hay que saber de un agente ANTES de contratarlo, no después.
100
+ *
101
+ * Un nombre no prueba nada: cualquiera puede registrarse como "Lint" con la
102
+ * misma descripción, y cuesta una transacción. Lo que sí es de alguien es su
103
+ * dominio, así que se dice si lo confirma. Y si su nombre acaba de cambiar de
104
+ * manos, también: en una venta lo único que viaja es el nombre, la reputación
105
+ * se queda con el vendedor.
106
+ *
107
+ * Va en la ficha y no en un campo aparte porque quien lee esto elige por su
108
+ * cuenta, y lo que no está delante no se mira.
109
+ */
110
+ function trustLine(agent) {
111
+ const partes = [];
112
+ if (agent.verificado === true)
113
+ partes.push('domain verified (its endpoint declares this same address)');
114
+ else
115
+ partes.push('DOMAIN NOT VERIFIED — the name alone proves nothing about who this is');
116
+ if (agent.nombre && agent.nombre.origen !== 'reclamado') {
117
+ const dias = Math.round(daysSince(agent.nombre.desdeTs));
118
+ if (dias <= 30) {
119
+ partes.push(`its name "${agent.nombre.nombre}" changed hands ${dias}d ago — reputation stays with the previous owner`);
120
+ }
121
+ }
122
+ return ` Trust: ${partes.join('; ')}`;
123
+ }
94
124
  function renderAgent(agent) {
95
125
  const price = `${formatEther(agent.pricePerTask)} ${symbolOf(agent.currency)}`;
96
126
  const skills = agent.metadata.skills.length ? agent.metadata.skills.join(', ') : '(no skills declared)';
97
127
  return [
98
128
  `${agent.metadata.name || '(no name)'} — ${agent.address}`,
99
129
  ` Status: ${agent.active ? 'active' : 'DELISTED (does not take jobs)'}`,
130
+ trustLine(agent),
100
131
  // "Per task" y no "Price" a secas: hay dos precios (tarea por escrow y
101
132
  // consulta por x402) y llamar "el precio" a uno de ellos fue justo lo que
102
133
  // hizo invisible al otro.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "panal-mcp",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "Servidor MCP de Panal: busca y contrata agentes de IA on-chain desde Claude",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,7 +30,7 @@
30
30
  "node": ">=20"
31
31
  },
32
32
  "dependencies": {
33
- "@panal/sdk": "^0.7.0",
33
+ "@panal/sdk": "^0.8.0",
34
34
  "viem": "^2.21.0"
35
35
  },
36
36
  "devDependencies": {