atproto-mcp 0.1.0
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.
- package/LICENSE +22 -0
- package/README.md +293 -0
- package/dist/cli.d.ts +10 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +261 -0
- package/dist/cli.js.map +1 -0
- package/dist/health-check.d.ts +7 -0
- package/dist/health-check.d.ts.map +1 -0
- package/dist/health-check.js +57 -0
- package/dist/health-check.js.map +1 -0
- package/dist/index.d.ts +122 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +612 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/index.d.ts +77 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +186 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/resources/index.d.ts +75 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +218 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/test/setup.d.ts +78 -0
- package/dist/test/setup.d.ts.map +1 -0
- package/dist/test/setup.js +138 -0
- package/dist/test/setup.js.map +1 -0
- package/dist/tools/implementations/advanced-social-tools.d.ts +250 -0
- package/dist/tools/implementations/advanced-social-tools.d.ts.map +1 -0
- package/dist/tools/implementations/advanced-social-tools.js +380 -0
- package/dist/tools/implementations/advanced-social-tools.js.map +1 -0
- package/dist/tools/implementations/base-tool.d.ts +73 -0
- package/dist/tools/implementations/base-tool.d.ts.map +1 -0
- package/dist/tools/implementations/base-tool.js +225 -0
- package/dist/tools/implementations/base-tool.js.map +1 -0
- package/dist/tools/implementations/content-management-tools.d.ts +81 -0
- package/dist/tools/implementations/content-management-tools.d.ts.map +1 -0
- package/dist/tools/implementations/content-management-tools.js +236 -0
- package/dist/tools/implementations/content-management-tools.js.map +1 -0
- package/dist/tools/implementations/create-post-tool.d.ts +131 -0
- package/dist/tools/implementations/create-post-tool.d.ts.map +1 -0
- package/dist/tools/implementations/create-post-tool.js +182 -0
- package/dist/tools/implementations/create-post-tool.js.map +1 -0
- package/dist/tools/implementations/follow-user-tool.d.ts +69 -0
- package/dist/tools/implementations/follow-user-tool.d.ts.map +1 -0
- package/dist/tools/implementations/follow-user-tool.js +200 -0
- package/dist/tools/implementations/follow-user-tool.js.map +1 -0
- package/dist/tools/implementations/get-user-profile-tool.d.ts +61 -0
- package/dist/tools/implementations/get-user-profile-tool.d.ts.map +1 -0
- package/dist/tools/implementations/get-user-profile-tool.js +139 -0
- package/dist/tools/implementations/get-user-profile-tool.js.map +1 -0
- package/dist/tools/implementations/index.d.ts +22 -0
- package/dist/tools/implementations/index.d.ts.map +1 -0
- package/dist/tools/implementations/index.js +32 -0
- package/dist/tools/implementations/index.js.map +1 -0
- package/dist/tools/implementations/like-post-tool.d.ts +68 -0
- package/dist/tools/implementations/like-post-tool.d.ts.map +1 -0
- package/dist/tools/implementations/like-post-tool.js +184 -0
- package/dist/tools/implementations/like-post-tool.js.map +1 -0
- package/dist/tools/implementations/media-tools.d.ts +360 -0
- package/dist/tools/implementations/media-tools.d.ts.map +1 -0
- package/dist/tools/implementations/media-tools.js +444 -0
- package/dist/tools/implementations/media-tools.js.map +1 -0
- package/dist/tools/implementations/moderation-tools.d.ts +189 -0
- package/dist/tools/implementations/moderation-tools.d.ts.map +1 -0
- package/dist/tools/implementations/moderation-tools.js +289 -0
- package/dist/tools/implementations/moderation-tools.js.map +1 -0
- package/dist/tools/implementations/oauth-tools.d.ts +108 -0
- package/dist/tools/implementations/oauth-tools.d.ts.map +1 -0
- package/dist/tools/implementations/oauth-tools.js +183 -0
- package/dist/tools/implementations/oauth-tools.js.map +1 -0
- package/dist/tools/implementations/reply-to-post-tool.d.ts +52 -0
- package/dist/tools/implementations/reply-to-post-tool.d.ts.map +1 -0
- package/dist/tools/implementations/reply-to-post-tool.js +167 -0
- package/dist/tools/implementations/reply-to-post-tool.js.map +1 -0
- package/dist/tools/implementations/repost-tool.d.ts +76 -0
- package/dist/tools/implementations/repost-tool.d.ts.map +1 -0
- package/dist/tools/implementations/repost-tool.js +181 -0
- package/dist/tools/implementations/repost-tool.js.map +1 -0
- package/dist/tools/implementations/search-posts-tool.d.ts +95 -0
- package/dist/tools/implementations/search-posts-tool.d.ts.map +1 -0
- package/dist/tools/implementations/search-posts-tool.js +208 -0
- package/dist/tools/implementations/search-posts-tool.js.map +1 -0
- package/dist/tools/implementations/social-graph-tools.d.ts +119 -0
- package/dist/tools/implementations/social-graph-tools.d.ts.map +1 -0
- package/dist/tools/implementations/social-graph-tools.js +262 -0
- package/dist/tools/implementations/social-graph-tools.js.map +1 -0
- package/dist/tools/implementations/streaming-tools.d.ts +130 -0
- package/dist/tools/implementations/streaming-tools.d.ts.map +1 -0
- package/dist/tools/implementations/streaming-tools.js +241 -0
- package/dist/tools/implementations/streaming-tools.js.map +1 -0
- package/dist/tools/implementations/timeline-tools.d.ts +69 -0
- package/dist/tools/implementations/timeline-tools.d.ts.map +1 -0
- package/dist/tools/implementations/timeline-tools.js +194 -0
- package/dist/tools/implementations/timeline-tools.js.map +1 -0
- package/dist/tools/index.d.ts +23 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +73 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/types/index.d.ts +242 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +73 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/atp-client.d.ts +109 -0
- package/dist/utils/atp-client.d.ts.map +1 -0
- package/dist/utils/atp-client.js +451 -0
- package/dist/utils/atp-client.js.map +1 -0
- package/dist/utils/config.d.ts +74 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +311 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/firehose-client.d.ts +96 -0
- package/dist/utils/firehose-client.d.ts.map +1 -0
- package/dist/utils/firehose-client.js +252 -0
- package/dist/utils/firehose-client.js.map +1 -0
- package/dist/utils/logger.d.ts +74 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +142 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/oauth-client.d.ts +61 -0
- package/dist/utils/oauth-client.d.ts.map +1 -0
- package/dist/utils/oauth-client.js +224 -0
- package/dist/utils/oauth-client.js.map +1 -0
- package/dist/utils/performance.d.ts +102 -0
- package/dist/utils/performance.d.ts.map +1 -0
- package/dist/utils/performance.js +302 -0
- package/dist/utils/performance.js.map +1 -0
- package/dist/utils/security.d.ts +154 -0
- package/dist/utils/security.d.ts.map +1 -0
- package/dist/utils/security.js +358 -0
- package/dist/utils/security.js.map +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search Posts Tool - Searches for posts on AT Protocol
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { BaseTool, ToolAuthMode } from './base-tool.js';
|
|
6
|
+
/**
|
|
7
|
+
* Zod schema for search posts parameters
|
|
8
|
+
*/
|
|
9
|
+
const SearchPostsSchema = z.object({
|
|
10
|
+
q: z
|
|
11
|
+
.string()
|
|
12
|
+
.min(1, 'Search query is required')
|
|
13
|
+
.max(300, 'Search query cannot exceed 300 characters'),
|
|
14
|
+
limit: z.number().int().min(1).max(100).optional().default(25),
|
|
15
|
+
cursor: z.string().optional(),
|
|
16
|
+
sort: z.enum(['top', 'latest']).optional().default('latest'),
|
|
17
|
+
since: z.string().optional(),
|
|
18
|
+
until: z.string().optional(),
|
|
19
|
+
mentions: z.string().optional(),
|
|
20
|
+
author: z.string().optional(),
|
|
21
|
+
lang: z.string().length(2, 'Language code must be 2 characters').optional(),
|
|
22
|
+
domain: z.string().optional(),
|
|
23
|
+
url: z.string().url().optional(),
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* Tool for searching posts on AT Protocol
|
|
27
|
+
*/
|
|
28
|
+
export class SearchPostsTool extends BaseTool {
|
|
29
|
+
schema = {
|
|
30
|
+
method: 'search_posts',
|
|
31
|
+
description: 'Search for posts on AT Protocol. Supports text search with various filters including author, language, date range, and more.',
|
|
32
|
+
params: SearchPostsSchema,
|
|
33
|
+
};
|
|
34
|
+
constructor(atpClient) {
|
|
35
|
+
super(atpClient, 'SearchPosts', ToolAuthMode.PUBLIC);
|
|
36
|
+
}
|
|
37
|
+
async execute(params) {
|
|
38
|
+
try {
|
|
39
|
+
this.logger.info('Searching posts', {
|
|
40
|
+
query: params.q,
|
|
41
|
+
limit: params.limit,
|
|
42
|
+
sort: params.sort,
|
|
43
|
+
author: params.author,
|
|
44
|
+
lang: params.lang,
|
|
45
|
+
hasCursor: !!params.cursor,
|
|
46
|
+
});
|
|
47
|
+
// Build search parameters
|
|
48
|
+
const searchParams = {
|
|
49
|
+
q: params.q,
|
|
50
|
+
limit: params.limit || 25,
|
|
51
|
+
};
|
|
52
|
+
// Add optional parameters
|
|
53
|
+
if (params.cursor)
|
|
54
|
+
searchParams.cursor = params.cursor;
|
|
55
|
+
if (params.sort)
|
|
56
|
+
searchParams.sort = params.sort;
|
|
57
|
+
if (params.since)
|
|
58
|
+
searchParams.since = params.since;
|
|
59
|
+
if (params.until)
|
|
60
|
+
searchParams.until = params.until;
|
|
61
|
+
if (params.mentions)
|
|
62
|
+
searchParams.mentions = params.mentions;
|
|
63
|
+
if (params.author) {
|
|
64
|
+
this.validateActor(params.author);
|
|
65
|
+
searchParams.author = params.author;
|
|
66
|
+
}
|
|
67
|
+
if (params.lang)
|
|
68
|
+
searchParams.lang = params.lang;
|
|
69
|
+
if (params.domain)
|
|
70
|
+
searchParams.domain = params.domain;
|
|
71
|
+
if (params.url)
|
|
72
|
+
searchParams.url = params.url;
|
|
73
|
+
// Execute search using AT Protocol (public endpoint)
|
|
74
|
+
const response = await this.executeAtpOperation(async () => {
|
|
75
|
+
const agent = this.atpClient.getPublicAgent();
|
|
76
|
+
return await agent.app.bsky.feed.searchPosts(searchParams);
|
|
77
|
+
}, 'searchPosts', {
|
|
78
|
+
query: params.q,
|
|
79
|
+
limit: params.limit,
|
|
80
|
+
sort: params.sort,
|
|
81
|
+
});
|
|
82
|
+
// Transform posts to our interface
|
|
83
|
+
const posts = response.data.posts.map((post) => this.transformPost(post));
|
|
84
|
+
const hasMore = !!response.data.cursor;
|
|
85
|
+
const cursor = response.data.cursor;
|
|
86
|
+
this.logger.info('Posts search completed', {
|
|
87
|
+
query: params.q,
|
|
88
|
+
foundPosts: posts.length,
|
|
89
|
+
hasMore,
|
|
90
|
+
hasCursor: !!cursor,
|
|
91
|
+
});
|
|
92
|
+
return {
|
|
93
|
+
success: true,
|
|
94
|
+
posts,
|
|
95
|
+
cursor,
|
|
96
|
+
hasMore,
|
|
97
|
+
searchQuery: params.q,
|
|
98
|
+
totalResults: response.data.hitsTotal,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
this.logger.error('Failed to search posts', error);
|
|
103
|
+
this.formatError(error);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Transform AT Protocol post data to our interface
|
|
108
|
+
*/
|
|
109
|
+
transformPost(postData) {
|
|
110
|
+
return {
|
|
111
|
+
uri: postData.uri,
|
|
112
|
+
cid: postData.cid,
|
|
113
|
+
author: {
|
|
114
|
+
did: postData.author.did,
|
|
115
|
+
handle: postData.author.handle,
|
|
116
|
+
displayName: postData.author.displayName,
|
|
117
|
+
description: postData.author.description,
|
|
118
|
+
avatar: postData.author.avatar,
|
|
119
|
+
followersCount: postData.author.followersCount,
|
|
120
|
+
followsCount: postData.author.followsCount,
|
|
121
|
+
postsCount: postData.author.postsCount,
|
|
122
|
+
},
|
|
123
|
+
record: {
|
|
124
|
+
text: postData.record.text || '',
|
|
125
|
+
createdAt: postData.record.createdAt,
|
|
126
|
+
reply: postData.record.reply
|
|
127
|
+
? {
|
|
128
|
+
root: {
|
|
129
|
+
uri: postData.record.reply.root.uri,
|
|
130
|
+
cid: postData.record.reply.root.cid,
|
|
131
|
+
},
|
|
132
|
+
parent: {
|
|
133
|
+
uri: postData.record.reply.parent.uri,
|
|
134
|
+
cid: postData.record.reply.parent.cid,
|
|
135
|
+
},
|
|
136
|
+
}
|
|
137
|
+
: undefined,
|
|
138
|
+
embed: postData.record.embed,
|
|
139
|
+
langs: postData.record.langs,
|
|
140
|
+
labels: postData.record.labels,
|
|
141
|
+
tags: postData.record.tags,
|
|
142
|
+
},
|
|
143
|
+
replyCount: postData.replyCount,
|
|
144
|
+
repostCount: postData.repostCount,
|
|
145
|
+
likeCount: postData.likeCount,
|
|
146
|
+
indexedAt: postData.indexedAt,
|
|
147
|
+
viewer: postData.viewer
|
|
148
|
+
? {
|
|
149
|
+
repost: postData.viewer.repost,
|
|
150
|
+
like: postData.viewer.like,
|
|
151
|
+
}
|
|
152
|
+
: undefined,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Search posts by hashtag
|
|
157
|
+
*/
|
|
158
|
+
async searchByHashtag(hashtag, options) {
|
|
159
|
+
try {
|
|
160
|
+
// Ensure hashtag starts with #
|
|
161
|
+
const formattedHashtag = hashtag.startsWith('#') ? hashtag : `#${hashtag}`;
|
|
162
|
+
const result = await this.execute({
|
|
163
|
+
q: formattedHashtag,
|
|
164
|
+
limit: options?.limit || 25,
|
|
165
|
+
cursor: options?.cursor,
|
|
166
|
+
sort: options?.sort || 'latest',
|
|
167
|
+
});
|
|
168
|
+
return {
|
|
169
|
+
success: result.success,
|
|
170
|
+
posts: result.posts,
|
|
171
|
+
cursor: result.cursor,
|
|
172
|
+
hasMore: result.hasMore,
|
|
173
|
+
hashtag: formattedHashtag,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
this.logger.error('Failed to search posts by hashtag', error);
|
|
178
|
+
throw error;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Search posts by author
|
|
183
|
+
*/
|
|
184
|
+
async searchByAuthor(author, query, options) {
|
|
185
|
+
try {
|
|
186
|
+
this.validateActor(author);
|
|
187
|
+
const result = await this.execute({
|
|
188
|
+
q: query || '*', // Use wildcard if no specific query
|
|
189
|
+
author,
|
|
190
|
+
limit: options?.limit || 25,
|
|
191
|
+
cursor: options?.cursor,
|
|
192
|
+
sort: options?.sort || 'latest',
|
|
193
|
+
});
|
|
194
|
+
return {
|
|
195
|
+
success: result.success,
|
|
196
|
+
posts: result.posts,
|
|
197
|
+
cursor: result.cursor,
|
|
198
|
+
hasMore: result.hasMore,
|
|
199
|
+
author,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
this.logger.error('Failed to search posts by author', error);
|
|
204
|
+
throw error;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=search-posts-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-posts-tool.js","sourceRoot":"","sources":["../../../src/tools/implementations/search-posts-tool.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAIxD;;GAEG;AACH,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,CAAC,EAAE,CAAC;SACD,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,EAAE,0BAA0B,CAAC;SAClC,GAAG,CAAC,GAAG,EAAE,2CAA2C,CAAC;IACxD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC9D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAA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M,CAAC,CAAC;YAE3B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC;gBAChC,CAAC,EAAE,KAAK,IAAI,GAAG,EAAE,oCAAoC;gBACrD,MAAM;gBACN,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE;gBAC3B,MAAM,EAAE,OAAO,EAAE,MAAM;gBACvB,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,QAAQ;aAChC,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,MAAM;aACP,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;YAC7D,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Social Graph Tools - Retrieve followers, follows, and notifications from AT Protocol
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { BaseTool } from './base-tool.js';
|
|
6
|
+
import type { AtpClient } from '../../utils/atp-client.js';
|
|
7
|
+
import type { IAtpProfile, IGetFollowersParams, IGetFollowsParams, IGetNotificationsParams } from '../../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Tool for retrieving user followers from AT Protocol
|
|
10
|
+
*/
|
|
11
|
+
export declare class GetFollowersTool extends BaseTool {
|
|
12
|
+
readonly schema: {
|
|
13
|
+
method: string;
|
|
14
|
+
description: string;
|
|
15
|
+
params: z.ZodObject<{
|
|
16
|
+
actor: z.ZodString;
|
|
17
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
18
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
actor: string;
|
|
21
|
+
limit: number;
|
|
22
|
+
cursor?: string | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
actor: string;
|
|
25
|
+
limit?: number | undefined;
|
|
26
|
+
cursor?: string | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
};
|
|
29
|
+
constructor(atpClient: AtpClient);
|
|
30
|
+
protected execute(params: IGetFollowersParams): Promise<{
|
|
31
|
+
success: boolean;
|
|
32
|
+
followers: Array<IAtpProfile & {
|
|
33
|
+
indexedAt?: string;
|
|
34
|
+
}>;
|
|
35
|
+
cursor?: string;
|
|
36
|
+
hasMore: boolean;
|
|
37
|
+
actor: string;
|
|
38
|
+
}>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Tool for retrieving users that a user follows from AT Protocol
|
|
42
|
+
*/
|
|
43
|
+
export declare class GetFollowsTool extends BaseTool {
|
|
44
|
+
readonly schema: {
|
|
45
|
+
method: string;
|
|
46
|
+
description: string;
|
|
47
|
+
params: z.ZodObject<{
|
|
48
|
+
actor: z.ZodString;
|
|
49
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
50
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
actor: string;
|
|
53
|
+
limit: number;
|
|
54
|
+
cursor?: string | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
actor: string;
|
|
57
|
+
limit?: number | undefined;
|
|
58
|
+
cursor?: string | undefined;
|
|
59
|
+
}>;
|
|
60
|
+
};
|
|
61
|
+
constructor(atpClient: AtpClient);
|
|
62
|
+
protected execute(params: IGetFollowsParams): Promise<{
|
|
63
|
+
success: boolean;
|
|
64
|
+
follows: Array<IAtpProfile & {
|
|
65
|
+
indexedAt?: string;
|
|
66
|
+
}>;
|
|
67
|
+
cursor?: string;
|
|
68
|
+
hasMore: boolean;
|
|
69
|
+
actor: string;
|
|
70
|
+
}>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Tool for retrieving notifications from AT Protocol
|
|
74
|
+
*/
|
|
75
|
+
export declare class GetNotificationsTool extends BaseTool {
|
|
76
|
+
readonly schema: {
|
|
77
|
+
method: string;
|
|
78
|
+
description: string;
|
|
79
|
+
params: z.ZodObject<{
|
|
80
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
81
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
82
|
+
seenAt: z.ZodOptional<z.ZodString>;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
limit: number;
|
|
85
|
+
cursor?: string | undefined;
|
|
86
|
+
seenAt?: string | undefined;
|
|
87
|
+
}, {
|
|
88
|
+
limit?: number | undefined;
|
|
89
|
+
cursor?: string | undefined;
|
|
90
|
+
seenAt?: string | undefined;
|
|
91
|
+
}>;
|
|
92
|
+
};
|
|
93
|
+
constructor(atpClient: AtpClient);
|
|
94
|
+
protected execute(params: IGetNotificationsParams): Promise<{
|
|
95
|
+
success: boolean;
|
|
96
|
+
notifications: Array<{
|
|
97
|
+
uri: string;
|
|
98
|
+
cid: string;
|
|
99
|
+
author: IAtpProfile;
|
|
100
|
+
reason: 'like' | 'repost' | 'follow' | 'mention' | 'reply' | 'quote';
|
|
101
|
+
record: any;
|
|
102
|
+
isRead: boolean;
|
|
103
|
+
indexedAt: string;
|
|
104
|
+
labels?: any[];
|
|
105
|
+
}>;
|
|
106
|
+
cursor?: string;
|
|
107
|
+
hasMore: boolean;
|
|
108
|
+
seenAt?: string;
|
|
109
|
+
}>;
|
|
110
|
+
/**
|
|
111
|
+
* Mark notifications as read
|
|
112
|
+
*/
|
|
113
|
+
markAsRead(seenAt?: string): Promise<{
|
|
114
|
+
success: boolean;
|
|
115
|
+
message: string;
|
|
116
|
+
seenAt: string;
|
|
117
|
+
}>;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=social-graph-tools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A+DH;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,QAAQ;IAChD,SAAgB,MAAM;;;;;;;;;;;;;;;;MAKpB;gBAEU,SAAS,EAAE,SAAS;cAIhB,OAAO,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC;QAChE,OAAO,EAAE,OAAO,CAAC;QACjB,aAAa,EAAE,KAAK,CAAC;YACnB,GAAG,EAAE,MAAM,CAAC;YACZ,GAAG,EAAE,MAAM,CAAC;YACZ,MAAM,EAAE,WAAW,CAAC;YACpB,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;YACrE,MAAM,EAAE,GAAG,CAAC;YACZ,MAAM,EAAE,OAAO,CAAC;YAChB,SAAS,EAAE,MAAM,CAAC;YAClB,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;SAChB,CAAC,CAAC;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IAmEF;;OAEG;IACU,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAChD,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CA+BH"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Social Graph Tools - Retrieve followers, follows, and notifications from AT Protocol
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { BaseTool } from './base-tool.js';
|
|
6
|
+
/**
|
|
7
|
+
* Zod schema for get followers parameters
|
|
8
|
+
*/
|
|
9
|
+
const GetFollowersSchema = z.object({
|
|
10
|
+
actor: z.string().min(1, 'Actor (DID or handle) is required'),
|
|
11
|
+
limit: z.number().int().min(1).max(100).optional().default(50),
|
|
12
|
+
cursor: z.string().optional(),
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Zod schema for get follows parameters
|
|
16
|
+
*/
|
|
17
|
+
const GetFollowsSchema = z.object({
|
|
18
|
+
actor: z.string().min(1, 'Actor (DID or handle) is required'),
|
|
19
|
+
limit: z.number().int().min(1).max(100).optional().default(50),
|
|
20
|
+
cursor: z.string().optional(),
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* Zod schema for get notifications parameters
|
|
24
|
+
*/
|
|
25
|
+
const GetNotificationsSchema = z.object({
|
|
26
|
+
limit: z.number().int().min(1).max(100).optional().default(50),
|
|
27
|
+
cursor: z.string().optional(),
|
|
28
|
+
seenAt: z.string().optional(),
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Tool for retrieving user followers from AT Protocol
|
|
32
|
+
*/
|
|
33
|
+
export class GetFollowersTool extends BaseTool {
|
|
34
|
+
schema = {
|
|
35
|
+
method: 'get_followers',
|
|
36
|
+
description: 'Retrieve followers of a user from AT Protocol. Returns a list of users who follow the specified actor.',
|
|
37
|
+
params: GetFollowersSchema,
|
|
38
|
+
};
|
|
39
|
+
constructor(atpClient) {
|
|
40
|
+
super(atpClient, 'GetFollowers');
|
|
41
|
+
}
|
|
42
|
+
async execute(params) {
|
|
43
|
+
try {
|
|
44
|
+
this.logger.info('Retrieving followers', {
|
|
45
|
+
actor: params.actor,
|
|
46
|
+
limit: params.limit,
|
|
47
|
+
hasCursor: !!params.cursor,
|
|
48
|
+
});
|
|
49
|
+
// Validate the actor identifier
|
|
50
|
+
this.validateActor(params.actor);
|
|
51
|
+
// Get followers using AT Protocol
|
|
52
|
+
const response = await this.executeAtpOperation(async () => {
|
|
53
|
+
const agent = this.atpClient.getAgent();
|
|
54
|
+
return await agent.getFollowers({
|
|
55
|
+
actor: params.actor,
|
|
56
|
+
limit: params.limit || 50,
|
|
57
|
+
cursor: params.cursor,
|
|
58
|
+
});
|
|
59
|
+
}, 'getFollowers', {
|
|
60
|
+
actor: params.actor,
|
|
61
|
+
limit: params.limit,
|
|
62
|
+
});
|
|
63
|
+
// Transform followers to our interface
|
|
64
|
+
const followers = response.data.followers.map((follower) => ({
|
|
65
|
+
did: follower.did,
|
|
66
|
+
handle: follower.handle,
|
|
67
|
+
displayName: follower.displayName,
|
|
68
|
+
description: follower.description,
|
|
69
|
+
avatar: follower.avatar,
|
|
70
|
+
banner: follower.banner,
|
|
71
|
+
followersCount: follower.followersCount,
|
|
72
|
+
followsCount: follower.followsCount,
|
|
73
|
+
postsCount: follower.postsCount,
|
|
74
|
+
indexedAt: follower.indexedAt,
|
|
75
|
+
}));
|
|
76
|
+
const hasMore = !!response.data.cursor;
|
|
77
|
+
const cursor = response.data.cursor;
|
|
78
|
+
this.logger.info('Followers retrieved successfully', {
|
|
79
|
+
actor: params.actor,
|
|
80
|
+
followersCount: followers.length,
|
|
81
|
+
hasMore,
|
|
82
|
+
});
|
|
83
|
+
return {
|
|
84
|
+
success: true,
|
|
85
|
+
followers,
|
|
86
|
+
cursor,
|
|
87
|
+
hasMore,
|
|
88
|
+
actor: params.actor,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
this.logger.error('Failed to retrieve followers', error);
|
|
93
|
+
this.formatError(error);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Tool for retrieving users that a user follows from AT Protocol
|
|
99
|
+
*/
|
|
100
|
+
export class GetFollowsTool extends BaseTool {
|
|
101
|
+
schema = {
|
|
102
|
+
method: 'get_follows',
|
|
103
|
+
description: 'Retrieve users that an actor follows from AT Protocol. Returns a list of users followed by the specified actor.',
|
|
104
|
+
params: GetFollowsSchema,
|
|
105
|
+
};
|
|
106
|
+
constructor(atpClient) {
|
|
107
|
+
super(atpClient, 'GetFollows');
|
|
108
|
+
}
|
|
109
|
+
async execute(params) {
|
|
110
|
+
try {
|
|
111
|
+
this.logger.info('Retrieving follows', {
|
|
112
|
+
actor: params.actor,
|
|
113
|
+
limit: params.limit,
|
|
114
|
+
hasCursor: !!params.cursor,
|
|
115
|
+
});
|
|
116
|
+
// Validate the actor identifier
|
|
117
|
+
this.validateActor(params.actor);
|
|
118
|
+
// Get follows using AT Protocol
|
|
119
|
+
const response = await this.executeAtpOperation(async () => {
|
|
120
|
+
const agent = this.atpClient.getAgent();
|
|
121
|
+
return await agent.getFollows({
|
|
122
|
+
actor: params.actor,
|
|
123
|
+
limit: params.limit || 50,
|
|
124
|
+
cursor: params.cursor,
|
|
125
|
+
});
|
|
126
|
+
}, 'getFollows', {
|
|
127
|
+
actor: params.actor,
|
|
128
|
+
limit: params.limit,
|
|
129
|
+
});
|
|
130
|
+
// Transform follows to our interface
|
|
131
|
+
const follows = response.data.follows.map((follow) => ({
|
|
132
|
+
did: follow.did,
|
|
133
|
+
handle: follow.handle,
|
|
134
|
+
displayName: follow.displayName,
|
|
135
|
+
description: follow.description,
|
|
136
|
+
avatar: follow.avatar,
|
|
137
|
+
banner: follow.banner,
|
|
138
|
+
followersCount: follow.followersCount,
|
|
139
|
+
followsCount: follow.followsCount,
|
|
140
|
+
postsCount: follow.postsCount,
|
|
141
|
+
indexedAt: follow.indexedAt,
|
|
142
|
+
}));
|
|
143
|
+
const hasMore = !!response.data.cursor;
|
|
144
|
+
const cursor = response.data.cursor;
|
|
145
|
+
this.logger.info('Follows retrieved successfully', {
|
|
146
|
+
actor: params.actor,
|
|
147
|
+
followsCount: follows.length,
|
|
148
|
+
hasMore,
|
|
149
|
+
});
|
|
150
|
+
return {
|
|
151
|
+
success: true,
|
|
152
|
+
follows,
|
|
153
|
+
cursor,
|
|
154
|
+
hasMore,
|
|
155
|
+
actor: params.actor,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
this.logger.error('Failed to retrieve follows', error);
|
|
160
|
+
this.formatError(error);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Tool for retrieving notifications from AT Protocol
|
|
166
|
+
*/
|
|
167
|
+
export class GetNotificationsTool extends BaseTool {
|
|
168
|
+
schema = {
|
|
169
|
+
method: 'get_notifications',
|
|
170
|
+
description: 'Retrieve notifications from AT Protocol. Returns likes, reposts, follows, mentions, and replies.',
|
|
171
|
+
params: GetNotificationsSchema,
|
|
172
|
+
};
|
|
173
|
+
constructor(atpClient) {
|
|
174
|
+
super(atpClient, 'GetNotifications');
|
|
175
|
+
}
|
|
176
|
+
async execute(params) {
|
|
177
|
+
try {
|
|
178
|
+
this.logger.info('Retrieving notifications', {
|
|
179
|
+
limit: params.limit,
|
|
180
|
+
hasCursor: !!params.cursor,
|
|
181
|
+
hasSeenAt: !!params.seenAt,
|
|
182
|
+
});
|
|
183
|
+
// Get notifications using AT Protocol
|
|
184
|
+
const response = await this.executeAtpOperation(async () => {
|
|
185
|
+
const agent = this.atpClient.getAgent();
|
|
186
|
+
return await agent.listNotifications({
|
|
187
|
+
limit: params.limit || 50,
|
|
188
|
+
cursor: params.cursor,
|
|
189
|
+
seenAt: params.seenAt,
|
|
190
|
+
});
|
|
191
|
+
}, 'listNotifications', {
|
|
192
|
+
limit: params.limit,
|
|
193
|
+
});
|
|
194
|
+
// Transform notifications to our interface
|
|
195
|
+
const notifications = response.data.notifications.map((notification) => ({
|
|
196
|
+
uri: notification.uri,
|
|
197
|
+
cid: notification.cid,
|
|
198
|
+
author: {
|
|
199
|
+
did: notification.author.did,
|
|
200
|
+
handle: notification.author.handle,
|
|
201
|
+
displayName: notification.author.displayName,
|
|
202
|
+
description: notification.author.description,
|
|
203
|
+
avatar: notification.author.avatar,
|
|
204
|
+
followersCount: notification.author.followersCount,
|
|
205
|
+
followsCount: notification.author.followsCount,
|
|
206
|
+
postsCount: notification.author.postsCount,
|
|
207
|
+
},
|
|
208
|
+
reason: notification.reason,
|
|
209
|
+
record: notification.record,
|
|
210
|
+
isRead: notification.isRead,
|
|
211
|
+
indexedAt: notification.indexedAt,
|
|
212
|
+
labels: notification.labels,
|
|
213
|
+
}));
|
|
214
|
+
const hasMore = !!response.data.cursor;
|
|
215
|
+
const cursor = response.data.cursor;
|
|
216
|
+
this.logger.info('Notifications retrieved successfully', {
|
|
217
|
+
notificationsCount: notifications.length,
|
|
218
|
+
hasMore,
|
|
219
|
+
unreadCount: notifications.filter(n => !n.isRead).length,
|
|
220
|
+
});
|
|
221
|
+
return {
|
|
222
|
+
success: true,
|
|
223
|
+
notifications,
|
|
224
|
+
cursor,
|
|
225
|
+
hasMore,
|
|
226
|
+
seenAt: response.data.seenAt,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
catch (error) {
|
|
230
|
+
this.logger.error('Failed to retrieve notifications', error);
|
|
231
|
+
this.formatError(error);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Mark notifications as read
|
|
236
|
+
*/
|
|
237
|
+
async markAsRead(seenAt) {
|
|
238
|
+
try {
|
|
239
|
+
const timestamp = seenAt || new Date().toISOString();
|
|
240
|
+
this.logger.info('Marking notifications as read', {
|
|
241
|
+
seenAt: timestamp,
|
|
242
|
+
});
|
|
243
|
+
await this.executeAtpOperation(async () => {
|
|
244
|
+
const agent = this.atpClient.getAgent();
|
|
245
|
+
return await agent.updateSeenNotifications(timestamp);
|
|
246
|
+
}, 'updateSeenNotifications', { seenAt: timestamp });
|
|
247
|
+
this.logger.info('Notifications marked as read successfully', {
|
|
248
|
+
seenAt: timestamp,
|
|
249
|
+
});
|
|
250
|
+
return {
|
|
251
|
+
success: true,
|
|
252
|
+
message: 'Notifications marked as read',
|
|
253
|
+
seenAt: timestamp,
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
catch (error) {
|
|
257
|
+
this.logger.error('Failed to mark notifications as read', error);
|
|
258
|
+
throw error;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=social-graph-tools.js.map
|
|
@@ -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