toll402-client 0.1.0 → 0.1.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/index.js +2 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -60,7 +60,7 @@ export class Toll402 {
60
60
  }
61
61
  /** Free: ranked tools for a plain-language need. */
62
62
  async find(need, opts = {}) {
63
- const r = await this.f(`${this.baseUrl}/v1/find`, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ need, ...opts }) });
63
+ const r = await this.f(`${this.baseUrl}/v1/find`, { method: "POST", headers: { "content-type": "application/json", "user-agent": "toll402-client/0.1.1" }, body: JSON.stringify({ need, ...opts }) });
64
64
  const j = (await r.json());
65
65
  if (!r.ok)
66
66
  throw new Toll402Error(`find: HTTP ${r.status}`, r.status, "find_failed", undefined, j);
@@ -70,7 +70,7 @@ export class Toll402 {
70
70
  /** Call any tool by catalog name ("read_url", "hn_top", …), id ("t/hn_top", "x/abc123") or path ("/v1/read"). Returns the tool's `result`. */
71
71
  async call(tool, input = {}) {
72
72
  const path = await this.resolvePath(tool);
73
- const r = await this.f(`${this.baseUrl}${path}`, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(input) });
73
+ const r = await this.f(`${this.baseUrl}${path}`, { method: "POST", headers: { "content-type": "application/json", "user-agent": "toll402-client/0.1.1" }, body: JSON.stringify(input) });
74
74
  const trial = r.headers.get("x-toll402-trial-remaining");
75
75
  this.trialRemaining = trial !== null ? Number(trial) : undefined;
76
76
  const pr = r.headers.get("payment-response") ?? r.headers.get("x-payment-response");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "toll402-client",
3
- "version": "0.1.0",
4
- "description": "One-line client for Toll402 pay-per-call tools for AI agents via x402 (USDC on Base). Free trial without a wallet; automatic payment with one.",
3
+ "version": "0.1.1",
4
+ "description": "One-line client for Toll402 \u2014 pay-per-call tools for AI agents via x402 (USDC on Base). Free trial without a wallet; automatic payment with one.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "homepage": "https://toll402.dev",