panal-mcp 0.13.1 → 0.14.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.
@@ -84,6 +84,11 @@ export interface LimitesDelAgente {
84
84
  * el agente caído y el único que nadie puede cambiar entre mirar y pagar.
85
85
  */
86
86
  niveles: Nivel[];
87
+ /**
88
+ * Los encargos de ejemplo de la ficha, si trae. Salen de la misma lectura,
89
+ * por lo mismo. La fuente es la cadena: ver `conEjemplosDeLaFicha`.
90
+ */
91
+ ejemplos?: string[];
87
92
  }
88
93
  export declare function fetchAgentLimits(botUrl: string): Promise<LimitesDelAgente>;
89
94
  /** Descarga acotada: se corta en cuanto se pasa del tope. */
@@ -14,7 +14,7 @@
14
14
  // implementaciones equivalentes de lo mismo —la del SDK y una aquí—, y dos
15
15
  // copias de un control de seguridad son una que se queda atrás sin que nadie
16
16
  // se entere el día que la otra mejora.
17
- import { assertPublicUrl, leerMaxBriefChars, leerNiveles, rutaDeAgente } from '@panal/sdk';
17
+ import { assertPublicUrl, leerEjemplos, leerMaxBriefChars, leerNiveles, rutaDeAgente } from '@panal/sdk';
18
18
  /** Tope de la respuesta. Sin esto, un endpoint hostil tumba el proceso. */
19
19
  const MAX_BYTES = 512 * 1024;
20
20
  const TIMEOUT_MS = 20_000;
@@ -129,7 +129,12 @@ export async function fetchAgentLimits(botUrl) {
129
129
  return { alcanzable: true, maxBriefChars: null, niveles: [] };
130
130
  try {
131
131
  const card = await res.json();
132
- return { alcanzable: true, maxBriefChars: parseMaxBriefChars(card), niveles: leerNiveles(card) };
132
+ return {
133
+ alcanzable: true,
134
+ maxBriefChars: parseMaxBriefChars(card),
135
+ niveles: leerNiveles(card),
136
+ ejemplos: leerEjemplos(card),
137
+ };
133
138
  }
134
139
  catch {
135
140
  return { alcanzable: true, maxBriefChars: null, niveles: [] };
package/dist/server.js CHANGED
@@ -42,7 +42,7 @@ import { createInterface } from 'node:readline';
42
42
  import { fileURLToPath } from 'node:url';
43
43
  import { formatEther, formatUnits, isAddress, keccak256, parseEther, toBytes } from 'viem';
44
44
  import { privateKeyToAccount } from 'viem/accounts';
45
- import { NATIVE_CURRENCY, TaskStatus, appendAttachmentsManifest, createPanalClient, downloadDeliveredFile, erc20Abi, matchAttachment, parseAttachmentsManifest, parseFilesManifest, stripFilesManifest, x402Currency, } from '@panal/sdk';
45
+ import { NATIVE_CURRENCY, TaskStatus, appendAttachmentsManifest, conEjemplosDeLaFicha, createPanalClient, downloadDeliveredFile, erc20Abi, leerEjemplosDeMetadata, matchAttachment, parseAttachmentsManifest, parseFilesManifest, stripFilesManifest, x402Currency, } from '@panal/sdk';
46
46
  import { MAX_ADJUNTOS, capacidadesDeAgente, guardarDescarga, leerAdjuntoLocal, raizAdjuntos, raizDescargas, subirAdjunto, } from './adjuntos.js';
47
47
  import { buscarNivel, lineaDeNiveles, nivelesDeAgente, precioDeNivel, renderNiveles, } from './niveles.js';
48
48
  import { QuoteBook, SpendLedger, limitFor, limitsFromEnv } from './limits.js';
@@ -352,7 +352,8 @@ const READ_TOOLS = [
352
352
  },
353
353
  {
354
354
  name: 'panal_get_agent',
355
- description: 'Full profile of a Panal agent, by address: price, the sizes it sells if it sells several, skills, status and its on-chain name.',
355
+ description: 'Full profile of a Panal agent, by address: price, the sizes it sells if it sells several, skills, status, ' +
356
+ 'its on-chain name and the example jobs its owner suggests.',
356
357
  inputSchema: {
357
358
  type: 'object',
358
359
  properties: { address: { type: 'string', description: 'The agent 0x… address.' } },
@@ -382,7 +383,15 @@ const READ_TOOLS = [
382
383
  ? ` Per question: ${fmt(BigInt(q.amount), q.asset)} ${symbolOf(q.asset)} (x402, answered on the spot)`
383
384
  : ' Per question: not offered (this agent only takes jobs through escrow)';
384
385
  const niveles = nivelesDeAgente(agent.metadataURI, ficha?.niveles ?? []);
385
- return `${renderAgent(agent, niveles, true)}\n${porLlamada}`;
386
+ // Los encargos de ejemplo que propone su dueño: ayudan a redactar el
387
+ // encargo con lo que este agente hace de verdad. Son una idea, no un
388
+ // encargo listo — al que pide le falta añadir su material.
389
+ const ejemplos = conEjemplosDeLaFicha(leerEjemplosDeMetadata(agent.metadataURI), ficha?.ejemplos ?? []);
390
+ const lineaEjemplos = ejemplos.length > 0
391
+ ? `\n Example jobs its owner suggests (a starting point; the brief still needs the actual material): ` +
392
+ ejemplos.map((e) => `"${e}"`).join(' · ')
393
+ : '';
394
+ return `${renderAgent(agent, niveles, true)}\n${porLlamada}${lineaEjemplos}`;
386
395
  },
387
396
  },
388
397
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "panal-mcp",
3
- "version": "0.13.1",
3
+ "version": "0.14.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.19.0",
33
+ "@panal/sdk": "^0.20.0",
34
34
  "viem": "^2.21.0"
35
35
  },
36
36
  "devDependencies": {