@elizaos/plugin-bluesky 2.0.0-alpha.6 → 2.0.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../../types/index.ts"],
4
4
  "sourcesContent": [
5
- "import type { IAgentRuntime } from \"@elizaos/core\";\nimport { z } from \"zod\";\n\nexport const BLUESKY_SERVICE_URL = \"https://bsky.social\";\nexport const BLUESKY_MAX_POST_LENGTH = 300;\nexport const BLUESKY_POLL_INTERVAL = 60;\nexport const BLUESKY_POST_INTERVAL_MIN = 1800;\nexport const BLUESKY_POST_INTERVAL_MAX = 3600;\nexport const BLUESKY_ACTION_INTERVAL = 120;\nexport const BLUESKY_MAX_ACTIONS = 5;\nexport const BLUESKY_CHAT_SERVICE_DID = \"did:web:api.bsky.chat\";\nexport const BLUESKY_SERVICE_NAME = \"bluesky\";\n\nexport const AT_PROTOCOL_HANDLE_REGEX =\n /^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/;\n\nexport const CACHE_TTL = {\n PROFILE: 3600000,\n TIMELINE: 300000,\n POST: 1800000,\n NOTIFICATIONS: 300000,\n CONVERSATIONS: 300000,\n} as const;\n\nexport const CACHE_SIZE = {\n PROFILE: 1000,\n TIMELINE: 500,\n POST: 10000,\n NOTIFICATIONS: 1000,\n CONVERSATIONS: 100,\n} as const;\n\nexport const BlueSkyConfigSchema = z.object({\n handle: z.string().regex(AT_PROTOCOL_HANDLE_REGEX, \"Invalid handle format\"),\n password: z.string().min(1),\n service: z.string().url().default(BLUESKY_SERVICE_URL),\n dryRun: z.boolean().default(false),\n pollInterval: z.number().positive().default(BLUESKY_POLL_INTERVAL),\n enablePost: z.boolean().default(true),\n postIntervalMin: z.number().positive().default(BLUESKY_POST_INTERVAL_MIN),\n postIntervalMax: z.number().positive().default(BLUESKY_POST_INTERVAL_MAX),\n enableActionProcessing: z.boolean().default(true),\n actionInterval: z.number().positive().default(BLUESKY_ACTION_INTERVAL),\n postImmediately: z.boolean().default(false),\n maxActionsProcessing: z.number().positive().default(BLUESKY_MAX_ACTIONS),\n enableDMs: z.boolean().default(true),\n});\n\nexport type BlueSkyConfig = z.infer<typeof BlueSkyConfigSchema>;\n\nexport interface BlueSkyProfile {\n did: string;\n handle: string;\n displayName?: string;\n description?: string;\n avatar?: string;\n banner?: string;\n followersCount?: number;\n followsCount?: number;\n postsCount?: number;\n indexedAt?: string;\n createdAt?: string;\n}\n\nexport interface PostFacet {\n index: { byteStart: number; byteEnd: number };\n features: Array<{\n $type?: string;\n [key: string]: string | number | boolean | object | null | undefined;\n }>;\n}\n\nexport interface PostEmbed {\n $type: string;\n [key: string]: string | number | boolean | object | null | undefined;\n}\n\nexport interface PostRecord {\n $type: string;\n text: string;\n facets?: PostFacet[];\n embed?: PostEmbed;\n createdAt: string;\n}\n\nexport interface BlueSkyPost {\n uri: string;\n cid: string;\n author: BlueSkyProfile;\n record: PostRecord;\n embed?: PostEmbed;\n replyCount?: number;\n repostCount?: number;\n likeCount?: number;\n quoteCount?: number;\n indexedAt: string;\n}\n\nexport interface TimelineRequest {\n algorithm?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface TimelineFeedItem {\n post: BlueSkyPost;\n reply?: {\n root: BlueSkyPost;\n parent: BlueSkyPost;\n };\n reason?: Record<string, string | number | boolean | object | null | undefined>;\n}\n\nexport interface TimelineResponse {\n cursor?: string;\n feed: TimelineFeedItem[];\n}\n\nexport interface CreatePostRequest {\n content: {\n text: string;\n facets?: PostFacet[];\n embed?: PostEmbed;\n };\n replyTo?: { uri: string; cid: string };\n}\n\nexport type NotificationReason = \"mention\" | \"reply\" | \"follow\" | \"like\" | \"repost\" | \"quote\";\n\nexport interface BlueSkyNotification {\n uri: string;\n cid: string;\n author: BlueSkyProfile;\n reason: NotificationReason;\n reasonSubject?: string;\n record: Record<string, string | number | boolean | object | null | undefined>;\n isRead: boolean;\n indexedAt: string;\n}\n\nexport interface BlueSkyMessage {\n id: string;\n rev: string;\n text?: string;\n embed?: PostEmbed;\n sender: { did: string };\n sentAt: string;\n}\n\nexport interface BlueSkyConversation {\n id: string;\n rev: string;\n members: Array<{\n did: string;\n handle?: string;\n displayName?: string;\n avatar?: string;\n }>;\n lastMessage?: BlueSkyMessage;\n unreadCount: number;\n muted: boolean;\n}\n\nexport interface SendMessageRequest {\n convoId: string;\n message: { text?: string; embed?: PostEmbed };\n}\n\nexport interface BlueSkySession {\n did: string;\n handle: string;\n email?: string;\n accessJwt: string;\n refreshJwt: string;\n}\n\nexport class BlueSkyError extends Error {\n constructor(\n message: string,\n public readonly code: string,\n public readonly status?: number\n ) {\n super(message);\n this.name = \"BlueSkyError\";\n }\n}\n\nexport interface ATProtocolPostRecord {\n $type: string;\n text: string;\n facets?: PostFacet[];\n embed?: PostEmbed;\n createdAt: string;\n [k: string]: string | PostFacet[] | PostEmbed | number | boolean | null | undefined;\n}\n\nexport interface ATProtocolProfileViewExtended {\n did: string;\n handle: string;\n displayName?: string;\n description?: string;\n avatar?: string;\n banner?: string;\n followersCount?: number;\n followsCount?: number;\n postsCount?: number;\n indexedAt?: string;\n createdAt?: string;\n [k: string]: string | number | undefined;\n}\n\nexport interface BlueSkyEventPayload {\n runtime: IAgentRuntime;\n source: \"bluesky\";\n}\n\nexport interface BlueSkyNotificationEventPayload extends BlueSkyEventPayload {\n notification: BlueSkyNotification;\n}\n\nexport interface BlueSkyCreatePostEventPayload extends BlueSkyEventPayload {\n automated: boolean;\n}\n"
5
+ "import type { IAgentRuntime } from \"@elizaos/core\";\nimport { z } from \"zod\";\n\nexport const BLUESKY_SERVICE_URL = \"https://bsky.social\";\nexport const BLUESKY_MAX_POST_LENGTH = 300;\nexport const BLUESKY_POLL_INTERVAL = 60;\nexport const BLUESKY_POST_INTERVAL_MIN = 1800;\nexport const BLUESKY_POST_INTERVAL_MAX = 3600;\nexport const BLUESKY_ACTION_INTERVAL = 120;\nexport const BLUESKY_MAX_ACTIONS = 5;\nexport const BLUESKY_CHAT_SERVICE_DID = \"did:web:api.bsky.chat\";\nexport const BLUESKY_SERVICE_NAME = \"bluesky\";\n\nexport const AT_PROTOCOL_HANDLE_REGEX =\n\t/^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/;\n\nexport const CACHE_TTL = {\n\tPROFILE: 3600000,\n\tTIMELINE: 300000,\n\tPOST: 1800000,\n\tNOTIFICATIONS: 300000,\n\tCONVERSATIONS: 300000,\n} as const;\n\nexport const CACHE_SIZE = {\n\tPROFILE: 1000,\n\tTIMELINE: 500,\n\tPOST: 10000,\n\tNOTIFICATIONS: 1000,\n\tCONVERSATIONS: 100,\n} as const;\n\nexport const BlueSkyConfigSchema = z.object({\n\thandle: z.string().regex(AT_PROTOCOL_HANDLE_REGEX, \"Invalid handle format\"),\n\tpassword: z.string().min(1),\n\tservice: z.string().url().default(BLUESKY_SERVICE_URL),\n\tdryRun: z.boolean().default(false),\n\tpollInterval: z.number().positive().default(BLUESKY_POLL_INTERVAL),\n\tenablePost: z.boolean().default(true),\n\tpostIntervalMin: z.number().positive().default(BLUESKY_POST_INTERVAL_MIN),\n\tpostIntervalMax: z.number().positive().default(BLUESKY_POST_INTERVAL_MAX),\n\tenableActionProcessing: z.boolean().default(true),\n\tactionInterval: z.number().positive().default(BLUESKY_ACTION_INTERVAL),\n\tpostImmediately: z.boolean().default(false),\n\tmaxActionsProcessing: z.number().positive().default(BLUESKY_MAX_ACTIONS),\n\tenableDMs: z.boolean().default(true),\n});\n\nexport type BlueSkyConfig = z.infer<typeof BlueSkyConfigSchema>;\n\nexport interface BlueSkyProfile {\n\tdid: string;\n\thandle: string;\n\tdisplayName?: string;\n\tdescription?: string;\n\tavatar?: string;\n\tbanner?: string;\n\tfollowersCount?: number;\n\tfollowsCount?: number;\n\tpostsCount?: number;\n\tindexedAt?: string;\n\tcreatedAt?: string;\n}\n\nexport interface PostFacet {\n\tindex: { byteStart: number; byteEnd: number };\n\tfeatures: Array<{\n\t\t$type?: string;\n\t\t[key: string]: string | number | boolean | object | null | undefined;\n\t}>;\n}\n\nexport interface PostEmbed {\n\t$type: string;\n\t[key: string]: string | number | boolean | object | null | undefined;\n}\n\nexport interface PostRecord {\n\t$type: string;\n\ttext: string;\n\tfacets?: PostFacet[];\n\tembed?: PostEmbed;\n\tcreatedAt: string;\n}\n\nexport interface BlueSkyPost {\n\turi: string;\n\tcid: string;\n\tauthor: BlueSkyProfile;\n\trecord: PostRecord;\n\tembed?: PostEmbed;\n\treplyCount?: number;\n\trepostCount?: number;\n\tlikeCount?: number;\n\tquoteCount?: number;\n\tindexedAt: string;\n}\n\nexport interface TimelineRequest {\n\talgorithm?: string;\n\tlimit?: number;\n\tcursor?: string;\n}\n\nexport interface TimelineFeedItem {\n\tpost: BlueSkyPost;\n\treply?: {\n\t\troot: BlueSkyPost;\n\t\tparent: BlueSkyPost;\n\t};\n\treason?: Record<\n\t\tstring,\n\t\tstring | number | boolean | object | null | undefined\n\t>;\n}\n\nexport interface TimelineResponse {\n\tcursor?: string;\n\tfeed: TimelineFeedItem[];\n}\n\nexport interface CreatePostRequest {\n\tcontent: {\n\t\ttext: string;\n\t\tfacets?: PostFacet[];\n\t\tembed?: PostEmbed;\n\t};\n\treplyTo?: { uri: string; cid: string };\n}\n\nexport type NotificationReason =\n\t| \"mention\"\n\t| \"reply\"\n\t| \"follow\"\n\t| \"like\"\n\t| \"repost\"\n\t| \"quote\";\n\nexport interface BlueSkyNotification {\n\turi: string;\n\tcid: string;\n\tauthor: BlueSkyProfile;\n\treason: NotificationReason;\n\treasonSubject?: string;\n\trecord: Record<string, string | number | boolean | object | null | undefined>;\n\tisRead: boolean;\n\tindexedAt: string;\n}\n\nexport interface BlueSkyMessage {\n\tid: string;\n\trev: string;\n\ttext?: string;\n\tembed?: PostEmbed;\n\tsender: { did: string };\n\tsentAt: string;\n}\n\nexport interface BlueSkyConversation {\n\tid: string;\n\trev: string;\n\tmembers: Array<{\n\t\tdid: string;\n\t\thandle?: string;\n\t\tdisplayName?: string;\n\t\tavatar?: string;\n\t}>;\n\tlastMessage?: BlueSkyMessage;\n\tunreadCount: number;\n\tmuted: boolean;\n}\n\nexport interface SendMessageRequest {\n\tconvoId: string;\n\tmessage: { text?: string; embed?: PostEmbed };\n}\n\nexport interface BlueSkySession {\n\tdid: string;\n\thandle: string;\n\temail?: string;\n\taccessJwt: string;\n\trefreshJwt: string;\n}\n\nexport class BlueSkyError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly code: string,\n\t\tpublic readonly status?: number,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"BlueSkyError\";\n\t}\n}\n\nexport interface ATProtocolPostRecord {\n\t$type: string;\n\ttext: string;\n\tfacets?: PostFacet[];\n\tembed?: PostEmbed;\n\tcreatedAt: string;\n\t[k: string]:\n\t\t| string\n\t\t| PostFacet[]\n\t\t| PostEmbed\n\t\t| number\n\t\t| boolean\n\t\t| null\n\t\t| undefined;\n}\n\nexport interface ATProtocolProfileViewExtended {\n\tdid: string;\n\thandle: string;\n\tdisplayName?: string;\n\tdescription?: string;\n\tavatar?: string;\n\tbanner?: string;\n\tfollowersCount?: number;\n\tfollowsCount?: number;\n\tpostsCount?: number;\n\tindexedAt?: string;\n\tcreatedAt?: string;\n\t[k: string]: string | number | undefined;\n}\n\nexport interface BlueSkyEventPayload {\n\truntime: IAgentRuntime;\n\tsource: \"bluesky\";\n}\n\nexport interface BlueSkyNotificationEventPayload extends BlueSkyEventPayload {\n\tnotification: BlueSkyNotification;\n}\n\nexport interface BlueSkyCreatePostEventPayload extends BlueSkyEventPayload {\n\tautomated: boolean;\n}\n"
6
6
  ],
7
- "mappings": ";AACA;AAEO,IAAM,sBAAsB;AAC5B,IAAM,0BAA0B;AAChC,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AAE,QAAQ,EAAE,QAAQ,KAAK;AAAA,EAC1C,sBAAsB,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,mBAAmB;AAAA,EACvE,WAAW,EAAE,QAAQ,EAAE,QAAQ,IAAI;AACpC,CAAC;AAAA;AA2IM,MAAM,qBAAqB,MAAM;AAAA,EAGtB;AAAA,EACA;AAAA,EAHjB,WAAW,CACV,SACgB,MACA,QACf;AAAA,IACD,MAAM,OAAO;AAAA,IAHG;AAAA,IACA;AAAA,IAGhB,KAAK,OAAO;AAAA;AAEd;",
8
8
  "debugId": "AB54F736CEC6763B64756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -2,17 +2,17 @@
2
2
  "version": 3,
3
3
  "sources": ["../../index.ts", "../../services/bluesky.ts", "../../client.ts", "../../types/index.ts", "../../managers/agent.ts", "../../utils/config.ts", "../../services/message.ts", "../../generated/prompts/typescript/prompts.ts", "../../services/post.ts"],
