Skip to content

Commit e82298f

Browse files
jarrodwattsclaude
andcommitted
fix: set User-Agent on outbound fetches to bypass Cloudflare bot filter
Cloudflare blocks Node.js default User-Agent on abs.xyz. Set AGW-CLI/1.0 on all companion app fetches (callback-key, RPC proxy). Also fix --version output to match package.json. Bumps CLI to 0.1.3. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 47f0313 commit e82298f

5 files changed

Lines changed: 11 additions & 2 deletions

File tree

packages/agw-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@abstract-foundation/agw-cli",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"type": "module",
55
"description": "Agent-first CLI for Abstract Global Wallet workflows",
66
"license": "MIT",

packages/agw-cli/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ async function main(): Promise<void> {
145145
program
146146
.name("agw-cli")
147147
.description("Agent-first CLI for Abstract Global Wallet workflows.")
148-
.version("0.1.0")
148+
.version("0.1.3")
149149
.showHelpAfterError();
150150

151151
program

packages/agw-core/src/auth/attestation.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createPublicKey, type KeyObject, verify as verifySignature } from "node:crypto";
2+
import { AGW_HTTP_HEADERS } from "../config/runtime.js";
23

34
const DEFAULT_CALLBACK_ISSUER = "agw";
45
const DEFAULT_CLOCK_SKEW_SECONDS = 60;
@@ -54,6 +55,7 @@ export async function resolveCallbackVerificationConfig(appUrl: string): Promise
5455
method: "GET",
5556
headers: {
5657
Accept: "application/json",
58+
...AGW_HTTP_HEADERS,
5759
},
5860
});
5961
if (!response.ok) {

packages/agw-core/src/config/runtime.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import path from "node:path";
33
import type { AgwOutputMode, AgwSanitizeProfile } from "../registry/types.js";
44

55
const DEFAULT_HOME_DIRNAME = ".agw";
6+
7+
export const AGW_HTTP_HEADERS: Record<string, string> = {
8+
"User-Agent": "AGW-CLI/1.0",
9+
};
610
const OUTPUT_ENV_KEY = "AGW_OUTPUT";
711
const SANITIZE_ENV_KEY = "AGW_SANITIZE_PROFILE";
812
const HOME_ENV_KEY = "AGW_HOME";

packages/agw-core/src/privy/client.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { KeyObject } from "node:crypto";
2+
import { AGW_HTTP_HEADERS } from "../config/runtime.js";
23
import { computeAuthorizationSignature, readAuthKeyfile } from "./auth.js";
34
import type {
45
PrivySignerConfig,
@@ -84,6 +85,7 @@ export class PrivyWalletClient {
8485
method: "GET",
8586
headers: {
8687
Accept: "application/json",
88+
...AGW_HTTP_HEADERS,
8789
},
8890
});
8991
if (!response.ok) {
@@ -139,6 +141,7 @@ export class PrivyWalletClient {
139141
method: "POST",
140142
headers: {
141143
"Content-Type": "application/json",
144+
...AGW_HTTP_HEADERS,
142145
},
143146
body: JSON.stringify({
144147
walletId: this.walletId,

0 commit comments

Comments
 (0)