panal-mcp 0.9.0 → 0.10.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/dist/adjuntos.js CHANGED
@@ -24,7 +24,7 @@
24
24
  */
25
25
  import { existsSync, mkdirSync, readFileSync, realpathSync, statSync, writeFileSync } from 'node:fs';
26
26
  import { extname, isAbsolute, join, relative, resolve, sep } from 'node:path';
27
- import { MAX_FILE_BYTES, assertPublicUrl, attachmentFrom, sanitizeFileName, } from '@panal/sdk';
27
+ import { MAX_FILE_BYTES, assertPublicUrl, attachmentFrom, rutaDeAgente, sanitizeFileName, } from '@panal/sdk';
28
28
  /** Cuántos adjuntos admite un encargo. El agente los guarda todos en disco. */
29
29
  export const MAX_ADJUNTOS = 10;
30
30
  const TIMEOUT_TARJETA_MS = 6_000;
@@ -176,7 +176,7 @@ export function leerAdjuntoLocal(ruta, topeBytes = MAX_FILE_BYTES) {
176
176
  export async function capacidadesDeAgente(botUrl) {
177
177
  try {
178
178
  const base = await assertPublicUrl(botUrl);
179
- const url = new URL('/agent.json', base);
179
+ const url = new URL(rutaDeAgente(base.toString(), 'agent.json'));
180
180
  const res = await fetch(url, { signal: AbortSignal.timeout(TIMEOUT_TARJETA_MS), redirect: 'error' });
181
181
  if (!res.ok)
182
182
  return { adjuntos: false, maxAdjuntoBytes: null };
@@ -206,7 +206,7 @@ export async function subirAdjunto(botUrl, taskId, file, bytes, client, signatur
206
206
  let url;
207
207
  try {
208
208
  const base = await assertPublicUrl(botUrl);
209
- url = new URL(`/upload/${taskId}`, base);
209
+ url = new URL(rutaDeAgente(base.toString(), `upload/${taskId}`));
210
210
  }
211
211
  catch (err) {
212
212
  return err instanceof Error ? err.message : String(err);
@@ -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 } from '@panal/sdk';
17
+ import { assertPublicUrl, leerMaxBriefChars, 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;
@@ -54,7 +54,7 @@ export async function pushBrief(botUrl, taskId, brief, client, signature) {
54
54
  let url;
55
55
  try {
56
56
  const base = await assertPublicUrl(botUrl);
57
- url = new URL(`/brief/${taskId}`, base);
57
+ url = new URL(rutaDeAgente(base.toString(), `brief/${taskId}`));
58
58
  }
59
59
  catch (err) {
60
60
  return err instanceof Error ? err.message : String(err);
@@ -110,7 +110,7 @@ export async function fetchAgentLimits(botUrl) {
110
110
  let url;
111
111
  try {
112
112
  const base = await assertPublicUrl(botUrl);
113
- url = new URL('/agent.json', base);
113
+ url = new URL(rutaDeAgente(base.toString(), 'agent.json'));
114
114
  }
115
115
  catch {
116
116
  // El guard rechaza la URL: a esa dirección no se le puede entregar nada, ni
@@ -144,7 +144,7 @@ export async function fetchAgentLimits(botUrl) {
144
144
  /** Descarga acotada: se corta en cuanto se pasa del tope. */
145
145
  export async function fetchResultText(botUrl, taskId, client, signature, expira) {
146
146
  const base = await assertPublicUrl(botUrl);
147
- const url = new URL(`/result/${taskId}`, base);
147
+ const url = new URL(rutaDeAgente(base.toString(), `result/${taskId}`));
148
148
  const controller = new AbortController();
149
149
  const timer = setTimeout(() => controller.abort(), TIMEOUT_MS);
150
150
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "panal-mcp",
3
- "version": "0.9.0",
3
+ "version": "0.10.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.13.0",
33
+ "@panal/sdk": "^0.17.0",
34
34
  "viem": "^2.21.0"
35
35
  },
36
36
  "devDependencies": {