4
4
  "sourcesContent": [
5
- "import type { IAgentRuntime, Plugin, TestCase, TestSuite } from \"@elizaos/core\";\nimport { logger } from \"@elizaos/core\";\nimport { BlueSkyService } from \"./services/bluesky\";\nimport { getApiKeyOptional } from \"./utils/config\";\n\nexport { BlueSkyClient } from \"./client\";\nexport { BlueSkyService } from \"./services/bluesky\";\n\nexport interface PluginConfig {\n readonly BLUESKY_HANDLE?: string;\n readonly BLUESKY_PASSWORD?: string;\n readonly BLUESKY_SERVICE?: string;\n readonly BLUESKY_DRY_RUN?: string;\n readonly BLUESKY_POLL_INTERVAL?: string;\n readonly BLUESKY_ENABLE_POSTING?: string;\n readonly BLUESKY_ENABLE_DMS?: string;\n readonly BLUESKY_POST_INTERVAL_MIN?: string;\n readonly BLUESKY_POST_INTERVAL_MAX?: string;\n readonly BLUESKY_ENABLE_ACTION_PROCESSING?: string;\n readonly BLUESKY_ACTION_INTERVAL?: string;\n readonly BLUESKY_POST_IMMEDIATELY?: string;\n readonly BLUESKY_MAX_ACTIONS_PROCESSING?: string;\n readonly BLUESKY_MAX_POST_LENGTH?: string;\n}\n\nconst pluginTests = [\n {\n name: \"bluesky_plugin_tests\",\n tests: [\n {\n name: \"bluesky_test_credentials_validation\",\n fn: async (runtime: IAgentRuntime) => {\n const handle = getApiKeyOptional(runtime, \"BLUESKY_HANDLE\");\n const password = getApiKeyOptional(runtime, \"BLUESKY_PASSWORD\");\n if (!handle || !password) {\n throw new Error(\"BLUESKY_HANDLE and BLUESKY_PASSWORD are not configured\");\n }\n logger.log(\"BlueSky credentials are configured\");\n },\n },\n {\n name: \"bluesky_test_service_initialization\",\n fn: async (runtime: IAgentRuntime) => {\n const handle = getApiKeyOptional(runtime, \"BLUESKY_HANDLE\");\n const password = getApiKeyOptional(runtime, \"BLUESKY_PASSWORD\");\n if (!handle || !password) {\n logger.log(\"Skipping service initialization test - credentials not configured\");\n return;\n }\n\n const service = await BlueSkyService.start(runtime);\n if (!service) {\n throw new Error(\"Failed to initialize BlueSky service\");\n }\n logger.log(\"BlueSky service initialized successfully\");\n },\n },\n ] as TestCase[],\n },\n] as TestSuite[];\n\nexport const blueSkyPlugin: Plugin = {\n name: \"bluesky\",\n description: \"BlueSky client plugin using AT Protocol for social interactions\",\n\n config: {\n BLUESKY_HANDLE: process.env.BLUESKY_HANDLE ?? null,\n BLUESKY_PASSWORD: process.env.BLUESKY_PASSWORD ?? null,\n BLUESKY_SERVICE: process.env.BLUESKY_SERVICE ?? null,\n BLUESKY_DRY_RUN: process.env.BLUESKY_DRY_RUN ?? null,\n BLUESKY_POLL_INTERVAL: process.env.BLUESKY_POLL_INTERVAL ?? null,\n BLUESKY_ENABLE_POSTING: process.env.BLUESKY_ENABLE_POSTING ?? null,\n BLUESKY_ENABLE_DMS: process.env.BLUESKY_ENABLE_DMS ?? null,\n BLUESKY_POST_INTERVAL_MIN: process.env.BLUESKY_POST_INTERVAL_MIN ?? null,\n BLUESKY_POST_INTERVAL_MAX: process.env.BLUESKY_POST_INTERVAL_MAX ?? null,\n BLUESKY_ENABLE_ACTION_PROCESSING: process.env.BLUESKY_ENABLE_ACTION_PROCESSING ?? null,\n BLUESKY_ACTION_INTERVAL: process.env.BLUESKY_ACTION_INTERVAL ?? null,\n BLUESKY_POST_IMMEDIATELY: process.env.BLUESKY_POST_IMMEDIATELY ?? null,\n BLUESKY_MAX_ACTIONS_PROCESSING: process.env.BLUESKY_MAX_ACTIONS_PROCESSING ?? null,\n BLUESKY_MAX_POST_LENGTH: process.env.BLUESKY_MAX_POST_LENGTH ?? null,\n },\n\n async init(_config, _runtime) {\n logger.log(\"BlueSky plugin initialized\");\n },\n\n services: [BlueSkyService],\n\n tests: pluginTests,\n};\n\nexport default blueSkyPlugin;\n",
6
- "import { type IAgentRuntime, logger, Service, type UUID } from \"@elizaos/core\";\nimport { BlueSkyClient } from \"../client\";\nimport { BlueSkyAgentManager } from \"../managers/agent\";\nimport { BLUESKY_SERVICE_NAME } from \"../types\";\nimport { hasBlueSkyEnabled, validateBlueSkyConfig } from \"../utils/config\";\nimport { BlueSkyMessageService } from \"./message\";\nimport { BlueSkyPostService } from \"./post\";\n\nexport class BlueSkyService extends Service {\n private static instance: BlueSkyService;\n private managers = new Map<UUID, BlueSkyAgentManager>();\n private messageServices = new Map<UUID, BlueSkyMessageService>();\n private postServices = new Map<UUID, BlueSkyPostService>();\n static serviceType = BLUESKY_SERVICE_NAME;\n readonly capabilityDescription = \"Send and receive messages on BlueSky\";\n\n private static getInstance(): BlueSkyService {\n BlueSkyService.instance ??= new BlueSkyService();\n return BlueSkyService.instance;\n }\n\n static async start(runtime: IAgentRuntime): Promise<Service> {\n const service = BlueSkyService.getInstance();\n\n if (service.managers.has(runtime.agentId)) {\n return service;\n }\n\n if (!hasBlueSkyEnabled(runtime)) {\n return service;\n }\n\n const config = validateBlueSkyConfig(runtime);\n const client = new BlueSkyClient({\n service: config.service,\n handle: config.handle,\n password: config.password,\n dryRun: config.dryRun,\n });\n\n const manager = new BlueSkyAgentManager(runtime, config, client);\n service.managers.set(runtime.agentId, manager);\n service.messageServices.set(runtime.agentId, new BlueSkyMessageService(client, runtime));\n service.postServices.set(runtime.agentId, new BlueSkyPostService(client, runtime));\n\n await manager.start();\n logger.success({ agentId: runtime.agentId }, \"BlueSky client started\");\n\n return service;\n }\n\n static async stop(runtime: IAgentRuntime): Promise<void> {\n const service = BlueSkyService.getInstance();\n const manager = service.managers.get(runtime.agentId);\n if (!manager) return;\n\n await manager.stop();\n service.managers.delete(runtime.agentId);\n service.messageServices.delete(runtime.agentId);\n service.postServices.delete(runtime.agentId);\n logger.info({ agentId: runtime.agentId }, \"BlueSky client stopped\");\n }\n\n async stop(): Promise<void> {\n for (const manager of this.managers.values()) {\n await BlueSkyService.stop(manager.runtime);\n }\n }\n\n getMessageService(agentId: UUID): BlueSkyMessageService | undefined {\n return this.messageServices.get(agentId);\n }\n\n getPostService(agentId: UUID): BlueSkyPostService | undefined {\n return this.postServices.get(agentId);\n }\n}\n",
7
- "import { type AppBskyFeedDefs, BskyAgent, RichText } from \"@atproto/api\";\nimport { logger } from \"@elizaos/core\";\nimport { LRUCache } from \"lru-cache\";\nimport type {\n ATProtocolPostRecord,\n ATProtocolProfileViewExtended,\n BlueSkyConversation,\n BlueSkyMessage,\n BlueSkyNotification,\n BlueSkyPost,\n BlueSkyProfile,\n BlueSkySession,\n CreatePostRequest,\n PostEmbed,\n PostFacet,\n SendMessageRequest,\n TimelineRequest,\n TimelineResponse,\n} from \"./types\";\nimport { BLUESKY_CHAT_SERVICE_DID, BlueSkyError, CACHE_SIZE, CACHE_TTL } from \"./types\";\n\nfunction isPostView(\n item:\n | AppBskyFeedDefs.PostView\n | AppBskyFeedDefs.NotFoundPost\n | AppBskyFeedDefs.BlockedPost\n | { $type: string; [k: string]: unknown }\n): item is AppBskyFeedDefs.PostView {\n return (\n typeof item === \"object\" &&\n item !== null &&\n \"uri\" in item &&\n \"cid\" in item &&\n \"author\" in item &&\n \"record\" in item &&\n \"indexedAt\" in item &&\n typeof (item as AppBskyFeedDefs.PostView).uri === \"string\" &&\n typeof (item as AppBskyFeedDefs.PostView).cid === \"string\"\n );\n}\n\nfunction isReplyWithPostViews(\n reply: AppBskyFeedDefs.ReplyRef | null | undefined\n): reply is { root: AppBskyFeedDefs.PostView; parent: AppBskyFeedDefs.PostView } {\n return (\n typeof reply === \"object\" &&\n reply !== null &&\n \"root\" in reply &&\n \"parent\" in reply &&\n isPostView(reply.root) &&\n isPostView(reply.parent)\n );\n}\n\nfunction adaptPostView(postView: AppBskyFeedDefs.PostView): BlueSkyPost {\n const author = postView.author as ATProtocolProfileViewExtended;\n const record = postView.record as ATProtocolPostRecord;\n\n return {\n uri: postView.uri,\n cid: postView.cid,\n author: {\n did: author.did,\n handle: author.handle,\n displayName: author.displayName,\n description: author.description,\n avatar: author.avatar,\n banner: author.banner,\n followersCount: author.followersCount,\n followsCount: author.followsCount,\n postsCount: author.postsCount,\n indexedAt: author.indexedAt,\n createdAt: author.createdAt,\n },\n record: {\n $type: record.$type ?? \"app.bsky.feed.post\",\n text: record.text ?? \"\",\n facets: record.facets as PostFacet[] | undefined,\n embed: record.embed as PostEmbed | undefined,\n createdAt: record.createdAt ?? \"\",\n },\n embed: postView.embed as PostEmbed | undefined,\n replyCount: postView.replyCount,\n repostCount: postView.repostCount,\n likeCount: postView.likeCount,\n quoteCount: postView.quoteCount,\n indexedAt: postView.indexedAt,\n };\n}\n\nexport interface BlueSkyClientConfig {\n service: string;\n handle: string;\n password: string;\n dryRun: boolean;\n}\n\nexport class BlueSkyClient {\n private readonly agent: BskyAgent;\n private session: BlueSkySession | null = null;\n private readonly profileCache: LRUCache<string, BlueSkyProfile>;\n\n constructor(private readonly config: BlueSkyClientConfig) {\n this.agent = new BskyAgent({ service: config.service });\n this.profileCache = new LRUCache({\n max: CACHE_SIZE.PROFILE,\n ttl: CACHE_TTL.PROFILE,\n });\n }\n\n async authenticate(): Promise<BlueSkySession> {\n const response = await this.agent.login({\n identifier: this.config.handle,\n password: this.config.password,\n });\n\n if (!response.success) {\n throw new BlueSkyError(\"Authentication failed\", \"AUTH_FAILED\");\n }\n\n this.session = {\n did: response.data.did,\n handle: response.data.handle,\n email: response.data.email,\n accessJwt: response.data.accessJwt,\n refreshJwt: response.data.refreshJwt,\n };\n\n logger.info(`Authenticated with BlueSky: ${this.session.handle}`);\n return this.session;\n }\n\n getSession(): BlueSkySession | null {\n return this.session;\n }\n\n async getProfile(handle: string): Promise<BlueSkyProfile> {\n const cached = this.profileCache.get(handle);\n if (cached) return cached;\n\n const response = await this.agent.getProfile({ actor: handle });\n const profile: BlueSkyProfile = {\n did: response.data.did,\n handle: response.data.handle,\n displayName: response.data.displayName,\n description: response.data.description,\n avatar: response.data.avatar,\n banner: response.data.banner,\n followersCount: response.data.followersCount,\n followsCount: response.data.followsCount,\n postsCount: response.data.postsCount,\n indexedAt: response.data.indexedAt,\n createdAt: response.data.createdAt,\n };\n\n this.profileCache.set(handle, profile);\n return profile;\n }\n\n async getTimeline(params: TimelineRequest = {}): Promise<TimelineResponse> {\n const response = await this.agent.getTimeline({\n algorithm: params.algorithm,\n limit: params.limit ?? 50,\n cursor: params.cursor,\n });\n\n return {\n cursor: response.data.cursor,\n feed: response.data.feed.map((item) => {\n const reply = isReplyWithPostViews(item.reply)\n ? {\n root: adaptPostView(item.reply.root),\n parent: adaptPostView(item.reply.parent),\n }\n : undefined;\n\n return {\n post: adaptPostView(item.post),\n reply,\n reason: item.reason as Record<\n string,\n string | number | boolean | object | null | undefined\n >,\n };\n }),\n };\n }\n\n async sendPost(request: CreatePostRequest): Promise<BlueSkyPost> {\n if (this.config.dryRun) {\n logger.info(`Dry run: would create post with text: ${request.content.text}`);\n return this.mockPost(request.content.text);\n }\n\n const rt = new RichText({ text: request.content.text });\n await rt.detectFacets(this.agent);\n\n const record: Record<\n string,\n | string\n | PostFacet[]\n | PostEmbed\n | { root: { uri: string; cid: string }; parent: { uri: string; cid: string } }\n > = {\n $type: \"app.bsky.feed.post\",\n text: rt.text,\n facets: rt.facets as PostFacet[],\n createdAt: new Date().toISOString(),\n };\n\n if (request.replyTo) {\n record.reply = { root: request.replyTo, parent: request.replyTo };\n }\n\n if (request.content.embed) {\n record.embed = request.content.embed;\n }\n\n const response = await this.agent.post(record);\n const thread = await this.agent.getPostThread({\n uri: response.uri,\n depth: 0,\n });\n\n if (thread.data.thread.$type !== \"app.bsky.feed.defs#threadViewPost\") {\n throw new BlueSkyError(\"Failed to retrieve created post\", \"POST_CREATE_FAILED\");\n }\n\n const threadViewPost = thread.data.thread as AppBskyFeedDefs.ThreadViewPost;\n return adaptPostView(threadViewPost.post);\n }\n\n async deletePost(uri: string): Promise<void> {\n if (this.config.dryRun) {\n logger.info(`Dry run: would delete post: ${uri}`);\n return;\n }\n await this.agent.deletePost(uri);\n }\n\n async likePost(uri: string, cid: string): Promise<void> {\n if (this.config.dryRun) {\n logger.info(`Dry run: would like post: ${uri}`);\n return;\n }\n await this.agent.like(uri, cid);\n }\n\n async repost(uri: string, cid: string): Promise<void> {\n if (this.config.dryRun) {\n logger.info({ uri }, \"Dry run: would repost\");\n return;\n }\n await this.agent.repost(uri, cid);\n }\n\n async getNotifications(\n limit = 50,\n cursor?: string\n ): Promise<{\n notifications: BlueSkyNotification[];\n cursor?: string;\n }> {\n const response = await this.agent.listNotifications({ limit, cursor });\n return {\n notifications: response.data.notifications as BlueSkyNotification[],\n cursor: response.data.cursor,\n };\n }\n\n async updateSeenNotifications(): Promise<void> {\n await this.agent.updateSeenNotifications();\n }\n\n async getConversations(\n limit = 50,\n cursor?: string\n ): Promise<{\n conversations: BlueSkyConversation[];\n cursor?: string;\n }> {\n const response = await this.agent.api.chat.bsky.convo.listConvos(\n { limit, cursor },\n { headers: { \"atproto-proxy\": BLUESKY_CHAT_SERVICE_DID } }\n );\n return {\n conversations: response.data.convos as BlueSkyConversation[],\n cursor: response.data.cursor,\n };\n }\n\n async getMessages(\n convoId: string,\n limit = 50,\n cursor?: string\n ): Promise<{\n messages: BlueSkyMessage[];\n cursor?: string;\n }> {\n const response = await this.agent.api.chat.bsky.convo.getMessages(\n { convoId, limit, cursor },\n { headers: { \"atproto-proxy\": BLUESKY_CHAT_SERVICE_DID } }\n );\n return {\n messages: response.data.messages as BlueSkyMessage[],\n cursor: response.data.cursor,\n };\n }\n\n async sendMessage(request: SendMessageRequest): Promise<BlueSkyMessage> {\n if (this.config.dryRun) {\n logger.info({ convoId: request.convoId }, \"Dry run: would send message\");\n return this.mockMessage(request.message.text ?? \"\");\n }\n\n const response = await this.agent.api.chat.bsky.convo.sendMessage(\n {\n convoId: request.convoId,\n message: { text: request.message.text ?? \"\" },\n },\n { headers: { \"atproto-proxy\": BLUESKY_CHAT_SERVICE_DID } }\n );\n return response.data as BlueSkyMessage;\n }\n\n async cleanup(): Promise<void> {\n this.profileCache.clear();\n this.session = null;\n }\n\n private mockPost(text: string): BlueSkyPost {\n const now = new Date().toISOString();\n return {\n uri: `mock://post/${Date.now()}`,\n cid: `mock-cid-${Date.now()}`,\n author: {\n did: this.session?.did ?? \"did:plc:mock\",\n handle: this.session?.handle ?? \"mock.handle\",\n },\n record: { $type: \"app.bsky.feed.post\", text, createdAt: now },\n indexedAt: now,\n };\n }\n\n private mockMessage(text: string): BlueSkyMessage {\n return {\n id: `mock-msg-${Date.now()}`,\n rev: \"1\",\n text,\n sender: { did: this.session?.did ?? \"did:plc:mock\" },\n sentAt: new Date().toISOString(),\n };\n }\n}\n",
8
- "import type { IAgentRuntime } from \"@elizaos/core\";\nimport { z } from \"zod\";\n\nexport const BLUESKY_SERVICE_URL = \"https://bsky.social\";\nexport const BLUESKY_MAX_POST_LENGTH = 300;\nexport const BLUESKY_POLL_INTERVAL = 60;\nexport const BLUESKY_POST_INTERVAL_MIN = 1800;\nexport const BLUESKY_POST_INTERVAL_MAX = 3600;\nexport const BLUESKY_ACTION_INTERVAL = 120;\nexport const BLUESKY_MAX_ACTIONS = 5;\nexport const BLUESKY_CHAT_SERVICE_DID = \"did:web:api.bsky.chat\";\nexport const BLUESKY_SERVICE_NAME = \"bluesky\";\n\nexport const AT_PROTOCOL_HANDLE_REGEX =\n /^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/;\n\nexport const CACHE_TTL = {\n PROFILE: 3600000,\n TIMELINE: 300000,\n POST: 1800000,\n NOTIFICATIONS: 300000,\n CONVERSATIONS: 300000,\n} as const;\n\nexport const CACHE_SIZE = {\n PROFILE: 1000,\n TIMELINE: 500,\n POST: 10000,\n NOTIFICATIONS: 1000,\n CONVERSATIONS: 100,\n} as const;\n\nexport const BlueSkyConfigSchema = z.object({\n handle: z.string().regex(AT_PROTOCOL_HANDLE_REGEX, \"Invalid handle format\"),\n password: z.string().min(1),\n service: z.string().url().default(BLUESKY_SERVICE_URL),\n dryRun: z.boolean().default(false),\n pollInterval: z.number().positive().default(BLUESKY_POLL_INTERVAL),\n enablePost: z.boolean().default(true),\n postIntervalMin: z.number().positive().default(BLUESKY_POST_INTERVAL_MIN),\n postIntervalMax: z.number().positive().default(BLUESKY_POST_INTERVAL_MAX),\n enableActionProcessing: z.boolean().default(true),\n actionInterval: z.number().positive().default(BLUESKY_ACTION_INTERVAL),\n postImmediately: z.boolean().default(false),\n maxActionsProcessing: z.number().positive().default(BLUESKY_MAX_ACTIONS),\n enableDMs: z.boolean().default(true),\n});\n\nexport type BlueSkyConfig = z.infer<typeof BlueSkyConfigSchema>;\n\nexport interface BlueSkyProfile {\n did: string;\n handle: string;\n displayName?: string;\n description?: string;\n avatar?: string;\n banner?: string;\n followersCount?: number;\n followsCount?: number;\n postsCount?: number;\n indexedAt?: string;\n createdAt?: string;\n}\n\nexport interface PostFacet {\n index: { byteStart: number; byteEnd: number };\n features: Array<{\n $type?: string;\n [key: string]: string | number | boolean | object | null | undefined;\n }>;\n}\n\nexport interface PostEmbed {\n $type: string;\n [key: string]: string | number | boolean | object | null | undefined;\n}\n\nexport interface PostRecord {\n $type: string;\n text: string;\n facets?: PostFacet[];\n embed?: PostEmbed;\n createdAt: string;\n}\n\nexport interface BlueSkyPost {\n uri: string;\n cid: string;\n author: BlueSkyProfile;\n record: PostRecord;\n embed?: PostEmbed;\n replyCount?: number;\n repostCount?: number;\n likeCount?: number;\n quoteCount?: number;\n indexedAt: string;\n}\n\nexport interface TimelineRequest {\n algorithm?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface TimelineFeedItem {\n post: BlueSkyPost;\n reply?: {\n root: BlueSkyPost;\n parent: BlueSkyPost;\n };\n reason?: Record<string, string | number | boolean | object | null | undefined>;\n}\n\nexport interface TimelineResponse {\n cursor?: string;\n feed: TimelineFeedItem[];\n}\n\nexport interface CreatePostRequest {\n content: {\n text: string;\n facets?: PostFacet[];\n embed?: PostEmbed;\n };\n replyTo?: { uri: string; cid: string };\n}\n\nexport type NotificationReason = \"mention\" | \"reply\" | \"follow\" | \"like\" | \"repost\" | \"quote\";\n\nexport interface BlueSkyNotification {\n uri: string;\n cid: string;\n author: BlueSkyProfile;\n reason: NotificationReason;\n reasonSubject?: string;\n record: Record<string, string | number | boolean | object | null | undefined>;\n isRead: boolean;\n indexedAt: string;\n}\n\nexport interface BlueSkyMessage {\n id: string;\n rev: string;\n text?: string;\n embed?: PostEmbed;\n sender: { did: string };\n sentAt: string;\n}\n\nexport interface BlueSkyConversation {\n id: string;\n rev: string;\n members: Array<{\n did: string;\n handle?: string;\n displayName?: string;\n avatar?: string;\n }>;\n lastMessage?: BlueSkyMessage;\n unreadCount: number;\n muted: boolean;\n}\n\nexport interface SendMessageRequest {\n convoId: string;\n message: { text?: string; embed?: PostEmbed };\n}\n\nexport interface BlueSkySession {\n did: string;\n handle: string;\n email?: string;\n accessJwt: string;\n refreshJwt: string;\n}\n\nexport class BlueSkyError extends Error {\n constructor(\n message: string,\n public readonly code: string,\n public readonly status?: number\n ) {\n super(message);\n this.name = \"BlueSkyError\";\n }\n}\n\nexport interface ATProtocolPostRecord {\n $type: string;\n text: string;\n facets?: PostFacet[];\n embed?: PostEmbed;\n createdAt: string;\n [k: string]: string | PostFacet[] | PostEmbed | number | boolean | null | undefined;\n}\n\nexport interface ATProtocolProfileViewExtended {\n did: string;\n handle: string;\n displayName?: string;\n description?: string;\n avatar?: string;\n banner?: string;\n followersCount?: number;\n followsCount?: number;\n postsCount?: number;\n indexedAt?: string;\n createdAt?: string;\n [k: string]: string | number | undefined;\n}\n\nexport interface BlueSkyEventPayload {\n runtime: IAgentRuntime;\n source: \"bluesky\";\n}\n\nexport interface BlueSkyNotificationEventPayload extends BlueSkyEventPayload {\n notification: BlueSkyNotification;\n}\n\nexport interface BlueSkyCreatePostEventPayload extends BlueSkyEventPayload {\n automated: boolean;\n}\n",
9
- "import { type IAgentRuntime, logger } from \"@elizaos/core\";\nimport type { BlueSkyClient } from \"../client\";\nimport type {\n BlueSkyConfig,\n BlueSkyCreatePostEventPayload,\n BlueSkyNotification,\n BlueSkyNotificationEventPayload,\n NotificationReason,\n} from \"../types\";\nimport {\n getActionInterval,\n getMaxActionsProcessing,\n getPollInterval,\n getPostIntervalRange,\n isPostingEnabled,\n shouldPostImmediately,\n} from \"../utils/config\";\n\nexport class BlueSkyAgentManager {\n private pollTimer: ReturnType<typeof setInterval> | null = null;\n private actionTimer: ReturnType<typeof setInterval> | null = null;\n private postTimer: ReturnType<typeof setTimeout> | null = null;\n private running = false;\n private lastSeenAt: string | null = null;\n\n constructor(\n public readonly runtime: IAgentRuntime,\n public readonly config: BlueSkyConfig,\n public readonly client: BlueSkyClient\n ) {}\n\n async start(): Promise<void> {\n if (this.running) return;\n\n await this.client.authenticate();\n this.running = true;\n\n this.startNotificationPolling();\n\n if (this.config.enableActionProcessing) {\n this.startActionProcessing();\n }\n\n if (isPostingEnabled(this.runtime)) {\n this.startAutomatedPosting();\n }\n\n logger.success({ agentId: this.runtime.agentId }, \"BlueSky agent manager started\");\n }\n\n async stop(): Promise<void> {\n this.running = false;\n\n if (this.pollTimer) clearInterval(this.pollTimer);\n if (this.actionTimer) clearInterval(this.actionTimer);\n if (this.postTimer) clearTimeout(this.postTimer);\n\n this.pollTimer = null;\n this.actionTimer = null;\n this.postTimer = null;\n\n await this.client.cleanup();\n logger.info({ agentId: this.runtime.agentId }, \"BlueSky agent manager stopped\");\n }\n\n private startNotificationPolling(): void {\n const interval = getPollInterval(this.runtime);\n this.pollNotifications();\n this.pollTimer = setInterval(() => this.pollNotifications(), interval);\n }\n\n private async pollNotifications(): Promise<void> {\n if (!this.running) return;\n\n const { notifications } = await this.client.getNotifications(50);\n if (notifications.length === 0) return;\n\n const newNotifications = this.lastSeenAt\n ? notifications.filter((n) => {\n const lastSeen = this.lastSeenAt;\n return lastSeen !== null && n.indexedAt > lastSeen;\n })\n : notifications;\n\n if (newNotifications.length > 0) {\n this.lastSeenAt = notifications[0].indexedAt;\n\n for (const notification of newNotifications) {\n this.emitNotificationEvent(notification);\n }\n\n await this.client.updateSeenNotifications();\n }\n }\n\n private emitNotificationEvent(notification: BlueSkyNotification): void {\n const eventMap: Record<NotificationReason, string> = {\n mention: \"bluesky.mention_received\",\n reply: \"bluesky.mention_received\",\n follow: \"bluesky.follow_received\",\n like: \"bluesky.like_received\",\n repost: \"bluesky.repost_received\",\n quote: \"bluesky.quote_received\",\n };\n\n const event = eventMap[notification.reason];\n if (event) {\n const payload: BlueSkyNotificationEventPayload = {\n runtime: this.runtime,\n source: \"bluesky\",\n notification,\n };\n void this.runtime.emitEvent(event, payload);\n }\n }\n\n private startActionProcessing(): void {\n const interval = getActionInterval(this.runtime);\n this.processActions();\n this.actionTimer = setInterval(() => this.processActions(), interval);\n }\n\n private async processActions(): Promise<void> {\n if (!this.running) return;\n\n const max = getMaxActionsProcessing(this.runtime);\n const { notifications } = await this.client.getNotifications(max);\n\n for (const notification of notifications) {\n if (notification.reason === \"mention\" || notification.reason === \"reply\") {\n const payload: BlueSkyNotificationEventPayload = {\n runtime: this.runtime,\n source: \"bluesky\",\n notification,\n };\n void this.runtime.emitEvent(\"bluesky.should_respond\", payload);\n }\n }\n }\n\n private startAutomatedPosting(): void {\n if (shouldPostImmediately(this.runtime)) {\n this.createAutomatedPost();\n }\n this.scheduleNextPost();\n }\n\n private scheduleNextPost(): void {\n const { min, max } = getPostIntervalRange(this.runtime);\n const interval = Math.random() * (max - min) + min;\n\n this.postTimer = setTimeout(() => {\n if (this.running) {\n this.createAutomatedPost();\n this.scheduleNextPost();\n }\n }, interval);\n }\n\n private createAutomatedPost(): void {\n const payload: BlueSkyCreatePostEventPayload = {\n runtime: this.runtime,\n source: \"bluesky\",\n automated: true,\n };\n void this.runtime.emitEvent(\"bluesky.create_post\", payload);\n }\n}\n",
10
- "import type { IAgentRuntime } from \"@elizaos/core\";\nimport {\n BLUESKY_ACTION_INTERVAL,\n BLUESKY_MAX_ACTIONS,\n BLUESKY_POLL_INTERVAL,\n BLUESKY_POST_INTERVAL_MAX,\n BLUESKY_POST_INTERVAL_MIN,\n BLUESKY_SERVICE_URL,\n type BlueSkyConfig,\n BlueSkyConfigSchema,\n} from \"../types\";\n\nexport type { BlueSkyConfig };\n\nexport function getApiKeyOptional(runtime: IAgentRuntime, key: string): string | undefined {\n const value = runtime.getSetting(key);\n return typeof value === \"string\" ? value : undefined;\n}\n\nexport function hasBlueSkyEnabled(runtime: IAgentRuntime): boolean {\n const enabled = runtime.getSetting(\"BLUESKY_ENABLED\");\n if (enabled) return String(enabled).toLowerCase() === \"true\";\n return Boolean(runtime.getSetting(\"BLUESKY_HANDLE\") && runtime.getSetting(\"BLUESKY_PASSWORD\"));\n}\n\nexport function validateBlueSkyConfig(runtime: IAgentRuntime): BlueSkyConfig {\n const result = BlueSkyConfigSchema.safeParse({\n handle: String(runtime.getSetting(\"BLUESKY_HANDLE\") ?? \"\"),\n password: String(runtime.getSetting(\"BLUESKY_PASSWORD\") ?? \"\"),\n service: String(runtime.getSetting(\"BLUESKY_SERVICE\") ?? BLUESKY_SERVICE_URL),\n dryRun: runtime.getSetting(\"BLUESKY_DRY_RUN\") === \"true\",\n pollInterval:\n parseInt(String(runtime.getSetting(\"BLUESKY_POLL_INTERVAL\") ?? \"\"), 10) ||\n BLUESKY_POLL_INTERVAL,\n enablePost: runtime.getSetting(\"BLUESKY_ENABLE_POSTING\") !== \"false\",\n postIntervalMin:\n parseInt(String(runtime.getSetting(\"BLUESKY_POST_INTERVAL_MIN\") ?? \"\"), 10) ||\n BLUESKY_POST_INTERVAL_MIN,\n postIntervalMax:\n parseInt(String(runtime.getSetting(\"BLUESKY_POST_INTERVAL_MAX\") ?? \"\"), 10) ||\n BLUESKY_POST_INTERVAL_MAX,\n enableActionProcessing: runtime.getSetting(\"BLUESKY_ENABLE_ACTION_PROCESSING\") !== \"false\",\n actionInterval:\n parseInt(String(runtime.getSetting(\"BLUESKY_ACTION_INTERVAL\") ?? \"\"), 10) ||\n BLUESKY_ACTION_INTERVAL,\n postImmediately: runtime.getSetting(\"BLUESKY_POST_IMMEDIATELY\") === \"true\",\n maxActionsProcessing:\n parseInt(String(runtime.getSetting(\"BLUESKY_MAX_ACTIONS_PROCESSING\") ?? \"\"), 10) ||\n BLUESKY_MAX_ACTIONS,\n enableDMs: runtime.getSetting(\"BLUESKY_ENABLE_DMS\") !== \"false\",\n });\n\n if (!result.success) {\n const errors =\n (result.error as { errors?: { path: string[]; message: string }[] }).errors\n ?.map((e) => `${e.path.join(\".\")}: ${e.message}`)\n .join(\", \") || result.error.toString();\n throw new Error(`Invalid BlueSky configuration: ${errors}`);\n }\n\n return result.data;\n}\n\nexport function getPollInterval(runtime: IAgentRuntime): number {\n const seconds =\n parseInt(String(runtime.getSetting(\"BLUESKY_POLL_INTERVAL\") ?? \"\"), 10) ||\n BLUESKY_POLL_INTERVAL;\n return seconds * 1000;\n}\n\nexport function getActionInterval(runtime: IAgentRuntime): number {\n const seconds =\n parseInt(String(runtime.getSetting(\"BLUESKY_ACTION_INTERVAL\") ?? \"\"), 10) ||\n BLUESKY_ACTION_INTERVAL;\n return seconds * 1000;\n}\n\nexport function getMaxActionsProcessing(runtime: IAgentRuntime): number {\n return (\n parseInt(String(runtime.getSetting(\"BLUESKY_MAX_ACTIONS_PROCESSING\") ?? \"\"), 10) ||\n BLUESKY_MAX_ACTIONS\n );\n}\n\nexport function isPostingEnabled(runtime: IAgentRuntime): boolean {\n return runtime.getSetting(\"BLUESKY_ENABLE_POSTING\") !== \"false\";\n}\n\nexport function shouldPostImmediately(runtime: IAgentRuntime): boolean {\n return runtime.getSetting(\"BLUESKY_POST_IMMEDIATELY\") === \"true\";\n}\n\nexport function getPostIntervalRange(runtime: IAgentRuntime): {\n min: number;\n max: number;\n} {\n const min =\n parseInt(String(runtime.getSetting(\"BLUESKY_POST_INTERVAL_MIN\") ?? \"\"), 10) ||\n BLUESKY_POST_INTERVAL_MIN;\n const max =\n parseInt(String(runtime.getSetting(\"BLUESKY_POST_INTERVAL_MAX\") ?? \"\"), 10) ||\n BLUESKY_POST_INTERVAL_MAX;\n return { min: min * 1000, max: max * 1000 };\n}\n",
11
- "import { composePrompt, type IAgentRuntime, ModelType } from \"@elizaos/core\";\nimport type { BlueSkyClient } from \"../client\";\nimport { generateDmTemplate } from \"../generated/prompts/typescript/prompts.js\";\nimport type { BlueSkyConversation, BlueSkyMessage } from \"../types\";\n\nexport class BlueSkyMessageService {\n static serviceType = \"IMessageService\";\n\n constructor(\n private readonly client: BlueSkyClient,\n private readonly runtime: IAgentRuntime\n ) {}\n\n async getMessages(convoId: string, limit = 50): Promise<BlueSkyMessage[]> {\n const response = await this.client.getMessages(convoId, limit);\n return response.messages;\n }\n\n async sendMessage(convoId: string, text: string): Promise<BlueSkyMessage> {\n const messageText = text.trim() || (await this.generateReply());\n return this.client.sendMessage({ convoId, message: { text: messageText } });\n }\n\n async getConversations(limit = 50): Promise<BlueSkyConversation[]> {\n const response = await this.client.getConversations(limit);\n return response.conversations;\n }\n\n private async generateReply(): Promise<string> {\n const prompt = composePrompt({\n state: {},\n template: generateDmTemplate,\n });\n const response = await this.runtime.useModel(ModelType.TEXT_SMALL, {\n prompt,\n maxTokens: 50,\n });\n return response as string;\n }\n}\n",
12
- "/**\n * Auto-generated prompt templates\n * DO NOT EDIT - Generated from ../../../../prompts/*.txt\n *\n * These prompts use Handlebars-style template syntax:\n * - {{variableName}} for simple substitution\n * - {{#each items}}...{{/each}} for iteration\n * - {{#if condition}}...{{/if}} for conditionals\n */\n\nexport const generateDmTemplate = `Generate a friendly direct message response under 200 characters.`;\n\nexport const GENERATE_DM_TEMPLATE = generateDmTemplate;\n\nexport const generatePostTemplate = `Generate an engaging BlueSky post under {{maxLength}} characters.`;\n\nexport const GENERATE_POST_TEMPLATE = generatePostTemplate;\n\nexport const truncatePostTemplate = `Shorten to under {{maxLength}} characters: \"{{text}}\"`;\n\nexport const TRUNCATE_POST_TEMPLATE = truncatePostTemplate;\n\n",
13
- "import { composePrompt, type IAgentRuntime, ModelType } from \"@elizaos/core\";\nimport type { BlueSkyClient } from \"../client\";\nimport {\n generatePostTemplate,\n truncatePostTemplate,\n} from \"../generated/prompts/typescript/prompts.js\";\nimport type { BlueSkyPost, CreatePostRequest } from \"../types\";\nimport { BLUESKY_MAX_POST_LENGTH } from \"../types\";\n\nexport class BlueSkyPostService {\n static serviceType = \"IPostService\";\n\n constructor(\n private readonly client: BlueSkyClient,\n private readonly runtime: IAgentRuntime\n ) {}\n\n async getPosts(limit = 50, cursor?: string): Promise<BlueSkyPost[]> {\n const response = await this.client.getTimeline({ limit, cursor });\n return response.feed.map((item) => item.post);\n }\n\n async createPost(text: string, replyTo?: { uri: string; cid: string }): Promise<BlueSkyPost> {\n let postText = text.trim() || (await this.generateContent());\n\n if (postText.length > BLUESKY_MAX_POST_LENGTH) {\n postText = await this.truncate(postText);\n }\n\n const request: CreatePostRequest = {\n content: { text: postText },\n replyTo,\n };\n\n return this.client.sendPost(request);\n }\n\n async deletePost(uri: string): Promise<void> {\n await this.client.deletePost(uri);\n }\n\n private async generateContent(): Promise<string> {\n const prompt = composePrompt({\n state: {\n maxLength: String(BLUESKY_MAX_POST_LENGTH),\n },\n template: generatePostTemplate,\n });\n const response = await this.runtime.useModel(ModelType.TEXT_SMALL, {\n prompt,\n maxTokens: 100,\n });\n return response as string;\n }\n\n private async truncate(text: string): Promise<string> {\n const prompt = composePrompt({\n state: {\n maxLength: String(BLUESKY_MAX_POST_LENGTH),\n text,\n },\n template: truncatePostTemplate,\n });\n const response = await this.runtime.useModel(ModelType.TEXT_SMALL, {\n prompt,\n maxTokens: 100,\n });\n const truncated = response as string;\n return truncated.length > BLUESKY_MAX_POST_LENGTH\n ? `${truncated.substring(0, BLUESKY_MAX_POST_LENGTH - 3)}...`\n : truncated;\n }\n}\n"
5
+ "import type { IAgentRuntime, Plugin, TestCase, TestSuite } from \"@elizaos/core\";\nimport { logger } from \"@elizaos/core\";\nimport { BlueSkyService } from \"./services/bluesky\";\nimport { getApiKeyOptional } from \"./utils/config\";\n\nexport { BlueSkyClient } from \"./client\";\nexport { BlueSkyService } from \"./services/bluesky\";\n\nexport interface PluginConfig {\n\treadonly BLUESKY_HANDLE?: string;\n\treadonly BLUESKY_PASSWORD?: string;\n\treadonly BLUESKY_SERVICE?: string;\n\treadonly BLUESKY_DRY_RUN?: string;\n\treadonly BLUESKY_POLL_INTERVAL?: string;\n\treadonly BLUESKY_ENABLE_POSTING?: string;\n\treadonly BLUESKY_ENABLE_DMS?: string;\n\treadonly BLUESKY_POST_INTERVAL_MIN?: string;\n\treadonly BLUESKY_POST_INTERVAL_MAX?: string;\n\treadonly BLUESKY_ENABLE_ACTION_PROCESSING?: string;\n\treadonly BLUESKY_ACTION_INTERVAL?: string;\n\treadonly BLUESKY_POST_IMMEDIATELY?: string;\n\treadonly BLUESKY_MAX_ACTIONS_PROCESSING?: string;\n\treadonly BLUESKY_MAX_POST_LENGTH?: string;\n}\n\nconst pluginTests = [\n\t{\n\t\tname: \"bluesky_plugin_tests\",\n\t\ttests: [\n\t\t\t{\n\t\t\t\tname: \"bluesky_test_credentials_validation\",\n\t\t\t\tfn: async (runtime: IAgentRuntime) => {\n\t\t\t\t\tconst handle = getApiKeyOptional(runtime, \"BLUESKY_HANDLE\");\n\t\t\t\t\tconst password = getApiKeyOptional(runtime, \"BLUESKY_PASSWORD\");\n\t\t\t\t\tif (!handle || !password) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\"BLUESKY_HANDLE and BLUESKY_PASSWORD are not configured\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tlogger.log(\"BlueSky credentials are configured\");\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"bluesky_test_service_initialization\",\n\t\t\t\tfn: async (runtime: IAgentRuntime) => {\n\t\t\t\t\tconst handle = getApiKeyOptional(runtime, \"BLUESKY_HANDLE\");\n\t\t\t\t\tconst password = getApiKeyOptional(runtime, \"BLUESKY_PASSWORD\");\n\t\t\t\t\tif (!handle || !password) {\n\t\t\t\t\t\tlogger.log(\n\t\t\t\t\t\t\t\"Skipping service initialization test - credentials not configured\",\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst service = await BlueSkyService.start(runtime);\n\t\t\t\t\tif (!service) {\n\t\t\t\t\t\tthrow new Error(\"Failed to initialize BlueSky service\");\n\t\t\t\t\t}\n\t\t\t\t\tlogger.log(\"BlueSky service initialized successfully\");\n\t\t\t\t},\n\t\t\t},\n\t\t] as TestCase[],\n\t},\n] as TestSuite[];\n\nexport const blueSkyPlugin: Plugin = {\n\tname: \"bluesky\",\n\tdescription:\n\t\t\"BlueSky client plugin using AT Protocol for social interactions\",\n\n\tconfig: {\n\t\tBLUESKY_HANDLE: process.env.BLUESKY_HANDLE ?? null,\n\t\tBLUESKY_PASSWORD: process.env.BLUESKY_PASSWORD ?? null,\n\t\tBLUESKY_SERVICE: process.env.BLUESKY_SERVICE ?? null,\n\t\tBLUESKY_DRY_RUN: process.env.BLUESKY_DRY_RUN ?? null,\n\t\tBLUESKY_POLL_INTERVAL: process.env.BLUESKY_POLL_INTERVAL ?? null,\n\t\tBLUESKY_ENABLE_POSTING: process.env.BLUESKY_ENABLE_POSTING ?? null,\n\t\tBLUESKY_ENABLE_DMS: process.env.BLUESKY_ENABLE_DMS ?? null,\n\t\tBLUESKY_POST_INTERVAL_MIN: process.env.BLUESKY_POST_INTERVAL_MIN ?? null,\n\t\tBLUESKY_POST_INTERVAL_MAX: process.env.BLUESKY_POST_INTERVAL_MAX ?? null,\n\t\tBLUESKY_ENABLE_ACTION_PROCESSING:\n\t\t\tprocess.env.BLUESKY_ENABLE_ACTION_PROCESSING ?? null,\n\t\tBLUESKY_ACTION_INTERVAL: process.env.BLUESKY_ACTION_INTERVAL ?? null,\n\t\tBLUESKY_POST_IMMEDIATELY: process.env.BLUESKY_POST_IMMEDIATELY ?? null,\n\t\tBLUESKY_MAX_ACTIONS_PROCESSING:\n\t\t\tprocess.env.BLUESKY_MAX_ACTIONS_PROCESSING ?? null,\n\t\tBLUESKY_MAX_POST_LENGTH: process.env.BLUESKY_MAX_POST_LENGTH ?? null,\n\t},\n\n\tasync init(_config, _runtime) {\n\t\tlogger.log(\"BlueSky plugin initialized\");\n\t},\n\n\tservices: [BlueSkyService],\n\n\ttests: pluginTests,\n};\n\nexport default blueSkyPlugin;\n",
6
+ "import { type IAgentRuntime, logger, Service, type UUID } from \"@elizaos/core\";\nimport { BlueSkyClient } from \"../client\";\nimport { BlueSkyAgentManager } from \"../managers/agent\";\nimport { BLUESKY_SERVICE_NAME } from \"../types\";\nimport { hasBlueSkyEnabled, validateBlueSkyConfig } from \"../utils/config\";\nimport { BlueSkyMessageService } from \"./message\";\nimport { BlueSkyPostService } from \"./post\";\n\nexport class BlueSkyService extends Service {\n\tprivate static instance: BlueSkyService;\n\tprivate managers = new Map<UUID, BlueSkyAgentManager>();\n\tprivate messageServices = new Map<UUID, BlueSkyMessageService>();\n\tprivate postServices = new Map<UUID, BlueSkyPostService>();\n\tstatic serviceType = BLUESKY_SERVICE_NAME;\n\treadonly capabilityDescription = \"Send and receive messages on BlueSky\";\n\n\tprivate static getInstance(): BlueSkyService {\n\t\tBlueSkyService.instance ??= new BlueSkyService();\n\t\treturn BlueSkyService.instance;\n\t}\n\n\tstatic async start(runtime: IAgentRuntime): Promise<Service> {\n\t\tconst service = BlueSkyService.getInstance();\n\n\t\tif (service.managers.has(runtime.agentId)) {\n\t\t\treturn service;\n\t\t}\n\n\t\tif (!hasBlueSkyEnabled(runtime)) {\n\t\t\treturn service;\n\t\t}\n\n\t\tconst config = validateBlueSkyConfig(runtime);\n\t\tconst client = new BlueSkyClient({\n\t\t\tservice: config.service,\n\t\t\thandle: config.handle,\n\t\t\tpassword: config.password,\n\t\t\tdryRun: config.dryRun,\n\t\t});\n\n\t\tconst manager = new BlueSkyAgentManager(runtime, config, client);\n\t\tservice.managers.set(runtime.agentId, manager);\n\t\tservice.messageServices.set(\n\t\t\truntime.agentId,\n\t\t\tnew BlueSkyMessageService(client, runtime),\n\t\t);\n\t\tservice.postServices.set(\n\t\t\truntime.agentId,\n\t\t\tnew BlueSkyPostService(client, runtime),\n\t\t);\n\n\t\tawait manager.start();\n\t\tlogger.success({ agentId: runtime.agentId }, \"BlueSky client started\");\n\n\t\treturn service;\n\t}\n\n\tstatic async stop(runtime: IAgentRuntime): Promise<void> {\n\t\tconst service = BlueSkyService.getInstance();\n\t\tconst manager = service.managers.get(runtime.agentId);\n\t\tif (!manager) return;\n\n\t\tawait manager.stop();\n\t\tservice.managers.delete(runtime.agentId);\n\t\tservice.messageServices.delete(runtime.agentId);\n\t\tservice.postServices.delete(runtime.agentId);\n\t\tlogger.info({ agentId: runtime.agentId }, \"BlueSky client stopped\");\n\t}\n\n\tasync stop(): Promise<void> {\n\t\tfor (const manager of this.managers.values()) {\n\t\t\tawait BlueSkyService.stop(manager.runtime);\n\t\t}\n\t}\n\n\tgetMessageService(agentId: UUID): BlueSkyMessageService | undefined {\n\t\treturn this.messageServices.get(agentId);\n\t}\n\n\tgetPostService(agentId: UUID): BlueSkyPostService | undefined {\n\t\treturn this.postServices.get(agentId);\n\t}\n}\n",
7
+ "import { type AppBskyFeedDefs, BskyAgent, RichText } from \"@atproto/api\";\nimport { logger } from \"@elizaos/core\";\nimport { LRUCache } from \"lru-cache\";\nimport type {\n\tATProtocolPostRecord,\n\tATProtocolProfileViewExtended,\n\tBlueSkyConversation,\n\tBlueSkyMessage,\n\tBlueSkyNotification,\n\tBlueSkyPost,\n\tBlueSkyProfile,\n\tBlueSkySession,\n\tCreatePostRequest,\n\tPostEmbed,\n\tPostFacet,\n\tSendMessageRequest,\n\tTimelineRequest,\n\tTimelineResponse,\n} from \"./types\";\nimport {\n\tBLUESKY_CHAT_SERVICE_DID,\n\tBlueSkyError,\n\tCACHE_SIZE,\n\tCACHE_TTL,\n} from \"./types\";\n\nfunction isPostView(\n\titem:\n\t\t| AppBskyFeedDefs.PostView\n\t\t| AppBskyFeedDefs.NotFoundPost\n\t\t| AppBskyFeedDefs.BlockedPost\n\t\t| { $type: string; [k: string]: unknown },\n): item is AppBskyFeedDefs.PostView {\n\treturn (\n\t\ttypeof item === \"object\" &&\n\t\titem !== null &&\n\t\t\"uri\" in item &&\n\t\t\"cid\" in item &&\n\t\t\"author\" in item &&\n\t\t\"record\" in item &&\n\t\t\"indexedAt\" in item &&\n\t\ttypeof (item as AppBskyFeedDefs.PostView).uri === \"string\" &&\n\t\ttypeof (item as AppBskyFeedDefs.PostView).cid === \"string\"\n\t);\n}\n\nfunction isReplyWithPostViews(\n\treply: AppBskyFeedDefs.ReplyRef | null | undefined,\n): reply is {\n\troot: AppBskyFeedDefs.PostView;\n\tparent: AppBskyFeedDefs.PostView;\n} {\n\treturn (\n\t\ttypeof reply === \"object\" &&\n\t\treply !== null &&\n\t\t\"root\" in reply &&\n\t\t\"parent\" in reply &&\n\t\tisPostView(reply.root) &&\n\t\tisPostView(reply.parent)\n\t);\n}\n\nfunction adaptPostView(postView: AppBskyFeedDefs.PostView): BlueSkyPost {\n\tconst author = postView.author as ATProtocolProfileViewExtended;\n\tconst record = postView.record as ATProtocolPostRecord;\n\n\treturn {\n\t\turi: postView.uri,\n\t\tcid: postView.cid,\n\t\tauthor: {\n\t\t\tdid: author.did,\n\t\t\thandle: author.handle,\n\t\t\tdisplayName: author.displayName,\n\t\t\tdescription: author.description,\n\t\t\tavatar: author.avatar,\n\t\t\tbanner: author.banner,\n\t\t\tfollowersCount: author.followersCount,\n\t\t\tfollowsCount: author.followsCount,\n\t\t\tpostsCount: author.postsCount,\n\t\t\tindexedAt: author.indexedAt,\n\t\t\tcreatedAt: author.createdAt,\n\t\t},\n\t\trecord: {\n\t\t\t$type: record.$type ?? \"app.bsky.feed.post\",\n\t\t\ttext: record.text ?? \"\",\n\t\t\tfacets: record.facets as PostFacet[] | undefined,\n\t\t\tembed: record.embed as PostEmbed | undefined,\n\t\t\tcreatedAt: record.createdAt ?? \"\",\n\t\t},\n\t\tembed: postView.embed as PostEmbed | undefined,\n\t\treplyCount: postView.replyCount,\n\t\trepostCount: postView.repostCount,\n\t\tlikeCount: postView.likeCount,\n\t\tquoteCount: postView.quoteCount,\n\t\tindexedAt: postView.indexedAt,\n\t};\n}\n\nexport interface BlueSkyClientConfig {\n\tservice: string;\n\thandle: string;\n\tpassword: string;\n\tdryRun: boolean;\n}\n\nexport class BlueSkyClient {\n\tprivate readonly agent: BskyAgent;\n\tprivate session: BlueSkySession | null = null;\n\tprivate readonly profileCache: LRUCache<string, BlueSkyProfile>;\n\n\tconstructor(private readonly config: BlueSkyClientConfig) {\n\t\tthis.agent = new BskyAgent({ service: config.service });\n\t\tthis.profileCache = new LRUCache({\n\t\t\tmax: CACHE_SIZE.PROFILE,\n\t\t\tttl: CACHE_TTL.PROFILE,\n\t\t});\n\t}\n\n\tasync authenticate(): Promise<BlueSkySession> {\n\t\tconst response = await this.agent.login({\n\t\t\tidentifier: this.config.handle,\n\t\t\tpassword: this.config.password,\n\t\t});\n\n\t\tif (!response.success) {\n\t\t\tthrow new BlueSkyError(\"Authentication failed\", \"AUTH_FAILED\");\n\t\t}\n\n\t\tthis.session = {\n\t\t\tdid: response.data.did,\n\t\t\thandle: response.data.handle,\n\t\t\temail: response.data.email,\n\t\t\taccessJwt: response.data.accessJwt,\n\t\t\trefreshJwt: response.data.refreshJwt,\n\t\t};\n\n\t\tlogger.info(`Authenticated with BlueSky: ${this.session.handle}`);\n\t\treturn this.session;\n\t}\n\n\tgetSession(): BlueSkySession | null {\n\t\treturn this.session;\n\t}\n\n\tasync getProfile(handle: string): Promise<BlueSkyProfile> {\n\t\tconst cached = this.profileCache.get(handle);\n\t\tif (cached) return cached;\n\n\t\tconst response = await this.agent.getProfile({ actor: handle });\n\t\tconst profile: BlueSkyProfile = {\n\t\t\tdid: response.data.did,\n\t\t\thandle: response.data.handle,\n\t\t\tdisplayName: response.data.displayName,\n\t\t\tdescription: response.data.description,\n\t\t\tavatar: response.data.avatar,\n\t\t\tbanner: response.data.banner,\n\t\t\tfollowersCount: response.data.followersCount,\n\t\t\tfollowsCount: response.data.followsCount,\n\t\t\tpostsCount: response.data.postsCount,\n\t\t\tindexedAt: response.data.indexedAt,\n\t\t\tcreatedAt: response.data.createdAt,\n\t\t};\n\n\t\tthis.profileCache.set(handle, profile);\n\t\treturn profile;\n\t}\n\n\tasync getTimeline(params: TimelineRequest = {}): Promise<TimelineResponse> {\n\t\tconst response = await this.agent.getTimeline({\n\t\t\talgorithm: params.algorithm,\n\t\t\tlimit: params.limit ?? 50,\n\t\t\tcursor: params.cursor,\n\t\t});\n\n\t\treturn {\n\t\t\tcursor: response.data.cursor,\n\t\t\tfeed: response.data.feed.map((item) => {\n\t\t\t\tconst reply = isReplyWithPostViews(item.reply)\n\t\t\t\t\t? {\n\t\t\t\t\t\t\troot: adaptPostView(item.reply.root),\n\t\t\t\t\t\t\tparent: adaptPostView(item.reply.parent),\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined;\n\n\t\t\t\treturn {\n\t\t\t\t\tpost: adaptPostView(item.post),\n\t\t\t\t\treply,\n\t\t\t\t\treason: item.reason as Record<\n\t\t\t\t\t\tstring,\n\t\t\t\t\t\tstring | number | boolean | object | null | undefined\n\t\t\t\t\t>,\n\t\t\t\t};\n\t\t\t}),\n\t\t};\n\t}\n\n\tasync sendPost(request: CreatePostRequest): Promise<BlueSkyPost> {\n\t\tif (this.config.dryRun) {\n\t\t\tlogger.info(\n\t\t\t\t`Dry run: would create post with text: ${request.content.text}`,\n\t\t\t);\n\t\t\treturn this.mockPost(request.content.text);\n\t\t}\n\n\t\tconst rt = new RichText({ text: request.content.text });\n\t\tawait rt.detectFacets(this.agent);\n\n\t\tconst record: Record<\n\t\t\tstring,\n\t\t\t| string\n\t\t\t| PostFacet[]\n\t\t\t| PostEmbed\n\t\t\t| {\n\t\t\t\t\troot: { uri: string; cid: string };\n\t\t\t\t\tparent: { uri: string; cid: string };\n\t\t\t }\n\t\t> = {\n\t\t\t$type: \"app.bsky.feed.post\",\n\t\t\ttext: rt.text,\n\t\t\tfacets: rt.facets as PostFacet[],\n\t\t\tcreatedAt: new Date().toISOString(),\n\t\t};\n\n\t\tif (request.replyTo) {\n\t\t\trecord.reply = { root: request.replyTo, parent: request.replyTo };\n\t\t}\n\n\t\tif (request.content.embed) {\n\t\t\trecord.embed = request.content.embed;\n\t\t}\n\n\t\tconst response = await this.agent.post(record);\n\t\tconst thread = await this.agent.getPostThread({\n\t\t\turi: response.uri,\n\t\t\tdepth: 0,\n\t\t});\n\n\t\tif (thread.data.thread.$type !== \"app.bsky.feed.defs#threadViewPost\") {\n\t\t\tthrow new BlueSkyError(\n\t\t\t\t\"Failed to retrieve created post\",\n\t\t\t\t\"POST_CREATE_FAILED\",\n\t\t\t);\n\t\t}\n\n\t\tconst threadViewPost = thread.data.thread as AppBskyFeedDefs.ThreadViewPost;\n\t\treturn adaptPostView(threadViewPost.post);\n\t}\n\n\tasync deletePost(uri: string): Promise<void> {\n\t\tif (this.config.dryRun) {\n\t\t\tlogger.info(`Dry run: would delete post: ${uri}`);\n\t\t\treturn;\n\t\t}\n\t\tawait this.agent.deletePost(uri);\n\t}\n\n\tasync likePost(uri: string, cid: string): Promise<void> {\n\t\tif (this.config.dryRun) {\n\t\t\tlogger.info(`Dry run: would like post: ${uri}`);\n\t\t\treturn;\n\t\t}\n\t\tawait this.agent.like(uri, cid);\n\t}\n\n\tasync repost(uri: string, cid: string): Promise<void> {\n\t\tif (this.config.dryRun) {\n\t\t\tlogger.info({ uri }, \"Dry run: would repost\");\n\t\t\treturn;\n\t\t}\n\t\tawait this.agent.repost(uri, cid);\n\t}\n\n\tasync getNotifications(\n\t\tlimit = 50,\n\t\tcursor?: string,\n\t): Promise<{\n\t\tnotifications: BlueSkyNotification[];\n\t\tcursor?: string;\n\t}> {\n\t\tconst response = await this.agent.listNotifications({ limit, cursor });\n\t\treturn {\n\t\t\tnotifications: response.data.notifications as BlueSkyNotification[],\n\t\t\tcursor: response.data.cursor,\n\t\t};\n\t}\n\n\tasync updateSeenNotifications(): Promise<void> {\n\t\tawait this.agent.updateSeenNotifications();\n\t}\n\n\tasync getConversations(\n\t\tlimit = 50,\n\t\tcursor?: string,\n\t): Promise<{\n\t\tconversations: BlueSkyConversation[];\n\t\tcursor?: string;\n\t}> {\n\t\tconst response = await this.agent.api.chat.bsky.convo.listConvos(\n\t\t\t{ limit, cursor },\n\t\t\t{ headers: { \"atproto-proxy\": BLUESKY_CHAT_SERVICE_DID } },\n\t\t);\n\t\treturn {\n\t\t\tconversations: response.data.convos as BlueSkyConversation[],\n\t\t\tcursor: response.data.cursor,\n\t\t};\n\t}\n\n\tasync getMessages(\n\t\tconvoId: string,\n\t\tlimit = 50,\n\t\tcursor?: string,\n\t): Promise<{\n\t\tmessages: BlueSkyMessage[];\n\t\tcursor?: string;\n\t}> {\n\t\tconst response = await this.agent.api.chat.bsky.convo.getMessages(\n\t\t\t{ convoId, limit, cursor },\n\t\t\t{ headers: { \"atproto-proxy\": BLUESKY_CHAT_SERVICE_DID } },\n\t\t);\n\t\treturn {\n\t\t\tmessages: response.data.messages as BlueSkyMessage[],\n\t\t\tcursor: response.data.cursor,\n\t\t};\n\t}\n\n\tasync sendMessage(request: SendMessageRequest): Promise<BlueSkyMessage> {\n\t\tif (this.config.dryRun) {\n\t\t\tlogger.info({ convoId: request.convoId }, \"Dry run: would send message\");\n\t\t\treturn this.mockMessage(request.message.text ?? \"\");\n\t\t}\n\n\t\tconst response = await this.agent.api.chat.bsky.convo.sendMessage(\n\t\t\t{\n\t\t\t\tconvoId: request.convoId,\n\t\t\t\tmessage: { text: request.message.text ?? \"\" },\n\t\t\t},\n\t\t\t{ headers: { \"atproto-proxy\": BLUESKY_CHAT_SERVICE_DID } },\n\t\t);\n\t\treturn response.data as BlueSkyMessage;\n\t}\n\n\tasync cleanup(): Promise<void> {\n\t\tthis.profileCache.clear();\n\t\tthis.session = null;\n\t}\n\n\tprivate mockPost(text: string): BlueSkyPost {\n\t\tconst now = new Date().toISOString();\n\t\treturn {\n\t\t\turi: `mock://post/${Date.now()}`,\n\t\t\tcid: `mock-cid-${Date.now()}`,\n\t\t\tauthor: {\n\t\t\t\tdid: this.session?.did ?? \"did:plc:mock\",\n\t\t\t\thandle: this.session?.handle ?? \"mock.handle\",\n\t\t\t},\n\t\t\trecord: { $type: \"app.bsky.feed.post\", text, createdAt: now },\n\t\t\tindexedAt: now,\n\t\t};\n\t}\n\n\tprivate mockMessage(text: string): BlueSkyMessage {\n\t\treturn {\n\t\t\tid: `mock-msg-${Date.now()}`,\n\t\t\trev: \"1\",\n\t\t\ttext,\n\t\t\tsender: { did: this.session?.did ?? \"did:plc:mock\" },\n\t\t\tsentAt: new Date().toISOString(),\n\t\t};\n\t}\n}\n",
8
+ "import type { IAgentRuntime } from \"@elizaos/core\";\nimport { z } from \"zod\";\n\nexport const BLUESKY_SERVICE_URL = \"https://bsky.social\";\nexport const BLUESKY_MAX_POST_LENGTH = 300;\nexport const BLUESKY_POLL_INTERVAL = 60;\nexport const BLUESKY_POST_INTERVAL_MIN = 1800;\nexport const BLUESKY_POST_INTERVAL_MAX = 3600;\nexport const BLUESKY_ACTION_INTERVAL = 120;\nexport const BLUESKY_MAX_ACTIONS = 5;\nexport const BLUESKY_CHAT_SERVICE_DID = \"did:web:api.bsky.chat\";\nexport const BLUESKY_SERVICE_NAME = \"bluesky\";\n\nexport const AT_PROTOCOL_HANDLE_REGEX =\n\t/^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/;\n\nexport const CACHE_TTL = {\n\tPROFILE: 3600000,\n\tTIMELINE: 300000,\n\tPOST: 1800000,\n\tNOTIFICATIONS: 300000,\n\tCONVERSATIONS: 300000,\n} as const;\n\nexport const CACHE_SIZE = {\n\tPROFILE: 1000,\n\tTIMELINE: 500,\n\tPOST: 10000,\n\tNOTIFICATIONS: 1000,\n\tCONVERSATIONS: 100,\n} as const;\n\nexport const BlueSkyConfigSchema = z.object({\n\thandle: z.string().regex(AT_PROTOCOL_HANDLE_REGEX, \"Invalid handle format\"),\n\tpassword: z.string().min(1),\n\tservice: z.string().url().default(BLUESKY_SERVICE_URL),\n\tdryRun: z.boolean().default(false),\n\tpollInterval: z.number().positive().default(BLUESKY_POLL_INTERVAL),\n\tenablePost: z.boolean().default(true),\n\tpostIntervalMin: z.number().positive().default(BLUESKY_POST_INTERVAL_MIN),\n\tpostIntervalMax: z.number().positive().default(BLUESKY_POST_INTERVAL_MAX),\n\tenableActionProcessing: z.boolean().default(true),\n\tactionInterval: z.number().positive().default(BLUESKY_ACTION_INTERVAL),\n\tpostImmediately: z.boolean().default(false),\n\tmaxActionsProcessing: z.number().positive().default(BLUESKY_MAX_ACTIONS),\n\tenableDMs: z.boolean().default(true),\n});\n\nexport type BlueSkyConfig = z.infer<typeof BlueSkyConfigSchema>;\n\nexport interface BlueSkyProfile {\n\tdid: string;\n\thandle: string;\n\tdisplayName?: string;\n\tdescription?: string;\n\tavatar?: string;\n\tbanner?: string;\n\tfollowersCount?: number;\n\tfollowsCount?: number;\n\tpostsCount?: number;\n\tindexedAt?: string;\n\tcreatedAt?: string;\n}\n\nexport interface PostFacet {\n\tindex: { byteStart: number; byteEnd: number };\n\tfeatures: Array<{\n\t\t$type?: string;\n\t\t[key: string]: string | number | boolean | object | null | undefined;\n\t}>;\n}\n\nexport interface PostEmbed {\n\t$type: string;\n\t[key: string]: string | number | boolean | object | null | undefined;\n}\n\nexport interface PostRecord {\n\t$type: string;\n\ttext: string;\n\tfacets?: PostFacet[];\n\tembed?: PostEmbed;\n\tcreatedAt: string;\n}\n\nexport interface BlueSkyPost {\n\turi: string;\n\tcid: string;\n\tauthor: BlueSkyProfile;\n\trecord: PostRecord;\n\tembed?: PostEmbed;\n\treplyCount?: number;\n\trepostCount?: number;\n\tlikeCount?: number;\n\tquoteCount?: number;\n\tindexedAt: string;\n}\n\nexport interface TimelineRequest {\n\talgorithm?: string;\n\tlimit?: number;\n\tcursor?: string;\n}\n\nexport interface TimelineFeedItem {\n\tpost: BlueSkyPost;\n\treply?: {\n\t\troot: BlueSkyPost;\n\t\tparent: BlueSkyPost;\n\t};\n\treason?: Record<\n\t\tstring,\n\t\tstring | number | boolean | object | null | undefined\n\t>;\n}\n\nexport interface TimelineResponse {\n\tcursor?: string;\n\tfeed: TimelineFeedItem[];\n}\n\nexport interface CreatePostRequest {\n\tcontent: {\n\t\ttext: string;\n\t\tfacets?: PostFacet[];\n\t\tembed?: PostEmbed;\n\t};\n\treplyTo?: { uri: string; cid: string };\n}\n\nexport type NotificationReason =\n\t| \"mention\"\n\t| \"reply\"\n\t| \"follow\"\n\t| \"like\"\n\t| \"repost\"\n\t| \"quote\";\n\nexport interface BlueSkyNotification {\n\turi: string;\n\tcid: string;\n\tauthor: BlueSkyProfile;\n\treason: NotificationReason;\n\treasonSubject?: string;\n\trecord: Record<string, string | number | boolean | object | null | undefined>;\n\tisRead: boolean;\n\tindexedAt: string;\n}\n\nexport interface BlueSkyMessage {\n\tid: string;\n\trev: string;\n\ttext?: string;\n\tembed?: PostEmbed;\n\tsender: { did: string };\n\tsentAt: string;\n}\n\nexport interface BlueSkyConversation {\n\tid: string;\n\trev: string;\n\tmembers: Array<{\n\t\tdid: string;\n\t\thandle?: string;\n\t\tdisplayName?: string;\n\t\tavatar?: string;\n\t}>;\n\tlastMessage?: BlueSkyMessage;\n\tunreadCount: number;\n\tmuted: boolean;\n}\n\nexport interface SendMessageRequest {\n\tconvoId: string;\n\tmessage: { text?: string; embed?: PostEmbed };\n}\n\nexport interface BlueSkySession {\n\tdid: string;\n\thandle: string;\n\temail?: string;\n\taccessJwt: string;\n\trefreshJwt: string;\n}\n\nexport class BlueSkyError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly code: string,\n\t\tpublic readonly status?: number,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"BlueSkyError\";\n\t}\n}\n\nexport interface ATProtocolPostRecord {\n\t$type: string;\n\ttext: string;\n\tfacets?: PostFacet[];\n\tembed?: PostEmbed;\n\tcreatedAt: string;\n\t[k: string]:\n\t\t| string\n\t\t| PostFacet[]\n\t\t| PostEmbed\n\t\t| number\n\t\t| boolean\n\t\t| null\n\t\t| undefined;\n}\n\nexport interface ATProtocolProfileViewExtended {\n\tdid: string;\n\thandle: string;\n\tdisplayName?: string;\n\tdescription?: string;\n\tavatar?: string;\n\tbanner?: string;\n\tfollowersCount?: number;\n\tfollowsCount?: number;\n\tpostsCount?: number;\n\tindexedAt?: string;\n\tcreatedAt?: string;\n\t[k: string]: string | number | undefined;\n}\n\nexport interface BlueSkyEventPayload {\n\truntime: IAgentRuntime;\n\tsource: \"bluesky\";\n}\n\nexport interface BlueSkyNotificationEventPayload extends BlueSkyEventPayload {\n\tnotification: BlueSkyNotification;\n}\n\nexport interface BlueSkyCreatePostEventPayload extends BlueSkyEventPayload {\n\tautomated: boolean;\n}\n",
9
+ "import { type IAgentRuntime, logger } from \"@elizaos/core\";\nimport type { BlueSkyClient } from \"../client\";\nimport type {\n\tBlueSkyConfig,\n\tBlueSkyCreatePostEventPayload,\n\tBlueSkyNotification,\n\tBlueSkyNotificationEventPayload,\n\tNotificationReason,\n} from \"../types\";\nimport {\n\tgetActionInterval,\n\tgetMaxActionsProcessing,\n\tgetPollInterval,\n\tgetPostIntervalRange,\n\tisPostingEnabled,\n\tshouldPostImmediately,\n} from \"../utils/config\";\n\nexport class BlueSkyAgentManager {\n\tprivate pollTimer: ReturnType<typeof setInterval> | null = null;\n\tprivate actionTimer: ReturnType<typeof setInterval> | null = null;\n\tprivate postTimer: ReturnType<typeof setTimeout> | null = null;\n\tprivate running = false;\n\tprivate lastSeenAt: string | null = null;\n\n\tconstructor(\n\t\tpublic readonly runtime: IAgentRuntime,\n\t\tpublic readonly config: BlueSkyConfig,\n\t\tpublic readonly client: BlueSkyClient,\n\t) {}\n\n\tasync start(): Promise<void> {\n\t\tif (this.running) return;\n\n\t\tawait this.client.authenticate();\n\t\tthis.running = true;\n\n\t\tthis.startNotificationPolling();\n\n\t\tif (this.config.enableActionProcessing) {\n\t\t\tthis.startActionProcessing();\n\t\t}\n\n\t\tif (isPostingEnabled(this.runtime)) {\n\t\t\tthis.startAutomatedPosting();\n\t\t}\n\n\t\tlogger.success(\n\t\t\t{ agentId: this.runtime.agentId },\n\t\t\t\"BlueSky agent manager started\",\n\t\t);\n\t}\n\n\tasync stop(): Promise<void> {\n\t\tthis.running = false;\n\n\t\tif (this.pollTimer) clearInterval(this.pollTimer);\n\t\tif (this.actionTimer) clearInterval(this.actionTimer);\n\t\tif (this.postTimer) clearTimeout(this.postTimer);\n\n\t\tthis.pollTimer = null;\n\t\tthis.actionTimer = null;\n\t\tthis.postTimer = null;\n\n\t\tawait this.client.cleanup();\n\t\tlogger.info(\n\t\t\t{ agentId: this.runtime.agentId },\n\t\t\t\"BlueSky agent manager stopped\",\n\t\t);\n\t}\n\n\tprivate startNotificationPolling(): void {\n\t\tconst interval = getPollInterval(this.runtime);\n\t\tthis.pollNotifications();\n\t\tthis.pollTimer = setInterval(() => this.pollNotifications(), interval);\n\t}\n\n\tprivate async pollNotifications(): Promise<void> {\n\t\tif (!this.running) return;\n\n\t\tconst { notifications } = await this.client.getNotifications(50);\n\t\tif (notifications.length === 0) return;\n\n\t\tconst newNotifications = this.lastSeenAt\n\t\t\t? notifications.filter((n) => {\n\t\t\t\t\tconst lastSeen = this.lastSeenAt;\n\t\t\t\t\treturn lastSeen !== null && n.indexedAt > lastSeen;\n\t\t\t\t})\n\t\t\t: notifications;\n\n\t\tif (newNotifications.length > 0) {\n\t\t\tthis.lastSeenAt = notifications[0].indexedAt;\n\n\t\t\tfor (const notification of newNotifications) {\n\t\t\t\tthis.emitNotificationEvent(notification);\n\t\t\t}\n\n\t\t\tawait this.client.updateSeenNotifications();\n\t\t}\n\t}\n\n\tprivate emitNotificationEvent(notification: BlueSkyNotification): void {\n\t\tconst eventMap: Record<NotificationReason, string> = {\n\t\t\tmention: \"bluesky.mention_received\",\n\t\t\treply: \"bluesky.mention_received\",\n\t\t\tfollow: \"bluesky.follow_received\",\n\t\t\tlike: \"bluesky.like_received\",\n\t\t\trepost: \"bluesky.repost_received\",\n\t\t\tquote: \"bluesky.quote_received\",\n\t\t};\n\n\t\tconst event = eventMap[notification.reason];\n\t\tif (event) {\n\t\t\tconst payload: BlueSkyNotificationEventPayload = {\n\t\t\t\truntime: this.runtime,\n\t\t\t\tsource: \"bluesky\",\n\t\t\t\tnotification,\n\t\t\t};\n\t\t\tvoid this.runtime.emitEvent(event, payload);\n\t\t}\n\t}\n\n\tprivate startActionProcessing(): void {\n\t\tconst interval = getActionInterval(this.runtime);\n\t\tthis.processActions();\n\t\tthis.actionTimer = setInterval(() => this.processActions(), interval);\n\t}\n\n\tprivate async processActions(): Promise<void> {\n\t\tif (!this.running) return;\n\n\t\tconst max = getMaxActionsProcessing(this.runtime);\n\t\tconst { notifications } = await this.client.getNotifications(max);\n\n\t\tfor (const notification of notifications) {\n\t\t\tif (\n\t\t\t\tnotification.reason === \"mention\" ||\n\t\t\t\tnotification.reason === \"reply\"\n\t\t\t) {\n\t\t\t\tconst payload: BlueSkyNotificationEventPayload = {\n\t\t\t\t\truntime: this.runtime,\n\t\t\t\t\tsource: \"bluesky\",\n\t\t\t\t\tnotification,\n\t\t\t\t};\n\t\t\t\tvoid this.runtime.emitEvent(\"bluesky.should_respond\", payload);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate startAutomatedPosting(): void {\n\t\tif (shouldPostImmediately(this.runtime)) {\n\t\t\tthis.createAutomatedPost();\n\t\t}\n\t\tthis.scheduleNextPost();\n\t}\n\n\tprivate scheduleNextPost(): void {\n\t\tconst { min, max } = getPostIntervalRange(this.runtime);\n\t\tconst interval = Math.random() * (max - min) + min;\n\n\t\tthis.postTimer = setTimeout(() => {\n\t\t\tif (this.running) {\n\t\t\t\tthis.createAutomatedPost();\n\t\t\t\tthis.scheduleNextPost();\n\t\t\t}\n\t\t}, interval);\n\t}\n\n\tprivate createAutomatedPost(): void {\n\t\tconst payload: BlueSkyCreatePostEventPayload = {\n\t\t\truntime: this.runtime,\n\t\t\tsource: \"bluesky\",\n\t\t\tautomated: true,\n\t\t};\n\t\tvoid this.runtime.emitEvent(\"bluesky.create_post\", payload);\n\t}\n}\n",
10
+ "import type { IAgentRuntime } from \"@elizaos/core\";\nimport {\n\tBLUESKY_ACTION_INTERVAL,\n\tBLUESKY_MAX_ACTIONS,\n\tBLUESKY_POLL_INTERVAL,\n\tBLUESKY_POST_INTERVAL_MAX,\n\tBLUESKY_POST_INTERVAL_MIN,\n\tBLUESKY_SERVICE_URL,\n\ttype BlueSkyConfig,\n\tBlueSkyConfigSchema,\n} from \"../types\";\n\nexport type { BlueSkyConfig };\n\nexport function getApiKeyOptional(\n\truntime: IAgentRuntime,\n\tkey: string,\n): string | undefined {\n\tconst value = runtime.getSetting(key);\n\treturn typeof value === \"string\" ? value : undefined;\n}\n\nexport function hasBlueSkyEnabled(runtime: IAgentRuntime): boolean {\n\tconst enabled = runtime.getSetting(\"BLUESKY_ENABLED\");\n\tif (enabled) return String(enabled).toLowerCase() === \"true\";\n\treturn Boolean(\n\t\truntime.getSetting(\"BLUESKY_HANDLE\") &&\n\t\t\truntime.getSetting(\"BLUESKY_PASSWORD\"),\n\t);\n}\n\nexport function validateBlueSkyConfig(runtime: IAgentRuntime): BlueSkyConfig {\n\tconst result = BlueSkyConfigSchema.safeParse({\n\t\thandle: String(runtime.getSetting(\"BLUESKY_HANDLE\") ?? \"\"),\n\t\tpassword: String(runtime.getSetting(\"BLUESKY_PASSWORD\") ?? \"\"),\n\t\tservice: String(\n\t\t\truntime.getSetting(\"BLUESKY_SERVICE\") ?? BLUESKY_SERVICE_URL,\n\t\t),\n\t\tdryRun: runtime.getSetting(\"BLUESKY_DRY_RUN\") === \"true\",\n\t\tpollInterval:\n\t\t\tparseInt(String(runtime.getSetting(\"BLUESKY_POLL_INTERVAL\") ?? \"\"), 10) ||\n\t\t\tBLUESKY_POLL_INTERVAL,\n\t\tenablePost: runtime.getSetting(\"BLUESKY_ENABLE_POSTING\") !== \"false\",\n\t\tpostIntervalMin:\n\t\t\tparseInt(\n\t\t\t\tString(runtime.getSetting(\"BLUESKY_POST_INTERVAL_MIN\") ?? \"\"),\n\t\t\t\t10,\n\t\t\t) || BLUESKY_POST_INTERVAL_MIN,\n\t\tpostIntervalMax:\n\t\t\tparseInt(\n\t\t\t\tString(runtime.getSetting(\"BLUESKY_POST_INTERVAL_MAX\") ?? \"\"),\n\t\t\t\t10,\n\t\t\t) || BLUESKY_POST_INTERVAL_MAX,\n\t\tenableActionProcessing:\n\t\t\truntime.getSetting(\"BLUESKY_ENABLE_ACTION_PROCESSING\") !== \"false\",\n\t\tactionInterval:\n\t\t\tparseInt(\n\t\t\t\tString(runtime.getSetting(\"BLUESKY_ACTION_INTERVAL\") ?? \"\"),\n\t\t\t\t10,\n\t\t\t) || BLUESKY_ACTION_INTERVAL,\n\t\tpostImmediately: runtime.getSetting(\"BLUESKY_POST_IMMEDIATELY\") === \"true\",\n\t\tmaxActionsProcessing:\n\t\t\tparseInt(\n\t\t\t\tString(runtime.getSetting(\"BLUESKY_MAX_ACTIONS_PROCESSING\") ?? \"\"),\n\t\t\t\t10,\n\t\t\t) || BLUESKY_MAX_ACTIONS,\n\t\tenableDMs: runtime.getSetting(\"BLUESKY_ENABLE_DMS\") !== \"false\",\n\t});\n\n\tif (!result.success) {\n\t\tconst errors =\n\t\t\t(\n\t\t\t\tresult.error as { errors?: { path: string[]; message: string }[] }\n\t\t\t).errors\n\t\t\t\t?.map((e) => `${e.path.join(\".\")}: ${e.message}`)\n\t\t\t\t.join(\", \") || result.error.toString();\n\t\tthrow new Error(`Invalid BlueSky configuration: ${errors}`);\n\t}\n\n\treturn result.data;\n}\n\nexport function getPollInterval(runtime: IAgentRuntime): number {\n\tconst seconds =\n\t\tparseInt(String(runtime.getSetting(\"BLUESKY_POLL_INTERVAL\") ?? \"\"), 10) ||\n\t\tBLUESKY_POLL_INTERVAL;\n\treturn seconds * 1000;\n}\n\nexport function getActionInterval(runtime: IAgentRuntime): number {\n\tconst seconds =\n\t\tparseInt(String(runtime.getSetting(\"BLUESKY_ACTION_INTERVAL\") ?? \"\"), 10) ||\n\t\tBLUESKY_ACTION_INTERVAL;\n\treturn seconds * 1000;\n}\n\nexport function getMaxActionsProcessing(runtime: IAgentRuntime): number {\n\treturn (\n\t\tparseInt(\n\t\t\tString(runtime.getSetting(\"BLUESKY_MAX_ACTIONS_PROCESSING\") ?? \"\"),\n\t\t\t10,\n\t\t) || BLUESKY_MAX_ACTIONS\n\t);\n}\n\nexport function isPostingEnabled(runtime: IAgentRuntime): boolean {\n\treturn runtime.getSetting(\"BLUESKY_ENABLE_POSTING\") !== \"false\";\n}\n\nexport function shouldPostImmediately(runtime: IAgentRuntime): boolean {\n\treturn runtime.getSetting(\"BLUESKY_POST_IMMEDIATELY\") === \"true\";\n}\n\nexport function getPostIntervalRange(runtime: IAgentRuntime): {\n\tmin: number;\n\tmax: number;\n} {\n\tconst min =\n\t\tparseInt(\n\t\t\tString(runtime.getSetting(\"BLUESKY_POST_INTERVAL_MIN\") ?? \"\"),\n\t\t\t10,\n\t\t) || BLUESKY_POST_INTERVAL_MIN;\n\tconst max =\n\t\tparseInt(\n\t\t\tString(runtime.getSetting(\"BLUESKY_POST_INTERVAL_MAX\") ?? \"\"),\n\t\t\t10,\n\t\t) || BLUESKY_POST_INTERVAL_MAX;\n\treturn { min: min * 1000, max: max * 1000 };\n}\n",
11
+ "import { composePrompt, type IAgentRuntime, ModelType } from \"@elizaos/core\";\nimport type { BlueSkyClient } from \"../client\";\nimport { generateDmTemplate } from \"../generated/prompts/typescript/prompts.js\";\nimport type { BlueSkyConversation, BlueSkyMessage } from \"../types\";\n\nexport class BlueSkyMessageService {\n\tstatic serviceType = \"IMessageService\";\n\n\tconstructor(\n\t\tprivate readonly client: BlueSkyClient,\n\t\tprivate readonly runtime: IAgentRuntime,\n\t) {}\n\n\tasync getMessages(convoId: string, limit = 50): Promise<BlueSkyMessage[]> {\n\t\tconst response = await this.client.getMessages(convoId, limit);\n\t\treturn response.messages;\n\t}\n\n\tasync sendMessage(convoId: string, text: string): Promise<BlueSkyMessage> {\n\t\tconst messageText = text.trim() || (await this.generateReply());\n\t\treturn this.client.sendMessage({ convoId, message: { text: messageText } });\n\t}\n\n\tasync getConversations(limit = 50): Promise<BlueSkyConversation[]> {\n\t\tconst response = await this.client.getConversations(limit);\n\t\treturn response.conversations;\n\t}\n\n\tprivate async generateReply(): Promise<string> {\n\t\tconst prompt = composePrompt({\n\t\t\tstate: {},\n\t\t\ttemplate: generateDmTemplate,\n\t\t});\n\t\tconst response = await this.runtime.useModel(ModelType.TEXT_SMALL, {\n\t\t\tprompt,\n\t\t\tmaxTokens: 50,\n\t\t});\n\t\treturn response as string;\n\t}\n}\n",
12
+ "/**\n * Auto-generated prompt templates\n * DO NOT EDIT - Generated from ../../../../prompts/*.txt\n *\n * These prompts use Handlebars-style template syntax:\n * - {{variableName}} for simple substitution\n * - {{#each items}}...{{/each}} for iteration\n * - {{#if condition}}...{{/if}} for conditionals\n */\n\nexport const generateDmTemplate = `Generate a friendly direct message response under 200 characters.`;\n\nexport const GENERATE_DM_TEMPLATE = generateDmTemplate;\n\nexport const generatePostTemplate = `Generate an engaging BlueSky post under {{maxLength}} characters.`;\n\nexport const GENERATE_POST_TEMPLATE = generatePostTemplate;\n\nexport const truncatePostTemplate = `Shorten to under {{maxLength}} characters: \"{{text}}\"`;\n\nexport const TRUNCATE_POST_TEMPLATE = truncatePostTemplate;\n",
13
+ "import { composePrompt, type IAgentRuntime, ModelType } from \"@elizaos/core\";\nimport type { BlueSkyClient } from \"../client\";\nimport {\n\tgeneratePostTemplate,\n\ttruncatePostTemplate,\n} from \"../generated/prompts/typescript/prompts.js\";\nimport type { BlueSkyPost, CreatePostRequest } from \"../types\";\nimport { BLUESKY_MAX_POST_LENGTH } from \"../types\";\n\nexport class BlueSkyPostService {\n\tstatic serviceType = \"IPostService\";\n\n\tconstructor(\n\t\tprivate readonly client: BlueSkyClient,\n\t\tprivate readonly runtime: IAgentRuntime,\n\t) {}\n\n\tasync getPosts(limit = 50, cursor?: string): Promise<BlueSkyPost[]> {\n\t\tconst response = await this.client.getTimeline({ limit, cursor });\n\t\treturn response.feed.map((item) => item.post);\n\t}\n\n\tasync createPost(\n\t\ttext: string,\n\t\treplyTo?: { uri: string; cid: string },\n\t): Promise<BlueSkyPost> {\n\t\tlet postText = text.trim() || (await this.generateContent());\n\n\t\tif (postText.length > BLUESKY_MAX_POST_LENGTH) {\n\t\t\tpostText = await this.truncate(postText);\n\t\t}\n\n\t\tconst request: CreatePostRequest = {\n\t\t\tcontent: { text: postText },\n\t\t\treplyTo,\n\t\t};\n\n\t\treturn this.client.sendPost(request);\n\t}\n\n\tasync deletePost(uri: string): Promise<void> {\n\t\tawait this.client.deletePost(uri);\n\t}\n\n\tprivate async generateContent(): Promise<string> {\n\t\tconst prompt = composePrompt({\n\t\t\tstate: {\n\t\t\t\tmaxLength: String(BLUESKY_MAX_POST_LENGTH),\n\t\t\t},\n\t\t\ttemplate: generatePostTemplate,\n\t\t});\n\t\tconst response = await this.runtime.useModel(ModelType.TEXT_SMALL, {\n\t\t\tprompt,\n\t\t\tmaxTokens: 100,\n\t\t});\n\t\treturn response as string;\n\t}\n\n\tprivate async truncate(text: string): Promise<string> {\n\t\tconst prompt = composePrompt({\n\t\t\tstate: {\n\t\t\t\tmaxLength: String(BLUESKY_MAX_POST_LENGTH),\n\t\t\t\ttext,\n\t\t\t},\n\t\t\ttemplate: truncatePostTemplate,\n\t\t});\n\t\tconst response = await this.runtime.useModel(ModelType.TEXT_SMALL, {\n\t\t\tprompt,\n\t\t\tmaxTokens: 100,\n\t\t});\n\t\tconst truncated = response as string;\n\t\treturn truncated.length > BLUESKY_MAX_POST_LENGTH\n\t\t\t? `${truncated.substring(0, BLUESKY_MAX_POST_LENGTH - 3)}...`\n\t\t\t: truncated;\n\t}\n}\n"
14
14
  ],
