run402 4.75.0 → 4.75.2

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "surface_version": "4.75.0",
2
+ "surface_version": "4.75.2",
3
3
  "verbs": [
4
4
  "repos create",
5
5
  "repos list",
package/lib/billing.mjs CHANGED
@@ -255,7 +255,7 @@ async function topup(args) {
255
255
  if (final.status === "paid" || final.status === "paid_late") {
256
256
  console.error(`Received — ${final.amount_sats} sats credited $${(final.amount_usd_micros / 1_000_000).toFixed(2)} to the balance${final.status === "paid_late" ? " (paid after the invoice expired; still credited)" : ""}.`);
257
257
  } else if (final.status === "expired") {
258
- console.error("The invoice expired unpaid. Mint a fresh one with the same command.");
258
+ console.error("No payment was observed before the invoice expired. If you already paid, it still credits on its own (the gateway keeps checking for an hour after expiry) — read the top-up again, or rerun with the same --idempotency-key. Otherwise mint a fresh one with the same command.");
259
259
  process.exitCode = 2;
260
260
  } else {
261
261
  console.error("Timed out still pending — a payment that lands later still credits (up to an hour after expiry); poll the top-up.");
@@ -472,11 +472,19 @@ export function isPublicAddress(address) {
472
472
  }
473
473
 
474
474
  export function pinnedLookup(record, expectedHostname) {
475
- return (hostname, _options, callback) => {
475
+ return (hostname, options, callback) => {
476
476
  if (hostname !== expectedHostname) {
477
477
  callback(new Error("relay_hostname_changed"));
478
478
  return;
479
479
  }
480
+ // Node 20+ sockets (autoSelectFamily) ask with `{ all: true }` and expect
481
+ // an array of records; answering in the single-address form there makes
482
+ // the connect fail with "Invalid IP address: undefined" — i.e. every relay
483
+ // looked unreachable from a current Node.
484
+ if (options && typeof options === "object" && options.all) {
485
+ callback(null, [{ address: record.address, family: record.family }]);
486
+ return;
487
+ }
480
488
  callback(null, record.address, record.family);
481
489
  };
482
490
  }
@@ -270,6 +270,9 @@ describe("Buzz doctor bounded zero-mutation runner", () => {
270
270
  assert.deepEqual(callbackResults[0], { error: null, address: "93.184.216.34", family: 4 });
271
271
  assert.equal(callbackResults[1].error.message, "relay_hostname_changed");
272
272
  assert.equal(callbackResults[1].address, undefined);
273
+ // Node 20+ sockets ask with `{ all: true }` and take an array of records.
274
+ lookup("community.example", { all: true, family: 0 }, (error, addresses) => callbackResults.push({ error, addresses }));
275
+ assert.deepEqual(callbackResults[2], { error: null, addresses: [{ address: "93.184.216.34", family: 4 }] });
273
276
 
274
277
  const contractCodes = Object.values(BUZZ_DOCTOR_CONTRACT.codes_by_check).flat().sort();
275
278
  assert.deepEqual(Object.keys(BUZZ_DOCTOR_REPAIR_MATRIX).sort(), contractCodes);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "run402",
3
- "version": "4.75.0",
3
+ "version": "4.75.2",
4
4
  "description": "CLI for Run402 — full-stack backend infrastructure for AI agents: Postgres, auth, storage, serverless functions and atomic deploys. Paid with x402/MPP. Includes $0.03 image generation.",
5
5
  "type": "module",
6
6
  "bin": {