agent402-mcp 0.13.17 → 0.13.18

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 (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +4 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -69,7 +69,7 @@ Every variable the server reads (all optional):
69
69
  | `AGENT402_MAX_PER_CALL` | `4` | Refuse any single call priced above this many USD (e.g. `0.05`); `off` disables it. Applies to the wallet and the credits path. |
70
70
  | `AGENT402_BUDGET` | no session cap | Opt-in hard cap on total USD spent per session (e.g. `1.00`); unset or `off` means no session cap. Applies to the wallet and the credits path. |
71
71
  | `AGENT402_NETWORKS` | _(unset)_ | Restrict + order the chains to pay on - e.g. `robinhood` (USDG on Robinhood Chain), `base,solana`, or a raw CAIP-2 like `eip155:4663`. Unset = the client picks (effectively Base on multi-chain sellers). |
72
- | `AGENT402_ASYNC` | `auto` | Slow routes (reports, video, the premium image; `async.recommended` on their `/api/pricing` row) are paid with `Prefer: respond-async` and collected from their job link, so a long run never outlives the connection. `off` waits on the connection instead; `always` uses a job on every route that runs as one. |
72
+ | `AGENT402_ASYNC` | `auto` | Slow routes (reports, video, the premium image; `async.recommended` on their `/api/pricing` row) are paid with `Prefer: respond-async` and collected from their job link, so a long run never outlives the connection. `off` waits on the connection instead (since 0.13.18 sending `Prefer: wait=<maxSeconds>` where the row gives `async.preferWait`); `always` uses a job on every route that runs as one. |
73
73
  | `AGENT402_ASYNC_TIMEOUT_MS` | `900000` | How long to poll a job before answering with its link (`structuredContent.jobUrl`) to collect later. |
74
74
 
75
75
  The per-call cap is on by default and the session budget is opt-in; both are
package/index.js CHANGED
@@ -358,7 +358,10 @@ async function callEndpoint(tool, args = {}, { onProgress = null } = {}) {
358
358
  const init = { method: tool.method, headers: { Accept: "application/json" } };
359
359
  // A slow route runs as a job (./async-job.js): the paid call asks for one,
360
360
  // and the job link is polled (free) until the answer is ready.
361
- const asyncHeaders = shouldRequestAsync(tool.async, ASYNC_MODE) ? { Prefer: "respond-async" } : {};
361
+ // With async off, a route that needs a header either way says how long to
362
+ // wait (async.preferWait), so the call waits on the connection instead.
363
+ const asyncHeaders = shouldRequestAsync(tool.async, ASYNC_MODE) ? { Prefer: "respond-async" }
364
+ : typeof tool.async?.preferWait === "string" && /^wait=\d+$/.test(tool.async.preferWait) ? { Prefer: tool.async.preferWait } : {};
362
365
  const collect = (r) => awaitJob(r, { baseUrl: BASE, fetchImpl: ownFetch, timeoutMs: ASYNC_TIMEOUT_MS, onProgress, slug: tool.slug });
363
366
  if (tool.method === "GET") {
364
367
  for (const [k, v] of Object.entries(args)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent402-mcp",
3
- "version": "0.13.17",
3
+ "version": "0.13.18",
4
4
  "mcpName": "io.github.MikeyPetrillo/agent402",
5
5
  "author": "Havok Holdings LLC <mike@agent402.tools> (https://agent402.tools)",
6
6
  "homepage": "https://agent402.tools",