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,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get User Profile Tool - Retrieves user profiles from AT Protocol
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { BaseTool, ToolAuthMode } from './base-tool.js';
|
|
6
|
+
/**
|
|
7
|
+
* Zod schema for get user profile parameters
|
|
8
|
+
*/
|
|
9
|
+
const GetUserProfileSchema = z.object({
|
|
10
|
+
actor: z.string().min(1, 'Actor (DID or handle) is required'),
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Tool for retrieving user profiles from AT Protocol
|
|
14
|
+
*/
|
|
15
|
+
export class GetUserProfileTool extends BaseTool {
|
|
16
|
+
schema = {
|
|
17
|
+
method: 'get_user_profile',
|
|
18
|
+
description: 'Retrieve a user profile from AT Protocol. Returns detailed profile information including stats and verification status.',
|
|
19
|
+
params: GetUserProfileSchema,
|
|
20
|
+
};
|
|
21
|
+
constructor(atpClient) {
|
|
22
|
+
super(atpClient, 'GetUserProfile', ToolAuthMode.ENHANCED);
|
|
23
|
+
}
|
|
24
|
+
async execute(params) {
|
|
25
|
+
try {
|
|
26
|
+
this.logger.info('Retrieving user profile', {
|
|
27
|
+
actor: params.actor,
|
|
28
|
+
});
|
|
29
|
+
// Validate the actor identifier
|
|
30
|
+
this.validateActor(params.actor);
|
|
31
|
+
// Get the user profile from AT Protocol
|
|
32
|
+
const response = await this.executeAtpOperation(async () => {
|
|
33
|
+
const agent = this.atpClient.getAgent();
|
|
34
|
+
return await agent.getProfile({ actor: params.actor });
|
|
35
|
+
}, 'getProfile', { actor: params.actor });
|
|
36
|
+
const profileData = response.data;
|
|
37
|
+
// Transform the profile data to match our interface
|
|
38
|
+
const profile = {
|
|
39
|
+
did: profileData.did,
|
|
40
|
+
handle: profileData.handle,
|
|
41
|
+
displayName: profileData.displayName,
|
|
42
|
+
description: profileData.description,
|
|
43
|
+
avatar: profileData.avatar,
|
|
44
|
+
banner: profileData.banner,
|
|
45
|
+
followersCount: profileData.followersCount,
|
|
46
|
+
followsCount: profileData.followsCount,
|
|
47
|
+
postsCount: profileData.postsCount,
|
|
48
|
+
indexedAt: profileData.indexedAt,
|
|
49
|
+
viewer: profileData.viewer
|
|
50
|
+
? {
|
|
51
|
+
muted: profileData.viewer.muted,
|
|
52
|
+
blockedBy: profileData.viewer.blockedBy,
|
|
53
|
+
blocking: profileData.viewer.blocking,
|
|
54
|
+
following: profileData.viewer.following,
|
|
55
|
+
followedBy: profileData.viewer.followedBy,
|
|
56
|
+
}
|
|
57
|
+
: undefined,
|
|
58
|
+
labels: profileData.labels?.map((label) => ({
|
|
59
|
+
src: label.src,
|
|
60
|
+
uri: label.uri,
|
|
61
|
+
cid: label.cid,
|
|
62
|
+
val: label.val,
|
|
63
|
+
cts: label.cts,
|
|
64
|
+
})),
|
|
65
|
+
};
|
|
66
|
+
this.logger.info('User profile retrieved successfully', {
|
|
67
|
+
actor: params.actor,
|
|
68
|
+
did: profile.did,
|
|
69
|
+
handle: profile.handle,
|
|
70
|
+
displayName: profile.displayName,
|
|
71
|
+
followersCount: profile.followersCount,
|
|
72
|
+
followsCount: profile.followsCount,
|
|
73
|
+
postsCount: profile.postsCount,
|
|
74
|
+
});
|
|
75
|
+
return {
|
|
76
|
+
success: true,
|
|
77
|
+
profile,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
this.logger.error('Failed to retrieve user profile', error);
|
|
82
|
+
this.formatError(error);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get multiple user profiles in batch
|
|
87
|
+
*/
|
|
88
|
+
async getProfiles(actors) {
|
|
89
|
+
try {
|
|
90
|
+
this.logger.info('Retrieving multiple user profiles', {
|
|
91
|
+
actorCount: actors.length,
|
|
92
|
+
actors: actors.slice(0, 5), // Log first 5 for debugging
|
|
93
|
+
});
|
|
94
|
+
// Validate all actor identifiers
|
|
95
|
+
for (const actor of actors) {
|
|
96
|
+
this.validateActor(actor);
|
|
97
|
+
}
|
|
98
|
+
// Get the user profiles from AT Protocol
|
|
99
|
+
const response = await this.executeAtpOperation(async () => {
|
|
100
|
+
const agent = this.atpClient.getAgent();
|
|
101
|
+
return await agent.getProfiles({ actors });
|
|
102
|
+
}, 'getProfiles', { actorCount: actors.length });
|
|
103
|
+
const profiles = response.data.profiles.map((profileData) => ({
|
|
104
|
+
did: profileData.did,
|
|
105
|
+
handle: profileData.handle,
|
|
106
|
+
displayName: profileData.displayName,
|
|
107
|
+
description: profileData.description,
|
|
108
|
+
avatar: profileData.avatar,
|
|
109
|
+
banner: profileData.banner,
|
|
110
|
+
followersCount: profileData.followersCount,
|
|
111
|
+
followsCount: profileData.followsCount,
|
|
112
|
+
postsCount: profileData.postsCount,
|
|
113
|
+
indexedAt: profileData.indexedAt,
|
|
114
|
+
viewer: profileData.viewer
|
|
115
|
+
? {
|
|
116
|
+
muted: profileData.viewer.muted,
|
|
117
|
+
blockedBy: profileData.viewer.blockedBy,
|
|
118
|
+
blocking: profileData.viewer.blocking,
|
|
119
|
+
following: profileData.viewer.following,
|
|
120
|
+
followedBy: profileData.viewer.followedBy,
|
|
121
|
+
}
|
|
122
|
+
: undefined,
|
|
123
|
+
}));
|
|
124
|
+
this.logger.info('Multiple user profiles retrieved successfully', {
|
|
125
|
+
requestedCount: actors.length,
|
|
126
|
+
retrievedCount: profiles.length,
|
|
127
|
+
});
|
|
128
|
+
return {
|
|
129
|
+
success: true,
|
|
130
|
+
profiles,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
this.logger.error('Failed to retrieve multiple user profiles', error);
|
|
135
|
+
throw error;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=get-user-profile-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-user-profile-tool.js","sourceRoot":"","sources":["../../../src/tools/implementations/get-user-profile-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,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,mCAAmC,CAAC;CAC9D,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,QAAQ;IAC9B,MAAM,GAAG;QACvB,MAAM,EAAE,kBAAkB;QAC1B,WAAW,EACT,yHAAyH;QAC3H,MAAM,EAAE,oBAAoB;KAC7B,CAAC;IAEF,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,gBAAgB,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC5D,CAAC;IAES,KAAK,CAAC,OAAO,CAAC,MAA6B;QAoBnD,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE;gBAC1C,KAAK,EAAE,MAAM,CAAC,KAAK;aACpB,CAAC,CAAC;YAEH,gCAAgC;YAChC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAEjC,wCAAwC;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AC,MAAM;aAChC,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,QAAQ;aACT,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,2CAA2C,EAAE,KAAK,CAAC,CAAC;YACtE,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AT Protocol MCP Tools - Implementation Index
|
|
3
|
+
*
|
|
4
|
+
* Exports all tool implementations for the AT Protocol MCP Server
|
|
5
|
+
*/
|
|
6
|
+
export { BaseTool } from './base-tool.js';
|
|
7
|
+
export { CreatePostTool } from './create-post-tool.js';
|
|
8
|
+
export { ReplyToPostTool } from './reply-to-post-tool.js';
|
|
9
|
+
export { LikePostTool, UnlikePostTool } from './like-post-tool.js';
|
|
10
|
+
export { RepostTool, UnrepostTool } from './repost-tool.js';
|
|
11
|
+
export { FollowUserTool, UnfollowUserTool } from './follow-user-tool.js';
|
|
12
|
+
export { GetUserProfileTool } from './get-user-profile-tool.js';
|
|
13
|
+
export { SearchPostsTool } from './search-posts-tool.js';
|
|
14
|
+
export { GetTimelineTool } from './timeline-tools.js';
|
|
15
|
+
export { GetFollowersTool, GetFollowsTool, GetNotificationsTool } from './social-graph-tools.js';
|
|
16
|
+
export { DeletePostTool, UpdateProfileTool } from './content-management-tools.js';
|
|
17
|
+
export { StartOAuthFlowTool, HandleOAuthCallbackTool, RefreshOAuthTokensTool, RevokeOAuthTokensTool, } from './oauth-tools.js';
|
|
18
|
+
export { MuteUserTool, UnmuteUserTool, BlockUserTool, UnblockUserTool, ReportContentTool, ReportUserTool, } from './moderation-tools.js';
|
|
19
|
+
export { StartStreamingTool, StopStreamingTool, GetStreamingStatusTool, GetRecentEventsTool, } from './streaming-tools.js';
|
|
20
|
+
export { CreateListTool, AddToListTool, RemoveFromListTool, GetListTool, GetThreadTool, GetCustomFeedTool, } from './advanced-social-tools.js';
|
|
21
|
+
export { UploadImageTool, UploadVideoTool, CreateRichTextPostTool, GenerateLinkPreviewTool, } from './media-tools.js';
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/implementations/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAG5D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGhE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAGjG,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGlF,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,cAAc,GACf,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AT Protocol MCP Tools - Implementation Index
|
|
3
|
+
*
|
|
4
|
+
* Exports all tool implementations for the AT Protocol MCP Server
|
|
5
|
+
*/
|
|
6
|
+
// Base tool class
|
|
7
|
+
export { BaseTool } from './base-tool.js';
|
|
8
|
+
// Core social operations
|
|
9
|
+
export { CreatePostTool } from './create-post-tool.js';
|
|
10
|
+
export { ReplyToPostTool } from './reply-to-post-tool.js';
|
|
11
|
+
export { LikePostTool, UnlikePostTool } from './like-post-tool.js';
|
|
12
|
+
export { RepostTool, UnrepostTool } from './repost-tool.js';
|
|
13
|
+
// User operations
|
|
14
|
+
export { FollowUserTool, UnfollowUserTool } from './follow-user-tool.js';
|
|
15
|
+
export { GetUserProfileTool } from './get-user-profile-tool.js';
|
|
16
|
+
// Data retrieval
|
|
17
|
+
export { SearchPostsTool } from './search-posts-tool.js';
|
|
18
|
+
export { GetTimelineTool } from './timeline-tools.js';
|
|
19
|
+
export { GetFollowersTool, GetFollowsTool, GetNotificationsTool } from './social-graph-tools.js';
|
|
20
|
+
// Content management
|
|
21
|
+
export { DeletePostTool, UpdateProfileTool } from './content-management-tools.js';
|
|
22
|
+
// OAuth authentication
|
|
23
|
+
export { StartOAuthFlowTool, HandleOAuthCallbackTool, RefreshOAuthTokensTool, RevokeOAuthTokensTool, } from './oauth-tools.js';
|
|
24
|
+
// Content moderation
|
|
25
|
+
export { MuteUserTool, UnmuteUserTool, BlockUserTool, UnblockUserTool, ReportContentTool, ReportUserTool, } from './moderation-tools.js';
|
|
26
|
+
// Real-time streaming
|
|
27
|
+
export { StartStreamingTool, StopStreamingTool, GetStreamingStatusTool, GetRecentEventsTool, } from './streaming-tools.js';
|
|
28
|
+
// Advanced social features
|
|
29
|
+
export { CreateListTool, AddToListTool, RemoveFromListTool, GetListTool, GetThreadTool, GetCustomFeedTool, } from './advanced-social-tools.js';
|
|
30
|
+
// Enhanced media support
|
|
31
|
+
export { UploadImageTool, UploadVideoTool, CreateRichTextPostTool, GenerateLinkPreviewTool, } from './media-tools.js';
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/implementations/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,kBAAkB;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,yBAAyB;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE5D,kBAAkB;AAClB,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,iBAAiB;AACjB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEjG,qBAAqB;AACrB,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElF,uBAAuB;AACvB,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAE1B,qBAAqB;AACrB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,cAAc,GACf,MAAM,uBAAuB,CAAC;AAE/B,sBAAsB;AACtB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAE9B,2BAA2B;AAC3B,OAAO,EACL,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AAEpC,yBAAyB;AACzB,OAAO,EACL,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Like Post Tool - Likes posts on 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 { ATURI, CID, ILikePostParams } from '../../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Tool for liking posts on AT Protocol
|
|
10
|
+
*/
|
|
11
|
+
export declare class LikePostTool extends BaseTool {
|
|
12
|
+
readonly schema: {
|
|
13
|
+
method: string;
|
|
14
|
+
description: string;
|
|
15
|
+
params: z.ZodObject<{
|
|
16
|
+
uri: z.ZodString;
|
|
17
|
+
cid: z.ZodString;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
uri: string;
|
|
20
|
+
cid: string;
|
|
21
|
+
}, {
|
|
22
|
+
uri: string;
|
|
23
|
+
cid: string;
|
|
24
|
+
}>;
|
|
25
|
+
};
|
|
26
|
+
constructor(atpClient: AtpClient);
|
|
27
|
+
protected execute(params: ILikePostParams): Promise<{
|
|
28
|
+
uri: ATURI;
|
|
29
|
+
cid: CID;
|
|
30
|
+
success: boolean;
|
|
31
|
+
message: string;
|
|
32
|
+
likedPost: {
|
|
33
|
+
uri: ATURI;
|
|
34
|
+
cid: CID;
|
|
35
|
+
};
|
|
36
|
+
}>;
|
|
37
|
+
/**
|
|
38
|
+
* Check if the post is already liked by the current user
|
|
39
|
+
*/
|
|
40
|
+
private checkExistingLike;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Unlike Post Tool - Removes likes from posts on AT Protocol
|
|
44
|
+
*/
|
|
45
|
+
export declare class UnlikePostTool extends BaseTool {
|
|
46
|
+
readonly schema: {
|
|
47
|
+
method: string;
|
|
48
|
+
description: string;
|
|
49
|
+
params: z.ZodObject<{
|
|
50
|
+
likeUri: z.ZodString;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
likeUri: string;
|
|
53
|
+
}, {
|
|
54
|
+
likeUri: string;
|
|
55
|
+
}>;
|
|
56
|
+
};
|
|
57
|
+
constructor(atpClient: AtpClient);
|
|
58
|
+
protected execute(params: {
|
|
59
|
+
likeUri: string;
|
|
60
|
+
}): Promise<{
|
|
61
|
+
success: boolean;
|
|
62
|
+
message: string;
|
|
63
|
+
deletedLike: {
|
|
64
|
+
uri: ATURI;
|
|
65
|
+
};
|
|
66
|
+
}>;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=like-post-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"like-post-tool.d.ts","sourceRoot":"","sources":["../../../src/tools/implementations/like-post-tool.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAUxE;;GAEG;AACH,qBAAa,YAAa,SAAQ,QAAQ;IACxC,SAAgB,MAAM;;;;;;;;;;;;;MAKpB;gBAEU,SAAS,EAAE,SAAS;cAIhB,OAAO,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC;QACxD,GAAG,EAAE,KAAK,CAAC;QACX,GAAG,EAAE,GAAG,CAAC;QACT,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE;YACT,GAAG,EAAE,KAAK,CAAC;YACX,GAAG,EAAE,GAAG,CAAC;SACV,CAAC;KACH,CAAC;IAgFF;;OAEG;YACW,iBAAiB;CAuChC;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,QAAQ;IAC1C,SAAgB,MAAM;;;;;;;;;;MAMpB;gBAEU,SAAS,EAAE,SAAS;cAIhB,OAAO,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAC5D,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE;YACX,GAAG,EAAE,KAAK,CAAC;SACZ,CAAC;KACH,CAAC;CAgDH"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Like Post Tool - Likes posts on AT Protocol
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { BaseTool } from './base-tool.js';
|
|
6
|
+
/**
|
|
7
|
+
* Zod schema for like post parameters
|
|
8
|
+
*/
|
|
9
|
+
const LikePostSchema = z.object({
|
|
10
|
+
uri: z.string().min(1, 'Post URI is required'),
|
|
11
|
+
cid: z.string().min(1, 'Post CID is required'),
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Tool for liking posts on AT Protocol
|
|
15
|
+
*/
|
|
16
|
+
export class LikePostTool extends BaseTool {
|
|
17
|
+
schema = {
|
|
18
|
+
method: 'like_post',
|
|
19
|
+
description: 'Like a post on AT Protocol. Creates a like record that references the target post.',
|
|
20
|
+
params: LikePostSchema,
|
|
21
|
+
};
|
|
22
|
+
constructor(atpClient) {
|
|
23
|
+
super(atpClient, 'LikePost');
|
|
24
|
+
}
|
|
25
|
+
async execute(params) {
|
|
26
|
+
try {
|
|
27
|
+
this.logger.info('Liking post', {
|
|
28
|
+
postUri: params.uri,
|
|
29
|
+
postCid: params.cid,
|
|
30
|
+
});
|
|
31
|
+
// Validate the post URI and CID
|
|
32
|
+
this.validateAtUri(params.uri);
|
|
33
|
+
this.validateCid(params.cid);
|
|
34
|
+
// Check if the post is already liked
|
|
35
|
+
const existingLike = await this.checkExistingLike(params.uri);
|
|
36
|
+
if (existingLike) {
|
|
37
|
+
this.logger.info('Post is already liked', {
|
|
38
|
+
postUri: params.uri,
|
|
39
|
+
likeUri: existingLike.uri,
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
uri: existingLike.uri,
|
|
43
|
+
cid: existingLike.cid,
|
|
44
|
+
success: true,
|
|
45
|
+
message: 'Post was already liked',
|
|
46
|
+
likedPost: {
|
|
47
|
+
uri: params.uri,
|
|
48
|
+
cid: params.cid,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
// Create the like record
|
|
53
|
+
const likeRecord = {
|
|
54
|
+
$type: 'app.bsky.feed.like',
|
|
55
|
+
subject: {
|
|
56
|
+
uri: params.uri,
|
|
57
|
+
cid: params.cid,
|
|
58
|
+
},
|
|
59
|
+
createdAt: new Date().toISOString(),
|
|
60
|
+
};
|
|
61
|
+
// Create the like using AT Protocol
|
|
62
|
+
const response = await this.executeAtpOperation(async () => {
|
|
63
|
+
const agent = this.atpClient.getAgent();
|
|
64
|
+
return await agent.com.atproto.repo.createRecord({
|
|
65
|
+
repo: agent.session?.did || '',
|
|
66
|
+
collection: 'app.bsky.feed.like',
|
|
67
|
+
record: likeRecord,
|
|
68
|
+
});
|
|
69
|
+
}, 'createLike', {
|
|
70
|
+
postUri: params.uri,
|
|
71
|
+
postCid: params.cid,
|
|
72
|
+
});
|
|
73
|
+
this.logger.info('Post liked successfully', {
|
|
74
|
+
likeUri: response.data.uri,
|
|
75
|
+
likeCid: response.data.cid,
|
|
76
|
+
postUri: params.uri,
|
|
77
|
+
});
|
|
78
|
+
return {
|
|
79
|
+
uri: response.data.uri,
|
|
80
|
+
cid: response.data.cid,
|
|
81
|
+
success: true,
|
|
82
|
+
message: 'Post liked successfully',
|
|
83
|
+
likedPost: {
|
|
84
|
+
uri: params.uri,
|
|
85
|
+
cid: params.cid,
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
this.logger.error('Failed to like post', error);
|
|
91
|
+
this.formatError(error);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Check if the post is already liked by the current user
|
|
96
|
+
*/
|
|
97
|
+
async checkExistingLike(postUri) {
|
|
98
|
+
try {
|
|
99
|
+
const response = await this.executeAtpOperation(async () => {
|
|
100
|
+
const agent = this.atpClient.getAgent();
|
|
101
|
+
const userDid = agent.session?.did;
|
|
102
|
+
if (!userDid) {
|
|
103
|
+
throw new Error('User session not available');
|
|
104
|
+
}
|
|
105
|
+
// List existing likes to check for duplicates
|
|
106
|
+
return await agent.com.atproto.repo.listRecords({
|
|
107
|
+
repo: userDid,
|
|
108
|
+
collection: 'app.bsky.feed.like',
|
|
109
|
+
limit: 100, // Should be enough to find recent likes
|
|
110
|
+
});
|
|
111
|
+
}, 'listLikes', { postUri });
|
|
112
|
+
// Check if any of the likes match the target post
|
|
113
|
+
for (const record of response.data.records) {
|
|
114
|
+
const likeRecord = record.value;
|
|
115
|
+
if (likeRecord.subject?.uri === postUri) {
|
|
116
|
+
return {
|
|
117
|
+
uri: record.uri,
|
|
118
|
+
cid: record.cid,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
this.logger.warn('Could not check for existing like', error);
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Unlike Post Tool - Removes likes from posts on AT Protocol
|
|
132
|
+
*/
|
|
133
|
+
export class UnlikePostTool extends BaseTool {
|
|
134
|
+
schema = {
|
|
135
|
+
method: 'unlike_post',
|
|
136
|
+
description: 'Remove a like from a post on AT Protocol. Deletes the like record.',
|
|
137
|
+
params: z.object({
|
|
138
|
+
likeUri: z.string().min(1, 'Like URI is required'),
|
|
139
|
+
}),
|
|
140
|
+
};
|
|
141
|
+
constructor(atpClient) {
|
|
142
|
+
super(atpClient, 'UnlikePost');
|
|
143
|
+
}
|
|
144
|
+
async execute(params) {
|
|
145
|
+
try {
|
|
146
|
+
this.logger.info('Unliking post', {
|
|
147
|
+
likeUri: params.likeUri,
|
|
148
|
+
});
|
|
149
|
+
// Validate the like URI
|
|
150
|
+
this.validateAtUri(params.likeUri);
|
|
151
|
+
// Delete the like record
|
|
152
|
+
await this.executeAtpOperation(async () => {
|
|
153
|
+
const agent = this.atpClient.getAgent();
|
|
154
|
+
const uriParts = params.likeUri.replace('at://', '').split('/');
|
|
155
|
+
const did = uriParts[0];
|
|
156
|
+
const collection = uriParts[1];
|
|
157
|
+
const rkey = uriParts[2];
|
|
158
|
+
if (!did || !collection || !rkey) {
|
|
159
|
+
throw new Error(`Invalid AT URI format: ${params.likeUri}`);
|
|
160
|
+
}
|
|
161
|
+
return await agent.com.atproto.repo.deleteRecord({
|
|
162
|
+
repo: did,
|
|
163
|
+
collection,
|
|
164
|
+
rkey,
|
|
165
|
+
});
|
|
166
|
+
}, 'deleteLike', { likeUri: params.likeUri });
|
|
167
|
+
this.logger.info('Post unliked successfully', {
|
|
168
|
+
likeUri: params.likeUri,
|
|
169
|
+
});
|
|
170
|
+
return {
|
|
171
|
+
success: true,
|
|
172
|
+
message: 'Post unliked successfully',
|
|
173
|
+
deletedLike: {
|
|
174
|
+
uri: params.likeUri,
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
this.logger.error('Failed to unlike post', error);
|
|
180
|
+
this.formatError(error);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=like-post-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"like-post-tool.js","sourceRoot":"","sources":["../../../src/tools/implementations/like-post-tool.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI1C;;GAEG;AACH,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,sBAAsB,CAAC;IAC9C,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,sBAAsB,CAAC;CAC/C,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,QAAQ;IACxB,MAAM,GAAG;QACvB,MAAM,EAAE,WAAW;QACnB,WAAW,EACT,oFAAoF;QACtF,MAAM,EAAE,cAAc;KACvB,CAAC;IAEF,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAC/B,CAAC;IAES,KAAK,CAAC,OAAO,CAAC,MAAuB;QAU7C,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE;gBAC9B,OAAO,EAAE,MAAM,CAAC,GAAG;gBACnB,OAAO,EAAE,MAAM,CAAC,GAAG;aACpB,CAAC,CAAC;YAEH,gCAAgC;YAChC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;Y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