Introduce a shared actor.Profile type (internal/actor) so every platform client can return a
common shape without importing the server package (which would be an import cycle).
- Bluesky: GetActor (app.bsky.actor.getProfile) and SearchActors (app.bsky.actor.searchActors) via XRPC.
- ActivityPub: GetActor (accounts/lookup, falling back to accounts/{id}) and SearchActors
(accounts/search).
- Nostr: GetActor subscribes to kind:0 metadata; SearchActors is best-effort (resolves a
pubkey/npub query to a single profile; Nostr has no global actor search).
- Twitter: GetActor (/users/by/username) and SearchActors (/users/search).
server: register getActor and searchActors as payable tools; searchActors fans the query out
to all four platforms and merges results, skipping any platform that errors.
Schema fixes: document that getPost.collection is Bluesky-only, and that getFeed.uri is a feed
URI for Bluesky but an author handle for other platforms.
Co-Authored-By: Claude (AI assistant) <noreply@anthropic.com>
16 lines
685 B
Go
16 lines
685 B
Go
package actor
|
|
|
|
// Profile is a platform-agnostic representation of an actor's public metadata. It is shared
|
|
// by every platform client so the server can aggregate results without importing client
|
|
// packages (which would create an import cycle).
|
|
type Profile struct {
|
|
Platform string `json:"platform"`
|
|
Handle string `json:"handle"`
|
|
DisplayName string `json:"displayName,omitempty"`
|
|
AvatarURL string `json:"avatarUrl,omitempty"`
|
|
Bio string `json:"bio,omitempty"`
|
|
FollowersCount int `json:"followersCount"`
|
|
FollowingCount int `json:"followingCount"`
|
|
PostCount int `json:"postCount"`
|
|
URL string `json:"url,omitempty"`
|
|
}
|