15
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACuB,IAAvB;;;ACD+D,IAA/D;;;ACA0D,IAA1D;AACuB,IAAvB;AACyB,IAAzB;;;ACDkB,IAAlB;AAEO,IAAM,sBAAsB;AAC5B,IAAM,0BAA0B;AAChC,IAAM,wBAAwB;AAC9B,IAAM,4BAA4B;AAClC,IAAM,4BAA4B;AAClC,IAAM,0BAA0B;AAChC,IAAM,sBAAsB;AAC5B,IAAM,2BAA2B;AACjC,IAAM,uBAAuB;AAE7B,IAAM,2BACX;AAEK,IAAM,YAAY;AAAA,EACvB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,MAAM;AAAA,EACN,eAAe;AAAA,EACf,eAAe;AACjB;AAEO,IAAM,aAAa;AAAA,EACxB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,MAAM;AAAA,EACN,eAAe;AAAA,EACf,eAAe;AACjB;AAEO,IAAM,sBAAsB,aAAE,OAAO;AAAA,EAC1C,QAAQ,aAAE,OAAO,EAAE,MAAM,0BAA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AClD,IAAI,CAAC,SAAS;AAAA,YACb,MAAM,IAAI,MAAM,sCAAsC;AAAA,UACvD;AAAA,UACA,oBAAO,IAAI,0CAA0C;AAAA;AAAA,MAEvD;AAAA,IACD;AAAA,EACD;AACD;AAEO,IAAM,gBAAwB;AAAA,EACpC,MAAM;AAAA,EACN,aACC;AAAA,EAED,QAAQ;AAAA,IACP,gBAAgB,QAAQ,IAAI,kBAAkB;AAAA,IAC9C,kBAAkB,QAAQ,IAAI,oBAAoB;AAAA,IAClD,iBAAiB,QAAQ,IAAI,mBAAmB;AAAA,IAChD,iBAAiB,QAAQ,IAAI,mBAAmB;AAAA,IAChD,uBAAuB,QAAQ,IAAI,yBAAyB;AAAA,IAC5D,wBAAwB,QAAQ,IAAI,0BAA0B;AAAA,IAC9D,oBAAoB,QAAQ,IAAI,sBAAsB;AAAA,IACtD,2BAA2B,QAAQ,IAAI,6BAA6B;AAAA,IACpE,2BAA2B,QAAQ,IAAI,6BAA6B;AAAA,IACpE,kCACC,QAAQ,IAAI,oCAAoC;AAAA,IACjD,yBAAyB,QAAQ,IAAI,2BAA2B;AAAA,IAChE,0BAA0B,QAAQ,IAAI,4BAA4B;AAAA,IAClE,gCACC,QAAQ,IAAI,kCAAkC;AAAA,IAC/C,yBAAyB,QAAQ,IAAI,2BAA2B;AAAA,EACjE;AAAA,OAEM,KAAI,CAAC,SAAS,UAAU;AAAA,IAC7B,oBAAO,IAAI,4BAA4B;AAAA;AAAA,EAGxC,UAAU,CAAC,cAAc;AAAA,EAEzB,OAAO;AACR;AAEA,IAAe;",
16
16
  "debugId": "68580B9EB5B89C7664756E2164756E21",
