panal-mcp 0.3.2 → 0.4.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/dist/server.js +43 -0
  2. package/package.json +2 -2
package/dist/server.js CHANGED
@@ -91,12 +91,55 @@ 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
+ * `verificado` tiene TRES estados y aquí se dicen los tres. `undefined` no es
111
+ * un «no»: es que por esta ruta no se ha mirado —la ficha viene de la cadena,
112
+ * que no guarda verificaciones de dominio—, o el agente cambió de endpoint y
113
+ * lo de antes ya no dice nada de la URL nueva. Contarlo como «no verificado»
114
+ * acusaba en falso a agentes que sí lo están, y hacía que dos herramientas del
115
+ * mismo servidor afirmaran lo contrario la una de la otra sobre el mismo
116
+ * agente: marketplace_stats lee la cadena y search_agents el indexador. Una
117
+ * insignia que se contradice consigo misma no sirve para lo único que sirve
118
+ * una insignia, que es decidir.
119
+ */
120
+ function trustLine(agent) {
121
+ const partes = [];
122
+ if (agent.verificado === true)
123
+ partes.push('domain verified (its endpoint declares this same address)');
124
+ else if (agent.verificado === false)
125
+ partes.push('DOMAIN NOT VERIFIED — the name alone proves nothing about who this is');
126
+ else
127
+ partes.push('domain NOT CHECKED on this listing — it was read from the chain, which does not record verification; the name alone proves nothing about who this is');
128
+ if (agent.nombre && agent.nombre.origen !== 'reclamado') {
129
+ const dias = Math.round(daysSince(agent.nombre.desdeTs));
130
+ if (dias <= 30) {
131
+ partes.push(`its name "${agent.nombre.nombre}" changed hands ${dias}d ago — reputation stays with the previous owner`);
132
+ }
133
+ }
134
+ return ` Trust: ${partes.join('; ')}`;
135
+ }
94
136
  function renderAgent(agent) {
95
137
  const price = `${formatEther(agent.pricePerTask)} ${symbolOf(agent.currency)}`;
96
138
  const skills = agent.metadata.skills.length ? agent.metadata.skills.join(', ') : '(no skills declared)';
97
139
  return [
98
140
  `${agent.metadata.name || '(no name)'} — ${agent.address}`,
99
141
  ` Status: ${agent.active ? 'active' : 'DELISTED (does not take jobs)'}`,
142
+ trustLine(agent),
100
143
  // "Per task" y no "Price" a secas: hay dos precios (tarea por escrow y
101
144
  // consulta por x402) y llamar "el precio" a uno de ellos fue justo lo que
102
145
  // 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.1",
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": {