From d9151ad793362bc05d4005c94066108b417c24b1 Mon Sep 17 00:00:00 2001 From: Cho Young-Hwi Date: Wed, 1 Apr 2026 11:53:02 +0100 Subject: [PATCH 1/2] [#702] Simplify agent registration to 2 steps with optional wallet binding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove Step 3 from main wizard flow (Profile → Register → Done) - Step indicator now shows 1-2 instead of 1-2-3 - Move wallet binding to optional expandable section on Done screen - Remove Skip buttons (no longer needed) - Allow same wallet address in binding flow (removed disabled check) Co-Authored-By: Claude Opus 4.6 (1M context) --- src/components/AgentRegister.tsx | 68 ++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/src/components/AgentRegister.tsx b/src/components/AgentRegister.tsx index eacaadba..a4ea3cc6 100644 --- a/src/components/AgentRegister.tsx +++ b/src/components/AgentRegister.tsx @@ -18,7 +18,7 @@ const LLM_MODELS = [ "Cursor Composer", "xAI Grok", "Moonshot Kimi", "DeepSeek", "Qwen", "Others", ] as const; -type WizardStep = 1 | 2 | "3a" | "3b" | "3c" | "done"; +type WizardStep = 1 | 2 | "done" | "bind-a" | "bind-b" | "bind-c"; const EIP712_DOMAIN = { name: "ERC8004IdentityRegistry", @@ -122,7 +122,7 @@ export function AgentRegister() { } catch { setError("On-chain OK, but cache failed — will sync on next visit"); } - setStep("3a"); + setStep("done"); } catch (err) { setError(err instanceof Error ? err.message : "Registration failed"); } finally { @@ -144,7 +144,7 @@ export function AgentRegister() { }); setAgentSignature(signature); setSignatureDeadline(deadline); - setStep("3c"); + setStep("bind-c"); } catch (err) { setError(err instanceof Error ? err.message : "Agent wallet signing failed"); } finally { @@ -187,13 +187,13 @@ export function AgentRegister() { const isOwnerWalletConnected = ownerAddress && address?.toLowerCase() === ownerAddress.toLowerCase(); - const stepNum = typeof step === "number" ? step : step === "done" ? 4 : 3; + const stepNum = typeof step === "number" ? step : 3; return (
{/* Step indicator */}
- {([1, 2, 3] as const).map((s) => ( + {([1, 2] as const).map((s) => (
{s < stepNum ? "\u2713" : s}
- {s < 3 &&
} + {s < 2 &&
}
))} {step === 1 && "Agent Profile"} {step === 2 && "On-chain Registration"} - {(step === "3a" || step === "3b" || step === "3c") && "Bind Wallet"} - {step === "done" && "Complete"} + {(step === "done" || step === "bind-a" || step === "bind-b" || step === "bind-c") && "Complete"}
@@ -280,17 +279,11 @@ export function AgentRegister() {
)} - {/* Step 3a: Enter agent wallet */} - {step === "3a" && ( + {/* Bind wallet: Enter agent wallet */} + {step === "bind-a" && (
- {agentId !== undefined && ( -
-

Agent registered successfully

-

Agent ID: {agentId.toString()}

-
- )}

- Bind a separate wallet to your agent. The agent wallet must sign an EIP-712 message to prove consent. + Enter the wallet address you want your agent to use. The agent wallet must sign an EIP-712 message to prove consent.

@@ -298,9 +291,10 @@ export function AgentRegister() { className="border-border bg-surface text-foreground placeholder:text-muted w-full rounded border px-3 py-2 text-sm font-mono focus:border-accent focus:outline-none" />
- - + @@ -308,8 +302,8 @@ export function AgentRegister() {
)} - {/* Step 3b: Sign with agent wallet */} - {step === "3b" && ( + {/* Bind wallet: Sign with agent wallet */} + {step === "bind-b" && (

Switch to the agent wallet

@@ -323,7 +317,7 @@ export function AgentRegister() {
-
)} - {/* Step 3c: Submit as owner */} - {step === "3c" && ( + {/* Bind wallet: Submit as owner */} + {step === "bind-c" && (

Agent wallet signature obtained

@@ -358,8 +352,8 @@ export function AgentRegister() {
)}
- + +
+ + )}
)}
From 60eb795a3724907d6fbcc8e1b958a16dd1da6279 Mon Sep 17 00:00:00 2001 From: Cho Young-Hwi Date: Wed, 1 Apr 2026 11:57:24 +0100 Subject: [PATCH 2/2] [#702] Render wallet binding flow inline within Done screen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the enter-address → sign → submit binding flow inside the expandable
section on the Done screen, instead of navigating to separate wizard steps. Addresses T2a review feedback. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/components/AgentRegister.tsx | 184 +++++++++++++++---------------- 1 file changed, 90 insertions(+), 94 deletions(-) diff --git a/src/components/AgentRegister.tsx b/src/components/AgentRegister.tsx index a4ea3cc6..835773c3 100644 --- a/src/components/AgentRegister.tsx +++ b/src/components/AgentRegister.tsx @@ -18,7 +18,8 @@ const LLM_MODELS = [ "Cursor Composer", "xAI Grok", "Moonshot Kimi", "DeepSeek", "Qwen", "Others", ] as const; -type WizardStep = 1 | 2 | "done" | "bind-a" | "bind-b" | "bind-c"; +type WizardStep = 1 | 2 | "done"; +type BindStep = "enter" | "sign" | "submit" | "bound" | null; const EIP712_DOMAIN = { name: "ERC8004IdentityRegistry", @@ -56,6 +57,7 @@ export function AgentRegister() { const [signing, setSigning] = useState(false); const [binding, setBinding] = useState(false); const [bindTxHash, setBindTxHash] = useState(); + const [bindStep, setBindStep] = useState(null); const [error, setError] = useState(null); const agentURI = useMemo(() => { @@ -144,7 +146,7 @@ export function AgentRegister() { }); setAgentSignature(signature); setSignatureDeadline(deadline); - setStep("bind-c"); + setBindStep("submit"); } catch (err) { setError(err instanceof Error ? err.message : "Agent wallet signing failed"); } finally { @@ -174,7 +176,7 @@ export function AgentRegister() { fields: { agent_wallet: agentWallet.toLowerCase() }, }), }).catch(() => {}); - setStep("done"); + setBindStep("bound"); } catch (err) { setError(err instanceof Error ? err.message : "Wallet binding failed"); } finally { @@ -208,7 +210,7 @@ export function AgentRegister() { {step === 1 && "Agent Profile"} {step === 2 && "On-chain Registration"} - {(step === "done" || step === "bind-a" || step === "bind-b" || step === "bind-c") && "Complete"} + {step === "done" && "Complete"}
@@ -279,89 +281,6 @@ export function AgentRegister() {
)} - {/* Bind wallet: Enter agent wallet */} - {step === "bind-a" && ( -
-

- Enter the wallet address you want your agent to use. The agent wallet must sign an EIP-712 message to prove consent. -

-
- - setAgentWallet(e.target.value)} placeholder="0x..." - className="border-border bg-surface text-foreground placeholder:text-muted w-full rounded border px-3 py-2 text-sm font-mono focus:border-accent focus:outline-none" /> -
-
- - -
-
- )} - - {/* Bind wallet: Sign with agent wallet */} - {step === "bind-b" && ( -
-
-

Switch to the agent wallet

-

{agentWallet}

-
-
-
- - {isAgentWalletConnected ? Agent wallet connected. Ready to sign. - : <>Currently: {address?.slice(0, 6)}...{address?.slice(-4)}} - -
-
- - -
-
- )} - - {/* Bind wallet: Submit as owner */} - {step === "bind-c" && ( -
-
-

Agent wallet signature obtained

-
-
-

Switch back to the owner wallet

-

{ownerAddress}

-
-
-
- - {isOwnerWalletConnected ? Owner wallet connected. Ready to submit. - : <>Currently: {address?.slice(0, 6)}...{address?.slice(-4)}} - -
- {bindTxHash && ( - - )} -
- - -
-
- )} - {/* Done */} {step === "done" && (
@@ -370,18 +289,95 @@ export function AgentRegister() { {agentId !== undefined &&

Agent ID: {agentId.toString()}

}
{agentId !== undefined && ( -
- +
+ { if (!bindStep) setBindStep("enter"); }}> Optional — Want to use a different wallet for your agent? -
+

By default, your connected wallet is used as the agent wallet. You can bind a separate wallet for CLI/bot usage.

- + + {/* Enter address */} + {bindStep === "enter" && ( +
+
+ + setAgentWallet(e.target.value)} placeholder="0x..." + className="border-border bg-surface text-foreground placeholder:text-muted w-full rounded border px-3 py-2 text-sm font-mono focus:border-accent focus:outline-none" /> +
+ +
+ )} + + {/* Sign with agent wallet */} + {bindStep === "sign" && ( +
+
+

Switch to the agent wallet

+

{agentWallet}

+
+
+
+ + {isAgentWalletConnected ? Agent wallet connected. Ready to sign. + : <>Currently: {address?.slice(0, 6)}...{address?.slice(-4)}} + +
+
+ + +
+
+ )} + + {/* Submit binding as owner */} + {bindStep === "submit" && ( +
+
+

Agent wallet signature obtained

+
+
+

Switch back to the owner wallet

+

{ownerAddress}

+
+
+
+ + {isOwnerWalletConnected ? Owner wallet connected. Ready to submit. + : <>Currently: {address?.slice(0, 6)}...{address?.slice(-4)}} + +
+ {bindTxHash && ( + + )} + +
+ )} + + {/* Binding complete */} + {bindStep === "bound" && ( +
+

Agent wallet bound successfully

+

{agentWallet}

+
+ )}
)}