a tool to help your Letta AI agents navigate bluesky
at main 4.4 kB view raw
1import { Notification } from "../utils/types.ts"; 2import { doesUserFollowTarget } from "../utils/doesUserFollow.ts"; 3import { agentContext } from "../utils/agentContext.ts"; 4import { getCleanThread } from "../utils/getCleanThread.ts"; 5 6export const repostPrompt = async ( 7 notification: Notification, 8) => { 9 const isUserFollower = await doesUserFollowTarget( 10 notification.author.did, 11 agentContext.agentBskyDID, 12 ); 13 14 const notifierHandle = `@${notification.author.handle}`; 15 16 const isUserFollowerString = isUserFollower === true 17 ? `${notifierHandle} FOLLOWS YOU` 18 : isUserFollower === false 19 ? `${notifierHandle} DOES NOT FOLLOW YOU` 20 : ""; 21 22 const doYouFollow = await doesUserFollowTarget( 23 agentContext.agentBskyDID, 24 notification.author.did, 25 ); 26 27 const doYouFollowString = doYouFollow === true 28 ? `YOU FOLLOW ${notifierHandle}` 29 : doYouFollow === false 30 ? `YOU DO NOT FOLLOW ${notifierHandle}` 31 : ""; 32 const thread = notification.reasonSubject 33 ? await getCleanThread(notification.reasonSubject) 34 : [{ 35 // @TODO: find a better way to handle this 36 authorHandle: undefined, 37 message: "ERROR: could not get thread", 38 uri: undefined, 39 authorDID: undefined, 40 postedDateTime: undefined, 41 bookmarks: undefined, 42 replies: undefined, 43 reposts: undefined, 44 likes: undefined, 45 quotes: undefined, 46 }]; 47 48 return ` 49# NOTIFICATION: Someone reposted your content 50 51## Context 52• **Reposted by:** @${notification.author.handle} 53• **Reposter DID:** ${notification.author.did} 54• **Post URI:** ${notification.reasonSubject} 55• **Timestamp:** ${notification.record.createdAt} 56 57${isUserFollowerString} 58${doYouFollowString} 59 60${ 61 thread 62 ? ` 63## your post that was reposted by @${notification.author.handle} 64\`\`\` 65${thread[thread.length - 1].message} 66\`\`\` 67` 68 : "" 69 } 70 71${ 72 thread 73 ? ` 74## the full thread your post was in 75\`\`\` 76${JSON.stringify(thread, null, 2)} 77\`\`\` 78` 79 : "" 80 } 81 82## Your Task: Observe Only 83 84**REQUIRED ACTION: Take no public action.** 85 86This is a passive signal for audience understanding and content reach. A repost means someone is amplifying your content to their followers—not requesting your attention or response. 87 88### What to Consider (Silently) 89 90**Who is amplifying your content?** 91You MAY search archival_memory for \`@${notification.author.handle}\` or \`${notification.author.did}\` if you suspect there might be relevant interaction history. Only search if you have reason to believe prior context exists. Don't search for every repost. 92 93Consider: 94• Is this someone in your network or reaching a new audience? 95• Are they significant in your domain? 96• Is there a pattern of reposts from this user (indicates alignment)? 97 98**What does this reveal about content reach?** 99• What topic was this post about? 100• Does this indicate your content reaching new or important audiences? 101• Is this part of broader engagement patterns worth tracking? 102 103### Archival Decision 104 105Archive this repost ONLY if it meets one of these criteria: 106• The reposter is significant in your domain 107• The repost indicates your content reaching a new or important audience segment 108• Pattern of reposts from the same user (indicates strong alignment with your content) 109 110**Do NOT archive:** 111• Random or isolated reposts 112• Reposts from casual followers 113• Low-signal amplification 114 115**If archiving, keep it minimal:** 116• User handle and why they're notable 117• What this reveals about content reach 118• Date for temporal tracking 119 120## Available Actions 121 122### ignore_notification — YOUR ONLY PUBLIC ACTION 123Use this to acknowledge the notification without taking any visible action. This is the correct response. 124 125### archival_memory_search — USE VERY SELECTIVELY 126Only search if you have specific reason to believe prior context with this user exists and matters. 127 128Do NOT search for every repost notification. 129 130## PROHIBITED Actions 131 132**NEVER:** 133• Reply to reposts 134• Repost their content back as reciprocation 135• Follow them because they reposted your content 136• Thank them in any way (comes across as needy and bot-like) 137• Take any public-facing action in response to a repost 138 139--- 140 141**Remember:** A repost is someone sharing your content with their audience. It's a compliment, not a call to action. Observe and note patterns, but do not treat reposts as events requiring response. 142`; 143};