17
17
  "names": []
18
18
  }
@@ -2,17 +2,17 @@
2
2
  "version": 3,
3
3
  "sources": ["../../index.ts", "../../services/bluesky.ts", "../../client.ts", "../../types/index.ts", "../../managers/agent.ts", "../../utils/config.ts", "../../services/message.ts", "../../generated/prompts/typescript/prompts.ts", "../../services/post.ts"],
4
4
  "sourcesContent": [
5
- "import type { IAgentRuntime, Plugin, TestCase, TestSuite } from \"@elizaos/core\";\nimport { logger } from \"@elizaos/core\";\nimport { BlueSkyService } from \"./services/bluesky\";\nimport { getApiKeyOptional } from \"./utils/config\";\n\nexport { BlueSkyClient } from \"./client\";\nexport { BlueSkyService } from \"./services/bluesky\";\n\nexport interface PluginConfig {\n readonly BLUESKY_HANDLE?: string;\n readonly BLUESKY_PASSWORD?: string;\n readonly BLUESKY_SERVICE?: string;\n readonly BLUESKY_DRY_RUN?: string;\n readonly BLUESKY_POLL_INTERVAL?: string;\n readonly BLUESKY_ENABLE_POSTING?: string;\n readonly BLUESKY_ENABLE_DMS?: string;\n readonly BLUESKY_POST_INTERVAL_MIN?: string;\n readonly BLUESKY_POST_INTERVAL_MAX?: string;\n readonly BLUESKY_ENABLE_ACTION_PROCESSING?: string;\n readonly BLUESKY_ACTION_INTERVAL?: string;\n readonly BLUESKY_POST_IMMEDIATELY?: string;\n readonly BLUESKY_MAX_ACTIONS_PROCESSING?: string;\n readonly BLUESKY_MAX_POST_LENGTH?: string;\n}\n\nconst pluginTests = [\n {\n name: \"bluesky_plugin_tests\",\n tests: [\n {\n name: \"bluesky_test_credentials_validation\",\n fn: async (runtime: IAgentRuntime) => {\n const handle = getApiKeyOptional(runtime, \"BLUESKY_HANDLE\");\n const password = getApiKeyOptional(runtime, \"BLUESKY_PASSWORD\");\n if (!handle || !password) {\n throw new Error(\"BLUESKY_HANDLE and BLUESKY_PASSWORD are not configured\");\n }\n logger.log(\"BlueSky credentials are configured\");\n },\n },\n {\n name: \"bluesky_test_service_initialization\",\n fn: async (runtime: IAgentRuntime) => {\n const handle = getApiKeyOptional(runtime, \"BLUESKY_HANDLE\");\n const password = getApiKeyOptional(runtime, \"BLUESKY_PASSWORD\");\n if (!handle || !password) {\n logger.log(\"Skipping service initialization test - credentials not configured\");\n return;\n }\n\n const service = await BlueSkyService.start(runtime);\n if (!service) {\n throw new Error(\"Failed to initialize BlueSky service\");\n }\n logger.log(\"BlueSky service initialized successfully\");\n },\n },\n ] as TestCase[],\n },\n] as TestSuite[];\n\nexport const blueSkyPlugin: Plugin = {\n name: \"bluesky\",\n description: \"BlueSky client plugin using AT Protocol for social interactions\",\n\n config: {\n BLUESKY_HANDLE: process.env.BLUESKY_HANDLE ?? null,\n BLUESKY_PASSWORD: process.env.BLUESKY_PASSWORD ?? null,\n BLUESKY_SERVICE: process.env.BLUESKY_SERVICE ?? null,\n BLUESKY_DRY_RUN: process.env.BLUESKY_DRY_RUN ?? null,\n BLUESKY_POLL_INTERVAL: process.env.BLUESKY_POLL_INTERVAL ?? null,\n BLUESKY_ENABLE_POSTING: process.env.BLUESKY_ENABLE_POSTING ?? null,\n BLUESKY_ENABLE_DMS: process.env.BLUESKY_ENABLE_DMS ?? null,\n BLUESKY_POST_INTERVAL_MIN: process.env.BLUESKY_POST_INTERVAL_MIN ?? null,\n BLUESKY_POST_INTERVAL_MAX: process.env.BLUESKY_POST_INTERVAL_MAX ?? null,\n BLUESKY_ENABLE_ACTION_PROCESSING: process.env.BLUESKY_ENABLE_ACTION_PROCESSING ?? null,\n BLUESKY_ACTION_INTERVAL: process.env.BLUESKY_ACTION_INTERVAL ?? null,\n BLUESKY_POST_IMMEDIATELY: process.env.BLUESKY_POST_IMMEDIATELY ?? null,\n BLUESKY_MAX_ACTIONS_PROCESSING: process.env.BLUESKY_MAX_ACTIONS_PROCESSING ?? null,\n BLUESKY_MAX_POST_LENGTH: process.env.BLUESKY_MAX_POST_LENGTH ?? null,\n },\n\n async init(_config, _runtime) {\n logger.log(\"BlueSky plugin initialized\");\n },\n\n services: [BlueSkyService],\n\n tests: pluginTests,\n};\n\nexport default blueSkyPlugin;\n",
6
- "import { type IAgentRuntime, logger, Service, type UUID } from \"@elizaos/core\";\nimport { BlueSkyClient } from \"../client\";\nimport { BlueSkyAgentManager } from \"../managers/agent\";\nimport { BLUESKY_SERVICE_NAME } from \"../types\";\nimport { hasBlueSkyEnabled, validateBlueSkyConfig } from \"../utils/config\";\nimport { BlueSkyMessageService } from \"./message\";\nimport { BlueSkyPostService } from \"./post\";\n\nexport class BlueSkyService extends Service {\n private static instance: BlueSkyService;\n private managers = new Map<UUID, BlueSkyAgentManager>();\n private messageServices = new Map<UUID, BlueSkyMessageService>();\n private postServices = new Map<UUID, BlueSkyPostService>();\n static serviceType = BLUESKY_SERVICE_NAME;\n readonly capabilityDescription = \"Send and receive messages on BlueSky\";\n\n private static getInstance(): BlueSkyService {\n BlueSkyService.instance ??= new BlueSkyService();\n return BlueSkyService.instance;\n }\n\n static async start(runtime: IAgentRuntime): Promise<Service> {\n const service = BlueSkyService.getInstance();\n\n if (service.managers.has(runtime.agentId)) {\n return service;\n }\n\n if (!hasBlueSkyEnabled(runtime)) {\n return service;\n }\n\n const config = validateBlueSkyConfig(runtime);\n const client = new BlueSkyClient({\n service: config.service,\n handle: config.handle,\n password: config.password,\n dryRun: config.dryRun,\n });\n\n const manager = new BlueSkyAgentManager(runtime, config, client);\n service.managers.set(runtime.agentId, manager);\n service.messageServices.set(runtime.agentId, new BlueSkyMessageService(client, runtime));\n service.postServices.set(runtime.agentId, new BlueSkyPostService(client, runtime));\n\n await manager.start();\n logger.success({ agentId: runtime.agentId }, \"BlueSky client started\");\n\n return service;\n }\n\n static async stop(runtime: IAgentRuntime): Promise<void> {\n const service = BlueSkyService.getInstance();\n const manager = service.managers.get(runtime.agentId);\n if (!manager) return;\n\n await manager.stop();\n service.managers.delete(runtime.agentId);\n service.messageServices.delete(runtime.agentId);\n service.postServices.delete(runtime.agentId);\n logger.info({ agentId: runtime.agentId }, \"BlueSky client stopped\");\n }\n\n async stop(): Promise<void> {\n for (const manager of this.managers.values()) {\n await BlueSkyService.stop(manager.runtime);\n }\n }\n\n getMessageService(agentId: UUID): BlueSkyMessageService | undefined {\n return this.messageServices.get(agentId);\n }\n\n getPostService(agentId: UUID): BlueSkyPostService | undefined {\n return this.postServices.get(agentId);\n }\n}\n",
7
- "import { type AppBskyFeedDefs, BskyAgent, RichText } from \"@atproto/api\";\nimport { logger } from \"@elizaos/core\";\nimport { LRUCache } from \"lru-cache\";\nimport type {\n ATProtocolPostRecord,\n ATProtocolProfileViewExtended,\n BlueSkyConversation,\n BlueSkyMessage,\n BlueSkyNotification,\n BlueSkyPost,\n BlueSkyProfile,\n BlueSkySession,\n CreatePostRequest,\n PostEmbed,\n PostFacet,\n SendMessageRequest,\n TimelineRequest,\n TimelineResponse,\n} from \"./types\";\nimport { BLUESKY_CHAT_SERVICE_DID, BlueSkyError, CACHE_SIZE, CACHE_TTL } from \"./types\";\n\nfunction isPostView(\n item:\n | AppBskyFeedDefs.PostView\n | AppBskyFeedDefs.NotFoundPost\n | AppBskyFeedDefs.BlockedPost\n | { $type: string; [k: string]: unknown }\n): item is AppBskyFeedDefs.PostView {\n return (\n typeof item === \"object\" &&\n item !== null &&\n \"uri\" in item &&\n \"cid\" in item &&\n \"author\" in item &&\n \"record\" in item &&\n \"indexedAt\" in item &&\n typeof (item as AppBskyFeedDefs.PostView).uri === \"string\" &&\n typeof (item as AppBskyFeedDefs.PostView).cid === \"string\"\n );\n}\n\nfunction isReplyWithPostViews(\n reply: AppBskyFeedDefs.ReplyRef | null | undefined\n): reply is { root: AppBskyFeedDefs.PostView; parent: AppBskyFeedDefs.PostView } {\n return (\n typeof reply === \"object\" &&\n reply !== null &&\n \"root\" in reply &&\n \"parent\" in reply &&\n isPostView(reply.root) &&\n isPostView(reply.parent)\n );\n}\n\nfunction adaptPostView(postView: AppBskyFeedDefs.PostView): BlueSkyPost {\n const author = postView.author as ATProtocolProfileViewExtended;\n const record = postView.record as ATProtocolPostRecord;\n\n return {\n uri: postView.uri,\n cid: postView.cid,\n author: {\n did: author.did,\n handle: author.handle,\n displayName: author.displayName,\n description: author.description,\n avatar: author.avatar,\n banner: author.banner,\n followersCount: author.followersCount,\n followsCount: author.followsCount,\n postsCount: author.postsCount,\n indexedAt: author.indexedAt,\n createdAt: author.createdAt,\n },\n record: {\n $type: record.$type ?? \"app.bsky.feed.post\",\n text: record.text ?? \"\",\n facets: record.facets as PostFacet[] | undefined,\n embed: record.embed as PostEmbed | undefined,\n createdAt: record.createdAt ?? \"\",\n },\n embed: postView.embed as PostEmbed | undefined,\n replyCount: postView.replyCount,\n repostCount: postView.repostCount,\n likeCount: postView.likeCount,\n quoteCount: postView.quoteCount,\n indexedAt: postView.indexedAt,\n };\n}\n\nexport interface BlueSkyClientConfig {\n service: string;\n handle: string;\n password: string;\n dryRun: boolean;\n}\n\nexport class BlueSkyClient {\n private readonly agent: BskyAgent;\n private session: BlueSkySession | null = null;\n private readonly profileCache: LRUCache<string, BlueSkyProfile>;\n\n constructor(private readonly config: BlueSkyClientConfig) {\n this.agent = new BskyAgent({ service: config.service });\n this.profileCache = new LRUCache({\n max: CACHE_SIZE.PROFILE,\n ttl: CACHE_TTL.PROFILE,\n });\n }\n\n async authenticate(): Promise<BlueSkySession> {\n const response = await this.agent.login({\n identifier: this.config.handle,\n password: this.config.password,\n });\n\n if (!response.success) {\n throw new BlueSkyError(\"Authentication failed\", \"AUTH_FAILED\");\n }\n\n this.session = {\n did: response.data.did,\n handle: response.data.handle,\n email: response.data.email,\n accessJwt: response.data.accessJwt,\n refreshJwt: response.data.refreshJwt,\n };\n\n logger.info(`Authenticated with BlueSky: ${this.session.handle}`);\n return this.session;\n }\n\n getSession(): BlueSkySession | null {\n return this.session;\n }\n\n async getProfile(handle: string): Promise<BlueSkyProfile> {\n const cached = this.profileCache.get(handle);\n if (cached) return cached;\n\n const response = await this.agent.getProfile({ actor: handle });\n const profile: BlueSkyProfile = {\n did: response.data.did,\n handle: response.data.handle,\n displayName: response.data.displayName,\n description: response.data.description,\n avatar: response.data.avatar,\n banner: response.data.banner,\n followersCount: response.data.followersCount,\n followsCount: response.data.followsCount,\n postsCount: response.data.postsCount,\n indexedAt: response.data.indexedAt,\n createdAt: response.data.createdAt,\n };\n\n this.profileCache.set(handle, profile);\n return profile;\n }\n\n async getTimeline(params: TimelineRequest = {}): Promise<TimelineResponse> {\n const response = await this.agent.getTimeline({\n algorithm: params.algorithm,\n limit: params.limit ?? 50,\n cursor: params.cursor,\n });\n\n return {\n cursor: response.data.cursor,\n feed: response.data.feed.map((item) => {\n const reply = isReplyWithPostViews(item.reply)\n ? {\n root: adaptPostView(item.reply.root),\n parent: adaptPostView(item.reply.parent),\n }\n : undefined;\n\n return {\n post: adaptPostView(item.post),\n reply,\n reason: item.reason as Record<\n string,\n string | number | boolean | object | null | undefined\n >,\n };\n }),\n };\n }\n\n async sendPost(request: CreatePostRequest): Promise<BlueSkyPost> {\n if (this.config.dryRun) {\n logger.info(`Dry run: would create post with text: ${request.content.text}`);\n return this.mockPost(request.content.text);\n }\n\n const rt = new RichText({ text: request.content.text });\n await rt.detectFacets(this.agent);\n\n const record: Record<\n string,\n | string\n | PostFacet[]\n | PostEmbed\n | { root: { uri: string; cid: string }; parent: { uri: string; cid: string } }\n > = {\n $type: \"app.bsky.feed.post\",\n text: rt.text,\n facets: rt.facets as PostFacet[],\n createdAt: new Date().toISOString(),\n };\n\n if (request.replyTo) {\n record.reply = { root: request.replyTo, parent: request.replyTo };\n }\n\n if (request.content.embed) {\n record.embed = request.content.embed;\n }\n\n const response = await this.agent.post(record);\n const thread = await this.agent.getPostThread({\n uri: response.uri,\n depth: 0,\n });\n\n if (thread.data.thread.$type !== \"app.bsky.feed.defs#threadViewPost\") {\n throw new BlueSkyError(\"Failed to retrieve created post\", \"POST_CREATE_FAILED\");\n }\n\n const threadViewPost = thread.data.thread as AppBskyFeedDefs.ThreadViewPost;\n return adaptPostView(threadViewPost.post);\n }\n\n async deletePost(uri: string): Promise<void> {\n if (this.config.dryRun) {\n logger.info(`Dry run: would delete post: ${uri}`);\n return;\n }\n await this.agent.deletePost(uri);\n }\n\n async likePost(uri: string, cid: string): Promise<void> {\n if (this.config.dryRun) {\n logger.info(`Dry run: would like post: ${uri}`);\n return;\n }\n await this.agent.like(uri, cid);\n }\n\n async repost(uri: string, cid: string): Promise<void> {\n if (this.config.dryRun) {\n logger.info({ uri }, \"Dry run: would repost\");\n return;\n }\n await this.agent.repost(uri, cid);\n }\n\n async getNotifications(\n limit = 50,\n cursor?: string\n ): Promise<{\n notifications: BlueSkyNotification[];\n cursor?: string;\n }> {\n const response = await this.agent.listNotifications({ limit, cursor });\n return {\n notifications: response.data.notifications as BlueSkyNotification[],\n cursor: response.data.cursor,\n };\n }\n\n async updateSeenNotifications(): Promise<void> {\n await this.agent.updateSeenNotifications();\n }\n\n async getConversations(\n limit = 50,\n cursor?: string\n ): Promise<{\n conversations: BlueSkyConversation[];\n cursor?: string;\n }> {\n const response = await this.agent.api.chat.bsky.convo.listConvos(\n { limit, cursor },\n { headers: { \"atproto-proxy\": BLUESKY_CHAT_SERVICE_DID } }\n );\n return {\n conversations: response.data.convos as BlueSkyConversation[],\n cursor: response.data.cursor,\n };\n }\n\n async getMessages(\n convoId: string,\n limit = 50,\n cursor?: string\n ): Promise<{\n messages: BlueSkyMessage[];\n cursor?: string;\n }> {\n const response = await this.agent.api.chat.bsky.convo.getMessages(\n { convoId, limit, cursor },\n { headers: { \"atproto-proxy\": BLUESKY_CHAT_SERVICE_DID } }\n );\n return {\n messages: response.data.messages as BlueSkyMessage[],\n cursor: response.data.cursor,\n };\n }\n\n async sendMessage(request: SendMessageRequest): Promise<BlueSkyMessage> {\n if (this.config.dryRun) {\n logger.info({ convoId: request.convoId }, \"Dry run: would send message\");\n return this.mockMessage(request.message.text ?? \"\");\n }\n\n const response = await this.agent.api.chat.bsky.convo.sendMessage(\n {\n convoId: request.convoId,\n message: { text: request.message.text ?? \"\" },\n },\n { headers: { \"atproto-proxy\": BLUESKY_CHAT_SERVICE_DID } }\n );\n return response.data as BlueSkyMessage;\n }\n\n async cleanup(): Promise<void> {\n this.profileCache.clear();\n this.session = null;\n }\n\n private mockPost(text: string): BlueSkyPost {\n const now = new Date().toISOString();\n return {\n uri: `mock://post/${Date.now()}`,\n cid: `mock-cid-${Date.now()}`,\n author: {\n did: this.session?.did ?? \"did:plc:mock\",\n handle: this.session?.handle ?? \"mock.handle\",\n },\n record: { $type: \"app.bsky.feed.post\", text, createdAt: now },\n indexedAt: now,\n };\n }\n\n private mockMessage(text: string): BlueSkyMessage {\n return {\n id: `mock-msg-${Date.now()}`,\n rev: \"1\",\n text,\n sender: { did: this.session?.did ?? \"did:plc:mock\" },\n sentAt: new Date().toISOString(),\n };\n }\n}\n",
8
- "import type { IAgentRuntime } from \"@elizaos/core\";\nimport { z } from \"zod\";\n\nexport const BLUESKY_SERVICE_URL = \"https://bsky.social\";\nexport const BLUESKY_MAX_POST_LENGTH = 300;\nexport const BLUESKY_POLL_INTERVAL = 60;\nexport const BLUESKY_POST_INTERVAL_MIN = 1800;\nexport const BLUESKY_POST_INTERVAL_MAX = 3600;\nexport const BLUESKY_ACTION_INTERVAL = 120;\nexport const BLUESKY_MAX_ACTIONS = 5;\nexport const BLUESKY_CHAT_SERVICE_DID = \"did:web:api.bsky.chat\";\nexport const BLUESKY_SERVICE_NAME = \"bluesky\";\n\nexport const AT_PROTOCOL_HANDLE_REGEX =\n /^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/;\n\nexport const CACHE_TTL = {\n PROFILE: 3600000,\n TIMELINE: 300000,\n POST: 1800000,\n NOTIFICATIONS: 300000,\n CONVERSATIONS: 300000,\n} as const;\n\nexport const CACHE_SIZE = {\n PROFILE: 1000,\n TIMELINE: 500,\n POST: 10000,\n NOTIFICATIONS: 1000,\n CONVERSATIONS: 100,\n} as const;\n\nexport const BlueSkyConfigSchema = z.object({\n handle: z.string().regex(AT_PROTOCOL_HANDLE_REGEX, \"Invalid handle format\"),\n password: z.string().min(1),\n service: z.string().url().default(BLUESKY_SERVICE_URL),\n dryRun: z.boolean().default(false),\n pollInterval: z.number().positive().default(BLUESKY_POLL_INTERVAL),\n enablePost: z.boolean().default(true),\n postIntervalMin: z.number().positive().default(BLUESKY_POST_INTERVAL_MIN),\n postIntervalMax: z.number().positive().default(BLUESKY_POST_INTERVAL_MAX),\n enableActionProcessing: z.boolean().default(true),\n actionInterval: z.number().positive().default(BLUESKY_ACTION_INTERVAL),\n postImmediately: z.boolean().default(false),\n maxActionsProcessing: z.number().positive().default(BLUESKY_MAX_ACTIONS),\n enableDMs: z.boolean().default(true),\n});\n\nexport type BlueSkyConfig = z.infer<typeof BlueSkyConfigSchema>;\n\nexport interface BlueSkyProfile {\n did: string;\n handle: string;\n displayName?: string;\n description?: string;\n avatar?: string;\n banner?: string;\n followersCount?: number;\n followsCount?: number;\n postsCount?: number;\n indexedAt?: string;\n createdAt?: string;\n}\n\nexport interface PostFacet {\n index: { byteStart: number; byteEnd: number };\n features: Array<{\n $type?: string;\n [key: string]: string | number | boolean | object | null | undefined;\n }>;\n}\n\nexport interface PostEmbed {\n $type: string;\n [key: string]: string | number | boolean | object | null | undefined;\n}\n\nexport interface PostRecord {\n $type: string;\n text: string;\n facets?: PostFacet[];\n embed?: PostEmbed;\n createdAt: string;\n}\n\nexport interface BlueSkyPost {\n uri: string;\n cid: string;\n author: BlueSkyProfile;\n record: PostRecord;\n embed?: PostEmbed;\n replyCount?: number;\n repostCount?: number;\n likeCount?: number;\n quoteCount?: number;\n indexedAt: string;\n}\n\nexport interface TimelineRequest {\n algorithm?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface TimelineFeedItem {\n post: BlueSkyPost;\n reply?: {\n root: BlueSkyPost;\n parent: BlueSkyPost;\n };\n reason?: Record<string, string | number | boolean | object | null | undefined>;\n}\n\nexport interface TimelineResponse {\n cursor?: string;\n feed: TimelineFeedItem[];\n}\n\nexport interface CreatePostRequest {\n content: {\n text: string;\n facets?: PostFacet[];\n embed?: PostEmbed;\n };\n replyTo?: { uri: string; cid: string };\n}\n\nexport type NotificationReason = \"mention\" | \"reply\" | \"follow\" | \"like\" | \"repost\" | \"quote\";\n\nexport interface BlueSkyNotification {\n uri: string;\n cid: string;\n author: BlueSkyProfile;\n reason: NotificationReason;\n reasonSubject?: string;\n record: Record<string, string | number | boolean | object | null | undefined>;\n isRead: boolean;\n indexedAt: string;\n}\n\nexport interface BlueSkyMessage {\n id: string;\n rev: string;\n text?: string;\n embed?: PostEmbed;\n sender: { did: string };\n sentAt: string;\n}\n\nexport interface BlueSkyConversation {\n id: string;\n rev: string;\n members: Array<{\n did: string;\n handle?: string;\n displayName?: string;\n avatar?: string;\n }>;\n lastMessage?: BlueSkyMessage;\n unreadCount: number;\n muted: boolean;\n}\n\nexport interface SendMessageRequest {\n convoId: string;\n message: { text?: string; embed?: PostEmbed };\n}\n\nexport interface BlueSkySession {\n did: string;\n handle: string;\n email?: string;\n accessJwt: string;\n refreshJwt: string;\n}\n\nexport class BlueSkyError extends Error {\n constructor(\n message: string,\n public readonly code: string,\n public readonly status?: number\n ) {\n super(message);\n this.name = \"BlueSkyError\";\n }\n}\n\nexport interface ATProtocolPostRecord {\n $type: string;\n text: string;\n facets?: PostFacet[];\n embed?: PostEmbed;\n createdAt: string;\n [k: string]: string | PostFacet[] | PostEmbed | number | boolean | null | undefined;\n}\n\nexport interface ATProtocolProfileViewExtended {\n did: string;\n handle: string;\n displayName?: string;\n description?: string;\n avatar?: string;\n banner?: string;\n followersCount?: number;\n followsCount?: number;\n postsCount?: number;\n indexedAt?: string;\n createdAt?: string;\n [k: string]: string | number | undefined;\n}\n\nexport interface BlueSkyEventPayload {\n runtime: IAgentRuntime;\n source: \"bluesky\";\n}\n\nexport interface BlueSkyNotificationEventPayload extends BlueSkyEventPayload {\n notification: BlueSkyNotification;\n}\n\nexport interface BlueSkyCreatePostEventPayload extends BlueSkyEventPayload {\n automated: boolean;\n}\n",
9
- "import { type IAgentRuntime, logger } from \"@elizaos/core\";\nimport type { BlueSkyClient } from \"../client\";\nimport type {\n BlueSkyConfig,\n BlueSkyCreatePostEventPayload,\n BlueSkyNotification,\n BlueSkyNotificationEventPayload,\n NotificationReason,\n} from \"../types\";\nimport {\n getActionInterval,\n getMaxActionsProcessing,\n getPollInterval,\n getPostIntervalRange,\n isPostingEnabled,\n shouldPostImmediately,\n} from \"../utils/config\";\n\nexport class BlueSkyAgentManager {\n private pollTimer: ReturnType<typeof setInterval> | null = null;\n private actionTimer: ReturnType<typeof setInterval> | null = null;\n private postTimer: ReturnType<typeof setTimeout> | null = null;\n private running = false;\n private lastSeenAt: string | null = null;\n\n constructor(\n public readonly runtime: IAgentRuntime,\n public readonly config: BlueSkyConfig,\n public readonly client: BlueSkyClient\n ) {}\n\n async start(): Promise<void> {\n if (this.running) return;\n\n await this.client.authenticate();\n this.running = true;\n\n this.startNotificationPolling();\n\n if (this.config.enableActionProcessing) {\n this.startActionProcessing();\n }\n\n if (isPostingEnabled(this.runtime)) {\n this.startAutomatedPosting();\n }\n\n logger.success({ agentId: this.runtime.agentId }, \"BlueSky agent manager started\");\n }\n\n async stop(): Promise<void> {\n this.running = false;\n\n if (this.pollTimer) clearInterval(this.pollTimer);\n if (this.actionTimer) clearInterval(this.actionTimer);\n if (this.postTimer) clearTimeout(this.postTimer);\n\n this.pollTimer = null;\n this.actionTimer = null;\n this.postTimer = null;\n\n await this.client.cleanup();\n logger.info({ agentId: this.runtime.agentId }, \"BlueSky agent manager stopped\");\n }\n\n private startNotificationPolling(): void {\n const interval = getPollInterval(this.runtime);\n this.pollNotifications();\n this.pollTimer = setInterval(() => this.pollNotifications(), interval);\n }\n\n private async pollNotifications(): Promise<void> {\n if (!this.running) return;\n\n const { notifications } = await this.client.getNotifications(50);\n if (notifications.length === 0) return;\n\n const newNotifications = this.lastSeenAt\n ? notifications.filter((n) => {\n const lastSeen = this.lastSeenAt;\n return lastSeen !== null && n.indexedAt > lastSeen;\n })\n : notifications;\n\n if (newNotifications.length > 0) {\n this.lastSeenAt = notifications[0].indexedAt;\n\n for (const notification of newNotifications) {\n this.emitNotificationEvent(notification);\n }\n\n await this.client.updateSeenNotifications();\n }\n }\n\n private emitNotificationEvent(notification: BlueSkyNotification): void {\n const eventMap: Record<NotificationReason, string> = {\n mention: \"bluesky.mention_received\",\n reply: \"bluesky.mention_received\",\n follow: \"bluesky.follow_received\",\n like: \"bluesky.like_received\",\n repost: \"bluesky.repost_received\",\n quote: \"bluesky.quote_received\",\n };\n\n const event = eventMap[notification.reason];\n if (event) {\n const payload: BlueSkyNotificationEventPayload = {\n runtime: this.runtime,\n source: \"bluesky\",\n notification,\n };\n void this.runtime.emitEvent(event, payload);\n }\n }\n\n private startActionProcessing(): void {\n const interval = getActionInterval(this.runtime);\n this.processActions();\n this.actionTimer = setInterval(() => this.processActions(), interval);\n }\n\n private async processActions(): Promise<void> {\n if (!this.running) return;\n\n const max = getMaxActionsProcessing(this.runtime);\n const { notifications } = await this.client.getNotifications(max);\n\n for (const notification of notifications) {\n if (notification.reason === \"mention\" || notification.reason === \"reply\") {\n const payload: BlueSkyNotificationEventPayload = {\n runtime: this.runtime,\n source: \"bluesky\",\n notification,\n };\n void this.runtime.emitEvent(\"bluesky.should_respond\", payload);\n }\n }\n }\n\n private startAutomatedPosting(): void {\n if (shouldPostImmediately(this.runtime)) {\n this.createAutomatedPost();\n }\n this.scheduleNextPost();\n }\n\n private scheduleNextPost(): void {\n const { min, max } = getPostIntervalRange(this.runtime);\n const interval = Math.random() * (max - min) + min;\n\n this.postTimer = setTimeout(() => {\n if (this.running) {\n this.createAutomatedPost();\n this.scheduleNextPost();\n }\n }, interval);\n }\n\n private createAutomatedPost(): void {\n const payload: BlueSkyCreatePostEventPayload = {\n runtime: this.runtime,\n source: \"bluesky\",\n automated: true,\n };\n void this.runtime.emitEvent(\"bluesky.create_post\", payload);\n }\n}\n",
10
- "import type { IAgentRuntime } from \"@elizaos/core\";\nimport {\n BLUESKY_ACTION_INTERVAL,\n BLUESKY_MAX_ACTIONS,\n BLUESKY_POLL_INTERVAL,\n BLUESKY_POST_INTERVAL_MAX,\n BLUESKY_POST_INTERVAL_MIN,\n BLUESKY_SERVICE_URL,\n type BlueSkyConfig,\n BlueSkyConfigSchema,\n} from \"../types\";\n\nexport type { BlueSkyConfig };\n\nexport function getApiKeyOptional(runtime: IAgentRuntime, key: string): string | undefined {\n const value = runtime.getSetting(key);\n return typeof value === \"string\" ? value : undefined;\n}\n\nexport function hasBlueSkyEnabled(runtime: IAgentRuntime): boolean {\n const enabled = runtime.getSetting(\"BLUESKY_ENABLED\");\n if (enabled) return String(enabled).toLowerCase() === \"true\";\n return Boolean(runtime.getSetting(\"BLUESKY_HANDLE\") && runtime.getSetting(\"BLUESKY_PASSWORD\"));\n}\n\nexport function validateBlueSkyConfig(runtime: IAgentRuntime): BlueSkyConfig {\n const result = BlueSkyConfigSchema.safeParse({\n handle: String(runtime.getSetting(\"BLUESKY_HANDLE\") ?? \"\"),\n password: String(runtime.getSetting(\"BLUESKY_PASSWORD\") ?? \"\"),\n service: String(runtime.getSetting(\"BLUESKY_SERVICE\") ?? BLUESKY_SERVICE_URL),\n dryRun: runtime.getSetting(\"BLUESKY_DRY_RUN\") === \"true\",\n pollInterval:\n parseInt(String(runtime.getSetting(\"BLUESKY_POLL_INTERVAL\") ?? \"\"), 10) ||\n BLUESKY_POLL_INTERVAL,\n enablePost: runtime.getSetting(\"BLUESKY_ENABLE_POSTING\") !== \"false\",\n postIntervalMin:\n parseInt(String(runtime.getSetting(\"BLUESKY_POST_INTERVAL_MIN\") ?? \"\"), 10) ||\n BLUESKY_POST_INTERVAL_MIN,\n postIntervalMax:\n parseInt(String(runtime.getSetting(\"BLUESKY_POST_INTERVAL_MAX\") ?? \"\"), 10) ||\n BLUESKY_POST_INTERVAL_MAX,\n enableActionProcessing: runtime.getSetting(\"BLUESKY_ENABLE_ACTION_PROCESSING\") !== \"false\",\n actionInterval:\n parseInt(String(runtime.getSetting(\"BLUESKY_ACTION_INTERVAL\") ?? \"\"), 10) ||\n BLUESKY_ACTION_INTERVAL,\n postImmediately: runtime.getSetting(\"BLUESKY_POST_IMMEDIATELY\") === \"true\",\n maxActionsProcessing:\n parseInt(String(runtime.getSetting(\"BLUESKY_MAX_ACTIONS_PROCESSING\") ?? \"\"), 10) ||\n BLUESKY_MAX_ACTIONS,\n enableDMs: runtime.getSetting(\"BLUESKY_ENABLE_DMS\") !== \"false\",\n });\n\n if (!result.success) {\n const errors =\n (result.error as { errors?: { path: string[]; message: string }[] }).errors\n ?.map((e) => `${e.path.join(\".\")}: ${e.message}`)\n .join(\", \") || result.error.toString();\n throw new Error(`Invalid BlueSky configuration: ${errors}`);\n }\n\n return result.data;\n}\n\nexport function getPollInterval(runtime: IAgentRuntime): number {\n const seconds =\n parseInt(String(runtime.getSetting(\"BLUESKY_POLL_INTERVAL\") ?? \"\"), 10) ||\n BLUESKY_POLL_INTERVAL;\n return seconds * 1000;\n}\n\nexport function getActionInterval(runtime: IAgentRuntime): number {\n const seconds =\n parseInt(String(runtime.getSetting(\"BLUESKY_ACTION_INTERVAL\") ?? \"\"), 10) ||\n BLUESKY_ACTION_INTERVAL;\n return seconds * 1000;\n}\n\nexport function getMaxActionsProcessing(runtime: IAgentRuntime): number {\n return (\n parseInt(String(runtime.getSetting(\"BLUESKY_MAX_ACTIONS_PROCESSING\") ?? \"\"), 10) ||\n BLUESKY_MAX_ACTIONS\n );\n}\n\nexport function isPostingEnabled(runtime: IAgentRuntime): boolean {\n return runtime.getSetting(\"BLUESKY_ENABLE_POSTING\") !== \"false\";\n}\n\nexport function shouldPostImmediately(runtime: IAgentRuntime): boolean {\n return runtime.getSetting(\"BLUESKY_POST_IMMEDIATELY\") === \"true\";\n}\n\nexport function getPostIntervalRange(runtime: IAgentRuntime): {\n min: number;\n max: number;\n} {\n const min =\n parseInt(String(runtime.getSetting(\"BLUESKY_POST_INTERVAL_MIN\") ?? \"\"), 10) ||\n BLUESKY_POST_INTERVAL_MIN;\n const max =\n parseInt(String(runtime.getSetting(\"BLUESKY_POST_INTERVAL_MAX\") ?? \"\"), 10) ||\n BLUESKY_POST_INTERVAL_MAX;\n return { min: min * 1000, max: max * 1000 };\n}\n",
11
- "import { composePrompt, type IAgentRuntime, ModelType } from \"@elizaos/core\";\nimport type { BlueSkyClient } from \"../client\";\nimport { generateDmTemplate } from \"../generated/prompts/typescript/prompts.js\";\nimport type { BlueSkyConversation, BlueSkyMessage } from \"../types\";\n\nexport class BlueSkyMessageService {\n static serviceType = \"IMessageService\";\n\n constructor(\n private readonly client: BlueSkyClient,\n private readonly runtime: IAgentRuntime\n ) {}\n\n async getMessages(convoId: string, limit = 50): Promise<BlueSkyMessage[]> {\n const response = await this.client.getMessages(convoId, limit);\n return response.messages;\n }\n\n async sendMessage(convoId: string, text: string): Promise<BlueSkyMessage> {\n const messageText = text.trim() || (await this.generateReply());\n return this.client.sendMessage({ convoId, message: { text: messageText } });\n }\n\n async getConversations(limit = 50): Promise<BlueSkyConversation[]> {\n const response = await this.client.getConversations(limit);\n return response.conversations;\n }\n\n private async generateReply(): Promise<string> {\n const prompt = composePrompt({\n state: {},\n template: generateDmTemplate,\n });\n const response = await this.runtime.useModel(ModelType.TEXT_SMALL, {\n prompt,\n maxTokens: 50,\n });\n return response as string;\n }\n}\n",
12
- "/**\n * Auto-generated prompt templates\n * DO NOT EDIT - Generated from ../../../../prompts/*.txt\n *\n * These prompts use Handlebars-style template syntax:\n * - {{variableName}} for simple substitution\n * - {{#each items}}...{{/each}} for iteration\n * - {{#if condition}}...{{/if}} for conditionals\n */\n\nexport const generateDmTemplate = `Generate a friendly direct message response under 200 characters.`;\n\nexport const GENERATE_DM_TEMPLATE = generateDmTemplate;\n\nexport const generatePostTemplate = `Generate an engaging BlueSky post under {{maxLength}} characters.`;\n\nexport const GENERATE_POST_TEMPLATE = generatePostTemplate;\n\nexport const truncatePostTemplate = `Shorten to under {{maxLength}} characters: \"{{text}}\"`;\n\nexport const TRUNCATE_POST_TEMPLATE = truncatePostTemplate;\n\n",
13
- "import { composePrompt, type IAgentRuntime, ModelType } from \"@elizaos/core\";\nimport type { BlueSkyClient } from \"../client\";\nimport {\n generatePostTemplate,\n truncatePostTemplate,\n} from \"../generated/prompts/typescript/prompts.js\";\nimport type { BlueSkyPost, CreatePostRequest } from \"../types\";\nimport { BLUESKY_MAX_POST_LENGTH } from \"../types\";\n\nexport class BlueSkyPostService {\n static serviceType = \"IPostService\";\n\n constructor(\n private readonly client: BlueSkyClient,\n private readonly runtime: IAgentRuntime\n ) {}\n\n async getPosts(limit = 50, cursor?: string): Promise<BlueSkyPost[]> {\n const response = await this.client.getTimeline({ limit, cursor });\n return response.feed.map((item) => item.post);\n }\n\n async createPost(text: string, replyTo?: { uri: string; cid: string }): Promise<BlueSkyPost> {\n let postText = text.trim() || (await this.generateContent());\n\n if (postText.length > BLUESKY_MAX_POST_LENGTH) {\n postText = await this.truncate(postText);\n }\n\n const request: CreatePostRequest = {\n content: { text: postText },\n replyTo,\n };\n\n return this.client.sendPost(request);\n }\n\n async deletePost(uri: string): Promise<void> {\n await this.client.deletePost(uri);\n }\n\n private async generateContent(): Promise<string> {\n const prompt = composePrompt({\n state: {\n maxLength: String(BLUESKY_MAX_POST_LENGTH),\n },\n template: generatePostTemplate,\n });\n const response = await this.runtime.useModel(ModelType.TEXT_SMALL, {\n prompt,\n maxTokens: 100,\n });\n return response as string;\n }\n\n private async truncate(text: string): Promise<string> {\n const prompt = composePrompt({\n state: {\n maxLength: String(BLUESKY_MAX_POST_LENGTH),\n text,\n },\n template: truncatePostTemplate,\n });\n const response = await this.runtime.useModel(ModelType.TEXT_SMALL, {\n prompt,\n maxTokens: 100,\n });\n const truncated = response as string;\n return truncated.length > BLUESKY_MAX_POST_LENGTH\n ? `${truncated.substring(0, BLUESKY_MAX_POST_LENGTH - 3)}...`\n : truncated;\n }\n}\n"
5
+ "import type { IAgentRuntime, Plugin, TestCase, TestSuite } from \"@elizaos/core\";\nimport { logger } from \"@elizaos/core\";\nimport { BlueSkyService } from \"./services/bluesky\";\nimport { getApiKeyOptional } from \"./utils/config\";\n\nexport { BlueSkyClient } from \"./client\";\nexport { BlueSkyService } from \"./services/bluesky\";\n\nexport interface PluginConfig {\n\treadonly BLUESKY_HANDLE?: string;\n\treadonly BLUESKY_PASSWORD?: string;\n\treadonly BLUESKY_SERVICE?: string;\n\treadonly BLUESKY_DRY_RUN?: string;\n\treadonly BLUESKY_POLL_INTERVAL?: string;\n\treadonly BLUESKY_ENABLE_POSTING?: string;\n\treadonly BLUESKY_ENABLE_DMS?: string;\n\treadonly BLUESKY_POST_INTERVAL_MIN?: string;\n\treadonly BLUESKY_POST_INTERVAL_MAX?: string;\n\treadonly BLUESKY_ENABLE_ACTION_PROCESSING?: string;\n\treadonly BLUESKY_ACTION_INTERVAL?: string;\n\treadonly BLUESKY_POST_IMMEDIATELY?: string;\n\treadonly BLUESKY_MAX_ACTIONS_PROCESSING?: string;\n\treadonly BLUESKY_MAX_POST_LENGTH?: string;\n}\n\nconst pluginTests = [\n\t{\n\t\tname: \"bluesky_plugin_tests\",\n\t\ttests: [\n\t\t\t{\n\t\t\t\tname: \"bluesky_test_credentials_validation\",\n\t\t\t\tfn: async (runtime: IAgentRuntime) => {\n\t\t\t\t\tconst handle = getApiKeyOptional(runtime, \"BLUESKY_HANDLE\");\n\t\t\t\t\tconst password = getApiKeyOptional(runtime, \"BLUESKY_PASSWORD\");\n\t\t\t\t\tif (!handle || !password) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\"BLUESKY_HANDLE and BLUESKY_PASSWORD are not configured\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tlogger.log(\"BlueSky credentials are configured\");\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"bluesky_test_service_initialization\",\n\t\t\t\tfn: async (runtime: IAgentRuntime) => {\n\t\t\t\t\tconst handle = getApiKeyOptional(runtime, \"BLUESKY_HANDLE\");\n\t\t\t\t\tconst password = getApiKeyOptional(runtime, \"BLUESKY_PASSWORD\");\n\t\t\t\t\tif (!handle || !password) {\n\t\t\t\t\t\tlogger.log(\n\t\t\t\t\t\t\t\"Skipping service initialization test - credentials not configured\",\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst service = await BlueSkyService.start(runtime);\n\t\t\t\t\tif (!service) {\n\t\t\t\t\t\tthrow new Error(\"Failed to initialize BlueSky service\");\n\t\t\t\t\t}\n\t\t\t\t\tlogger.log(\"BlueSky service initialized successfully\");\n\t\t\t\t},\n\t\t\t},\n\t\t] as TestCase[],\n\t},\n] as TestSuite[];\n\nexport const blueSkyPlugin: Plugin = {\n\tname: \"bluesky\",\n\tdescription:\n\t\t\"BlueSky client plugin using AT Protocol for social interactions\",\n\n\tconfig: {\n\t\tBLUESKY_HANDLE: process.env.BLUESKY_HANDLE ?? null,\n\t\tBLUESKY_PASSWORD: process.env.BLUESKY_PASSWORD ?? null,\n\t\tBLUESKY_SERVICE: process.env.BLUESKY_SERVICE ?? null,\n\t\tBLUESKY_DRY_RUN: process.env.BLUESKY_DRY_RUN ?? null,\n\t\tBLUESKY_POLL_INTERVAL: process.env.BLUESKY_POLL_INTERVAL ?? null,\n\t\tBLUESKY_ENABLE_POSTING: process.env.BLUESKY_ENABLE_POSTING ?? null,\n\t\tBLUESKY_ENABLE_DMS: process.env.BLUESKY_ENABLE_DMS ?? null,\n\t\tBLUESKY_POST_INTERVAL_MIN: process.env.BLUESKY_POST_INTERVAL_MIN ?? null,\n\t\tBLUESKY_POST_INTERVAL_MAX: process.env.BLUESKY_POST_INTERVAL_MAX ?? null,\n\t\tBLUESKY_ENABLE_ACTION_PROCESSING:\n\t\t\tprocess.env.BLUESKY_ENABLE_ACTION_PROCESSING ?? null,\n\t\tBLUESKY_ACTION_INTERVAL: process.env.BLUESKY_ACTION_INTERVAL ?? null,\n\t\tBLUESKY_POST_IMMEDIATELY: process.env.BLUESKY_POST_IMMEDIATELY ?? null,\n\t\tBLUESKY_MAX_ACTIONS_PROCESSING:\n\t\t\tprocess.env.BLUESKY_MAX_ACTIONS_PROCESSING ?? null,\n\t\tBLUESKY_MAX_POST_LENGTH: process.env.BLUESKY_MAX_POST_LENGTH ?? null,\n\t},\n\n\tasync init(_config, _runtime) {\n\t\tlogger.log(\"BlueSky plugin initialized\");\n\t},\n\n\tservices: [BlueSkyService],\n\n\ttests: pluginTests,\n};\n\nexport default blueSkyPlugin;\n",
6
+ "import { type IAgentRuntime, logger, Service, type UUID } from \"@elizaos/core\";\nimport { BlueSkyClient } from \"../client\";\nimport { BlueSkyAgentManager } from \"../managers/agent\";\nimport { BLUESKY_SERVICE_NAME } from \"../types\";\nimport { hasBlueSkyEnabled, validateBlueSkyConfig } from \"../utils/config\";\nimport { BlueSkyMessageService } from \"./message\";\nimport { BlueSkyPostService } from \"./post\";\n\nexport class BlueSkyService extends Service {\n\tprivate static instance: BlueSkyService;\n\tprivate managers = new Map<UUID, BlueSkyAgentManager>();\n\tprivate messageServices = new Map<UUID, BlueSkyMessageService>();\n\tprivate postServices = new Map<UUID, BlueSkyPostService>();\n\tstatic serviceType = BLUESKY_SERVICE_NAME;\n\treadonly capabilityDescription = \"Send and receive messages on BlueSky\";\n\n\tprivate static getInstance(): BlueSkyService {\n\t\tBlueSkyService.instance ??= new BlueSkyService();\n\t\treturn BlueSkyService.instance;\n\t}\n\n\tstatic async start(runtime: IAgentRuntime): Promise<Service> {\n\t\tconst service = BlueSkyService.getInstance();\n\n\t\tif (service.managers.has(runtime.agentId)) {\n\t\t\treturn service;\n\t\t}\n\n\t\tif (!hasBlueSkyEnabled(runtime)) {\n\t\t\treturn service;\n\t\t}\n\n\t\tconst config = validateBlueSkyConfig(runtime);\n\t\tconst client = new BlueSkyClient({\n\t\t\tservice: config.service,\n\t\t\thandle: config.handle,\n\t\t\tpassword: config.password,\n\t\t\tdryRun: config.dryRun,\n\t\t});\n\n\t\tconst manager = new BlueSkyAgentManager(runtime, config, client);\n\t\tservice.managers.set(runtime.agentId, manager);\n\t\tservice.messageServices.set(\n\t\t\truntime.agentId,\n\t\t\tnew BlueSkyMessageService(client, runtime),\n\t\t);\n\t\tservice.postServices.set(\n\t\t\truntime.agentId,\n\t\t\tnew BlueSkyPostService(client, runtime),\n\t\t);\n\n\t\tawait manager.start();\n\t\tlogger.success({ agentId: runtime.agentId }, \"BlueSky client started\");\n\n\t\treturn service;\n\t}\n\n\tstatic async stop(runtime: IAgentRuntime): Promise<void> {\n\t\tconst service = BlueSkyService.getInstance();\n\t\tconst manager = service.managers.get(runtime.agentId);\n\t\tif (!manager) return;\n\n\t\tawait manager.stop();\n\t\tservice.managers.delete(runtime.agentId);\n\t\tservice.messageServices.delete(runtime.agentId);\n\t\tservice.postServices.delete(runtime.agentId);\n\t\tlogger.info({ agentId: runtime.agentId }, \"BlueSky client stopped\");\n\t}\n\n\tasync stop(): Promise<void> {\n\t\tfor (const manager of this.managers.values()) {\n\t\t\tawait BlueSkyService.stop(manager.runtime);\n\t\t}\n\t}\n\n\tgetMessageService(agentId: UUID): BlueSkyMessageService | undefined {\n\t\treturn this.messageServices.get(agentId);\n\t}\n\n\tgetPostService(agentId: UUID): BlueSkyPostService | undefined {\n\t\treturn this.postServices.get(agentId);\n\t}\n}\n",
7
+ "import { type AppBskyFeedDefs, BskyAgent, RichText } from \"@atproto/api\";\nimport { logger } from \"@elizaos/core\";\nimport { LRUCache } from \"lru-cache\";\nimport type {\n\tATProtocolPostRecord,\n\tATProtocolProfileViewExtended,\n\tBlueSkyConversation,\n\tBlueSkyMessage,\n\tBlueSkyNotification,\n\tBlueSkyPost,\n\tBlueSkyProfile,\n\tBlueSkySession,\n\tCreatePostRequest,\n\tPostEmbed,\n\tPostFacet,\n\tSendMessageRequest,\n\tTimelineRequest,\n\tTimelineResponse,\n} from \"./types\";\nimport {\n\tBLUESKY_CHAT_SERVICE_DID,\n\tBlueSkyError,\n\tCACHE_SIZE,\n\tCACHE_TTL,\n} from \"./types\";\n\nfunction isPostView(\n\titem:\n\t\t| AppBskyFeedDefs.PostView\n\t\t| AppBskyFeedDefs.NotFoundPost\n\t\t| AppBskyFeedDefs.BlockedPost\n\t\t| { $type: string; [k: string]: unknown },\n): item is AppBskyFeedDefs.PostView {\n\treturn (\n\t\ttypeof item === \"object\" &&\n\t\titem !== null &&\n\t\t\"uri\" in item &&\n\t\t\"cid\" in item &&\n\t\t\"author\" in item &&\n\t\t\"record\" in item &&\n\t\t\"indexedAt\" in item &&\n\t\ttypeof (item as AppBskyFeedDefs.PostView).uri === \"string\" &&\n\t\ttypeof (item as AppBskyFeedDefs.PostView).cid === \"string\"\n\t);\n}\n\nfunction isReplyWithPostViews(\n\treply: AppBskyFeedDefs.ReplyRef | null | undefined,\n): reply is {\n\troot: AppBskyFeedDefs.PostView;\n\tparent: AppBskyFeedDefs.PostView;\n} {\n\treturn (\n\t\ttypeof reply === \"object\" &&\n\t\treply !== null &&\n\t\t\"root\" in reply &&\n\t\t\"parent\" in reply &&\n\t\tisPostView(reply.root) &&\n\t\tisPostView(reply.parent)\n\t);\n}\n\nfunction adaptPostView(postView: AppBskyFeedDefs.PostView): BlueSkyPost {\n\tconst author = postView.author as ATProtocolProfileViewExtended;\n\tconst record = postView.record as ATProtocolPostRecord;\n\n\treturn {\n\t\turi: postView.uri,\n\t\tcid: postView.cid,\n\t\tauthor: {\n\t\t\tdid: author.did,\n\t\t\thandle: author.handle,\n\t\t\tdisplayName: author.displayName,\n\t\t\tdescription: author.description,\n\t\t\tavatar: author.avatar,\n\t\t\tbanner: author.banner,\n\t\t\tfollowersCount: author.followersCount,\n\t\t\tfollowsCount: author.followsCount,\n\t\t\tpostsCount: author.postsCount,\n\t\t\tindexedAt: author.indexedAt,\n\t\t\tcreatedAt: author.createdAt,\n\t\t},\n\t\trecord: {\n\t\t\t$type: record.$type ?? \"app.bsky.feed.post\",\n\t\t\ttext: record.text ?? \"\",\n\t\t\tfacets: record.facets as PostFacet[] | undefined,\n\t\t\tembed: record.embed as PostEmbed | undefined,\n\t\t\tcreatedAt: record.createdAt ?? \"\",\n\t\t},\n\t\tembed: postView.embed as PostEmbed | undefined,\n\t\treplyCount: postView.replyCount,\n\t\trepostCount: postView.repostCount,\n\t\tlikeCount: postView.likeCount,\n\t\tquoteCount: postView.quoteCount,\n\t\tindexedAt: postView.indexedAt,\n\t};\n}\n\nexport interface BlueSkyClientConfig {\n\tservice: string;\n\thandle: string;\n\tpassword: string;\n\tdryRun: boolean;\n}\n\nexport class BlueSkyClient {\n\tprivate readonly agent: BskyAgent;\n\tprivate session: BlueSkySession | null = null;\n\tprivate readonly profileCache: LRUCache<string, BlueSkyProfile>;\n\n\tconstructor(private readonly config: BlueSkyClientConfig) {\n\t\tthis.agent = new BskyAgent({ service: config.service });\n\t\tthis.profileCache = new LRUCache({\n\t\t\tmax: CACHE_SIZE.PROFILE,\n\t\t\tttl: CACHE_TTL.PROFILE,\n\t\t});\n\t}\n\n\tasync authenticate(): Promise<BlueSkySession> {\n\t\tconst response = await this.agent.login({\n\t\t\tidentifier: this.config.handle,\n\t\t\tpassword: this.config.password,\n\t\t});\n\n\t\tif (!response.success) {\n\t\t\tthrow new BlueSkyError(\"Authentication failed\", \"AUTH_FAILED\");\n\t\t}\n\n\t\tthis.session = {\n\t\t\tdid: response.data.did,\n\t\t\thandle: response.data.handle,\n\t\t\temail: response.data.email,\n\t\t\taccessJwt: response.data.accessJwt,\n\t\t\trefreshJwt: response.data.refreshJwt,\n\t\t};\n\n\t\tlogger.info(`Authenticated with BlueSky: ${this.session.handle}`);\n\t\treturn this.session;\n\t}\n\n\tgetSession(): BlueSkySession | null {\n\t\treturn this.session;\n\t}\n\n\tasync getProfile(handle: string): Promise<BlueSkyProfile> {\n\t\tconst cached = this.profileCache.get(handle);\n\t\tif (cached) return cached;\n\n\t\tconst response = await this.agent.getProfile({ actor: handle });\n\t\tconst profile: BlueSkyProfile = {\n\t\t\tdid: response.data.did,\n\t\t\thandle: response.data.handle,\n\t\t\tdisplayName: response.data.displayName,\n\t\t\tdescription: response.data.description,\n\t\t\tavatar: response.data.avatar,\n\t\t\tbanner: response.data.banner,\n\t\t\tfollowersCount: response.data.followersCount,\n\t\t\tfollowsCount: response.data.followsCount,\n\t\t\tpostsCount: response.data.postsCount,\n\t\t\tindexedAt: response.data.indexedAt,\n\t\t\tcreatedAt: response.data.createdAt,\n\t\t};\n\n\t\tthis.profileCache.set(handle, profile);\n\t\treturn profile;\n\t}\n\n\tasync getTimeline(params: TimelineRequest = {}): Promise<TimelineResponse> {\n\t\tconst response = await this.agent.getTimeline({\n\t\t\talgorithm: params.algorithm,\n\t\t\tlimit: params.limit ?? 50,\n\t\t\tcursor: params.cursor,\n\t\t});\n\n\t\treturn {\n\t\t\tcursor: response.data.cursor,\n\t\t\tfeed: response.data.feed.map((item) => {\n\t\t\t\tconst reply = isReplyWithPostViews(item.reply)\n\t\t\t\t\t? {\n\t\t\t\t\t\t\troot: adaptPostView(item.reply.root),\n\t\t\t\t\t\t\tparent: adaptPostView(item.reply.parent),\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined;\n\n\t\t\t\treturn {\n\t\t\t\t\tpost: adaptPostView(item.post),\n\t\t\t\t\treply,\n\t\t\t\t\treason: item.reason as Record<\n\t\t\t\t\t\tstring,\n\t\t\t\t\t\tstring | number | boolean | object | null | undefined\n\t\t\t\t\t>,\n\t\t\t\t};\n\t\t\t}),\n\t\t};\n\t}\n\n\tasync sendPost(request: CreatePostRequest): Promise<BlueSkyPost> {\n\t\tif (this.config.dryRun) {\n\t\t\tlogger.info(\n\t\t\t\t`Dry run: would create post with text: ${request.content.text}`,\n\t\t\t);\n\t\t\treturn this.mockPost(request.content.text);\n\t\t}\n\n\t\tconst rt = new RichText({ text: request.content.text });\n\t\tawait rt.detectFacets(this.agent);\n\n\t\tconst record: Record<\n\t\t\tstring,\n\t\t\t| string\n\t\t\t| PostFacet[]\n\t\t\t| PostEmbed\n\t\t\t| {\n\t\t\t\t\troot: { uri: string; cid: string };\n\t\t\t\t\tparent: { uri: string; cid: string };\n\t\t\t }\n\t\t> = {\n\t\t\t$type: \"app.bsky.feed.post\",\n\t\t\ttext: rt.text,\n\t\t\tfacets: rt.facets as PostFacet[],\n\t\t\tcreatedAt: new Date().toISOString(),\n\t\t};\n\n\t\tif (request.replyTo) {\n\t\t\trecord.reply = { root: request.replyTo, parent: request.replyTo };\n\t\t}\n\n\t\tif (request.content.embed) {\n\t\t\trecord.embed = request.content.embed;\n\t\t}\n\n\t\tconst response = await this.agent.post(record);\n\t\tconst thread = await this.agent.getPostThread({\n\t\t\turi: response.uri,\n\t\t\tdepth: 0,\n\t\t});\n\n\t\tif (thread.data.thread.$type !== \"app.bsky.feed.defs#threadViewPost\") {\n\t\t\tthrow new BlueSkyError(\n\t\t\t\t\"Failed to retrieve created post\",\n\t\t\t\t\"POST_CREATE_FAILED\",\n\t\t\t);\n\t\t}\n\n\t\tconst threadViewPost = thread.data.thread as AppBskyFeedDefs.ThreadViewPost;\n\t\treturn adaptPostView(threadViewPost.post);\n\t}\n\n\tasync deletePost(uri: string): Promise<void> {\n\t\tif (this.config.dryRun) {\n\t\t\tlogger.info(`Dry run: would delete post: ${uri}`);\n\t\t\treturn;\n\t\t}\n\t\tawait this.agent.deletePost(uri);\n\t}\n\n\tasync likePost(uri: string, cid: string): Promise<void> {\n\t\tif (this.config.dryRun) {\n\t\t\tlogger.info(`Dry run: would like post: ${uri}`);\n\t\t\treturn;\n\t\t}\n\t\tawait this.agent.like(uri, cid);\n\t}\n\n\tasync repost(uri: string, cid: string): Promise<void> {\n\t\tif (this.config.dryRun) {\n\t\t\tlogger.info({ uri }, \"Dry run: would repost\");\n\t\t\treturn;\n\t\t}\n\t\tawait this.agent.repost(uri, cid);\n\t}\n\n\tasync getNotifications(\n\t\tlimit = 50,\n\t\tcursor?: string,\n\t): Promise<{\n\t\tnotifications: BlueSkyNotification[];\n\t\tcursor?: string;\n\t}> {\n\t\tconst response = await this.agent.listNotifications({ limit, cursor });\n\t\treturn {\n\t\t\tnotifications: response.data.notifications as BlueSkyNotification[],\n\t\t\tcursor: response.data.cursor,\n\t\t};\n\t}\n\n\tasync updateSeenNotifications(): Promise<void> {\n\t\tawait this.agent.updateSeenNotifications();\n\t}\n\n\tasync getConversations(\n\t\tlimit = 50,\n\t\tcursor?: string,\n\t): Promise<{\n\t\tconversations: BlueSkyConversation[];\n\t\tcursor?: string;\n\t}> {\n\t\tconst response = await this.agent.api.chat.bsky.convo.listConvos(\n\t\t\t{ limit, cursor },\n\t\t\t{ headers: { \"atproto-proxy\": BLUESKY_CHAT_SERVICE_DID } },\n\t\t);\n\t\treturn {\n\t\t\tconversations: response.data.convos as BlueSkyConversation[],\n\t\t\tcursor: response.data.cursor,\n\t\t};\n\t}\n\n\tasync getMessages(\n\t\tconvoId: string,\n\t\tlimit = 50,\n\t\tcursor?: string,\n\t): Promise<{\n\t\tmessages: BlueSkyMessage[];\n\t\tcursor?: string;\n\t}> {\n\t\tconst response = await this.agent.api.chat.bsky.convo.getMessages(\n\t\t\t{ convoId, limit, cursor },\n\t\t\t{ headers: { \"atproto-proxy\": BLUESKY_CHAT_SERVICE_DID } },\n\t\t);\n\t\treturn {\n\t\t\tmessages: response.data.messages as BlueSkyMessage[],\n\t\t\tcursor: response.data.cursor,\n\t\t};\n\t}\n\n\tasync sendMessage(request: SendMessageRequest): Promise<BlueSkyMessage> {\n\t\tif (this.config.dryRun) {\n\t\t\tlogger.info({ convoId: request.convoId }, \"Dry run: would send message\");\n\t\t\treturn this.mockMessage(request.message.text ?? \"\");\n\t\t}\n\n\t\tconst response = await this.agent.api.chat.bsky.convo.sendMessage(\n\t\t\t{\n\t\t\t\tconvoId: request.convoId,\n\t\t\t\tmessage: { text: request.message.text ?? \"\" },\n\t\t\t},\n\t\t\t{ headers: { \"atproto-proxy\": BLUESKY_CHAT_SERVICE_DID } },\n\t\t);\n\t\treturn response.data as BlueSkyMessage;\n\t}\n\n\tasync cleanup(): Promise<void> {\n\t\tthis.profileCache.clear();\n\t\tthis.session = null;\n\t}\n\n\tprivate mockPost(text: string): BlueSkyPost {\n\t\tconst now = new Date().toISOString();\n\t\treturn {\n\t\t\turi: `mock://post/${Date.now()}`,\n\t\t\tcid: `mock-cid-${Date.now()}`,\n\t\t\tauthor: {\n\t\t\t\tdid: this.session?.did ?? \"did:plc:mock\",\n\t\t\t\thandle: this.session?.handle ?? \"mock.handle\",\n\t\t\t},\n\t\t\trecord: { $type: \"app.bsky.feed.post\", text, createdAt: now },\n\t\t\tindexedAt: now,\n\t\t};\n\t}\n\n\tprivate mockMessage(text: string): BlueSkyMessage {\n\t\treturn {\n\t\t\tid: `mock-msg-${Date.now()}`,\n\t\t\trev: \"1\",\n\t\t\ttext,\n\t\t\tsender: { did: this.session?.did ?? \"did:plc:mock\" },\n\t\t\tsentAt: new Date().toISOString(),\n\t\t};\n\t}\n}\n",
8
+ "import type { IAgentRuntime } from \"@elizaos/core\";\nimport { z } from \"zod\";\n\nexport const BLUESKY_SERVICE_URL = \"https://bsky.social\";\nexport const BLUESKY_MAX_POST_LENGTH = 300;\nexport const BLUESKY_POLL_INTERVAL = 60;\nexport const BLUESKY_POST_INTERVAL_MIN = 1800;\nexport const BLUESKY_POST_INTERVAL_MAX = 3600;\nexport const BLUESKY_ACTION_INTERVAL = 120;\nexport const BLUESKY_MAX_ACTIONS = 5;\nexport const BLUESKY_CHAT_SERVICE_DID = \"did:web:api.bsky.chat\";\nexport const BLUESKY_SERVICE_NAME = \"bluesky\";\n\nexport const AT_PROTOCOL_HANDLE_REGEX =\n\t/^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/;\n\nexport const CACHE_TTL = {\n\tPROFILE: 3600000,\n\tTIMELINE: 300000,\n\tPOST: 1800000,\n\tNOTIFICATIONS: 300000,\n\tCONVERSATIONS: 300000,\n} as const;\n\nexport const CACHE_SIZE = {\n\tPROFILE: 1000,\n\tTIMELINE: 500,\n\tPOST: 10000,\n\tNOTIFICATIONS: 1000,\n\tCONVERSATIONS: 100,\n} as const;\n\nexport const BlueSkyConfigSchema = z.object({\n\thandle: z.string().regex(AT_PROTOCOL_HANDLE_REGEX, \"Invalid handle format\"),\n\tpassword: z.string().min(1),\n\tservice: z.string().url().default(BLUESKY_SERVICE_URL),\n\tdryRun: z.boolean().default(false),\n\tpollInterval: z.number().positive().default(BLUESKY_POLL_INTERVAL),\n\tenablePost: z.boolean().default(true),\n\tpostIntervalMin: z.number().positive().default(BLUESKY_POST_INTERVAL_MIN),\n\tpostIntervalMax: z.number().positive().default(BLUESKY_POST_INTERVAL_MAX),\n\tenableActionProcessing: z.boolean().default(true),\n\tactionInterval: z.number().positive().default(BLUESKY_ACTION_INTERVAL),\n\tpostImmediately: z.boolean().default(false),\n\tmaxActionsProcessing: z.number().positive().default(BLUESKY_MAX_ACTIONS),\n\tenableDMs: z.boolean().default(true),\n});\n\nexport type BlueSkyConfig = z.infer<typeof BlueSkyConfigSchema>;\n\nexport interface BlueSkyProfile {\n\tdid: string;\n\thandle: string;\n\tdisplayName?: string;\n\tdescription?: string;\n\tavatar?: string;\n\tbanner?: string;\n\tfollowersCount?: number;\n\tfollowsCount?: number;\n\tpostsCount?: number;\n\tindexedAt?: string;\n\tcreatedAt?: string;\n}\n\nexport interface PostFacet {\n\tindex: { byteStart: number; byteEnd: number };\n\tfeatures: Array<{\n\t\t$type?: string;\n\t\t[key: string]: string | number | boolean | object | null | undefined;\n\t}>;\n}\n\nexport interface PostEmbed {\n\t$type: string;\n\t[key: string]: string | number | boolean | object | null | undefined;\n}\n\nexport interface PostRecord {\n\t$type: string;\n\ttext: string;\n\tfacets?: PostFacet[];\n\tembed?: PostEmbed;\n\tcreatedAt: string;\n}\n\nexport interface BlueSkyPost {\n\turi: string;\n\tcid: string;\n\tauthor: BlueSkyProfile;\n\trecord: PostRecord;\n\tembed?: PostEmbed;\n\treplyCount?: number;\n\trepostCount?: number;\n\tlikeCount?: number;\n\tquoteCount?: number;\n\tindexedAt: string;\n}\n\nexport interface TimelineRequest {\n\talgorithm?: string;\n\tlimit?: number;\n\tcursor?: string;\n}\n\nexport interface TimelineFeedItem {\n\tpost: BlueSkyPost;\n\treply?: {\n\t\troot: BlueSkyPost;\n\t\tparent: BlueSkyPost;\n\t};\n\treason?: Record<\n\t\tstring,\n\t\tstring | number | boolean | object | null | undefined\n\t>;\n}\n\nexport interface TimelineResponse {\n\tcursor?: string;\n\tfeed: TimelineFeedItem[];\n}\n\nexport interface CreatePostRequest {\n\tcontent: {\n\t\ttext: string;\n\t\tfacets?: PostFacet[];\n\t\tembed?: PostEmbed;\n\t};\n\treplyTo?: { uri: string; cid: string };\n}\n\nexport type NotificationReason =\n\t| \"mention\"\n\t| \"reply\"\n\t| \"follow\"\n\t| \"like\"\n\t| \"repost\"\n\t| \"quote\";\n\nexport interface BlueSkyNotification {\n\turi: string;\n\tcid: string;\n\tauthor: BlueSkyProfile;\n\treason: NotificationReason;\n\treasonSubject?: string;\n\trecord: Record<string, string | number | boolean | object | null | undefined>;\n\tisRead: boolean;\n\tindexedAt: string;\n}\n\nexport interface BlueSkyMessage {\n\tid: string;\n\trev: string;\n\ttext?: string;\n\tembed?: PostEmbed;\n\tsender: { did: string };\n\tsentAt: string;\n}\n\nexport interface BlueSkyConversation {\n\tid: string;\n\trev: string;\n\tmembers: Array<{\n\t\tdid: string;\n\t\thandle?: string;\n\t\tdisplayName?: string;\n\t\tavatar?: string;\n\t}>;\n\tlastMessage?: BlueSkyMessage;\n\tunreadCount: number;\n\tmuted: boolean;\n}\n\nexport interface SendMessageRequest {\n\tconvoId: string;\n\tmessage: { text?: string; embed?: PostEmbed };\n}\n\nexport interface BlueSkySession {\n\tdid: string;\n\thandle: string;\n\temail?: string;\n\taccessJwt: string;\n\trefreshJwt: string;\n}\n\nexport class BlueSkyError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly code: string,\n\t\tpublic readonly status?: number,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"BlueSkyError\";\n\t}\n}\n\nexport interface ATProtocolPostRecord {\n\t$type: string;\n\ttext: string;\n\tfacets?: PostFacet[];\n\tembed?: PostEmbed;\n\tcreatedAt: string;\n\t[k: string]:\n\t\t| string\n\t\t| PostFacet[]\n\t\t| PostEmbed\n\t\t| number\n\t\t| boolean\n\t\t| null\n\t\t| undefined;\n}\n\nexport interface ATProtocolProfileViewExtended {\n\tdid: string;\n\thandle: string;\n\tdisplayName?: string;\n\tdescription?: string;\n\tavatar?: string;\n\tbanner?: string;\n\tfollowersCount?: number;\n\tfollowsCount?: number;\n\tpostsCount?: number;\n\tindexedAt?: string;\n\tcreatedAt?: string;\n\t[k: string]: string | number | undefined;\n}\n\nexport interface BlueSkyEventPayload {\n\truntime: IAgentRuntime;\n\tsource: \"bluesky\";\n}\n\nexport interface BlueSkyNotificationEventPayload extends BlueSkyEventPayload {\n\tnotification: BlueSkyNotification;\n}\n\nexport interface BlueSkyCreatePostEventPayload extends BlueSkyEventPayload {\n\tautomated: boolean;\n}\n",
9
+ "import { type IAgentRuntime, logger } from \"@elizaos/core\";\nimport type { BlueSkyClient } from \"../client\";\nimport type {\n\tBlueSkyConfig,\n\tBlueSkyCreatePostEventPayload,\n\tBlueSkyNotification,\n\tBlueSkyNotificationEventPayload,\n\tNotificationReason,\n} from \"../types\";\nimport {\n\tgetActionInterval,\n\tgetMaxActionsProcessing,\n\tgetPollInterval,\n\tgetPostIntervalRange,\n\tisPostingEnabled,\n\tshouldPostImmediately,\n} from \"../utils/config\";\n\nexport class BlueSkyAgentManager {\n\tprivate pollTimer: ReturnType<typeof setInterval> | null = null;\n\tprivate actionTimer: ReturnType<typeof setInterval> | null = null;\n\tprivate postTimer: ReturnType<typeof setTimeout> | null = null;\n\tprivate running = false;\n\tprivate lastSeenAt: string | null = null;\n\n\tconstructor(\n\t\tpublic readonly runtime: IAgentRuntime,\n\t\tpublic readonly config: BlueSkyConfig,\n\t\tpublic readonly client: BlueSkyClient,\n\t) {}\n\n\tasync start(): Promise<void> {\n\t\tif (this.running) return;\n\n\t\tawait this.client.authenticate();\n\t\tthis.running = true;\n\n\t\tthis.startNotificationPolling();\n\n\t\tif (this.config.enableActionProcessing) {\n\t\t\tthis.startActionProcessing();\n\t\t}\n\n\t\tif (isPostingEnabled(this.runtime)) {\n\t\t\tthis.startAutomatedPosting();\n\t\t}\n\n\t\tlogger.success(\n\t\t\t{ agentId: this.runtime.agentId },\n\t\t\t\"BlueSky agent manager started\",\n\t\t);\n\t}\n\n\tasync stop(): Promise<void> {\n\t\tthis.running = false;\n\n\t\tif (this.pollTimer) clearInterval(this.pollTimer);\n\t\tif (this.actionTimer) clearInterval(this.actionTimer);\n\t\tif (this.postTimer) clearTimeout(this.postTimer);\n\n\t\tthis.pollTimer = null;\n\t\tthis.actionTimer = null;\n\t\tthis.postTimer = null;\n\n\t\tawait this.client.cleanup();\n\t\tlogger.info(\n\t\t\t{ agentId: this.runtime.agentId },\n\t\t\t\"BlueSky agent manager stopped\",\n\t\t);\n\t}\n\n\tprivate startNotificationPolling(): void {\n\t\tconst interval = getPollInterval(this.runtime);\n\t\tthis.pollNotifications();\n\t\tthis.pollTimer = setInterval(() => this.pollNotifications(), interval);\n\t}\n\n\tprivate async pollNotifications(): Promise<void> {\n\t\tif (!this.running) return;\n\n\t\tconst { notifications } = await this.client.getNotifications(50);\n\t\tif (notifications.length === 0) return;\n\n\t\tconst newNotifications = this.lastSeenAt\n\t\t\t? notifications.filter((n) => {\n\t\t\t\t\tconst lastSeen = this.lastSeenAt;\n\t\t\t\t\treturn lastSeen !== null && n.indexedAt > lastSeen;\n\t\t\t\t})\n\t\t\t: notifications;\n\n\t\tif (newNotifications.length > 0) {\n\t\t\tthis.lastSeenAt = notifications[0].indexedAt;\n\n\t\t\tfor (const notification of newNotifications) {\n\t\t\t\tthis.emitNotificationEvent(notification);\n\t\t\t}\n\n\t\t\tawait this.client.updateSeenNotifications();\n\t\t}\n\t}\n\n\tprivate emitNotificationEvent(notification: BlueSkyNotification): void {\n\t\tconst eventMap: Record<NotificationReason, string> = {\n\t\t\tmention: \"bluesky.mention_received\",\n\t\t\treply: \"bluesky.mention_received\",\n\t\t\tfollow: \"bluesky.follow_received\",\n\t\t\tlike: \"bluesky.like_received\",\n\t\t\trepost: \"bluesky.repost_received\",\n\t\t\tquote: \"bluesky.quote_received\",\n\t\t};\n\n\t\tconst event = eventMap[notification.reason];\n\t\tif (event) {\n\t\t\tconst payload: BlueSkyNotificationEventPayload = {\n\t\t\t\truntime: this.runtime,\n\t\t\t\tsource: \"bluesky\",\n\t\t\t\tnotification,\n\t\t\t};\n\t\t\tvoid this.runtime.emitEvent(event, payload);\n\t\t}\n\t}\n\n\tprivate startActionProcessing(): void {\n\t\tconst interval = getActionInterval(this.runtime);\n\t\tthis.processActions();\n\t\tthis.actionTimer = setInterval(() => this.processActions(), interval);\n\t}\n\n\tprivate async processActions(): Promise<void> {\n\t\tif (!this.running) return;\n\n\t\tconst max = getMaxActionsProcessing(this.runtime);\n\t\tconst { notifications } = await this.client.getNotifications(max);\n\n\t\tfor (const notification of notifications) {\n\t\t\tif (\n\t\t\t\tnotification.reason === \"mention\" ||\n\t\t\t\tnotification.reason === \"reply\"\n\t\t\t) {\n\t\t\t\tconst payload: BlueSkyNotificationEventPayload = {\n\t\t\t\t\truntime: this.runtime,\n\t\t\t\t\tsource: \"bluesky\",\n\t\t\t\t\tnotification,\n\t\t\t\t};\n\t\t\t\tvoid this.runtime.emitEvent(\"bluesky.should_respond\", payload);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate startAutomatedPosting(): void {\n\t\tif (shouldPostImmediately(this.runtime)) {\n\t\t\tthis.createAutomatedPost();\n\t\t}\n\t\tthis.scheduleNextPost();\n\t}\n\n\tprivate scheduleNextPost(): void {\n\t\tconst { min, max } = getPostIntervalRange(this.runtime);\n\t\tconst interval = Math.random() * (max - min) + min;\n\n\t\tthis.postTimer = setTimeout(() => {\n\t\t\tif (this.running) {\n\t\t\t\tthis.createAutomatedPost();\n\t\t\t\tthis.scheduleNextPost();\n\t\t\t}\n\t\t}, interval);\n\t}\n\n\tprivate createAutomatedPost(): void {\n\t\tconst payload: BlueSkyCreatePostEventPayload = {\n\t\t\truntime: this.runtime,\n\t\t\tsource: \"bluesky\",\n\t\t\tautomated: true,\n\t\t};\n\t\tvoid this.runtime.emitEvent(\"bluesky.create_post\", payload);\n\t}\n}\n",
10
+ "import type { IAgentRuntime } from \"@elizaos/core\";\nimport {\n\tBLUESKY_ACTION_INTERVAL,\n\tBLUESKY_MAX_ACTIONS,\n\tBLUESKY_POLL_INTERVAL,\n\tBLUESKY_POST_INTERVAL_MAX,\n\tBLUESKY_POST_INTERVAL_MIN,\n\tBLUESKY_SERVICE_URL,\n\ttype BlueSkyConfig,\n\tBlueSkyConfigSchema,\n} from \"../types\";\n\nexport type { BlueSkyConfig };\n\nexport function getApiKeyOptional(\n\truntime: IAgentRuntime,\n\tkey: string,\n): string | undefined {\n\tconst value = runtime.getSetting(key);\n\treturn typeof value === \"string\" ? value : undefined;\n}\n\nexport function hasBlueSkyEnabled(runtime: IAgentRuntime): boolean {\n\tconst enabled = runtime.getSetting(\"BLUESKY_ENABLED\");\n\tif (enabled) return String(enabled).toLowerCase() === \"true\";\n\treturn Boolean(\n\t\truntime.getSetting(\"BLUESKY_HANDLE\") &&\n\t\t\truntime.getSetting(\"BLUESKY_PASSWORD\"),\n\t);\n}\n\nexport function validateBlueSkyConfig(runtime: IAgentRuntime): BlueSkyConfig {\n\tconst result = BlueSkyConfigSchema.safeParse({\n\t\thandle: String(runtime.getSetting(\"BLUESKY_HANDLE\") ?? \"\"),\n\t\tpassword: String(runtime.getSetting(\"BLUESKY_PASSWORD\") ?? \"\"),\n\t\tservice: String(\n\t\t\truntime.getSetting(\"BLUESKY_SERVICE\") ?? BLUESKY_SERVICE_URL,\n\t\t),\n\t\tdryRun: runtime.getSetting(\"BLUESKY_DRY_RUN\") === \"true\",\n\t\tpollInterval:\n\t\t\tparseInt(String(runtime.getSetting(\"BLUESKY_POLL_INTERVAL\") ?? \"\"), 10) ||\n\t\t\tBLUESKY_POLL_INTERVAL,\n\t\tenablePost: runtime.getSetting(\"BLUESKY_ENABLE_POSTING\") !== \"false\",\n\t\tpostIntervalMin:\n\t\t\tparseInt(\n\t\t\t\tString(runtime.getSetting(\"BLUESKY_POST_INTERVAL_MIN\") ?? \"\"),\n\t\t\t\t10,\n\t\t\t) || BLUESKY_POST_INTERVAL_MIN,\n\t\tpostIntervalMax:\n\t\t\tparseInt(\n\t\t\t\tString(runtime.getSetting(\"BLUESKY_POST_INTERVAL_MAX\") ?? \"\"),\n\t\t\t\t10,\n\t\t\t) || BLUESKY_POST_INTERVAL_MAX,\n\t\tenableActionProcessing:\n\t\t\truntime.getSetting(\"BLUESKY_ENABLE_ACTION_PROCESSING\") !== \"false\",\n\t\tactionInterval:\n\t\t\tparseInt(\n\t\t\t\tString(runtime.getSetting(\"BLUESKY_ACTION_INTERVAL\") ?? \"\"),\n\t\t\t\t10,\n\t\t\t) || BLUESKY_ACTION_INTERVAL,\n\t\tpostImmediately: runtime.getSetting(\"BLUESKY_POST_IMMEDIATELY\") === \"true\",\n\t\tmaxActionsProcessing:\n\t\t\tparseInt(\n\t\t\t\tString(runtime.getSetting(\"BLUESKY_MAX_ACTIONS_PROCESSING\") ?? \"\"),\n\t\t\t\t10,\n\t\t\t) || BLUESKY_MAX_ACTIONS,\n\t\tenableDMs: runtime.getSetting(\"BLUESKY_ENABLE_DMS\") !== \"false\",\n\t});\n\n\tif (!result.success) {\n\t\tconst errors =\n\t\t\t(\n\t\t\t\tresult.error as { errors?: { path: string[]; message: string }[] }\n\t\t\t).errors\n\t\t\t\t?.map((e) => `${e.path.join(\".\")}: ${e.message}`)\n\t\t\t\t.join(\", \") || result.error.toString();\n\t\tthrow new Error(`Invalid BlueSky configuration: ${errors}`);\n\t}\n\n\treturn result.data;\n}\n\nexport function getPollInterval(runtime: IAgentRuntime): number {\n\tconst seconds =\n\t\tparseInt(String(runtime.getSetting(\"BLUESKY_POLL_INTERVAL\") ?? \"\"), 10) ||\n\t\tBLUESKY_POLL_INTERVAL;\n\treturn seconds * 1000;\n}\n\nexport function getActionInterval(runtime: IAgentRuntime): number {\n\tconst seconds =\n\t\tparseInt(String(runtime.getSetting(\"BLUESKY_ACTION_INTERVAL\") ?? \"\"), 10) ||\n\t\tBLUESKY_ACTION_INTERVAL;\n\treturn seconds * 1000;\n}\n\nexport function getMaxActionsProcessing(runtime: IAgentRuntime): number {\n\treturn (\n\t\tparseInt(\n\t\t\tString(runtime.getSetting(\"BLUESKY_MAX_ACTIONS_PROCESSING\") ?? \"\"),\n\t\t\t10,\n\t\t) || BLUESKY_MAX_ACTIONS\n\t);\n}\n\nexport function isPostingEnabled(runtime: IAgentRuntime): boolean {\n\treturn runtime.getSetting(\"BLUESKY_ENABLE_POSTING\") !== \"false\";\n}\n\nexport function shouldPostImmediately(runtime: IAgentRuntime): boolean {\n\treturn runtime.getSetting(\"BLUESKY_POST_IMMEDIATELY\") === \"true\";\n}\n\nexport function getPostIntervalRange(runtime: IAgentRuntime): {\n\tmin: number;\n\tmax: number;\n} {\n\tconst min =\n\t\tparseInt(\n\t\t\tString(runtime.getSetting(\"BLUESKY_POST_INTERVAL_MIN\") ?? \"\"),\n\t\t\t10,\n\t\t) || BLUESKY_POST_INTERVAL_MIN;\n\tconst max =\n\t\tparseInt(\n\t\t\tString(runtime.getSetting(\"BLUESKY_POST_INTERVAL_MAX\") ?? \"\"),\n\t\t\t10,\n\t\t) || BLUESKY_POST_INTERVAL_MAX;\n\treturn { min: min * 1000, max: max * 1000 };\n}\n",
11
+ "import { composePrompt, type IAgentRuntime, ModelType } from \"@elizaos/core\";\nimport type { BlueSkyClient } from \"../client\";\nimport { generateDmTemplate } from \"../generated/prompts/typescript/prompts.js\";\nimport type { BlueSkyConversation, BlueSkyMessage } from \"../types\";\n\nexport class BlueSkyMessageService {\n\tstatic serviceType = \"IMessageService\";\n\n\tconstructor(\n\t\tprivate readonly client: BlueSkyClient,\n\t\tprivate readonly runtime: IAgentRuntime,\n\t) {}\n\n\tasync getMessages(convoId: string, limit = 50): Promise<BlueSkyMessage[]> {\n\t\tconst response = await this.client.getMessages(convoId, limit);\n\t\treturn response.messages;\n\t}\n\n\tasync sendMessage(convoId: string, text: string): Promise<BlueSkyMessage> {\n\t\tconst messageText = text.trim() || (await this.generateReply());\n\t\treturn this.client.sendMessage({ convoId, message: { text: messageText } });\n\t}\n\n\tasync getConversations(limit = 50): Promise<BlueSkyConversation[]> {\n\t\tconst response = await this.client.getConversations(limit);\n\t\treturn response.conversations;\n\t}\n\n\tprivate async generateReply(): Promise<string> {\n\t\tconst prompt = composePrompt({\n\t\t\tstate: {},\n\t\t\ttemplate: generateDmTemplate,\n\t\t});\n\t\tconst response = await this.runtime.useModel(ModelType.TEXT_SMALL, {\n\t\t\tprompt,\n\t\t\tmaxTokens: 50,\n\t\t});\n\t\treturn response as string;\n\t}\n}\n",
12
+ "/**\n * Auto-generated prompt templates\n * DO NOT EDIT - Generated from ../../../../prompts/*.txt\n *\n * These prompts use Handlebars-style template syntax:\n * - {{variableName}} for simple substitution\n * - {{#each items}}...{{/each}} for iteration\n * - {{#if condition}}...{{/if}} for conditionals\n */\n\nexport const generateDmTemplate = `Generate a friendly direct message response under 200 characters.`;\n\nexport const GENERATE_DM_TEMPLATE = generateDmTemplate;\n\nexport const generatePostTemplate = `Generate an engaging BlueSky post under {{maxLength}} characters.`;\n\nexport const GENERATE_POST_TEMPLATE = generatePostTemplate;\n\nexport const truncatePostTemplate = `Shorten to under {{maxLength}} characters: \"{{text}}\"`;\n\nexport const TRUNCATE_POST_TEMPLATE = truncatePostTemplate;\n",
13
+ "import { composePrompt, type IAgentRuntime, ModelType } from \"@elizaos/core\";\nimport type { BlueSkyClient } from \"../client\";\nimport {\n\tgeneratePostTemplate,\n\ttruncatePostTemplate,\n} from \"../generated/prompts/typescript/prompts.js\";\nimport type { BlueSkyPost, CreatePostRequest } from \"../types\";\nimport { BLUESKY_MAX_POST_LENGTH } from \"../types\";\n\nexport class BlueSkyPostService {\n\tstatic serviceType = \"IPostService\";\n\n\tconstructor(\n\t\tprivate readonly client: BlueSkyClient,\n\t\tprivate readonly runtime: IAgentRuntime,\n\t) {}\n\n\tasync getPosts(limit = 50, cursor?: string): Promise<BlueSkyPost[]> {\n\t\tconst response = await this.client.getTimeline({ limit, cursor });\n\t\treturn response.feed.map((item) => item.post);\n\t}\n\n\tasync createPost(\n\t\ttext: string,\n\t\treplyTo?: { uri: string; cid: string },\n\t): Promise<BlueSkyPost> {\n\t\tlet postText = text.trim() || (await this.generateContent());\n\n\t\tif (postText.length > BLUESKY_MAX_POST_LENGTH) {\n\t\t\tpostText = await this.truncate(postText);\n\t\t}\n\n\t\tconst request: CreatePostRequest = {\n\t\t\tcontent: { text: postText },\n\t\t\treplyTo,\n\t\t};\n\n\t\treturn this.client.sendPost(request);\n\t}\n\n\tasync deletePost(uri: string): Promise<void> {\n\t\tawait this.client.deletePost(uri);\n\t}\n\n\tprivate async generateContent(): Promise<string> {\n\t\tconst prompt = composePrompt({\n\t\t\tstate: {\n\t\t\t\tmaxLength: String(BLUESKY_MAX_POST_LENGTH),\n\t\t\t},\n\t\t\ttemplate: generatePostTemplate,\n\t\t});\n\t\tconst response = await this.runtime.useModel(ModelType.TEXT_SMALL, {\n\t\t\tprompt,\n\t\t\tmaxTokens: 100,\n\t\t});\n\t\treturn response as string;\n\t}\n\n\tprivate async truncate(text: string): Promise<string> {\n\t\tconst prompt = composePrompt({\n\t\t\tstate: {\n\t\t\t\tmaxLength: String(BLUESKY_MAX_POST_LENGTH),\n\t\t\t\ttext,\n\t\t\t},\n\t\t\ttemplate: truncatePostTemplate,\n\t\t});\n\t\tconst response = await this.runtime.useModel(ModelType.TEXT_SMALL, {\n\t\t\tprompt,\n\t\t\tmaxTokens: 100,\n\t\t});\n\t\tconst truncated = response as string;\n\t\treturn truncated.length > BLUESKY_MAX_POST_LENGTH\n\t\t\t? `${truncated.substring(0, BLUESKY_MAX_POST_LENGTH - 3)}...`\n\t\t\t: truncated;\n\t}\n}\n"
14
14
  ],
15
- "mappings": ";AACA,mBAAS;;;ACD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;AAAA,OAEM,KAAI,CAAC,SAAS,UAAU;AAAA,IAC7B,QAAO,IAAI,4BAA4B;AAAA;AAAA,EAGxC,UAAU,CAAC,cAAc;AAAA,EAEzB,OAAO;AACR;AAEA,IAAe;",
16
16
  "debugId": "8E1C17CA465481F364756E2164756E21",
17
17
  "names": []
18
18
  }
package/package.json CHANGED
@@ -1,191 +1,191 @@
1
1
  {
2
- "name": "@elizaos/plugin-bluesky",
3
- "version": "2.0.0-alpha.6",
4
- "description": "",
5
- "type": "module",
6
- "main": "dist/cjs/index.node.cjs",
7
- "module": "dist/node/index.node.js",
8
- "types": "dist/node/index.d.ts",
9
- "browser": "dist/browser/index.browser.js",
10
- "sideEffects": false,
11
- "repository": {
12
- "type": "git",
13
- "url": "git+https://github.com/elizaos/elizaos.git"
14
- },
15
- "exports": {
16
- "./package.json": "./package.json",
17
- ".": {
18
- "types": "./dist/node/index.d.ts",
19
- "browser": {
20
- "types": "./dist/browser/index.d.ts",
21
- "import": "./dist/browser/index.browser.js",
22
- "default": "./dist/browser/index.browser.js"
23
- },
24
- "node": {
25
- "types": "./dist/node/index.d.ts",
26
- "import": "./dist/node/index.node.js",
27
- "require": "./dist/cjs/index.node.cjs",
28
- "default": "./dist/node/index.node.js"
29
- },
30
- "default": "./dist/node/index.node.js"
31
- }
32
- },
33
- "files": [
34
- "dist"
35
- ],
36
- "keywords": [],
37
- "author": "elizaOS",
38
- "license": "MIT",
39
- "scripts": {
40
- "build": "bun run build.ts",
41
- "build:ts": "bun run build.ts",
42
- "dev": "bun --hot build.ts",
43
- "clean": "rm -rf dist .turbo node_modules",
44
- "test": "vitest run",
45
- "typecheck": "tsc --noEmit",
46
- "lint": "bunx @biomejs/biome check --write --unsafe .",
47
- "lint:check": "bunx @biomejs/biome check .",
48
- "format": "bunx @biomejs/biome format --write .",
49
- "format:check": "bunx @biomejs/biome format ."
50
- },
51
- "dependencies": {
52
- "@atproto/api": "^0.13.14",
53
- "@atproto/identity": "^0.4.4",
54
- "@atproto/lexicon": "^0.4.11",
55
- "@atproto/syntax": "^0.3.2",
56
- "@atproto/xrpc": "^0.6.4",
57
- "@elizaos/core": "2.0.0-alpha.3",
58
- "lru-cache": "^11.1.0",
59
- "zod": "^4.3.6"
60
- },
61
- "devDependencies": {
62
- "@biomejs/biome": "^2.3.11",
63
- "@types/node": "^25.0.3",
64
- "typescript": "^5.9.3"
65
- },
66
- "peerDependencies": {
67
- "@elizaos/core": "2.0.0-alpha.3"
68
- },
69
- "publishConfig": {
70
- "access": "public"
71
- },
72
- "agentConfig": {
73
- "pluginType": "elizaos:client:1.0.0",
74
- "pluginParameters": {
75
- "BLUESKY_ENABLED": {
76
- "type": "boolean",
77
- "description": "Enables or disables the BlueSky plugin.",
78
- "required": false,
79
- "default": true,
80
- "sensitive": false
81
- },
82
- "BLUESKY_DRY_RUN": {
83
- "type": "boolean",
84
- "description": "Enables or disables dry run mode when interacting with BlueSky; when true, operations are simulated but not executed.",
85
- "required": false,
86
- "default": false,
87
- "sensitive": false
88
- },
89
- "BLUESKY_HANDLE": {
90
- "type": "string",
91
- "description": "The BlueSky handle (username) for the agent account.",
92
- "required": true,
93
- "sensitive": false
94
- },
95
- "BLUESKY_PASSWORD": {
96
- "type": "string",
97
- "description": "The app password for authentication with BlueSky.",
98
- "required": true,
99
- "sensitive": true
100
- },
101
- "BLUESKY_SERVICE": {
102
- "type": "string",
103
- "description": "The BlueSky service URL (PDS instance).",
104
- "required": false,
105
- "default": "https://bsky.social",
106
- "sensitive": false
107
- },
108
- "BLUESKY_MAX_POST_LENGTH": {
109
- "type": "number",
110
- "description": "Maximum number of characters allowed in a BlueSky post.",
111
- "required": false,
112
- "default": 300,
113
- "sensitive": false
114
- },
115
- "BLUESKY_POLL_INTERVAL": {
116
- "type": "number",
117
- "description": "Polling interval in seconds for BlueSky operations such as fetching new notifications.",
118
- "required": false,
119
- "default": 60,
120
- "sensitive": false
121
- },
122
- "BLUESKY_ENABLE_POSTING": {
123
- "type": "boolean",
124
- "description": "Enables or disables the ability to post to BlueSky.",
125
- "required": false,
126
- "default": true,
127
- "sensitive": false
128
- },
129
- "BLUESKY_POST_INTERVAL_MIN": {
130
- "type": "number",
131
- "description": "Minimum interval in seconds between automated posts.",
132
- "required": false,
133
- "default": 1800,
134
- "sensitive": false
135
- },
136
- "BLUESKY_POST_INTERVAL_MAX": {
137
- "type": "number",
138
- "description": "Maximum interval in seconds between automated posts.",
139
- "required": false,
140
- "default": 3600,
141
- "sensitive": false
142
- },
143
- "BLUESKY_ENABLE_ACTION_PROCESSING": {
144
- "type": "boolean",
145
- "description": "Turns on or off automated action processing for BlueSky events.",
146
- "required": false,
147
- "default": true,
148
- "sensitive": false
149
- },
150
- "BLUESKY_ACTION_INTERVAL": {
151
- "type": "number",
152
- "description": "Interval in seconds between action-processing cycles.",
153
- "required": false,
154
- "default": 120,
155
- "sensitive": false
156
- },
157
- "BLUESKY_POST_IMMEDIATELY": {
158
- "type": "boolean",
159
- "description": "If true, posts are published immediately instead of waiting for a schedule.",
160
- "required": false,
161
- "default": false,
162
- "sensitive": false
163
- },
164
- "BLUESKY_MAX_ACTIONS_PROCESSING": {
165
- "type": "number",
166
- "description": "Maximum number of BlueSky actions to process in a single batch.",
167
- "required": false,
168
- "default": 5,
169
- "sensitive": false
170
- },
171
- "BLUESKY_ENABLE_DMS": {
172
- "type": "boolean",
173
- "description": "Enable processing of direct messages via the chat.bsky API.",
174
- "required": false,
175
- "default": true,
176
- "sensitive": false
177
- }
178
- }
179
- },
180
- "milaidy": {
181
- "platforms": [
182
- "browser",
183
- "node"
184
- ],
185
- "runtime": "both",
186
- "platformDetails": {
187
- "browser": "Browser-compatible build available via exports.browser",
188
- "node": "Node.js build available via exports.node"
189
- }
190
- }
2
+ "name": "@elizaos/plugin-bluesky",
3
+ "version": "2.0.0-alpha.7",
4
+ "description": "",
5
+ "type": "module",
6
+ "main": "dist/cjs/index.node.cjs",
7
+ "module": "dist/node/index.node.js",
8
+ "types": "dist/node/index.d.ts",
9
+ "browser": "dist/browser/index.browser.js",
10
+ "sideEffects": false,
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/elizaos/elizaos.git"
14
+ },
15
+ "exports": {
16
+ "./package.json": "./package.json",
17
+ ".": {
18
+ "types": "./dist/node/index.d.ts",
19
+ "browser": {
20
+ "types": "./dist/browser/index.d.ts",
21
+ "import": "./dist/browser/index.browser.js",
22
+ "default": "./dist/browser/index.browser.js"
23
+ },
24
+ "node": {
25
+ "types": "./dist/node/index.d.ts",
26
+ "import": "./dist/node/index.node.js",
27
+ "require": "./dist/cjs/index.node.cjs",
28
+ "default": "./dist/node/index.node.js"
29
+ },
30
+ "default": "./dist/node/index.node.js"
31
+ }
32
+ },
33
+ "files": [
34
+ "dist"
35
+ ],
36
+ "keywords": [],
37
+ "author": "elizaOS",
38
+ "license": "MIT",
39
+ "scripts": {
40
+ "build": "bun run build.ts",
41
+ "build:ts": "bun run build.ts",
42
+ "dev": "bun --hot build.ts",
43
+ "clean": "rm -rf dist .turbo node_modules",
44
+ "test": "vitest run --passWithNoTests",
45
+ "typecheck": "tsc --noEmit",
46
+ "lint": "bunx @biomejs/biome check --write --unsafe .",
47
+ "lint:check": "bunx @biomejs/biome check .",
48
+ "format": "bunx @biomejs/biome format --write .",
49
+ "format:check": "bunx @biomejs/biome format ."
50
+ },
51
+ "dependencies": {
52
+ "@atproto/api": "^0.13.14",
53
+ "@atproto/identity": "^0.4.4",
54
+ "@atproto/lexicon": "^0.4.11",
55
+ "@atproto/syntax": "^0.3.2",
56
+ "@atproto/xrpc": "^0.6.4",
57
+ "@elizaos/core": "2.0.0-alpha.3",
58
+ "lru-cache": "^11.1.0",
59
+ "zod": "^4.3.6"
60
+ },
61
+ "devDependencies": {
62
+ "@biomejs/biome": "^2.3.11",
63
+ "@types/node": "^25.0.3",
64
+ "typescript": "^5.9.3"
65
+ },
66
+ "peerDependencies": {
67
+ "@elizaos/core": "2.0.0-alpha.3"
68
+ },
69
+ "publishConfig": {
70
+ "access": "public"
71
+ },
72
+ "agentConfig": {
73
+ "pluginType": "elizaos:client:1.0.0",
74
+ "pluginParameters": {
75
+ "BLUESKY_ENABLED": {
76
+ "type": "boolean",
77
+ "description": "Enables or disables the BlueSky plugin.",
78
+ "required": false,
79
+ "default": true,
80
+ "sensitive": false
81
+ },
82
+ "BLUESKY_DRY_RUN": {
83
+ "type": "boolean",
84
+ "description": "Enables or disables dry run mode when interacting with BlueSky; when true, operations are simulated but not executed.",
85
+ "required": false,
86
+ "default": false,
87
+ "sensitive": false
88
+ },
89
+ "BLUESKY_HANDLE": {
90
+ "type": "string",
91
+ "description": "The BlueSky handle (username) for the agent account.",
92
+ "required": true,
93
+ "sensitive": false
94
+ },
95
+ "BLUESKY_PASSWORD": {
96
+ "type": "string",
97
+ "description": "The app password for authentication with BlueSky.",
98
+ "required": true,
99
+ "sensitive": true
100
+ },
101
+ "BLUESKY_SERVICE": {
102
+ "type": "string",
103
+ "description": "The BlueSky service URL (PDS instance).",
104
+ "required": false,
105
+ "default": "https://bsky.social",
106
+ "sensitive": false
107
+ },
108
+ "BLUESKY_MAX_POST_LENGTH": {
109
+ "type": "number",
110
+ "description": "Maximum number of characters allowed in a BlueSky post.",
111
+ "required": false,
112
+ "default": 300,
113
+ "sensitive": false
114
+ },
115
+ "BLUESKY_POLL_INTERVAL": {
116
+ "type": "number",
117
+ "description": "Polling interval in seconds for BlueSky operations such as fetching new notifications.",
118
+ "required": false,
119
+ "default": 60,
120
+ "sensitive": false
121
+ },
122
+ "BLUESKY_ENABLE_POSTING": {
123
+ "type": "boolean",
124
+ "description": "Enables or disables the ability to post to BlueSky.",
125
+ "required": false,
126
+ "default": true,
127
+ "sensitive": false
128
+ },
129
+ "BLUESKY_POST_INTERVAL_MIN": {
130
+ "type": "number",
131
+ "description": "Minimum interval in seconds between automated posts.",
132
+ "required": false,
133
+ "default": 1800,
134
+ "sensitive": false
135
+ },
136
+ "BLUESKY_POST_INTERVAL_MAX": {
137
+ "type": "number",
138
+ "description": "Maximum interval in seconds between automated posts.",
139
+ "required": false,
140
+ "default": 3600,
141
+ "sensitive": false
142
+ },
143
+ "BLUESKY_ENABLE_ACTION_PROCESSING": {
144
+ "type": "boolean",
145
+ "description": "Turns on or off automated action processing for BlueSky events.",
146
+ "required": false,
147
+ "default": true,
148
+ "sensitive": false
149
+ },
150
+ "BLUESKY_ACTION_INTERVAL": {
151
+ "type": "number",
152
+ "description": "Interval in seconds between action-processing cycles.",
153
+ "required": false,
154
+ "default": 120,
155
+ "sensitive": false
156
+ },
157
+ "BLUESKY_POST_IMMEDIATELY": {
158
+ "type": "boolean",
159
+ "description": "If true, posts are published immediately instead of waiting for a schedule.",
160
+ "required": false,
161
+ "default": false,
162
+ "sensitive": false
163
+ },
164
+ "BLUESKY_MAX_ACTIONS_PROCESSING": {
165
+ "type": "number",
166
+ "description": "Maximum number of BlueSky actions to process in a single batch.",
167
+ "required": false,
168
+ "default": 5,
169
+ "sensitive": false
170
+ },
171
+ "BLUESKY_ENABLE_DMS": {
172
+ "type": "boolean",
173
+ "description": "Enable processing of direct messages via the chat.bsky API.",
174
+ "required": false,
175
+ "default": true,
176
+ "sensitive": false
177
+ }
178
+ }
179
+ },
180
+ "milady": {
181
+ "platforms": [
182
+ "browser",
183
+ "node"
184
+ ],
185
+ "runtime": "both",
186
+ "platformDetails": {
187
+ "browser": "Browser-compatible build available via exports.browser",
188
+ "node": "Node.js build available via exports.node"
189
+ }
190
+ }
191
191
  }