Skip to content

[#841] Display "{human}'s AI Writer" via ERC-8004 owner + FID lookup #846

@realproject7

Description

@realproject7

Parent Epic: #841

Summary

When an ERC-8004 agent writes a story, display the human owner'''s identity instead of a bare wallet address. Show "{farcaster_name}'''s AI Writer" everywhere the writer identity appears.

How it Works

```
Story writer: 0xdABF... (OWS wallet)
→ Is this an ERC-8004 agent? Check users.agent_id
→ Yes → Look up owner: users.agent_owner = 0x4d68...
→ Does owner have FID? Check users table or Neynar API
→ Yes, FID 8106 → "project7'''s AI Writer"
```

Tasks

1. Cache Owner FID

When agent is registered/indexed:

  • `users` table already has `agent_owner` column
  • After indexing agent registration, also look up the owner'''s Farcaster data via Neynar
  • Cache owner'''s `fid`, `display_name`, `pfp_url` in the agent'''s user row or a separate lookup

2. WriterIdentity Component

Modify `src/components/WriterIdentity.tsx` (or `WriterIdentityClient.tsx`):

  • Current: shows wallet address or Farcaster name for the writer
  • New: if `writer_type === "agent"` AND `agent_owner` has a Farcaster identity:
    • Show: {owner_display_name}'''s AI Writer with owner'''s Farcaster avatar
    • Smaller text below: Agent #{agent_id} · {agent_name}
  • Fallback: if owner has no FID, show: AI Writer #{agent_id} (current behavior)

3. Profile Page

On the agent'''s profile page (`/profile/{owsWallet}`):

  • Add "Operated by" section:
    • Owner'''s Farcaster avatar + display name
    • Link to owner'''s profile page
    • Badge: "ERC-8004 Verified" (on-chain binding)
  • Keep existing agent stats below

4. Story Cards

On StoryCard component where writer is shown:

  • Same logic: if agent with owner FID → "{name}'''s AI Writer"
  • Small AI badge icon next to the name

5. Story Detail Header

On the storyline page header:

  • Writer section: "{name}'''s AI Writer" with link to both profiles
  • Or: "Written by {agent_name} · Owned by {owner_name}"

Data Flow

  • `users.agent_owner` → already populated on registration
  • `users.fid` (for owner) → already fetched via Neynar on onboard
  • Just need to JOIN: agent user → owner user → owner'''s Farcaster data

Acceptance Criteria

  • WriterIdentity shows "{human}'''s AI Writer" when agent has owner with FID
  • Profile page shows "Operated by" section with owner info
  • Story cards show human-linked AI writer name
  • Falls back to plain agent display when owner has no FID
  • All data sourced from on-chain ERC-8004 (not off-chain hack)

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/T3Assigned to T3 builder agentenhancementNew feature or requestphase/6-agentsPhase 6: Agent Layer

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions