export interface SessionInfo {
  isAuthenticated: boolean;
  did: string | null;
  handle: string | null;
  pdsUrl: string | null;
}

export interface FeedRequest {
  source: string;
  limit: number;
  generatorId: string;
}

export interface FeedSignal {
  collection: string;
  subjectUri: string;
  signal: string;
  weight: number;
  generatorId: string;
  createdAt: string;
  metadata: Record<string, string>;
}

export interface FeedAuthor {
  did: string;
  handle: string;
  displayName: string;
  likeCount: number;
  source: "first-order" | "second-order";
}

export interface FeedImportPayload {
  account: {
    did: string;
    handle: string;
    pdsUrl: string | null;
  };
  authors: FeedAuthor[];
  items: FeedItem[];
  seedItems: FeedItem[];
}

export interface FeedItem {
  subjectUri: string;
  authorDid: string;
  authorHandle: string;
  authorDisplayName: string;
  text: string;
  origin: string;
  labels: string[];
  createdAt: string | null;
  score?: number;
  semanticScore?: number;
  authorAffinity?: number;
}

export interface PublishFeedRequest {
  ownerDid: string;
  serviceDid: string;
  feedKey: string;
  displayName: string;
  description: string;
}

export interface GeneratorDefinition {
  id: string;
  name: string;
  description: string;
  strategy: string;
}

export interface FeedGeneratorDescription {
  feedUri: string;
  feedKey: string;
  displayName: string;
  description: string;
  isConfigured: boolean;
  serviceDid: string | null;
}

export interface LikeFeedState {
  actorDid: string | null;
  importedPostCount: number;
  importedAuthorCount: number;
  items: FeedItem[];
  authors: FeedAuthor[];
}

export interface FeedSignalRecord {
  collection: string;
  subjectUri: string;
  signal: "MoreLikeThis" | "LessOfThis" | "LessFromAuthor";
  weight: number;
  generatorId: string;
  createdAt: string;
  metadata: Record<string, string>;
}

export type FeedSignalType = "MoreLikeThis" | "LessOfThis" | "LessFromAuthor";

export interface StoredFeedState {
  actorDid: string | null;
  generatorId: string;
  feedItems: FeedItemViewModel[];
  lastUpdated?: string;
}

export interface FeedItemViewModel {
  subjectUri: string;
  authorDid: string;
  authorHandle: string;
  authorDisplayName: string;
  text: string;
  origin: string;
  labels: string[];
  createdAt: string | null;
  score: number;
  semanticScore: number;
  authorAffinity: number;
}

export interface TasteProfileResult {
  actorDid: string | null;
  seedCount: number;
  candidateCount: number;
  idealPost: TasteProfileContributor | null;
  tasteKeywords: string | null;
  topSeedInfluences: TasteProfileContributor[];
  topContributors: TasteProfileContributor[];
}

export interface TasteProfileContributor {
  subjectUri: string;
  authorHandle: string;
  text: string;
  similarity: number;
}

export interface BlueskyList {
  uri: string;
  name: string;
  description?: string;
  creator: {
    did: string;
    handle: string;
    displayName?: string;
  };
  indexedAt: string;
}

export interface ListMember {
  did: string;
  handle: string;
  displayName: string;
}

export interface FollowedPerson {
  did: string;
  handle: string;
  displayName: string;
  followerCount: number;
  followedBy: string[];
}

export interface FollowsAnalysisResult {
  sourceCount: number;
  analyzedCount: number;
  topFollowed: FollowedPerson[];
}

export interface SelectableOption {
  key: string;
  title: string;
  description: string;
  isSelected: boolean;
}

export interface OAuthConfig {
  publicOrigin?: string | null;
  isConfigured: boolean;
  allowLocalDev: boolean;
  currentOrigin: string;
}
An unhandled error has occurred. Reload 🗙