Skip to content

Commit 45ff1a6

Browse files
jarrodwattsclaude
andcommitted
fix: fetch Privy app ID from companion app for all URLs
Same pattern as the callback key fix — remove localhost-only guard and let the CLI fetch the app ID from /api/session/callback-key for production URLs too. Bumps CLI to 0.1.4. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 50b2843 commit 45ff1a6

3 files changed

Lines changed: 3 additions & 17 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.3",
3+
"version": "0.1.4",
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.3")
148+
.version("0.1.4")
149149
.showHelpAfterError();
150150

151151
program

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

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import type {
88
} from "./types.js";
99

1010
const PRIVY_API_BASE = "https://api.privy.io";
11-
const LOCALHOST_HOSTS = new Set(["localhost", "127.0.0.1", "[::1]"]);
1211

1312
export interface PrivyWalletClientConfig {
1413
signerConfig: PrivySignerConfig;
@@ -45,14 +44,7 @@ export class PrivyWalletClient {
4544
return Buffer.from(`${appId}:${appSecret}`).toString("base64");
4645
}
4746

48-
private isLoopbackAppUrl(): boolean {
49-
try {
50-
const parsed = new URL(this.appUrl);
51-
return LOCALHOST_HOSTS.has(parsed.hostname);
52-
} catch {
53-
return false;
54-
}
55-
}
47+
5648

5749
private async resolveRuntimeConfig(): Promise<{ appId: string; mode: "proxy" | "direct" }> {
5850
if (this.runtimeConfigPromise) {
@@ -75,12 +67,6 @@ export class PrivyWalletClient {
7567
};
7668
}
7769

78-
if (!this.isLoopbackAppUrl()) {
79-
throw new Error(
80-
"AGW_PRIVY_APP_ID is required for non-localhost hosted app URLs when the CLI is running without Privy server credentials.",
81-
);
82-
}
83-
8470
const response = await fetch(new URL("/api/session/callback-key", this.appUrl), {
8571
method: "GET",
8672
headers: {

0 commit comments

Comments
 (0)