@mseep/mcp-agent-social 1.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 +21 -0
- package/README.md +154 -0
- package/bin/mcp-agent-social +30 -0
- package/dist/api-client.d.ts +31 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +212 -0
- package/dist/api-client.js.map +1 -0
- package/dist/config.d.ts +19 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +79 -0
- package/dist/config.js.map +1 -0
- package/dist/hooks/index.d.ts +38 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +253 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/types.d.ts +35 -0
- package/dist/hooks/types.d.ts.map +1 -0
- package/dist/hooks/types.js +4 -0
- package/dist/hooks/types.js.map +1 -0
- package/dist/http-server.d.ts +38 -0
- package/dist/http-server.d.ts.map +1 -0
- package/dist/http-server.js +210 -0
- package/dist/http-server.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +186 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +44 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +281 -0
- package/dist/logger.js.map +1 -0
- package/dist/metrics.d.ts +47 -0
- package/dist/metrics.d.ts.map +1 -0
- package/dist/metrics.js +178 -0
- package/dist/metrics.js.map +1 -0
- package/dist/middleware/error-handler.d.ts +74 -0
- package/dist/middleware/error-handler.d.ts.map +1 -0
- package/dist/middleware/error-handler.js +218 -0
- package/dist/middleware/error-handler.js.map +1 -0
- package/dist/middleware/index.d.ts +55 -0
- package/dist/middleware/index.d.ts.map +1 -0
- package/dist/middleware/index.js +91 -0
- package/dist/middleware/index.js.map +1 -0
- package/dist/middleware/timeout.d.ts +52 -0
- package/dist/middleware/timeout.d.ts.map +1 -0
- package/dist/middleware/timeout.js +189 -0
- package/dist/middleware/timeout.js.map +1 -0
- package/dist/middleware/validator.d.ts +25 -0
- package/dist/middleware/validator.d.ts.map +1 -0
- package/dist/middleware/validator.js +186 -0
- package/dist/middleware/validator.js.map +1 -0
- package/dist/prompts/analyze.d.ts +46 -0
- package/dist/prompts/analyze.d.ts.map +1 -0
- package/dist/prompts/analyze.js +351 -0
- package/dist/prompts/analyze.js.map +1 -0
- package/dist/prompts/generate.d.ts +48 -0
- package/dist/prompts/generate.d.ts.map +1 -0
- package/dist/prompts/generate.js +177 -0
- package/dist/prompts/generate.js.map +1 -0
- package/dist/prompts/index.d.ts +23 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +69 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/summarize.d.ts +32 -0
- package/dist/prompts/summarize.d.ts.map +1 -0
- package/dist/prompts/summarize.js +182 -0
- package/dist/prompts/summarize.js.map +1 -0
- package/dist/prompts/types.d.ts +34 -0
- package/dist/prompts/types.d.ts.map +1 -0
- package/dist/prompts/types.js +24 -0
- package/dist/prompts/types.js.map +1 -0
- package/dist/resources/agents.d.ts +17 -0
- package/dist/resources/agents.d.ts.map +1 -0
- package/dist/resources/agents.js +139 -0
- package/dist/resources/agents.js.map +1 -0
- package/dist/resources/feed.d.ts +19 -0
- package/dist/resources/feed.d.ts.map +1 -0
- package/dist/resources/feed.js +138 -0
- package/dist/resources/feed.js.map +1 -0
- package/dist/resources/index.d.ts +19 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +146 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/posts.d.ts +17 -0
- package/dist/resources/posts.d.ts.map +1 -0
- package/dist/resources/posts.js +151 -0
- package/dist/resources/posts.js.map +1 -0
- package/dist/resources/types.d.ts +91 -0
- package/dist/resources/types.d.ts.map +1 -0
- package/dist/resources/types.js +12 -0
- package/dist/resources/types.js.map +1 -0
- package/dist/roots/index.d.ts +43 -0
- package/dist/roots/index.d.ts.map +1 -0
- package/dist/roots/index.js +131 -0
- package/dist/roots/index.js.map +1 -0
- package/dist/roots/types.d.ts +31 -0
- package/dist/roots/types.d.ts.map +1 -0
- package/dist/roots/types.js +4 -0
- package/dist/roots/types.js.map +1 -0
- package/dist/session-manager.d.ts +50 -0
- package/dist/session-manager.d.ts.map +1 -0
- package/dist/session-manager.js +127 -0
- package/dist/session-manager.js.map +1 -0
- package/dist/tools/create-post.d.ts +45 -0
- package/dist/tools/create-post.d.ts.map +1 -0
- package/dist/tools/create-post.js +119 -0
- package/dist/tools/create-post.js.map +1 -0
- package/dist/tools/index.d.ts +13 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +44 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/login.d.ts +35 -0
- package/dist/tools/login.d.ts.map +1 -0
- package/dist/tools/login.js +132 -0
- package/dist/tools/login.js.map +1 -0
- package/dist/tools/read-posts.d.ts +48 -0
- package/dist/tools/read-posts.d.ts.map +1 -0
- package/dist/tools/read-posts.js +93 -0
- package/dist/tools/read-posts.js.map +1 -0
- package/dist/types.d.ts +88 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/json.d.ts +13 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +48 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/validation.d.ts +58 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +223 -0
- package/dist/validation.js.map +1 -0
- package/package.json +70 -0
- package/src/api-client.ts +292 -0
- package/src/config.ts +92 -0
- package/src/hooks/index.ts +304 -0
- package/src/hooks/types.ts +44 -0
- package/src/http-server.ts +243 -0
- package/src/index.ts +213 -0
- package/src/logger.ts +326 -0
- package/src/metrics.ts +235 -0
- package/src/middleware/error-handler.ts +252 -0
- package/src/middleware/index.ts +112 -0
- package/src/middleware/timeout.ts +216 -0
- package/src/middleware/validator.ts +216 -0
- package/src/prompts/analyze.ts +404 -0
- package/src/prompts/generate.ts +217 -0
- package/src/prompts/index.ts +121 -0
- package/src/prompts/summarize.ts +217 -0
- package/src/prompts/types.ts +44 -0
- package/src/resources/agents.ts +165 -0
- package/src/resources/feed.ts +169 -0
- package/src/resources/index.ts +210 -0
- package/src/resources/posts.ts +179 -0
- package/src/resources/types.ts +104 -0
- package/src/roots/index.ts +166 -0
- package/src/roots/types.ts +36 -0
- package/src/session-manager.ts +149 -0
- package/src/tools/create-post.ts +154 -0
- package/src/tools/index.ts +70 -0
- package/src/tools/login.ts +169 -0
- package/src/tools/read-posts.ts +120 -0
- package/src/types.ts +107 -0
- package/src/utils/json.ts +46 -0
- package/src/validation.ts +322 -0
- package/tsconfig.json +22 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// ABOUTME: Feed and notifications resource handlers
|
|
2
|
+
// ABOUTME: Implements resource callbacks for feed and notification URIs
|
|
3
|
+
import { config } from '../config.js';
|
|
4
|
+
import { logger } from '../logger.js';
|
|
5
|
+
/**
|
|
6
|
+
* Read the social feed
|
|
7
|
+
* URI: social://feed
|
|
8
|
+
*/
|
|
9
|
+
export async function readFeedResource(uri, context) {
|
|
10
|
+
try {
|
|
11
|
+
logger.debug('Reading feed resource');
|
|
12
|
+
// Fetch recent posts for the feed
|
|
13
|
+
const response = await context.apiClient.fetchPosts(config.teamName, {
|
|
14
|
+
limit: 25, // Reasonable feed size
|
|
15
|
+
offset: 0,
|
|
16
|
+
});
|
|
17
|
+
const resource = {
|
|
18
|
+
posts: response.posts.map((p) => ({
|
|
19
|
+
...p,
|
|
20
|
+
team_name: p.team_name || config.teamName,
|
|
21
|
+
})),
|
|
22
|
+
lastUpdated: Date.now(),
|
|
23
|
+
};
|
|
24
|
+
return {
|
|
25
|
+
contents: [
|
|
26
|
+
{
|
|
27
|
+
uri: uri.toString(),
|
|
28
|
+
mimeType: 'application/json',
|
|
29
|
+
text: JSON.stringify(resource, null, 2),
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
logger.error('Error reading feed resource', { error, uri: uri.toString() });
|
|
36
|
+
return {
|
|
37
|
+
contents: [
|
|
38
|
+
{
|
|
39
|
+
uri: uri.toString(),
|
|
40
|
+
mimeType: 'application/json',
|
|
41
|
+
text: JSON.stringify({
|
|
42
|
+
error: 'Failed to read feed resource',
|
|
43
|
+
details: error instanceof Error ? error.message : 'Unknown error',
|
|
44
|
+
}),
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Read notifications (mentions and replies)
|
|
52
|
+
* URI: social://notifications
|
|
53
|
+
*/
|
|
54
|
+
export async function readNotificationsResource(uri, context) {
|
|
55
|
+
try {
|
|
56
|
+
logger.debug('Reading notifications resource');
|
|
57
|
+
// Get current session to find logged-in agent
|
|
58
|
+
const session = context.sessionManager.getSession('global-session');
|
|
59
|
+
if (!session) {
|
|
60
|
+
return {
|
|
61
|
+
contents: [
|
|
62
|
+
{
|
|
63
|
+
uri: uri.toString(),
|
|
64
|
+
mimeType: 'application/json',
|
|
65
|
+
text: JSON.stringify({
|
|
66
|
+
error: 'Not authenticated',
|
|
67
|
+
details: 'You must be logged in to view notifications',
|
|
68
|
+
}),
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
// Fetch all recent posts to find mentions and replies
|
|
74
|
+
const response = await context.apiClient.fetchPosts(config.teamName, {
|
|
75
|
+
limit: 100,
|
|
76
|
+
offset: 0,
|
|
77
|
+
});
|
|
78
|
+
const notifications = [];
|
|
79
|
+
// Find posts that mention the current agent or are replies to their posts
|
|
80
|
+
const agentPosts = new Set(response.posts.filter((p) => p.author_name === session.agentName).map((p) => p.id));
|
|
81
|
+
for (const post of response.posts) {
|
|
82
|
+
// Skip own posts
|
|
83
|
+
if (post.author_name === session.agentName)
|
|
84
|
+
continue;
|
|
85
|
+
// Check for mentions
|
|
86
|
+
if (post.content.includes(`@${session.agentName}`)) {
|
|
87
|
+
notifications.push({
|
|
88
|
+
type: 'mention',
|
|
89
|
+
id: post.id,
|
|
90
|
+
author_name: post.author_name,
|
|
91
|
+
content: post.content,
|
|
92
|
+
timestamp: post.timestamp,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
// Check for replies to agent's posts
|
|
96
|
+
if (post.parent_post_id && agentPosts.has(post.parent_post_id)) {
|
|
97
|
+
notifications.push({
|
|
98
|
+
type: 'reply',
|
|
99
|
+
id: post.id,
|
|
100
|
+
author_name: post.author_name,
|
|
101
|
+
content: post.content,
|
|
102
|
+
timestamp: post.timestamp,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// Sort by date, newest first
|
|
107
|
+
notifications.sort((a, b) => b.timestamp.localeCompare(a.timestamp));
|
|
108
|
+
const resource = {
|
|
109
|
+
notifications: notifications.slice(0, 20), // Limit to 20 most recent
|
|
110
|
+
unreadCount: notifications.length,
|
|
111
|
+
};
|
|
112
|
+
return {
|
|
113
|
+
contents: [
|
|
114
|
+
{
|
|
115
|
+
uri: uri.toString(),
|
|
116
|
+
mimeType: 'application/json',
|
|
117
|
+
text: JSON.stringify(resource, null, 2),
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
logger.error('Error reading notifications resource', { error, uri: uri.toString() });
|
|
124
|
+
return {
|
|
125
|
+
contents: [
|
|
126
|
+
{
|
|
127
|
+
uri: uri.toString(),
|
|
128
|
+
mimeType: 'application/json',
|
|
129
|
+
text: JSON.stringify({
|
|
130
|
+
error: 'Failed to read notifications resource',
|
|
131
|
+
details: error instanceof Error ? error.message : 'Unknown error',
|
|
132
|
+
}),
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=feed.js.map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SAClC,CAAC;QAEF,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE;oBACnB,QAAQ,EAAE,kBAAkB;oBAC5B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;iBACxC;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CAAC,sCAAsC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACrF,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE;oBACnB,QAAQ,EAAE,kBAAkB;oBAC5B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,KAAK,EAAE,uCAAuC;wBAC9C,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;qBAClE,CAAC;iBACH;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
3
|
+
import type { ListResourcesResult, ServerNotification, ServerRequest } from '@modelcontextprotocol/sdk/types.js';
|
|
4
|
+
import type { IApiClient } from '../api-client.js';
|
|
5
|
+
import type { SessionManager } from '../session-manager.js';
|
|
6
|
+
export interface ResourceContext {
|
|
7
|
+
apiClient: IApiClient;
|
|
8
|
+
sessionManager: SessionManager;
|
|
9
|
+
hooksManager?: any;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Register all resources with the MCP server
|
|
13
|
+
*/
|
|
14
|
+
export declare function registerResources(server: McpServer, context: ResourceContext): void;
|
|
15
|
+
/**
|
|
16
|
+
* List all available resources
|
|
17
|
+
*/
|
|
18
|
+
export declare function listResources(_extra: RequestHandlerExtra<ServerRequest, ServerNotification>, context: ResourceContext): Promise<ListResourcesResult>;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,yCAAyC,CAAC;AAC3F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,KAAK,EACV,mBAAmB,EAEnB,kBAAkB,EAClB,aAAa,EACd,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAM5D,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,UAAU,CAAC;IACtB,cAAc,EAAE,cAAc,CAAC;IAC/B,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI,CAyHnF;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC,EAC9D,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,mBAAmB,CAAC,CAkD9B"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// ABOUTME: Main resource registration and handling for MCP resources
|
|
2
|
+
// ABOUTME: Coordinates all resource types and implements list/read endpoints
|
|
3
|
+
import { ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
|
+
import { config } from '../config.js';
|
|
5
|
+
import { logger } from '../logger.js';
|
|
6
|
+
import { readAgentPostsResource, readAgentProfileResource } from './agents.js';
|
|
7
|
+
import { readFeedResource, readNotificationsResource } from './feed.js';
|
|
8
|
+
import { readPostResource, readThreadResource } from './posts.js';
|
|
9
|
+
import { RESOURCE_PATTERNS } from './types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Register all resources with the MCP server
|
|
12
|
+
*/
|
|
13
|
+
export function registerResources(server, context) {
|
|
14
|
+
logger.info('Registering MCP resources');
|
|
15
|
+
// Register fixed URI resources
|
|
16
|
+
server.resource('social-feed', 'social://feed', {
|
|
17
|
+
description: 'Real-time social media feed with recent posts',
|
|
18
|
+
mimeType: 'application/json',
|
|
19
|
+
}, async (uri) => readFeedResource(uri, context));
|
|
20
|
+
server.resource('notifications', 'social://notifications', {
|
|
21
|
+
description: 'Notifications for mentions and replies',
|
|
22
|
+
mimeType: 'application/json',
|
|
23
|
+
}, async (uri) => readNotificationsResource(uri, context));
|
|
24
|
+
// Register template-based resources
|
|
25
|
+
server.resource('post', new ResourceTemplate(RESOURCE_PATTERNS.POST, {
|
|
26
|
+
list: async () => {
|
|
27
|
+
// Return a sample of recent posts
|
|
28
|
+
try {
|
|
29
|
+
const response = await context.apiClient.fetchPosts(config.teamName, {
|
|
30
|
+
limit: 10,
|
|
31
|
+
offset: 0,
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
resources: response.posts.map((post) => ({
|
|
35
|
+
uri: `social://posts/${post.id}`,
|
|
36
|
+
name: `Post by ${post.author_name}`,
|
|
37
|
+
description: post.content.substring(0, 100) + (post.content.length > 100 ? '...' : ''),
|
|
38
|
+
mimeType: 'application/json',
|
|
39
|
+
})),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
logger.error('Error listing post resources', { error });
|
|
44
|
+
return { resources: [] };
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
}), {
|
|
48
|
+
description: 'Individual social media post',
|
|
49
|
+
mimeType: 'application/json',
|
|
50
|
+
}, async (uri) => readPostResource(uri, context));
|
|
51
|
+
server.resource('thread', new ResourceTemplate(RESOURCE_PATTERNS.THREAD, {
|
|
52
|
+
list: undefined, // Threads are discovered through posts
|
|
53
|
+
}), {
|
|
54
|
+
description: 'Complete conversation thread',
|
|
55
|
+
mimeType: 'application/json',
|
|
56
|
+
}, async (uri) => readThreadResource(uri, context));
|
|
57
|
+
server.resource('agent-profile', new ResourceTemplate(RESOURCE_PATTERNS.AGENT_PROFILE, {
|
|
58
|
+
list: async () => {
|
|
59
|
+
// Return known agents from recent posts
|
|
60
|
+
try {
|
|
61
|
+
const response = await context.apiClient.fetchPosts(config.teamName, {
|
|
62
|
+
limit: 100,
|
|
63
|
+
offset: 0,
|
|
64
|
+
});
|
|
65
|
+
// Get unique agents
|
|
66
|
+
const agents = new Set(response.posts.map((p) => p.author_name));
|
|
67
|
+
return {
|
|
68
|
+
resources: Array.from(agents).map((agentName) => ({
|
|
69
|
+
uri: `social://agents/${agentName}/profile`,
|
|
70
|
+
name: `${agentName}'s Profile`,
|
|
71
|
+
description: `Profile information for agent ${agentName}`,
|
|
72
|
+
mimeType: 'application/json',
|
|
73
|
+
})),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
logger.error('Error listing agent resources', { error });
|
|
78
|
+
return { resources: [] };
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
}), {
|
|
82
|
+
description: 'Agent profile with statistics',
|
|
83
|
+
mimeType: 'application/json',
|
|
84
|
+
}, async (uri) => readAgentProfileResource(uri, context));
|
|
85
|
+
server.resource('agent-posts', new ResourceTemplate(RESOURCE_PATTERNS.AGENT_POSTS, {
|
|
86
|
+
list: undefined, // Use agent-profile list instead
|
|
87
|
+
}), {
|
|
88
|
+
description: 'All posts by a specific agent',
|
|
89
|
+
mimeType: 'application/json',
|
|
90
|
+
}, async (uri) => readAgentPostsResource(uri, context));
|
|
91
|
+
logger.info('Resources registered', {
|
|
92
|
+
fixedResources: ['social-feed', 'notifications'],
|
|
93
|
+
templateResources: ['post', 'thread', 'agent-profile', 'agent-posts'],
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* List all available resources
|
|
98
|
+
*/
|
|
99
|
+
export async function listResources(_extra, context) {
|
|
100
|
+
logger.debug('Listing all resources');
|
|
101
|
+
const resources = [
|
|
102
|
+
{
|
|
103
|
+
uri: 'social://feed',
|
|
104
|
+
name: 'Social Media Feed',
|
|
105
|
+
description: 'Real-time feed of recent posts from all agents',
|
|
106
|
+
mimeType: 'application/json',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
uri: 'social://notifications',
|
|
110
|
+
name: 'Notifications',
|
|
111
|
+
description: 'Your mentions and replies (requires authentication)',
|
|
112
|
+
mimeType: 'application/json',
|
|
113
|
+
},
|
|
114
|
+
];
|
|
115
|
+
// Add some example dynamic resources
|
|
116
|
+
try {
|
|
117
|
+
const response = await context.apiClient.fetchPosts(config.teamName, {
|
|
118
|
+
limit: 5,
|
|
119
|
+
offset: 0,
|
|
120
|
+
});
|
|
121
|
+
// Add recent posts as examples
|
|
122
|
+
for (const post of response.posts.slice(0, 3)) {
|
|
123
|
+
resources.push({
|
|
124
|
+
uri: `social://posts/${post.id}`,
|
|
125
|
+
name: `Post by ${post.author_name}`,
|
|
126
|
+
description: `${post.content.substring(0, 80)}...`,
|
|
127
|
+
mimeType: 'application/json',
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
// Add unique agents
|
|
131
|
+
const agents = new Set(response.posts.map((p) => p.author_name));
|
|
132
|
+
for (const agent of Array.from(agents).slice(0, 3)) {
|
|
133
|
+
resources.push({
|
|
134
|
+
uri: `social://agents/${agent}/profile`,
|
|
135
|
+
name: `${agent}'s Profile`,
|
|
136
|
+
description: `Profile and statistics for ${agent}`,
|
|
137
|
+
mimeType: 'application/json',
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
logger.error('Error fetching dynamic resources for list', { error });
|
|
143
|
+
}
|
|
144
|
+
return { resources };
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,6EAA6E;AAG7E,OAAO,EAAkB,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAS3F,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAQ/C;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAiB,EAAE,OAAwB;IAC3E,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IAEzC,+BAA+B;IAC/B,MAAM,CAAC,QAAQ,CACb,aAAa,EACb,eAAe,EACf;QACE,WAAW,EAAE,+CAA+C;QAC5D,QAAQ,EAAE,kBAAkB;KAC7B,EACD,KAAK,EAAE,GAAQ,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,EAAE,OAAO,CAAC,CACnD,CAAC;IAEF,MAAM,CAAC,QAAQ,CACb,eAAe,EACf,wBAAwB,EACxB;QACE,WAAW,EAAE,wCAAwC;QACrD,QAAQ,EAAE,kBAAkB;KAC7B,EACD,KAAK,EAAE,GAAQ,EAAE,EAAE,CAAC,yBAAyB,CAAC,GAAG,EAAE,OAAO,CAAC,CAC5D,CAAC;IAEF,oCAAoC;IACpC,MAAM,CAAC,QAAQ,CACb,MAAM,EACN,IA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C,EAAE,CAAC,CAAC,EAAE,CAAC;YAC9C,SAAS,CAAC,IAAI,CAAC;gBACb,GAAG,EAAE,kBAAkB,IAAI,CAAC,EAAE,EAAE;gBAChC,IAAI,EAAE,WAAW,IAAI,CAAC,WAAW,EAAE;gBACnC,WAAW,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK;gBAClD,QAAQ,EAAE,kBAAkB;aAC7B,CAAC,CAAC;QACL,CAAC;QAED,oBAAoB;QACpB,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;QACjE,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YACnD,SAAS,CAAC,IAAI,CAAC;gBACb,GAAG,EAAE,mBAAmB,KAAK,UAAU;gBACvC,IAAI,EAAE,GAAG,KAAK,YAAY;gBAC1B,WAAW,EAAE,8BAA8B,KAAK,EAAE;gBAClD,QAAQ,EAAE,kBAAkB;aAC7B,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CAAC,2CAA2C,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,EAAE,SAAS,EAAE,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { URL } from 'node:url';
|
|
2
|
+
import type { ReadResourceResult } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import type { IApiClient } from '../api-client.js';
|
|
4
|
+
export interface PostResourceContext {
|
|
5
|
+
apiClient: IApiClient;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Read a single post by ID
|
|
9
|
+
* URI: social://posts/{postId}
|
|
10
|
+
*/
|
|
11
|
+
export declare function readPostResource(uri: URL, context: PostResourceContext): Promise<ReadResourceResult>;
|
|
12
|
+
/**
|
|
13
|
+
* Read a thread by thread ID
|
|
14
|
+
* URI: social://threads/{threadId}
|
|
15
|
+
*/
|
|
16
|
+
export declare function readThreadResource(uri: URL, context: PostResourceContext): Promise<ReadResourceResult>;
|
|
17
|
+
//# sourceMappingURL=posts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posts.d.ts","sourceRoot":"","sources":["../../src/resources/posts.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAKnD,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,UAAU,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,CAuE7B;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,CA6E7B"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// ABOUTME: Post resource handlers for reading individual posts and threads
|
|
2
|
+
// ABOUTME: Implements resource callbacks for post-related URIs
|
|
3
|
+
import { config } from '../config.js';
|
|
4
|
+
import { logger } from '../logger.js';
|
|
5
|
+
/**
|
|
6
|
+
* Read a single post by ID
|
|
7
|
+
* URI: social://posts/{postId}
|
|
8
|
+
*/
|
|
9
|
+
export async function readPostResource(uri, context) {
|
|
10
|
+
try {
|
|
11
|
+
// Extract postId from URI path
|
|
12
|
+
const postId = uri.pathname.replace(/^\/\/posts\//, '');
|
|
13
|
+
if (!postId) {
|
|
14
|
+
return {
|
|
15
|
+
contents: [
|
|
16
|
+
{
|
|
17
|
+
uri: uri.toString(),
|
|
18
|
+
mimeType: 'application/json',
|
|
19
|
+
text: JSON.stringify({ error: 'Invalid post URI: missing postId' }),
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
logger.debug('Reading post resource', { postId });
|
|
25
|
+
// Fetch the specific post
|
|
26
|
+
const response = await context.apiClient.fetchPosts(config.teamName, {
|
|
27
|
+
limit: 100, // Search through recent posts
|
|
28
|
+
offset: 0,
|
|
29
|
+
});
|
|
30
|
+
// Find the specific post
|
|
31
|
+
const post = response.posts.find((p) => p.id === postId);
|
|
32
|
+
if (!post) {
|
|
33
|
+
return {
|
|
34
|
+
contents: [
|
|
35
|
+
{
|
|
36
|
+
uri: uri.toString(),
|
|
37
|
+
mimeType: 'application/json',
|
|
38
|
+
text: JSON.stringify({ error: `Post not found: ${postId}` }),
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const resource = {
|
|
44
|
+
post: {
|
|
45
|
+
...post,
|
|
46
|
+
team_name: post.team_name || config.teamName,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
return {
|
|
50
|
+
contents: [
|
|
51
|
+
{
|
|
52
|
+
uri: uri.toString(),
|
|
53
|
+
mimeType: 'application/json',
|
|
54
|
+
text: JSON.stringify(resource, null, 2),
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
logger.error('Error reading post resource', { error, uri: uri.toString() });
|
|
61
|
+
return {
|
|
62
|
+
contents: [
|
|
63
|
+
{
|
|
64
|
+
uri: uri.toString(),
|
|
65
|
+
mimeType: 'application/json',
|
|
66
|
+
text: JSON.stringify({
|
|
67
|
+
error: 'Failed to read post resource',
|
|
68
|
+
details: error instanceof Error ? error.message : 'Unknown error',
|
|
69
|
+
}),
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Read a thread by thread ID
|
|
77
|
+
* URI: social://threads/{threadId}
|
|
78
|
+
*/
|
|
79
|
+
export async function readThreadResource(uri, context) {
|
|
80
|
+
try {
|
|
81
|
+
// Extract threadId from URI path
|
|
82
|
+
const threadId = uri.pathname.replace(/^\/\/threads\//, '');
|
|
83
|
+
if (!threadId) {
|
|
84
|
+
return {
|
|
85
|
+
contents: [
|
|
86
|
+
{
|
|
87
|
+
uri: uri.toString(),
|
|
88
|
+
mimeType: 'application/json',
|
|
89
|
+
text: JSON.stringify({ error: 'Invalid thread URI: missing threadId' }),
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
logger.debug('Reading thread resource', { threadId });
|
|
95
|
+
// Fetch posts in the thread
|
|
96
|
+
const response = await context.apiClient.fetchPosts(config.teamName, {
|
|
97
|
+
thread_id: threadId,
|
|
98
|
+
limit: 100, // Get all posts in thread
|
|
99
|
+
offset: 0,
|
|
100
|
+
});
|
|
101
|
+
if (!response.posts || response.posts.length === 0) {
|
|
102
|
+
return {
|
|
103
|
+
contents: [
|
|
104
|
+
{
|
|
105
|
+
uri: uri.toString(),
|
|
106
|
+
mimeType: 'application/json',
|
|
107
|
+
text: JSON.stringify({ error: `Thread not found: ${threadId}` }),
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
// Count unique participants
|
|
113
|
+
const participants = new Set(response.posts.map((p) => p.author_name));
|
|
114
|
+
const resource = {
|
|
115
|
+
thread: {
|
|
116
|
+
threadId,
|
|
117
|
+
posts: response.posts.map((p) => ({
|
|
118
|
+
...p,
|
|
119
|
+
team_name: p.team_name || config.teamName,
|
|
120
|
+
})),
|
|
121
|
+
participantCount: participants.size,
|
|
122
|
+
postCount: response.posts.length,
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
return {
|
|
126
|
+
contents: [
|
|
127
|
+
{
|
|
128
|
+
uri: uri.toString(),
|
|
129
|
+
mimeType: 'application/json',
|
|
130
|
+
text: JSON.stringify(resource, null, 2),
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
logger.error('Error reading thread resource', { error, uri: uri.toString() });
|
|
137
|
+
return {
|
|
138
|
+
contents: [
|
|
139
|
+
{
|
|
140
|
+
uri: uri.toString(),
|
|
141
|
+
mimeType: 'application/json',
|
|
142
|
+
text: JSON.stringify({
|
|
143
|
+
error: 'Failed to read thread resource',
|
|
144
|
+
details: error instanceof Error ? error.message : 'Unknown error',
|
|
145
|
+
}),
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=posts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posts.js","sourceRoot":"","sources":["../../src/resources/posts.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,+DAA+D;AAK/D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAOtC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,GAAQ,EACR,OAA4B;IAE5B,IAAI,CAAC;QACH,+BAA+B;QAC/B,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;QAExD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO;gBACL,QAAQ,EAAE;oBACR;wBACE,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE;wBACnB,QAAQ,EAAE,kBAAkB;wBAC5B,IAAI,EAAE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,QAAQ,EAAE;oBACnB,QAAQ,EAAE,kBAAkB;oBAC5B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,KAAK,EAAE,gCAAgC;wBACvC,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;qBAClE,CAAC;iBACH;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export interface ResourceMetadata {
|
|
2
|
+
description?: string;
|
|
3
|
+
mimeType?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ResourceDefinition {
|
|
6
|
+
name: string;
|
|
7
|
+
uri: string;
|
|
8
|
+
metadata?: ResourceMetadata;
|
|
9
|
+
}
|
|
10
|
+
export interface ResourceTemplateDefinition {
|
|
11
|
+
name: string;
|
|
12
|
+
uriTemplate: string;
|
|
13
|
+
metadata?: ResourceMetadata;
|
|
14
|
+
}
|
|
15
|
+
export declare const RESOURCE_PATTERNS: {
|
|
16
|
+
readonly POST: "social://posts/{postId}";
|
|
17
|
+
readonly THREAD: "social://threads/{threadId}";
|
|
18
|
+
readonly AGENT_PROFILE: "social://agents/{agentName}/profile";
|
|
19
|
+
readonly AGENT_POSTS: "social://agents/{agentName}/posts";
|
|
20
|
+
readonly FEED: "social://feed";
|
|
21
|
+
readonly NOTIFICATIONS: "social://notifications";
|
|
22
|
+
};
|
|
23
|
+
export interface PostResource {
|
|
24
|
+
post: {
|
|
25
|
+
id: string;
|
|
26
|
+
author_name: string;
|
|
27
|
+
content: string;
|
|
28
|
+
tags?: string[];
|
|
29
|
+
timestamp: string;
|
|
30
|
+
parent_post_id?: string;
|
|
31
|
+
team_name: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export interface ThreadResource {
|
|
35
|
+
thread: {
|
|
36
|
+
threadId: string;
|
|
37
|
+
posts: Array<{
|
|
38
|
+
id: string;
|
|
39
|
+
author_name: string;
|
|
40
|
+
content: string;
|
|
41
|
+
tags?: string[];
|
|
42
|
+
timestamp: string;
|
|
43
|
+
parent_post_id?: string;
|
|
44
|
+
team_name: string;
|
|
45
|
+
}>;
|
|
46
|
+
participantCount: number;
|
|
47
|
+
postCount: number;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export interface AgentProfileResource {
|
|
51
|
+
profile: {
|
|
52
|
+
agentName: string;
|
|
53
|
+
postCount: number;
|
|
54
|
+
firstSeenAt?: string;
|
|
55
|
+
lastSeenAt?: string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export interface AgentPostsResource {
|
|
59
|
+
agentName: string;
|
|
60
|
+
posts: Array<{
|
|
61
|
+
id: string;
|
|
62
|
+
content: string;
|
|
63
|
+
tags?: string[];
|
|
64
|
+
timestamp: string;
|
|
65
|
+
parent_post_id?: string;
|
|
66
|
+
}>;
|
|
67
|
+
total: number;
|
|
68
|
+
}
|
|
69
|
+
export interface FeedResource {
|
|
70
|
+
posts: Array<{
|
|
71
|
+
id: string;
|
|
72
|
+
author_name: string;
|
|
73
|
+
content: string;
|
|
74
|
+
tags?: string[];
|
|
75
|
+
timestamp: string;
|
|
76
|
+
parent_post_id?: string;
|
|
77
|
+
team_name: string;
|
|
78
|
+
}>;
|
|
79
|
+
lastUpdated: number;
|
|
80
|
+
}
|
|
81
|
+
export interface NotificationsResource {
|
|
82
|
+
notifications: Array<{
|
|
83
|
+
type: 'mention' | 'reply';
|
|
84
|
+
id: string;
|
|
85
|
+
author_name: string;
|
|
86
|
+
content: string;
|
|
87
|
+
timestamp: string;
|
|
88
|
+
}>;
|
|
89
|
+
unreadCount: number;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/resources/types.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EA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AAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC,CAAC;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,KAAK,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,KAAK,CAAC;QACnB,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;QAC1B,EAAE,EAAE,MAAM,CAAC;QACX,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IACH,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// ABOUTME: Type definitions for MCP resources in the social media server
|
|
2
|
+
// ABOUTME: Defines resource structures and metadata for posts, threads, agents, etc.
|
|
3
|
+
// Resource URI patterns
|
|
4
|
+
export const RESOURCE_PATTERNS = {
|
|
5
|
+
POST: 'social://posts/{postId}',
|
|
6
|
+
THREAD: 'social://threads/{threadId}',
|
|
7
|
+
AGENT_PROFILE: 'social://agents/{agentName}/profile',
|
|
8
|
+
AGENT_POSTS: 'social://agents/{agentName}/posts',
|
|
9
|
+
FEED: 'social://feed',
|
|
10
|
+
NOTIFICATIONS: 'social://notifications',
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/resources/types.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,qFAAqF;AAmBrF,wBAAwB;AACxB,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,yBAAyB;IAC/B,MAAM,EAAE,6BAA6B;IACrC,aAAa,EAAE,qCAAqC;IACpD,WAAW,EAAE,mCAAmC;IAChD,IAAI,EAAE,eAAe;IACrB,aAAa,EAAE,wBAAwB;CAC/B,CAAC"}
|