@agent-relay/mcp 2.1.4 → 2.1.6
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/dist/cloud.d.ts +7 -114
- package/dist/cloud.d.ts.map +1 -1
- package/dist/cloud.js +21 -431
- package/dist/cloud.js.map +1 -1
- package/dist/errors.d.ts +4 -22
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +4 -43
- package/dist/errors.js.map +1 -1
- package/dist/hybrid-client.d.ts.map +1 -1
- package/dist/hybrid-client.js +7 -1
- package/dist/hybrid-client.js.map +1 -1
- package/package.json +4 -3
package/dist/cloud.d.ts
CHANGED
|
@@ -1,120 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cloud Integration for Agent Relay MCP Server
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
export interface CloudWorkspace {
|
|
8
|
-
workspaceId: string;
|
|
9
|
-
cloudApiUrl: string;
|
|
10
|
-
workspaceToken?: string;
|
|
11
|
-
ownerUserId?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface DiscoveryResult {
|
|
14
|
-
socketPath: string;
|
|
15
|
-
project: string;
|
|
16
|
-
source: 'env' | 'cloud' | 'cwd' | 'scan';
|
|
17
|
-
isCloud: boolean;
|
|
18
|
-
workspace?: CloudWorkspace;
|
|
19
|
-
}
|
|
20
|
-
export interface CloudConnectionOptions {
|
|
21
|
-
/** Override socket path (for testing) */
|
|
22
|
-
socketPath?: string;
|
|
23
|
-
/** Override workspace detection */
|
|
24
|
-
workspace?: Partial<CloudWorkspace>;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Detect if running in a cloud workspace environment.
|
|
28
|
-
*
|
|
29
|
-
* Cloud workspaces set these environment variables:
|
|
30
|
-
* - WORKSPACE_ID: The unique workspace identifier
|
|
31
|
-
* - CLOUD_API_URL: The cloud API endpoint
|
|
32
|
-
* - WORKSPACE_TOKEN: Bearer token for API auth (optional)
|
|
33
|
-
* - WORKSPACE_OWNER_USER_ID: The workspace owner's user ID (optional)
|
|
34
|
-
*/
|
|
35
|
-
export declare function detectCloudWorkspace(): CloudWorkspace | null;
|
|
36
|
-
/**
|
|
37
|
-
* Check if we're running in a cloud workspace.
|
|
38
|
-
*/
|
|
39
|
-
export declare function isCloudWorkspace(): boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Get the workspace-namespaced socket path.
|
|
42
|
-
*
|
|
43
|
-
* In cloud workspaces, sockets are stored at:
|
|
44
|
-
* /tmp/relay/{WORKSPACE_ID}/sockets/daemon.sock
|
|
45
|
-
*
|
|
46
|
-
* This provides multi-tenant isolation on shared infrastructure.
|
|
47
|
-
*/
|
|
48
|
-
export declare function getCloudSocketPath(workspaceId: string): string;
|
|
49
|
-
/**
|
|
50
|
-
* Get the workspace-namespaced outbox path.
|
|
51
|
-
*
|
|
52
|
-
* In cloud workspaces, outbox directories are at:
|
|
53
|
-
* /tmp/relay/{WORKSPACE_ID}/outbox/{agentName}/
|
|
54
|
-
*/
|
|
55
|
-
export declare function getCloudOutboxPath(workspaceId: string, agentName: string): string;
|
|
56
|
-
/**
|
|
57
|
-
* Discover relay daemon socket with cloud-awareness.
|
|
58
|
-
*
|
|
59
|
-
* Priority order:
|
|
60
|
-
* 1. RELAY_SOCKET environment variable (explicit path)
|
|
61
|
-
* 2. Cloud workspace socket (if WORKSPACE_ID is set)
|
|
62
|
-
* 3. RELAY_PROJECT environment variable (project name → data dir)
|
|
63
|
-
* 4. Current working directory .relay/config.json
|
|
64
|
-
* 5. Scan data directory for active sockets
|
|
65
|
-
*
|
|
66
|
-
* @param options - Optional configuration overrides
|
|
67
|
-
* @returns Discovery result with socket path, project info, and cloud status
|
|
68
|
-
*/
|
|
69
|
-
export declare function discoverSocket(options?: CloudConnectionOptions): DiscoveryResult | null;
|
|
70
|
-
/**
|
|
71
|
-
* Make an authenticated request to the cloud API.
|
|
72
|
-
*
|
|
73
|
-
* @param workspace - Cloud workspace configuration
|
|
74
|
-
* @param path - API path (e.g., '/api/status')
|
|
75
|
-
* @param options - Fetch options
|
|
76
|
-
* @returns Response from the API
|
|
77
|
-
*/
|
|
78
|
-
export declare function cloudApiRequest(workspace: CloudWorkspace, path: string, options?: RequestInit): Promise<Response>;
|
|
79
|
-
/**
|
|
80
|
-
* Get the workspace status from the cloud API.
|
|
81
|
-
*/
|
|
82
|
-
export declare function getWorkspaceStatus(workspace: CloudWorkspace): Promise<{
|
|
83
|
-
status: string;
|
|
84
|
-
agents?: string[];
|
|
85
|
-
} | null>;
|
|
86
|
-
export interface CloudConnectionInfo {
|
|
87
|
-
socketPath: string;
|
|
88
|
-
project: string;
|
|
89
|
-
isCloud: boolean;
|
|
90
|
-
workspace?: CloudWorkspace;
|
|
91
|
-
daemonUrl?: string;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Get connection info for the relay daemon.
|
|
95
|
-
*
|
|
96
|
-
* This function determines the best way to connect to the daemon:
|
|
97
|
-
* - In cloud environments: Uses workspace-namespaced socket
|
|
98
|
-
* - In local environments: Uses standard socket discovery
|
|
99
|
-
*
|
|
100
|
-
* @param options - Optional configuration overrides
|
|
101
|
-
* @returns Connection info or null if daemon not found
|
|
102
|
-
*/
|
|
103
|
-
export declare function getConnectionInfo(options?: CloudConnectionOptions): CloudConnectionInfo | null;
|
|
104
|
-
/**
|
|
105
|
-
* Environment variable summary for debugging.
|
|
106
|
-
*/
|
|
107
|
-
export declare function getCloudEnvironmentSummary(): Record<string, string | undefined>;
|
|
108
|
-
/**
|
|
109
|
-
* Discover the agent name for the MCP server.
|
|
110
|
-
*
|
|
111
|
-
* Priority order:
|
|
112
|
-
* 1. RELAY_AGENT_NAME environment variable (explicit)
|
|
113
|
-
* 2. Identity file in .agent-relay directory (written by wrapper)
|
|
114
|
-
* 3. Scan outbox directories to find agent's outbox
|
|
4
|
+
* This module re-exports all cloud/discovery functionality from
|
|
5
|
+
* @agent-relay/utils, which is the single source of truth for socket
|
|
6
|
+
* discovery, cloud workspace detection, and agent identity discovery.
|
|
115
7
|
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
8
|
+
* Previously this module contained its own implementation (~520 lines).
|
|
9
|
+
* It has been consolidated into @agent-relay/utils to eliminate code
|
|
10
|
+
* duplication between MCP and SDK packages.
|
|
118
11
|
*/
|
|
119
|
-
export
|
|
12
|
+
export { type CloudWorkspace, type DiscoveryResult, type CloudConnectionOptions, type CloudConnectionInfo, detectCloudWorkspace, isCloudWorkspace, getCloudSocketPath, getCloudOutboxPath, discoverSocket, cloudApiRequest, getWorkspaceStatus, getConnectionInfo, getCloudEnvironmentSummary, discoverAgentName, } from '@agent-relay/utils/discovery';
|
|
120
13
|
//# sourceMappingURL=cloud.d.ts.map
|
package/dist/cloud.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud.d.ts","sourceRoot":"","sources":["../src/cloud.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cloud.d.ts","sourceRoot":"","sources":["../src/cloud.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EAGxB,oBAAoB,EACpB,gBAAgB,EAGhB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EAGd,eAAe,EACf,kBAAkB,EAGlB,iBAAiB,EAGjB,0BAA0B,EAG1B,iBAAiB,GAClB,MAAM,8BAA8B,CAAC"}
|
package/dist/cloud.js
CHANGED
|
@@ -1,435 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cloud Integration for Agent Relay MCP Server
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const cloudApiUrl = process.env.CLOUD_API_URL;
|
|
26
|
-
if (!workspaceId || !cloudApiUrl) {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
workspaceId,
|
|
31
|
-
cloudApiUrl,
|
|
32
|
-
workspaceToken: process.env.WORKSPACE_TOKEN,
|
|
33
|
-
ownerUserId: process.env.WORKSPACE_OWNER_USER_ID,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Check if we're running in a cloud workspace.
|
|
38
|
-
*/
|
|
39
|
-
export function isCloudWorkspace() {
|
|
40
|
-
return detectCloudWorkspace() !== null;
|
|
41
|
-
}
|
|
42
|
-
// ============================================================================
|
|
43
|
-
// Workspace-Aware Socket Discovery
|
|
44
|
-
// ============================================================================
|
|
45
|
-
/**
|
|
46
|
-
* Get the workspace-namespaced socket path.
|
|
47
|
-
*
|
|
48
|
-
* In cloud workspaces, sockets are stored at:
|
|
49
|
-
* /tmp/relay/{WORKSPACE_ID}/sockets/daemon.sock
|
|
50
|
-
*
|
|
51
|
-
* This provides multi-tenant isolation on shared infrastructure.
|
|
52
|
-
*/
|
|
53
|
-
export function getCloudSocketPath(workspaceId) {
|
|
54
|
-
return `/tmp/relay/${workspaceId}/sockets/daemon.sock`;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Get the workspace-namespaced outbox path.
|
|
58
|
-
*
|
|
59
|
-
* In cloud workspaces, outbox directories are at:
|
|
60
|
-
* /tmp/relay/{WORKSPACE_ID}/outbox/{agentName}/
|
|
61
|
-
*/
|
|
62
|
-
export function getCloudOutboxPath(workspaceId, agentName) {
|
|
63
|
-
return `/tmp/relay/${workspaceId}/outbox/${agentName}`;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Get platform-specific data directory.
|
|
67
|
-
*/
|
|
68
|
-
function getDataDir() {
|
|
69
|
-
const platform = process.platform;
|
|
70
|
-
if (platform === 'darwin') {
|
|
71
|
-
return join(homedir(), 'Library', 'Application Support', 'agent-relay');
|
|
72
|
-
}
|
|
73
|
-
else if (platform === 'win32') {
|
|
74
|
-
return join(process.env.APPDATA || homedir(), 'agent-relay');
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
return join(process.env.XDG_DATA_HOME || join(homedir(), '.local', 'share'), 'agent-relay');
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Discover relay daemon socket with cloud-awareness.
|
|
82
|
-
*
|
|
83
|
-
* Priority order:
|
|
84
|
-
* 1. RELAY_SOCKET environment variable (explicit path)
|
|
85
|
-
* 2. Cloud workspace socket (if WORKSPACE_ID is set)
|
|
86
|
-
* 3. RELAY_PROJECT environment variable (project name → data dir)
|
|
87
|
-
* 4. Current working directory .relay/config.json
|
|
88
|
-
* 5. Scan data directory for active sockets
|
|
89
|
-
*
|
|
90
|
-
* @param options - Optional configuration overrides
|
|
91
|
-
* @returns Discovery result with socket path, project info, and cloud status
|
|
92
|
-
*/
|
|
93
|
-
export function discoverSocket(options = {}) {
|
|
94
|
-
// 0. Use override if provided
|
|
95
|
-
if (options.socketPath && existsSync(options.socketPath)) {
|
|
96
|
-
const workspace = options.workspace
|
|
97
|
-
? {
|
|
98
|
-
workspaceId: options.workspace.workspaceId || 'override',
|
|
99
|
-
cloudApiUrl: options.workspace.cloudApiUrl || '',
|
|
100
|
-
}
|
|
101
|
-
: undefined;
|
|
102
|
-
return {
|
|
103
|
-
socketPath: options.socketPath,
|
|
104
|
-
project: workspace?.workspaceId || 'override',
|
|
105
|
-
source: 'env',
|
|
106
|
-
isCloud: !!workspace,
|
|
107
|
-
workspace,
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
// 1. Explicit socket path from environment
|
|
111
|
-
const socketEnv = process.env.RELAY_SOCKET;
|
|
112
|
-
if (socketEnv && existsSync(socketEnv)) {
|
|
113
|
-
const workspace = detectCloudWorkspace();
|
|
114
|
-
return {
|
|
115
|
-
socketPath: socketEnv,
|
|
116
|
-
project: process.env.RELAY_PROJECT || workspace?.workspaceId || 'unknown',
|
|
117
|
-
source: 'env',
|
|
118
|
-
isCloud: !!workspace,
|
|
119
|
-
workspace: workspace || undefined,
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
// 2. Cloud workspace socket (highest priority for cloud environments)
|
|
123
|
-
const workspace = detectCloudWorkspace();
|
|
124
|
-
if (workspace) {
|
|
125
|
-
const cloudSocket = getCloudSocketPath(workspace.workspaceId);
|
|
126
|
-
if (existsSync(cloudSocket)) {
|
|
127
|
-
return {
|
|
128
|
-
socketPath: cloudSocket,
|
|
129
|
-
project: workspace.workspaceId,
|
|
130
|
-
source: 'cloud',
|
|
131
|
-
isCloud: true,
|
|
132
|
-
workspace,
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
// 3. Project name → data dir lookup
|
|
137
|
-
const projectEnv = process.env.RELAY_PROJECT;
|
|
138
|
-
if (projectEnv) {
|
|
139
|
-
const dataDir = getDataDir();
|
|
140
|
-
const projectSocket = join(dataDir, 'projects', projectEnv, 'daemon.sock');
|
|
141
|
-
if (existsSync(projectSocket)) {
|
|
142
|
-
return {
|
|
143
|
-
socketPath: projectSocket,
|
|
144
|
-
project: projectEnv,
|
|
145
|
-
source: 'env',
|
|
146
|
-
isCloud: false,
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
// 4. Project-local socket (created by daemon in project's .agent-relay directory)
|
|
151
|
-
// This is the primary path for local development
|
|
152
|
-
// First try cwd, then scan up to find project root
|
|
153
|
-
const projectRoot = findProjectRoot(process.cwd());
|
|
154
|
-
const searchDirs = [process.cwd()];
|
|
155
|
-
if (projectRoot && projectRoot !== process.cwd()) {
|
|
156
|
-
searchDirs.push(projectRoot);
|
|
157
|
-
}
|
|
158
|
-
for (const dir of searchDirs) {
|
|
159
|
-
const projectLocalSocket = join(dir, '.agent-relay', 'relay.sock');
|
|
160
|
-
if (existsSync(projectLocalSocket)) {
|
|
161
|
-
// Read project ID from marker file if available
|
|
162
|
-
let projectId = 'local';
|
|
163
|
-
const markerPath = join(dir, '.agent-relay', '.project');
|
|
164
|
-
if (existsSync(markerPath)) {
|
|
165
|
-
try {
|
|
166
|
-
const marker = JSON.parse(readFileSync(markerPath, 'utf-8'));
|
|
167
|
-
projectId = marker.projectId || 'local';
|
|
168
|
-
}
|
|
169
|
-
catch {
|
|
170
|
-
// Ignore marker read errors
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return {
|
|
174
|
-
socketPath: projectLocalSocket,
|
|
175
|
-
project: projectId,
|
|
176
|
-
source: 'cwd',
|
|
177
|
-
isCloud: false,
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
// 4b. Legacy .relay/config.json support
|
|
182
|
-
const cwdConfig = join(process.cwd(), '.relay', 'config.json');
|
|
183
|
-
if (existsSync(cwdConfig)) {
|
|
184
|
-
try {
|
|
185
|
-
const config = JSON.parse(readFileSync(cwdConfig, 'utf-8'));
|
|
186
|
-
if (config.socketPath && existsSync(config.socketPath)) {
|
|
187
|
-
return {
|
|
188
|
-
socketPath: config.socketPath,
|
|
189
|
-
project: config.project || 'local',
|
|
190
|
-
source: 'cwd',
|
|
191
|
-
isCloud: false,
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
catch (err) {
|
|
196
|
-
// Invalid config (malformed JSON, permission error, etc.), continue to next method
|
|
197
|
-
if (process.env.DEBUG || process.env.RELAY_DEBUG) {
|
|
198
|
-
console.debug('[cloud] Failed to read cwd config:', cwdConfig, err);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
// 5. Scan data directory for active sockets
|
|
203
|
-
const dataDir = getDataDir();
|
|
204
|
-
const projectsDir = join(dataDir, 'projects');
|
|
205
|
-
if (existsSync(projectsDir)) {
|
|
206
|
-
try {
|
|
207
|
-
const projects = readdirSync(projectsDir, { withFileTypes: true })
|
|
208
|
-
.filter((d) => d.isDirectory())
|
|
209
|
-
.map((d) => d.name);
|
|
210
|
-
for (const project of projects) {
|
|
211
|
-
const socketPath = join(projectsDir, project, 'daemon.sock');
|
|
212
|
-
if (existsSync(socketPath)) {
|
|
213
|
-
return {
|
|
214
|
-
socketPath,
|
|
215
|
-
project,
|
|
216
|
-
source: 'scan',
|
|
217
|
-
isCloud: false,
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
catch (err) {
|
|
223
|
-
// Directory read failed (permission error, etc.), return null
|
|
224
|
-
if (process.env.DEBUG || process.env.RELAY_DEBUG) {
|
|
225
|
-
console.debug('[cloud] Failed to scan projects directory:', projectsDir, err);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
return null;
|
|
230
|
-
}
|
|
231
|
-
// ============================================================================
|
|
232
|
-
// Cloud API Helpers
|
|
233
|
-
// ============================================================================
|
|
234
|
-
/**
|
|
235
|
-
* Make an authenticated request to the cloud API.
|
|
236
|
-
*
|
|
237
|
-
* @param workspace - Cloud workspace configuration
|
|
238
|
-
* @param path - API path (e.g., '/api/status')
|
|
239
|
-
* @param options - Fetch options
|
|
240
|
-
* @returns Response from the API
|
|
241
|
-
*/
|
|
242
|
-
export async function cloudApiRequest(workspace, path, options = {}) {
|
|
243
|
-
const url = `${workspace.cloudApiUrl}${path}`;
|
|
244
|
-
const headers = {
|
|
245
|
-
'Content-Type': 'application/json',
|
|
246
|
-
...options.headers,
|
|
247
|
-
};
|
|
248
|
-
if (workspace.workspaceToken) {
|
|
249
|
-
headers['Authorization'] = `Bearer ${workspace.workspaceToken}`;
|
|
250
|
-
}
|
|
251
|
-
return fetch(url, {
|
|
252
|
-
...options,
|
|
253
|
-
headers,
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Get the workspace status from the cloud API.
|
|
258
|
-
*/
|
|
259
|
-
export async function getWorkspaceStatus(workspace) {
|
|
260
|
-
try {
|
|
261
|
-
const response = await cloudApiRequest(workspace, `/api/workspaces/${workspace.workspaceId}/status`);
|
|
262
|
-
if (!response.ok) {
|
|
263
|
-
return null;
|
|
264
|
-
}
|
|
265
|
-
return (await response.json());
|
|
266
|
-
}
|
|
267
|
-
catch {
|
|
268
|
-
return null;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* Get connection info for the relay daemon.
|
|
273
|
-
*
|
|
274
|
-
* This function determines the best way to connect to the daemon:
|
|
275
|
-
* - In cloud environments: Uses workspace-namespaced socket
|
|
276
|
-
* - In local environments: Uses standard socket discovery
|
|
277
|
-
*
|
|
278
|
-
* @param options - Optional configuration overrides
|
|
279
|
-
* @returns Connection info or null if daemon not found
|
|
280
|
-
*/
|
|
281
|
-
export function getConnectionInfo(options = {}) {
|
|
282
|
-
const discovery = discoverSocket(options);
|
|
283
|
-
if (!discovery) {
|
|
284
|
-
return null;
|
|
285
|
-
}
|
|
286
|
-
const info = {
|
|
287
|
-
socketPath: discovery.socketPath,
|
|
288
|
-
project: discovery.project,
|
|
289
|
-
isCloud: discovery.isCloud,
|
|
290
|
-
workspace: discovery.workspace,
|
|
291
|
-
};
|
|
292
|
-
// In cloud environments, we may also have a daemon URL for HTTP API access
|
|
293
|
-
if (discovery.workspace?.cloudApiUrl) {
|
|
294
|
-
info.daemonUrl = discovery.workspace.cloudApiUrl;
|
|
295
|
-
}
|
|
296
|
-
return info;
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Environment variable summary for debugging.
|
|
300
|
-
*/
|
|
301
|
-
export function getCloudEnvironmentSummary() {
|
|
302
|
-
return {
|
|
303
|
-
WORKSPACE_ID: process.env.WORKSPACE_ID,
|
|
304
|
-
CLOUD_API_URL: process.env.CLOUD_API_URL,
|
|
305
|
-
WORKSPACE_TOKEN: process.env.WORKSPACE_TOKEN ? '[set]' : undefined,
|
|
306
|
-
WORKSPACE_OWNER_USER_ID: process.env.WORKSPACE_OWNER_USER_ID,
|
|
307
|
-
RELAY_SOCKET: process.env.RELAY_SOCKET,
|
|
308
|
-
RELAY_PROJECT: process.env.RELAY_PROJECT,
|
|
309
|
-
RELAY_AGENT_NAME: process.env.RELAY_AGENT_NAME,
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
// ============================================================================
|
|
313
|
-
// Agent Identity Discovery
|
|
314
|
-
// ============================================================================
|
|
315
|
-
/**
|
|
316
|
-
* Discover the agent name for the MCP server.
|
|
317
|
-
*
|
|
318
|
-
* Priority order:
|
|
319
|
-
* 1. RELAY_AGENT_NAME environment variable (explicit)
|
|
320
|
-
* 2. Identity file in .agent-relay directory (written by wrapper)
|
|
321
|
-
* 3. Scan outbox directories to find agent's outbox
|
|
322
|
-
*
|
|
323
|
-
* @param discovery - Optional discovery result with socket path info
|
|
324
|
-
* @returns Agent name or null if not found
|
|
325
|
-
*/
|
|
326
|
-
export function discoverAgentName(discovery) {
|
|
327
|
-
// 1. Explicit environment variable
|
|
328
|
-
const envName = process.env.RELAY_AGENT_NAME;
|
|
329
|
-
if (envName) {
|
|
330
|
-
return envName;
|
|
331
|
-
}
|
|
332
|
-
// 2. Identity file in .agent-relay directory
|
|
333
|
-
// The wrapper creates this file with the agent name
|
|
334
|
-
const projectRoot = findProjectRoot(process.cwd());
|
|
335
|
-
const searchDirs = [process.cwd()];
|
|
336
|
-
if (projectRoot && projectRoot !== process.cwd()) {
|
|
337
|
-
searchDirs.push(projectRoot);
|
|
338
|
-
}
|
|
339
|
-
for (const dir of searchDirs) {
|
|
340
|
-
const relayDir = join(dir, '.agent-relay');
|
|
341
|
-
if (!existsSync(relayDir))
|
|
342
|
-
continue;
|
|
343
|
-
// First check for per-process identity files
|
|
344
|
-
// The orchestrator writes mcp-identity-{orchestrator.pid}
|
|
345
|
-
// Try to find one by checking process.ppid and its ancestors
|
|
346
|
-
const pidIdentityPath = join(relayDir, `mcp-identity-${process.ppid}`);
|
|
347
|
-
if (existsSync(pidIdentityPath)) {
|
|
348
|
-
try {
|
|
349
|
-
const content = readFileSync(pidIdentityPath, 'utf-8').trim();
|
|
350
|
-
if (content) {
|
|
351
|
-
return content;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
catch {
|
|
355
|
-
// Ignore read errors
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
// Scan all mcp-identity-* files and return the most recently modified one
|
|
359
|
-
// This handles the case where MCP server's ppid doesn't match the orchestrator
|
|
360
|
-
try {
|
|
361
|
-
const files = readdirSync(relayDir, { withFileTypes: true })
|
|
362
|
-
.filter((d) => d.isFile() && d.name.startsWith('mcp-identity-'))
|
|
363
|
-
.map((d) => ({
|
|
364
|
-
path: join(relayDir, d.name),
|
|
365
|
-
name: d.name,
|
|
366
|
-
}));
|
|
367
|
-
if (files.length > 0) {
|
|
368
|
-
// Sort by mtime (most recent first) to get the latest identity
|
|
369
|
-
const sorted = files
|
|
370
|
-
.map((f) => {
|
|
371
|
-
try {
|
|
372
|
-
const stat = statSync(f.path);
|
|
373
|
-
return { ...f, mtime: stat.mtimeMs };
|
|
374
|
-
}
|
|
375
|
-
catch {
|
|
376
|
-
return { ...f, mtime: 0 };
|
|
377
|
-
}
|
|
378
|
-
})
|
|
379
|
-
.sort((a, b) => b.mtime - a.mtime);
|
|
380
|
-
// Return the most recently modified identity file
|
|
381
|
-
const latest = sorted[0];
|
|
382
|
-
if (latest) {
|
|
383
|
-
try {
|
|
384
|
-
const content = readFileSync(latest.path, 'utf-8').trim();
|
|
385
|
-
if (content) {
|
|
386
|
-
return content;
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
catch {
|
|
390
|
-
// Ignore
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
catch {
|
|
396
|
-
// Ignore scan errors
|
|
397
|
-
}
|
|
398
|
-
// Fallback to simple identity file (for single-agent scenarios)
|
|
399
|
-
const identityPath = join(relayDir, 'mcp-identity');
|
|
400
|
-
if (existsSync(identityPath)) {
|
|
401
|
-
try {
|
|
402
|
-
const content = readFileSync(identityPath, 'utf-8').trim();
|
|
403
|
-
if (content) {
|
|
404
|
-
return content;
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
catch {
|
|
408
|
-
// Ignore read errors
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
// 3. Check outbox directories for a match
|
|
413
|
-
// If only one agent's outbox exists, assume we're that agent
|
|
414
|
-
for (const dir of searchDirs) {
|
|
415
|
-
const outboxDir = join(dir, '.agent-relay', 'outbox');
|
|
416
|
-
if (existsSync(outboxDir)) {
|
|
417
|
-
try {
|
|
418
|
-
const agents = readdirSync(outboxDir, { withFileTypes: true })
|
|
419
|
-
.filter((d) => d.isDirectory())
|
|
420
|
-
.map((d) => d.name);
|
|
421
|
-
// If there's exactly one outbox, use that agent name
|
|
422
|
-
if (agents.length === 1) {
|
|
423
|
-
return agents[0];
|
|
424
|
-
}
|
|
425
|
-
// If there are multiple, we can't determine which one we are
|
|
426
|
-
// The wrapper should have created an identity file
|
|
427
|
-
}
|
|
428
|
-
catch {
|
|
429
|
-
// Ignore read errors
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
return null;
|
|
434
|
-
}
|
|
4
|
+
* This module re-exports all cloud/discovery functionality from
|
|
5
|
+
* @agent-relay/utils, which is the single source of truth for socket
|
|
6
|
+
* discovery, cloud workspace detection, and agent identity discovery.
|
|
7
|
+
*
|
|
8
|
+
* Previously this module contained its own implementation (~520 lines).
|
|
9
|
+
* It has been consolidated into @agent-relay/utils to eliminate code
|
|
10
|
+
* duplication between MCP and SDK packages.
|
|
11
|
+
*/
|
|
12
|
+
export {
|
|
13
|
+
// Cloud workspace detection
|
|
14
|
+
detectCloudWorkspace, isCloudWorkspace,
|
|
15
|
+
// Socket discovery
|
|
16
|
+
getCloudSocketPath, getCloudOutboxPath, discoverSocket,
|
|
17
|
+
// Cloud API helpers
|
|
18
|
+
cloudApiRequest, getWorkspaceStatus,
|
|
19
|
+
// Connection factory
|
|
20
|
+
getConnectionInfo,
|
|
21
|
+
// Debug helpers
|
|
22
|
+
getCloudEnvironmentSummary,
|
|
23
|
+
// Agent identity
|
|
24
|
+
discoverAgentName, } from '@agent-relay/utils/discovery';
|
|
435
25
|
//# sourceMappingURL=cloud.js.map
|
package/dist/cloud.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud.js","sourceRoot":"","sources":["../src/cloud.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AA4BtD,+EAA+E;AAC/E,4BAA4B;AAC5B,+EAA+E;AAE/E;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB;IAClC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IAC7C,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;IAE9C,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,WAAW;QACX,WAAW;QACX,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe;QAC3C,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,uBAAuB;KACjD,CAAC;AACJ,CAAC;AAED;;GAEG;A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CAAC,CAAC,CAAC;gBACnB,CAAC;gBAED,6DAA6D;gBAC7D,mDAAmD;YACrD,CAAC;YAAC,MAAM,CAAC;gBACP,qBAAqB;YACvB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
1
|
+
{"version":3,"file":"cloud.js","sourceRoot":"","sources":["../src/cloud.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO;AAOL,4BAA4B;AAC5B,oBAAoB,EACpB,gBAAgB;AAEhB,mBAAmB;AACnB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc;AAEd,oBAAoB;AACpB,eAAe,EACf,kBAAkB;AAElB,qBAAqB;AACrB,iBAAiB;AAEjB,gBAAgB;AAChB,0BAA0B;AAE1B,iBAAiB;AACjB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,27 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Error Types for Agent Relay MCP Server
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Re-exports error classes from @agent-relay/utils, which is the single
|
|
5
|
+
* source of truth for error types. Previously this module contained
|
|
6
|
+
* its own implementation.
|
|
5
7
|
*/
|
|
6
|
-
export
|
|
7
|
-
constructor(message: string);
|
|
8
|
-
}
|
|
9
|
-
export declare class DaemonNotRunningError extends RelayError {
|
|
10
|
-
constructor(message?: string);
|
|
11
|
-
}
|
|
12
|
-
export declare class AgentNotFoundError extends RelayError {
|
|
13
|
-
constructor(agentName: string);
|
|
14
|
-
}
|
|
15
|
-
export declare class TimeoutError extends RelayError {
|
|
16
|
-
constructor(operation: string, timeoutMs: number);
|
|
17
|
-
}
|
|
18
|
-
export declare class ConnectionError extends RelayError {
|
|
19
|
-
constructor(message: string);
|
|
20
|
-
}
|
|
21
|
-
export declare class ChannelNotFoundError extends RelayError {
|
|
22
|
-
constructor(channel: string);
|
|
23
|
-
}
|
|
24
|
-
export declare class SpawnError extends RelayError {
|
|
25
|
-
constructor(workerName: string, reason: string);
|
|
26
|
-
}
|
|
8
|
+
export { RelayError, DaemonNotRunningError, AgentNotFoundError, TimeoutError, ConnectionError, ChannelNotFoundError, SpawnError, } from '@agent-relay/utils/errors';
|
|
27
9
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,UAAU,GACX,MAAM,2BAA2B,CAAC"}
|
package/dist/errors.js
CHANGED
|
@@ -1,48 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Error Types for Agent Relay MCP Server
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Re-exports error classes from @agent-relay/utils, which is the single
|
|
5
|
+
* source of truth for error types. Previously this module contained
|
|
6
|
+
* its own implementation.
|
|
5
7
|
*/
|
|
6
|
-
export
|
|
7
|
-
constructor(message) {
|
|
8
|
-
super(message);
|
|
9
|
-
this.name = 'RelayError';
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
export class DaemonNotRunningError extends RelayError {
|
|
13
|
-
constructor(message) {
|
|
14
|
-
super(message || 'Relay daemon is not running. Start with: agent-relay up');
|
|
15
|
-
this.name = 'DaemonNotRunningError';
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export class AgentNotFoundError extends RelayError {
|
|
19
|
-
constructor(agentName) {
|
|
20
|
-
super(`Agent not found: ${agentName}`);
|
|
21
|
-
this.name = 'AgentNotFoundError';
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export class TimeoutError extends RelayError {
|
|
25
|
-
constructor(operation, timeoutMs) {
|
|
26
|
-
super(`Timeout after ${timeoutMs}ms: ${operation}`);
|
|
27
|
-
this.name = 'TimeoutError';
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export class ConnectionError extends RelayError {
|
|
31
|
-
constructor(message) {
|
|
32
|
-
super(`Connection error: ${message}`);
|
|
33
|
-
this.name = 'ConnectionError';
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export class ChannelNotFoundError extends RelayError {
|
|
37
|
-
constructor(channel) {
|
|
38
|
-
super(`Channel not found: ${channel}`);
|
|
39
|
-
this.name = 'ChannelNotFoundError';
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
export class SpawnError extends RelayError {
|
|
43
|
-
constructor(workerName, reason) {
|
|
44
|
-
super(`Failed to spawn worker "${workerName}": ${reason}`);
|
|
45
|
-
this.name = 'SpawnError';
|
|
46
|
-
}
|
|
47
|
-
}
|
|
8
|
+
export { RelayError, DaemonNotRunningError, AgentNotFoundError, TimeoutError, ConnectionError, ChannelNotFoundError, SpawnError, } from '@agent-relay/utils/errors';
|
|
48
9
|
//# sourceMappingURL=errors.js.map
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,UAAU,GACX,MAAM,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hybrid-client.d.ts","sourceRoot":"","sources":["../src/hybrid-client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK/C,MAAM,WAAW,mBAAmB;IAClC,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"hybrid-client.d.ts","sourceRoot":"","sources":["../src/hybrid-client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK/C,MAAM,WAAW,mBAAmB;IAClC,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,WAAW,CA8J5E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,GAAG,IAAI,CAqBnD"}
|
package/dist/hybrid-client.js
CHANGED
|
@@ -27,7 +27,13 @@ export function createHybridClient(options) {
|
|
|
27
27
|
mkdirSync(inboxDir, { recursive: true });
|
|
28
28
|
}
|
|
29
29
|
// Get socket path for queries
|
|
30
|
-
|
|
30
|
+
// Use discoverSocket() which respects cloud workspace config and env overrides.
|
|
31
|
+
// Only fall back to relayDir/relay.sock for non-cloud local development.
|
|
32
|
+
const discovery = discoverSocket();
|
|
33
|
+
const socketPath = options.socketPath || discovery?.socketPath || join(relayDir, 'relay.sock');
|
|
34
|
+
if (process.env.DEBUG || process.env.RELAY_DEBUG) {
|
|
35
|
+
console.debug('[hybrid-client] Socket path:', socketPath, 'source:', discovery?.source ?? 'fallback', 'isCloud:', discovery?.isCloud ?? false);
|
|
36
|
+
}
|
|
31
37
|
// Create socket client for queries only
|
|
32
38
|
let socketClient = null;
|
|
33
39
|
const getSocketClient = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hybrid-client.js","sourceRoot":"","sources":["../src/hybrid-client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAuC,MAAM,SAAS,CAAC;AACpG,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAa5C;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAA4B;IAC7D,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,GAAG,SAAS,EAAE,GAAG,OAAO,CAAC;IAEhE,oBAAoB;IACpB,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IACnD,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IACtD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IAEpD,2BAA2B;IAC3B,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC3B,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED,8BA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{
|
|
2
2
|
"name": "@agent-relay/mcp",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"description": "MCP server for Agent Relay - native messaging tools for AI agents in Claude, Cursor, and VS Code",
|
|
5
5
|
"author": "Agent Workforce Inc.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -47,8 +47,9 @@
|
|
|
47
47
|
"prepublishOnly": "npm run clean && npm run build && npm test"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@agent-relay/config": "2.1.
|
|
51
|
-
"@agent-relay/protocol": "2.1.
|
|
50
|
+
"@agent-relay/config": "2.1.6",
|
|
51
|
+
"@agent-relay/protocol": "2.1.6",
|
|
52
|
+
"@agent-relay/utils": "2.1.6",
|
|
52
53
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
53
54
|
"smol-toml": "^1.6.0",
|
|
54
55
|
"zod": "^3.23.8"
|