@agent-relay/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 +190 -0
- package/README.md +214 -0
- package/dist/bin.d.ts +12 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +127 -0
- package/dist/bin.js.map +1 -0
- package/dist/client.d.ts +68 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +115 -0
- package/dist/client.js.map +1 -0
- package/dist/cloud.d.ts +108 -0
- package/dist/cloud.d.ts.map +1 -0
- package/dist/cloud.js +279 -0
- package/dist/cloud.js.map +1 -0
- package/dist/errors.d.ts +27 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +48 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/install-cli.d.ts +35 -0
- package/dist/install-cli.d.ts.map +1 -0
- package/dist/install-cli.js +157 -0
- package/dist/install-cli.js.map +1 -0
- package/dist/install.d.ts +101 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +398 -0
- package/dist/install.js.map +1 -0
- package/dist/prompts/index.d.ts +2 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +2 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/protocol.d.ts +11 -0
- package/dist/prompts/protocol.d.ts.map +1 -0
- package/dist/prompts/protocol.js +168 -0
- package/dist/prompts/protocol.js.map +1 -0
- package/dist/resources/agents.d.ts +11 -0
- package/dist/resources/agents.d.ts.map +1 -0
- package/dist/resources/agents.js +17 -0
- package/dist/resources/agents.js.map +1 -0
- package/dist/resources/inbox.d.ts +11 -0
- package/dist/resources/inbox.d.ts.map +1 -0
- package/dist/resources/inbox.js +17 -0
- package/dist/resources/inbox.js.map +1 -0
- package/dist/resources/index.d.ts +4 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +4 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/project.d.ts +11 -0
- package/dist/resources/project.d.ts.map +1 -0
- package/dist/resources/project.js +21 -0
- package/dist/resources/project.js.map +1 -0
- package/dist/server.d.ts +19 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +215 -0
- package/dist/server.js.map +1 -0
- package/dist/simple.d.ts +173 -0
- package/dist/simple.d.ts.map +1 -0
- package/dist/simple.js +120 -0
- package/dist/simple.js.map +1 -0
- package/dist/tools/index.d.ts +10 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +10 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/relay-health.d.ts +23 -0
- package/dist/tools/relay-health.d.ts.map +1 -0
- package/dist/tools/relay-health.js +138 -0
- package/dist/tools/relay-health.js.map +1 -0
- package/dist/tools/relay-inbox.d.ts +26 -0
- package/dist/tools/relay-inbox.d.ts.map +1 -0
- package/dist/tools/relay-inbox.js +58 -0
- package/dist/tools/relay-inbox.js.map +1 -0
- package/dist/tools/relay-logs.d.ts +20 -0
- package/dist/tools/relay-logs.d.ts.map +1 -0
- package/dist/tools/relay-logs.js +88 -0
- package/dist/tools/relay-logs.js.map +1 -0
- package/dist/tools/relay-metrics.d.ts +20 -0
- package/dist/tools/relay-metrics.d.ts.map +1 -0
- package/dist/tools/relay-metrics.js +135 -0
- package/dist/tools/relay-metrics.js.map +1 -0
- package/dist/tools/relay-release.d.ts +20 -0
- package/dist/tools/relay-release.d.ts.map +1 -0
- package/dist/tools/relay-release.js +44 -0
- package/dist/tools/relay-release.js.map +1 -0
- package/dist/tools/relay-send.d.ts +29 -0
- package/dist/tools/relay-send.d.ts.map +1 -0
- package/dist/tools/relay-send.js +71 -0
- package/dist/tools/relay-send.js.map +1 -0
- package/dist/tools/relay-spawn.d.ts +36 -0
- package/dist/tools/relay-spawn.d.ts.map +1 -0
- package/dist/tools/relay-spawn.js +73 -0
- package/dist/tools/relay-spawn.js.map +1 -0
- package/dist/tools/relay-status.d.ts +11 -0
- package/dist/tools/relay-status.d.ts.map +1 -0
- package/dist/tools/relay-status.js +43 -0
- package/dist/tools/relay-status.js.map +1 -0
- package/dist/tools/relay-who.d.ts +20 -0
- package/dist/tools/relay-who.d.ts.map +1 -0
- package/dist/tools/relay-who.js +47 -0
- package/dist/tools/relay-who.js.map +1 -0
- package/package.json +69 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import type { RelayClient } from '../client.js';
|
|
4
|
+
export declare const relaySendSchema: z.ZodObject<{
|
|
5
|
+
to: z.ZodString;
|
|
6
|
+
message: z.ZodString;
|
|
7
|
+
thread: z.ZodOptional<z.ZodString>;
|
|
8
|
+
await_response: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
9
|
+
timeout_ms: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
to: string;
|
|
12
|
+
message: string;
|
|
13
|
+
await_response: boolean;
|
|
14
|
+
timeout_ms: number;
|
|
15
|
+
thread?: string | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
to: string;
|
|
18
|
+
message: string;
|
|
19
|
+
thread?: string | undefined;
|
|
20
|
+
await_response?: boolean | undefined;
|
|
21
|
+
timeout_ms?: number | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
export type RelaySendInput = z.infer<typeof relaySendSchema>;
|
|
24
|
+
export declare const relaySendTool: Tool;
|
|
25
|
+
/**
|
|
26
|
+
* Send a message via the relay daemon, optionally waiting for a response.
|
|
27
|
+
*/
|
|
28
|
+
export declare function handleRelaySend(client: RelayClient, input: RelaySendInput): Promise<string>;
|
|
29
|
+
//# sourceMappingURL=relay-send.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-send.d.ts","sourceRoot":"","sources":["../../src/tools/relay-send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;EAc1B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE7D,eAAO,MAAM,aAAa,EAAE,IAsC3B,CAAC;AAEF;;GAEG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,MAAM,CAAC,CAajB"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const relaySendSchema = z.object({
|
|
3
|
+
to: z.string().describe('Target: agent name, #channel, or * for broadcast'),
|
|
4
|
+
message: z.string().describe('Message content'),
|
|
5
|
+
thread: z.string().optional().describe('Optional thread ID for threaded conversations'),
|
|
6
|
+
await_response: z
|
|
7
|
+
.boolean()
|
|
8
|
+
.optional()
|
|
9
|
+
.default(false)
|
|
10
|
+
.describe('If true, wait for a response (blocks until reply or timeout)'),
|
|
11
|
+
timeout_ms: z
|
|
12
|
+
.number()
|
|
13
|
+
.optional()
|
|
14
|
+
.default(30000)
|
|
15
|
+
.describe('Timeout in milliseconds when await_response is true'),
|
|
16
|
+
});
|
|
17
|
+
export const relaySendTool = {
|
|
18
|
+
name: 'relay_send',
|
|
19
|
+
description: `Send a message via Agent Relay.
|
|
20
|
+
|
|
21
|
+
Examples:
|
|
22
|
+
- Direct message: to="Alice", message="Hello"
|
|
23
|
+
- Channel: to="#general", message="Team update"
|
|
24
|
+
- Broadcast: to="*", message="System notice"
|
|
25
|
+
- Threaded: to="Bob", message="Follow up", thread="task-123"
|
|
26
|
+
- Await reply: to="Worker", message="Process this", await_response=true`,
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
to: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: 'Target: agent name, #channel, or * for broadcast',
|
|
33
|
+
},
|
|
34
|
+
message: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
description: 'Message content',
|
|
37
|
+
},
|
|
38
|
+
thread: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: 'Optional thread ID for threaded conversations',
|
|
41
|
+
},
|
|
42
|
+
await_response: {
|
|
43
|
+
type: 'boolean',
|
|
44
|
+
description: 'If true, wait for a response',
|
|
45
|
+
default: false,
|
|
46
|
+
},
|
|
47
|
+
timeout_ms: {
|
|
48
|
+
type: 'number',
|
|
49
|
+
description: 'Timeout in ms when await_response is true',
|
|
50
|
+
default: 30000,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
required: ['to', 'message'],
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Send a message via the relay daemon, optionally waiting for a response.
|
|
58
|
+
*/
|
|
59
|
+
export async function handleRelaySend(client, input) {
|
|
60
|
+
const { to, message, thread, await_response, timeout_ms } = input;
|
|
61
|
+
if (await_response) {
|
|
62
|
+
const response = await client.sendAndWait(to, message, {
|
|
63
|
+
thread,
|
|
64
|
+
timeoutMs: timeout_ms,
|
|
65
|
+
});
|
|
66
|
+
return `Response from ${response.from}: ${response.content}`;
|
|
67
|
+
}
|
|
68
|
+
await client.send(to, message, { thread });
|
|
69
|
+
return `Message sent to ${to}`;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=relay-send.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-send.js","sourceRoot":"","sources":["../../src/tools/relay-send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,CAAC,MA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UAAU,eAAe,CACnC,MAAmB,EACnB,KAAqB;IAErB,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAElE,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,EAAE,EAAE,OAAO,EAAE;YACrD,MAAM;YACN,SAAS,EAAE,UAAU;SACtB,CAAC,CAAC;QACH,OAAO,iBAAiB,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC/D,CAAC;IAED,MAAM,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAC3C,OAAO,mBAAmB,EAAE,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import type { RelayClient } from '../client.js';
|
|
4
|
+
/**
|
|
5
|
+
* Supported CLI tools for spawning workers.
|
|
6
|
+
* This list should be kept in sync with CliType in packages/wrapper/src/shared.ts
|
|
7
|
+
* Note: 'cursor', 'spawned', 'other' are excluded as they're not valid spawn targets.
|
|
8
|
+
*/
|
|
9
|
+
export declare const SPAWNABLE_CLIS: readonly ["claude", "codex", "gemini", "droid", "opencode"];
|
|
10
|
+
export type SpawnableCli = typeof SPAWNABLE_CLIS[number];
|
|
11
|
+
export declare const relaySpawnSchema: z.ZodObject<{
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
cli: z.ZodEnum<["claude", "codex", "gemini", "droid", "opencode"]>;
|
|
14
|
+
task: z.ZodString;
|
|
15
|
+
model: z.ZodOptional<z.ZodString>;
|
|
16
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
name: string;
|
|
19
|
+
cli: "claude" | "gemini" | "opencode" | "droid" | "codex";
|
|
20
|
+
task: string;
|
|
21
|
+
cwd?: string | undefined;
|
|
22
|
+
model?: string | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
name: string;
|
|
25
|
+
cli: "claude" | "gemini" | "opencode" | "droid" | "codex";
|
|
26
|
+
task: string;
|
|
27
|
+
cwd?: string | undefined;
|
|
28
|
+
model?: string | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
export type RelaySpawnInput = z.infer<typeof relaySpawnSchema>;
|
|
31
|
+
export declare const relaySpawnTool: Tool;
|
|
32
|
+
/**
|
|
33
|
+
* Spawn a worker agent using the relay client.
|
|
34
|
+
*/
|
|
35
|
+
export declare function handleRelaySpawn(client: RelayClient, input: RelaySpawnInput): Promise<string>;
|
|
36
|
+
//# sourceMappingURL=relay-spawn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-spawn.d.ts","sourceRoot":"","sources":["../../src/tools/relay-spawn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,cAAc,6DAA8D,CAAC;AAC1F,MAAM,MAAM,YAAY,GAAG,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;EAQ3B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE/D,eAAO,MAAM,cAAc,EAAE,IAsC5B,CAAC;AAEF;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,MAAM,CAAC,CAgBjB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Supported CLI tools for spawning workers.
|
|
4
|
+
* This list should be kept in sync with CliType in packages/wrapper/src/shared.ts
|
|
5
|
+
* Note: 'cursor', 'spawned', 'other' are excluded as they're not valid spawn targets.
|
|
6
|
+
*/
|
|
7
|
+
export const SPAWNABLE_CLIS = ['claude', 'codex', 'gemini', 'droid', 'opencode'];
|
|
8
|
+
export const relaySpawnSchema = z.object({
|
|
9
|
+
name: z.string().describe('Unique name for the worker agent'),
|
|
10
|
+
cli: z.enum(SPAWNABLE_CLIS).describe('CLI tool to use for the worker (claude, codex, gemini, droid, opencode)'),
|
|
11
|
+
task: z.string().describe('Task description/prompt for the worker'),
|
|
12
|
+
model: z.string().optional().describe('Model override (e.g., "claude-3-5-sonnet")'),
|
|
13
|
+
cwd: z.string().optional().describe('Working directory for the worker'),
|
|
14
|
+
});
|
|
15
|
+
export const relaySpawnTool = {
|
|
16
|
+
name: 'relay_spawn',
|
|
17
|
+
description: `Spawn a worker agent to handle a subtask.
|
|
18
|
+
|
|
19
|
+
The worker runs in a separate process with its own CLI instance.
|
|
20
|
+
You'll receive a confirmation when the worker is ready.
|
|
21
|
+
|
|
22
|
+
Example:
|
|
23
|
+
name="TestRunner"
|
|
24
|
+
cli="claude"
|
|
25
|
+
task="Run the test suite and report failures"`,
|
|
26
|
+
inputSchema: {
|
|
27
|
+
type: 'object',
|
|
28
|
+
properties: {
|
|
29
|
+
name: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
description: 'Unique name for the worker agent',
|
|
32
|
+
},
|
|
33
|
+
cli: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
enum: SPAWNABLE_CLIS,
|
|
36
|
+
description: 'CLI tool to use (claude, codex, gemini, droid, opencode)',
|
|
37
|
+
},
|
|
38
|
+
task: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: 'Task description for the worker',
|
|
41
|
+
},
|
|
42
|
+
model: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
description: 'Optional model override',
|
|
45
|
+
},
|
|
46
|
+
cwd: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
description: 'Working directory for the worker',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
required: ['name', 'cli', 'task'],
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Spawn a worker agent using the relay client.
|
|
56
|
+
*/
|
|
57
|
+
export async function handleRelaySpawn(client, input) {
|
|
58
|
+
const { name, cli, task, model, cwd } = input;
|
|
59
|
+
const result = await client.spawn({
|
|
60
|
+
name,
|
|
61
|
+
cli,
|
|
62
|
+
task,
|
|
63
|
+
model,
|
|
64
|
+
cwd,
|
|
65
|
+
});
|
|
66
|
+
if (result.success) {
|
|
67
|
+
return `Worker "${name}" spawned successfully. It will message you when ready.`;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
return `Failed to spawn worker: ${result.error}`;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=relay-spawn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-spawn.js","sourceRoot":"","sources":["../../src/tools/relay-spawn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAU,CAAC;AAG1F,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IAC7D,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,QAAQ,CAClC,yEAAyE,CAC1E;IACD,IAAI,EAAE,CAAC,CAAC,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AAE,CAAC;QACnB,OAAO,WAAW,IAAI,yDAAyD,CAAC;IAClF,CAAC;SAAM,CAAC;QACN,OAAO,2BAA2B,MAAM,CAAC,KAAK,EAAE,CAAC;IACnD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import type { RelayClient } from '../client.js';
|
|
4
|
+
export declare const relayStatusSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
5
|
+
export type RelayStatusInput = z.infer<typeof relayStatusSchema>;
|
|
6
|
+
export declare const relayStatusTool: Tool;
|
|
7
|
+
/**
|
|
8
|
+
* Retrieve relay daemon status and format a human-readable summary.
|
|
9
|
+
*/
|
|
10
|
+
export declare function handleRelayStatus(client: RelayClient, _input: RelayStatusInput): Promise<string>;
|
|
11
|
+
//# sourceMappingURL=relay-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-status.d.ts","sourceRoot":"","sources":["../../src/tools/relay-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,eAAO,MAAM,iBAAiB,gDAAe,CAAC;AAE9C,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEjE,eAAO,MAAM,eAAe,EAAE,IAQ7B,CAAC;AAEF;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,MAAM,CAAC,CAgCjB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const relayStatusSchema = z.object({});
|
|
3
|
+
export const relayStatusTool = {
|
|
4
|
+
name: 'relay_status',
|
|
5
|
+
description: `Show connection and daemon status for Agent Relay.`,
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: 'object',
|
|
8
|
+
properties: {},
|
|
9
|
+
required: [],
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Retrieve relay daemon status and format a human-readable summary.
|
|
14
|
+
*/
|
|
15
|
+
export async function handleRelayStatus(client, _input) {
|
|
16
|
+
const status = await client.getStatus();
|
|
17
|
+
const connected = status.connected ? 'Yes' : 'No';
|
|
18
|
+
let agentCount = 'unknown';
|
|
19
|
+
if (typeof client.listAgents === 'function') {
|
|
20
|
+
try {
|
|
21
|
+
const agents = await client.listAgents({});
|
|
22
|
+
agentCount = Array.isArray(agents) ? agents.length : 'unknown';
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
agentCount = 'unknown';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const lines = [
|
|
29
|
+
`Connected: ${connected}`,
|
|
30
|
+
`Agent Name: ${status.agentName}`,
|
|
31
|
+
`Project: ${status.project}`,
|
|
32
|
+
`Socket: ${status.socketPath}`,
|
|
33
|
+
];
|
|
34
|
+
if (status.daemonVersion) {
|
|
35
|
+
lines.push(`Daemon Version: ${status.daemonVersion}`);
|
|
36
|
+
}
|
|
37
|
+
if (status.uptime) {
|
|
38
|
+
lines.push(`Uptime: ${status.uptime}`);
|
|
39
|
+
}
|
|
40
|
+
lines.push(`Agent Count: ${agentCount}`);
|
|
41
|
+
return lines.join('\n');
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=relay-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-status.js","sourceRoot":"","sources":["../../src/tools/relay-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,CAAC,M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AC,IAAI,CAAC,WAAW,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,gBAAgB,UAAU,EAAE,CAAC,CAAC;IAEzC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import type { RelayClient } from '../client.js';
|
|
4
|
+
export declare const relayWhoSchema: z.ZodObject<{
|
|
5
|
+
include_idle: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
6
|
+
project: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
include_idle: boolean;
|
|
9
|
+
project?: string | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
project?: string | undefined;
|
|
12
|
+
include_idle?: boolean | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
export type RelayWhoInput = z.infer<typeof relayWhoSchema>;
|
|
15
|
+
export declare const relayWhoTool: Tool;
|
|
16
|
+
/**
|
|
17
|
+
* List online agents with status and optional project filtering.
|
|
18
|
+
*/
|
|
19
|
+
export declare function handleRelayWho(client: RelayClient, input: RelayWhoInput): Promise<string>;
|
|
20
|
+
//# sourceMappingURL=relay-who.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-who.d.ts","sourceRoot":"","sources":["../../src/tools/relay-who.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,eAAO,MAAM,cAAc;;;;;;;;;EAGzB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE3D,eAAO,MAAM,YAAY,EAAE,IAyB1B,CAAC;AAEF;;GAEG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,aAAa,GACnB,OAAO,CAAC,MAAM,CAAC,CAcjB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const relayWhoSchema = z.object({
|
|
3
|
+
include_idle: z.boolean().optional().default(true).describe('Include idle agents'),
|
|
4
|
+
project: z.string().optional().describe('Filter by project (for multi-project setups)'),
|
|
5
|
+
});
|
|
6
|
+
export const relayWhoTool = {
|
|
7
|
+
name: 'relay_who',
|
|
8
|
+
description: `List online agents in the relay network.
|
|
9
|
+
|
|
10
|
+
Shows agent names, their CLI type, and current status.
|
|
11
|
+
|
|
12
|
+
Example output:
|
|
13
|
+
- Alice (claude) - active
|
|
14
|
+
- Bob (codex) - idle
|
|
15
|
+
- TestRunner (claude) - active [worker of: Alice]`,
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: 'object',
|
|
18
|
+
properties: {
|
|
19
|
+
include_idle: {
|
|
20
|
+
type: 'boolean',
|
|
21
|
+
description: 'Include idle agents',
|
|
22
|
+
default: true,
|
|
23
|
+
},
|
|
24
|
+
project: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Filter by project',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
required: [],
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* List online agents with status and optional project filtering.
|
|
34
|
+
*/
|
|
35
|
+
export async function handleRelayWho(client, input) {
|
|
36
|
+
const agents = await client.listAgents(input);
|
|
37
|
+
if (agents.length === 0) {
|
|
38
|
+
return 'No agents online.';
|
|
39
|
+
}
|
|
40
|
+
const formatted = agents.map((a) => {
|
|
41
|
+
const status = a.idle ? 'idle' : 'active';
|
|
42
|
+
const worker = a.parent ? ` [worker of: ${a.parent}]` : '';
|
|
43
|
+
return `- ${a.name} (${a.cli}) - ${status}${worker}`;
|
|
44
|
+
});
|
|
45
|
+
return `${agents.length} agent(s) online:\n${formatted.join('\n')}`;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=relay-who.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-who.js","sourceRoot":"","sources":["../../src/tools/relay-who.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IAClF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;CACxF,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,YAAY,GAAS;IAChC,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE;;;;;;;kDAOmC;IAChD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,YAAY,EAAE;gBACZ,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,qBAAqB;gBAClC,OAAO,EAAE,IAAI;aACd;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mBAAmB;aACjC;SACF;QACD,QAAQ,EAAE,EAAE;KACb;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAmB,EACnB,KAAoB;IAEpB,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAE9C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACjC,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;QAC1C,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,OAAO,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,OAAO,MAAM,GAAG,MAAM,EAAE,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,MAAM,CAAC,MAAM,sBAAsB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACtE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agent-relay/mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for Agent Relay - native messaging tools for AI agents in Claude, Cursor, and VS Code",
|
|
5
|
+
"author": "Agent Workforce Inc.",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"homepage": "https://github.com/AgentWorkforce/relay#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/AgentWorkforce/relay.git",
|
|
11
|
+
"directory": "packages/mcp"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/AgentWorkforce/relay/issues"
|
|
15
|
+
},
|
|
16
|
+
"type": "module",
|
|
17
|
+
"main": "dist/index.js",
|
|
18
|
+
"types": "dist/index.d.ts",
|
|
19
|
+
"bin": {
|
|
20
|
+
"agent-relay-mcp": "dist/bin.js"
|
|
21
|
+
},
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"import": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./simple": {
|
|
28
|
+
"types": "./dist/simple.d.ts",
|
|
29
|
+
"import": "./dist/simple.js",
|
|
30
|
+
"default": "./dist/simple.js"
|
|
31
|
+
},
|
|
32
|
+
"./install": {
|
|
33
|
+
"types": "./dist/install-cli.d.ts",
|
|
34
|
+
"import": "./dist/install-cli.js",
|
|
35
|
+
"default": "./dist/install-cli.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"README.md",
|
|
41
|
+
"LICENSE"
|
|
42
|
+
],
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsc",
|
|
45
|
+
"clean": "rm -rf dist",
|
|
46
|
+
"test": "vitest run",
|
|
47
|
+
"prepublishOnly": "npm run clean && npm run build && npm test"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
51
|
+
"zod": "^3.23.8"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/node": "^22.19.3",
|
|
55
|
+
"typescript": "^5.9.3",
|
|
56
|
+
"vitest": "^2.1.9"
|
|
57
|
+
},
|
|
58
|
+
"keywords": [
|
|
59
|
+
"mcp",
|
|
60
|
+
"agent-relay",
|
|
61
|
+
"ai-agents",
|
|
62
|
+
"claude",
|
|
63
|
+
"cursor",
|
|
64
|
+
"vscode"
|
|
65
|
+
],
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"access": "public"
|
|
68
|
+
}
|
|
69
|
+
}
|