agent-communication-mcp 0.6.0 → 0.7.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.
@@ -1,183 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.presenceTools = exports.listRoomUsersTool = exports.leaveRoomTool = exports.enterRoomTool = void 0;
4
- exports.handleEnterRoom = handleEnterRoom;
5
- exports.handleLeaveRoom = handleLeaveRoom;
6
- exports.handleListRoomUsers = handleListRoomUsers;
7
- const PresenceService_1 = require("../presence/PresenceService");
8
- const room_schema_1 = require("../../../schemas/room.schema");
9
- const errors_1 = require("../../../errors");
10
- const presenceService = new PresenceService_1.PresenceService();
11
- exports.enterRoomTool = {
12
- name: 'agent_communication/enter_room',
13
- description: 'Enter a room and set presence status to online',
14
- inputSchema: {
15
- type: 'object',
16
- properties: {
17
- agentName: {
18
- type: 'string',
19
- description: 'Name of the agent entering the room',
20
- minLength: 1,
21
- maxLength: 50
22
- },
23
- roomName: {
24
- type: 'string',
25
- description: 'Name of the room to enter',
26
- pattern: '^[a-zA-Z0-9-_]+$',
27
- minLength: 1,
28
- maxLength: 50
29
- },
30
- profile: {
31
- type: 'object',
32
- description: 'Optional agent profile information',
33
- properties: {
34
- role: {
35
- type: 'string',
36
- description: 'Role of the agent (e.g., "coordinator", "analyzer")',
37
- maxLength: 50
38
- },
39
- description: {
40
- type: 'string',
41
- description: 'Description of the agent',
42
- maxLength: 200
43
- },
44
- capabilities: {
45
- type: 'array',
46
- description: 'List of agent capabilities',
47
- items: {
48
- type: 'string',
49
- maxLength: 50
50
- },
51
- maxItems: 20
52
- },
53
- metadata: {
54
- type: 'object',
55
- description: 'Additional metadata'
56
- }
57
- }
58
- }
59
- },
60
- required: ['agentName', 'roomName']
61
- }
62
- };
63
- exports.leaveRoomTool = {
64
- name: 'agent_communication/leave_room',
65
- description: 'Leave a room and set presence status to offline',
66
- inputSchema: {
67
- type: 'object',
68
- properties: {
69
- agentName: {
70
- type: 'string',
71
- description: 'Name of the agent leaving the room',
72
- minLength: 1,
73
- maxLength: 50
74
- },
75
- roomName: {
76
- type: 'string',
77
- description: 'Name of the room to leave',
78
- pattern: '^[a-zA-Z0-9-_]+$',
79
- minLength: 1,
80
- maxLength: 50
81
- }
82
- },
83
- required: ['agentName', 'roomName']
84
- }
85
- };
86
- exports.listRoomUsersTool = {
87
- name: 'agent_communication/list_room_users',
88
- description: 'List all users in a room with their status and profile information',
89
- inputSchema: {
90
- type: 'object',
91
- properties: {
92
- roomName: {
93
- type: 'string',
94
- description: 'Name of the room to list users from',
95
- pattern: '^[a-zA-Z0-9-_]+$',
96
- minLength: 1,
97
- maxLength: 50
98
- }
99
- },
100
- required: ['roomName']
101
- }
102
- };
103
- async function handleEnterRoom(args) {
104
- try {
105
- const validatedInput = room_schema_1.enterRoomInputSchema.parse(args);
106
- const result = await presenceService.enterRoom(validatedInput.agentName, validatedInput.roomName, validatedInput.profile);
107
- return {
108
- content: [
109
- {
110
- type: 'text',
111
- text: JSON.stringify(result, null, 2)
112
- }
113
- ]
114
- };
115
- }
116
- catch (error) {
117
- if (error.name && error.code) {
118
- throw (0, errors_1.toMCPError)(error);
119
- }
120
- throw {
121
- code: -32603,
122
- message: `Internal error: ${error.message}`,
123
- data: { errorType: error.constructor.name }
124
- };
125
- }
126
- }
127
- async function handleLeaveRoom(args) {
128
- try {
129
- const validatedInput = room_schema_1.leaveRoomInputSchema.parse(args);
130
- const result = await presenceService.leaveRoom(validatedInput.agentName, validatedInput.roomName);
131
- return {
132
- content: [
133
- {
134
- type: 'text',
135
- text: JSON.stringify(result, null, 2)
136
- }
137
- ]
138
- };
139
- }
140
- catch (error) {
141
- if (error.name && error.code) {
142
- throw (0, errors_1.toMCPError)(error);
143
- }
144
- throw {
145
- code: -32603,
146
- message: `Internal error: ${error.message}`,
147
- data: { errorType: error.constructor.name }
148
- };
149
- }
150
- }
151
- async function handleListRoomUsers(args) {
152
- try {
153
- const validatedInput = room_schema_1.listRoomUsersInputSchema.parse(args);
154
- const result = await presenceService.listRoomUsers(validatedInput.roomName);
155
- return {
156
- content: [
157
- {
158
- type: 'text',
159
- text: JSON.stringify(result, null, 2)
160
- }
161
- ]
162
- };
163
- }
164
- catch (error) {
165
- if (error.name && error.code) {
166
- throw (0, errors_1.toMCPError)(error);
167
- }
168
- throw {
169
- code: -32603,
170
- message: `Internal error: ${error.message}`,
171
- data: { errorType: error.constructor.name }
172
- };
173
- }
174
- }
175
- exports.presenceTools = {
176
- tools: [exports.enterRoomTool, exports.leaveRoomTool, exports.listRoomUsersTool],
177
- handlers: {
178
- 'agent_communication/enter_room': handleEnterRoom,
179
- 'agent_communication/leave_room': handleLeaveRoom,
180
- 'agent_communication/list_room_users': handleListRoomUsers
181
- }
182
- };
183
- //# sourceMappingURL=presence.tools.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"presence.tools.js","sourceRoot":"","sources":["../../../../src/features/rooms/tools/presence.tools.ts"],"names":[],"mappings":";;;AA0GA,0CAiCC;AAED,0CAgCC;AAED,kDA6BC;AAxMD,iEAA8D;AAC9D,8DAAoH;AACpH,4CAA6C;AAE7C,MAAM,eAAe,GAAG,IAAI,iCAAe,EAAE,CAAC;AAEjC,QAAA,aAAa,GAAS;IACjC,IAAI,EAAE,gCAAgC;IACtC,WAAW,EAAE,gDAAgD;IAC7D,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qCAAqC;gBAClD,SAAS,EAAE,CAAC;gBACZ,SAAS,EAAE,EAAE;aACd;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,2BAA2B;gBACxC,OAAO,EAAE,kBAAkB;gBAC3B,SAAS,EAAE,CAAC;gBACZ,SAAS,EAAE,EAAE;aACd;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAA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