@awcp/mcp 0.0.0-dev-202601301521 → 0.0.0-dev-202601310648
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/auto-daemon.d.ts +67 -0
- package/dist/auto-daemon.d.ts.map +1 -0
- package/dist/auto-daemon.js +154 -0
- package/dist/auto-daemon.js.map +1 -0
- package/dist/bin/awcp-mcp.d.ts +3 -18
- package/dist/bin/awcp-mcp.d.ts.map +1 -1
- package/dist/bin/awcp-mcp.js +235 -46
- package/dist/bin/awcp-mcp.js.map +1 -1
- package/dist/peer-discovery.d.ts +27 -0
- package/dist/peer-discovery.d.ts.map +1 -0
- package/dist/peer-discovery.js +117 -0
- package/dist/peer-discovery.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +3 -2
- package/dist/server.js.map +1 -1
- package/dist/tools/delegate-cancel.d.ts +2 -5
- package/dist/tools/delegate-cancel.d.ts.map +1 -1
- package/dist/tools/delegate-cancel.js +7 -26
- package/dist/tools/delegate-cancel.js.map +1 -1
- package/dist/tools/delegate-cancel.txt +16 -0
- package/dist/tools/delegate-output.d.ts +1 -1
- package/dist/tools/delegate-output.d.ts.map +1 -1
- package/dist/tools/delegate-output.js +7 -25
- package/dist/tools/delegate-output.js.map +1 -1
- package/dist/tools/delegate-output.txt +22 -0
- package/dist/tools/delegate.d.ts +6 -1
- package/dist/tools/delegate.d.ts.map +1 -1
- package/dist/tools/delegate.js +34 -26
- package/dist/tools/delegate.js.map +1 -1
- package/dist/tools/delegate.txt +46 -0
- package/package.json +7 -4
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-start Delegator Daemon
|
|
3
|
+
*
|
|
4
|
+
* Automatically starts the Delegator Daemon if not running.
|
|
5
|
+
* Used by MCP server to provide zero-config experience.
|
|
6
|
+
*/
|
|
7
|
+
import type { AccessMode } from '@awcp/sdk';
|
|
8
|
+
import { type DaemonInstance } from '@awcp/sdk/delegator/daemon';
|
|
9
|
+
/**
|
|
10
|
+
* Options for auto-starting the daemon
|
|
11
|
+
*/
|
|
12
|
+
export interface AutoDaemonOptions {
|
|
13
|
+
/** Port for the daemon (default: 3100) */
|
|
14
|
+
port?: number;
|
|
15
|
+
/** Timeout in ms to wait for daemon to start (default: 10000) */
|
|
16
|
+
startTimeout?: number;
|
|
17
|
+
/** Directory for workspace exports (default: ~/.awcp/exports) */
|
|
18
|
+
exportsDir?: string;
|
|
19
|
+
/** Export strategy: symlink, bind, worktree (default: symlink) */
|
|
20
|
+
exportStrategy?: 'symlink' | 'bind' | 'worktree';
|
|
21
|
+
/** Transport type (default: archive) */
|
|
22
|
+
transport?: 'archive' | 'sshfs';
|
|
23
|
+
/** Maximum total bytes for workspace (default: 100MB) */
|
|
24
|
+
maxTotalBytes?: number;
|
|
25
|
+
/** Maximum file count (default: 10000) */
|
|
26
|
+
maxFileCount?: number;
|
|
27
|
+
/** Maximum single file size in bytes (default: 50MB) */
|
|
28
|
+
maxSingleFileBytes?: number;
|
|
29
|
+
/** Default TTL in seconds (default: 3600) */
|
|
30
|
+
defaultTtl?: number;
|
|
31
|
+
/** Default access mode: ro or rw (default: rw) */
|
|
32
|
+
defaultAccessMode?: AccessMode;
|
|
33
|
+
/** Directory for temp files (default: ~/.awcp/temp) */
|
|
34
|
+
tempDir?: string;
|
|
35
|
+
/** Public base URL for cloud/proxy environments */
|
|
36
|
+
publicBaseUrl?: string;
|
|
37
|
+
/** Port for archive HTTP server (default: auto) */
|
|
38
|
+
archiveServerPort?: number;
|
|
39
|
+
/** Path to CA private key (required for SSHFS) */
|
|
40
|
+
sshCaKey?: string;
|
|
41
|
+
/** SSH server host (default: localhost) */
|
|
42
|
+
sshHost?: string;
|
|
43
|
+
/** SSH server port (default: 22) */
|
|
44
|
+
sshPort?: number;
|
|
45
|
+
/** SSH username (default: current user) */
|
|
46
|
+
sshUser?: string;
|
|
47
|
+
/** Directory for SSH keys (default: ~/.awcp/keys) */
|
|
48
|
+
sshKeyDir?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Start daemon in-process
|
|
52
|
+
*
|
|
53
|
+
* This starts the daemon in the same process as the MCP server.
|
|
54
|
+
* Simpler but means the daemon dies when MCP server dies.
|
|
55
|
+
*/
|
|
56
|
+
export declare function startInProcessDaemon(options?: AutoDaemonOptions): Promise<DaemonInstance>;
|
|
57
|
+
/**
|
|
58
|
+
* Ensure daemon is running, starting it if necessary
|
|
59
|
+
*
|
|
60
|
+
* Returns the daemon URL. If daemon is already running, just returns the URL.
|
|
61
|
+
* If not running, starts it in-process and returns the URL.
|
|
62
|
+
*/
|
|
63
|
+
export declare function ensureDaemonRunning(options?: AutoDaemonOptions): Promise<{
|
|
64
|
+
url: string;
|
|
65
|
+
daemon?: DaemonInstance;
|
|
66
|
+
}>;
|
|
67
|
+
//# sourceMappingURL=auto-daemon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-daemon.d.ts","sourceRoot":"","sources":["../src/auto-daemon.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAmB,UAAU,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGvF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAEhC,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kEAAkE;IAClE,cAAc,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,UAAU,CAAC;IAGjD,wCAAwC;IACxC,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAGhC,yDAAyD;IACzD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAG5B,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAG/B,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mDAAmD;IACnD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAG3B,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAwGD;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,cAAc,CAAC,CAazB;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,cAAc,CAAA;CAAE,CAAC,CA6BnD"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-start Delegator Daemon
|
|
3
|
+
*
|
|
4
|
+
* Automatically starts the Delegator Daemon if not running.
|
|
5
|
+
* Used by MCP server to provide zero-config experience.
|
|
6
|
+
*/
|
|
7
|
+
import { mkdir } from 'node:fs/promises';
|
|
8
|
+
import { join } from 'node:path';
|
|
9
|
+
import { homedir } from 'node:os';
|
|
10
|
+
import { startDelegatorDaemon } from '@awcp/sdk/delegator/daemon';
|
|
11
|
+
import { ArchiveTransport } from '@awcp/transport-archive';
|
|
12
|
+
/**
|
|
13
|
+
* Default AWCP directory
|
|
14
|
+
*/
|
|
15
|
+
function getAwcpDir() {
|
|
16
|
+
return process.env.AWCP_HOME || join(homedir(), '.awcp');
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Check if daemon is running by hitting health endpoint
|
|
20
|
+
*/
|
|
21
|
+
async function isDaemonRunning(url) {
|
|
22
|
+
try {
|
|
23
|
+
const res = await fetch(`${url}/health`, { signal: AbortSignal.timeout(2000) });
|
|
24
|
+
return res.ok;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Wait for daemon to become healthy
|
|
32
|
+
*/
|
|
33
|
+
async function waitForDaemon(url, timeoutMs) {
|
|
34
|
+
const start = Date.now();
|
|
35
|
+
while (Date.now() - start < timeoutMs) {
|
|
36
|
+
if (await isDaemonRunning(url)) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Create default delegator config
|
|
45
|
+
*/
|
|
46
|
+
async function createDefaultConfig(options) {
|
|
47
|
+
const awcpDir = getAwcpDir();
|
|
48
|
+
const exportsDir = options.exportsDir || join(awcpDir, 'exports');
|
|
49
|
+
const tempDir = options.tempDir || join(awcpDir, 'temp');
|
|
50
|
+
// Create transport based on type
|
|
51
|
+
let transport;
|
|
52
|
+
if (options.transport === 'sshfs') {
|
|
53
|
+
// Dynamically import SSHFS transport to avoid requiring it when not used
|
|
54
|
+
const { SshfsTransport } = await import('@awcp/transport-sshfs');
|
|
55
|
+
if (!options.sshCaKey) {
|
|
56
|
+
throw new Error('SSHFS transport requires --ssh-ca-key option');
|
|
57
|
+
}
|
|
58
|
+
transport = new SshfsTransport({
|
|
59
|
+
delegator: {
|
|
60
|
+
caKeyPath: options.sshCaKey,
|
|
61
|
+
keyDir: options.sshKeyDir || join(awcpDir, 'keys'),
|
|
62
|
+
host: options.sshHost || 'localhost',
|
|
63
|
+
port: options.sshPort || 22,
|
|
64
|
+
user: options.sshUser || process.env.USER,
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
// Default to Archive transport (no SSHFS setup required)
|
|
70
|
+
transport = new ArchiveTransport({
|
|
71
|
+
delegator: {
|
|
72
|
+
tempDir,
|
|
73
|
+
serverPort: options.archiveServerPort ?? 0,
|
|
74
|
+
publicBaseUrl: options.publicBaseUrl,
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
export: {
|
|
80
|
+
baseDir: exportsDir,
|
|
81
|
+
strategy: options.exportStrategy || 'symlink',
|
|
82
|
+
},
|
|
83
|
+
transport,
|
|
84
|
+
admission: {
|
|
85
|
+
maxTotalBytes: options.maxTotalBytes,
|
|
86
|
+
maxFileCount: options.maxFileCount,
|
|
87
|
+
maxSingleFileBytes: options.maxSingleFileBytes,
|
|
88
|
+
},
|
|
89
|
+
defaults: {
|
|
90
|
+
ttlSeconds: options.defaultTtl,
|
|
91
|
+
accessMode: options.defaultAccessMode,
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Ensure AWCP directories exist
|
|
97
|
+
*/
|
|
98
|
+
async function ensureDirectories(options) {
|
|
99
|
+
const awcpDir = getAwcpDir();
|
|
100
|
+
const exportsDir = options.exportsDir || join(awcpDir, 'exports');
|
|
101
|
+
const tempDir = options.tempDir || join(awcpDir, 'temp');
|
|
102
|
+
await mkdir(awcpDir, { recursive: true });
|
|
103
|
+
await mkdir(exportsDir, { recursive: true });
|
|
104
|
+
await mkdir(tempDir, { recursive: true });
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Start daemon in-process
|
|
108
|
+
*
|
|
109
|
+
* This starts the daemon in the same process as the MCP server.
|
|
110
|
+
* Simpler but means the daemon dies when MCP server dies.
|
|
111
|
+
*/
|
|
112
|
+
export async function startInProcessDaemon(options = {}) {
|
|
113
|
+
const port = options.port ?? 3100;
|
|
114
|
+
await ensureDirectories(options);
|
|
115
|
+
const config = await createDefaultConfig(options);
|
|
116
|
+
const daemon = await startDelegatorDaemon({
|
|
117
|
+
port,
|
|
118
|
+
delegator: config,
|
|
119
|
+
});
|
|
120
|
+
return daemon;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Ensure daemon is running, starting it if necessary
|
|
124
|
+
*
|
|
125
|
+
* Returns the daemon URL. If daemon is already running, just returns the URL.
|
|
126
|
+
* If not running, starts it in-process and returns the URL.
|
|
127
|
+
*/
|
|
128
|
+
export async function ensureDaemonRunning(options = {}) {
|
|
129
|
+
const port = options.port ?? 3100;
|
|
130
|
+
const url = `http://localhost:${port}`;
|
|
131
|
+
const startTimeout = options.startTimeout ?? 10000;
|
|
132
|
+
// Check if already running
|
|
133
|
+
if (await isDaemonRunning(url)) {
|
|
134
|
+
console.error(`[AWCP] Daemon already running at ${url}`);
|
|
135
|
+
return { url };
|
|
136
|
+
}
|
|
137
|
+
// Start daemon in-process
|
|
138
|
+
console.error(`[AWCP] Starting Delegator Daemon on port ${port}...`);
|
|
139
|
+
try {
|
|
140
|
+
const daemon = await startInProcessDaemon(options);
|
|
141
|
+
// Wait for it to be ready
|
|
142
|
+
if (await waitForDaemon(url, startTimeout)) {
|
|
143
|
+
console.error(`[AWCP] Daemon started successfully at ${url}`);
|
|
144
|
+
return { url, daemon };
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
throw new Error('Daemon started but health check failed');
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
throw new Error(`Failed to start Delegator Daemon: ${error instanceof Error ? error.message : String(error)}`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
//# source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starts an MCP server that provides AWCP delegation tools.
|
|
6
|
-
*
|
|
6
|
+
* Automatically starts the Delegator Daemon if not already running.
|
|
7
7
|
*
|
|
8
8
|
* Usage:
|
|
9
|
-
* awcp-mcp [
|
|
9
|
+
* awcp-mcp [options]
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
* --daemon-url URL of Delegator Daemon (default: http://localhost:3100)
|
|
13
|
-
* --help Show this help message
|
|
14
|
-
*
|
|
15
|
-
* Example:
|
|
16
|
-
* awcp-mcp --daemon-url http://localhost:3100
|
|
17
|
-
*
|
|
18
|
-
* Claude Desktop config (claude_desktop_config.json):
|
|
19
|
-
* {
|
|
20
|
-
* "mcpServers": {
|
|
21
|
-
* "awcp": {
|
|
22
|
-
* "command": "npx",
|
|
23
|
-
* "args": ["awcp-mcp", "--daemon-url", "http://localhost:3100"]
|
|
24
|
-
* }
|
|
25
|
-
* }
|
|
26
|
-
* }
|
|
11
|
+
* See --help for all options.
|
|
27
12
|
*/
|
|
28
13
|
export {};
|
|
29
14
|
//# sourceMappingURL=awcp-mcp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"awcp-mcp.d.ts","sourceRoot":"","sources":["../../src/bin/awcp-mcp.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"awcp-mcp.d.ts","sourceRoot":"","sources":["../../src/bin/awcp-mcp.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG"}
|
package/dist/bin/awcp-mcp.js
CHANGED
|
@@ -3,77 +3,266 @@
|
|
|
3
3
|
* AWCP MCP Server CLI
|
|
4
4
|
*
|
|
5
5
|
* Starts an MCP server that provides AWCP delegation tools.
|
|
6
|
-
*
|
|
6
|
+
* Automatically starts the Delegator Daemon if not already running.
|
|
7
7
|
*
|
|
8
8
|
* Usage:
|
|
9
|
-
* awcp-mcp [
|
|
9
|
+
* awcp-mcp [options]
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
* --daemon-url URL of Delegator Daemon (default: http://localhost:3100)
|
|
13
|
-
* --help Show this help message
|
|
14
|
-
*
|
|
15
|
-
* Example:
|
|
16
|
-
* awcp-mcp --daemon-url http://localhost:3100
|
|
17
|
-
*
|
|
18
|
-
* Claude Desktop config (claude_desktop_config.json):
|
|
19
|
-
* {
|
|
20
|
-
* "mcpServers": {
|
|
21
|
-
* "awcp": {
|
|
22
|
-
* "command": "npx",
|
|
23
|
-
* "args": ["awcp-mcp", "--daemon-url", "http://localhost:3100"]
|
|
24
|
-
* }
|
|
25
|
-
* }
|
|
26
|
-
* }
|
|
11
|
+
* See --help for all options.
|
|
27
12
|
*/
|
|
28
13
|
import { createAwcpMcpServer } from '../server.js';
|
|
14
|
+
import { ensureDaemonRunning } from '../auto-daemon.js';
|
|
15
|
+
import { discoverPeers } from '../peer-discovery.js';
|
|
29
16
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
17
|
+
function parseArgs(args) {
|
|
18
|
+
const result = {
|
|
19
|
+
port: 3100,
|
|
20
|
+
transport: 'archive',
|
|
21
|
+
peerUrls: [],
|
|
22
|
+
};
|
|
34
23
|
for (let i = 0; i < args.length; i++) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
const arg = args[i];
|
|
25
|
+
const nextArg = args[i + 1] ?? '';
|
|
26
|
+
switch (arg) {
|
|
27
|
+
// Help
|
|
28
|
+
case '--help':
|
|
29
|
+
case '-h':
|
|
30
|
+
printHelp();
|
|
31
|
+
process.exit(0);
|
|
32
|
+
// Daemon
|
|
33
|
+
case '--daemon-url':
|
|
34
|
+
result.daemonUrl = nextArg;
|
|
35
|
+
i++;
|
|
36
|
+
break;
|
|
37
|
+
case '--port':
|
|
38
|
+
result.port = parseInt(nextArg, 10);
|
|
39
|
+
i++;
|
|
40
|
+
break;
|
|
41
|
+
// Export
|
|
42
|
+
case '--exports-dir':
|
|
43
|
+
result.exportsDir = nextArg;
|
|
44
|
+
i++;
|
|
45
|
+
break;
|
|
46
|
+
case '--export-strategy':
|
|
47
|
+
result.exportStrategy = nextArg;
|
|
48
|
+
i++;
|
|
49
|
+
break;
|
|
50
|
+
// Transport
|
|
51
|
+
case '--transport':
|
|
52
|
+
result.transport = nextArg;
|
|
53
|
+
i++;
|
|
54
|
+
break;
|
|
55
|
+
// Admission
|
|
56
|
+
case '--max-total-bytes':
|
|
57
|
+
result.maxTotalBytes = parseInt(nextArg, 10);
|
|
58
|
+
i++;
|
|
59
|
+
break;
|
|
60
|
+
case '--max-file-count':
|
|
61
|
+
result.maxFileCount = parseInt(nextArg, 10);
|
|
62
|
+
i++;
|
|
63
|
+
break;
|
|
64
|
+
case '--max-single-file-bytes':
|
|
65
|
+
result.maxSingleFileBytes = parseInt(nextArg, 10);
|
|
66
|
+
i++;
|
|
67
|
+
break;
|
|
68
|
+
// Defaults
|
|
69
|
+
case '--default-ttl':
|
|
70
|
+
result.defaultTtl = parseInt(nextArg, 10);
|
|
71
|
+
i++;
|
|
72
|
+
break;
|
|
73
|
+
case '--default-access-mode':
|
|
74
|
+
result.defaultAccessMode = nextArg;
|
|
75
|
+
i++;
|
|
76
|
+
break;
|
|
77
|
+
// Archive transport
|
|
78
|
+
case '--temp-dir':
|
|
79
|
+
result.tempDir = nextArg;
|
|
80
|
+
i++;
|
|
81
|
+
break;
|
|
82
|
+
case '--public-base-url':
|
|
83
|
+
result.publicBaseUrl = nextArg;
|
|
84
|
+
i++;
|
|
85
|
+
break;
|
|
86
|
+
case '--archive-server-port':
|
|
87
|
+
result.archiveServerPort = parseInt(nextArg, 10);
|
|
88
|
+
i++;
|
|
89
|
+
break;
|
|
90
|
+
// SSHFS transport
|
|
91
|
+
case '--ssh-ca-key':
|
|
92
|
+
result.sshCaKey = nextArg;
|
|
93
|
+
i++;
|
|
94
|
+
break;
|
|
95
|
+
case '--ssh-host':
|
|
96
|
+
result.sshHost = nextArg;
|
|
97
|
+
i++;
|
|
98
|
+
break;
|
|
99
|
+
case '--ssh-port':
|
|
100
|
+
result.sshPort = parseInt(nextArg, 10);
|
|
101
|
+
i++;
|
|
102
|
+
break;
|
|
103
|
+
case '--ssh-user':
|
|
104
|
+
result.sshUser = nextArg;
|
|
105
|
+
i++;
|
|
106
|
+
break;
|
|
107
|
+
case '--ssh-key-dir':
|
|
108
|
+
result.sshKeyDir = nextArg;
|
|
109
|
+
i++;
|
|
110
|
+
break;
|
|
111
|
+
// Peers
|
|
112
|
+
case '--peers':
|
|
113
|
+
result.peerUrls = nextArg.split(',').map(u => u.trim()).filter(Boolean);
|
|
114
|
+
i++;
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return result;
|
|
119
|
+
}
|
|
120
|
+
async function main() {
|
|
121
|
+
const parsed = parseArgs(process.argv.slice(2));
|
|
122
|
+
if (!parsed) {
|
|
123
|
+
process.exit(1);
|
|
124
|
+
}
|
|
125
|
+
// Discover peers (fetch Agent Cards)
|
|
126
|
+
let peersContext;
|
|
127
|
+
if (parsed.peerUrls.length > 0) {
|
|
128
|
+
console.error(`[AWCP MCP] Discovering ${parsed.peerUrls.length} peer(s)...`);
|
|
129
|
+
peersContext = await discoverPeers(parsed.peerUrls);
|
|
130
|
+
}
|
|
131
|
+
// Determine daemon URL
|
|
132
|
+
let finalDaemonUrl;
|
|
133
|
+
if (parsed.daemonUrl) {
|
|
134
|
+
// Use provided daemon URL (no auto-start)
|
|
135
|
+
finalDaemonUrl = parsed.daemonUrl;
|
|
136
|
+
console.error(`[AWCP MCP] Using existing daemon at ${parsed.daemonUrl}`);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
// Build auto-daemon options from parsed args
|
|
140
|
+
const options = {
|
|
141
|
+
port: parsed.port,
|
|
142
|
+
exportsDir: parsed.exportsDir,
|
|
143
|
+
exportStrategy: parsed.exportStrategy,
|
|
144
|
+
transport: parsed.transport,
|
|
145
|
+
maxTotalBytes: parsed.maxTotalBytes,
|
|
146
|
+
maxFileCount: parsed.maxFileCount,
|
|
147
|
+
maxSingleFileBytes: parsed.maxSingleFileBytes,
|
|
148
|
+
defaultTtl: parsed.defaultTtl,
|
|
149
|
+
defaultAccessMode: parsed.defaultAccessMode,
|
|
150
|
+
tempDir: parsed.tempDir,
|
|
151
|
+
publicBaseUrl: parsed.publicBaseUrl,
|
|
152
|
+
archiveServerPort: parsed.archiveServerPort,
|
|
153
|
+
sshCaKey: parsed.sshCaKey,
|
|
154
|
+
sshHost: parsed.sshHost,
|
|
155
|
+
sshPort: parsed.sshPort,
|
|
156
|
+
sshUser: parsed.sshUser,
|
|
157
|
+
sshKeyDir: parsed.sshKeyDir,
|
|
158
|
+
};
|
|
159
|
+
const result = await ensureDaemonRunning(options);
|
|
160
|
+
finalDaemonUrl = result.url;
|
|
161
|
+
// Handle shutdown to clean up daemon
|
|
162
|
+
if (result.daemon) {
|
|
163
|
+
const cleanup = async () => {
|
|
164
|
+
console.error('[AWCP MCP] Shutting down daemon...');
|
|
165
|
+
await result.daemon.stop();
|
|
166
|
+
process.exit(0);
|
|
167
|
+
};
|
|
168
|
+
process.on('SIGINT', cleanup);
|
|
169
|
+
process.on('SIGTERM', cleanup);
|
|
38
170
|
}
|
|
39
|
-
|
|
40
|
-
|
|
171
|
+
}
|
|
172
|
+
// Create MCP server with peers context
|
|
173
|
+
const server = createAwcpMcpServer({
|
|
174
|
+
daemonUrl: finalDaemonUrl,
|
|
175
|
+
peers: peersContext,
|
|
176
|
+
});
|
|
177
|
+
// Connect via stdio
|
|
178
|
+
const transport = new StdioServerTransport();
|
|
179
|
+
await server.connect(transport);
|
|
180
|
+
console.error(`[AWCP MCP] Server started, daemon at ${finalDaemonUrl}`);
|
|
181
|
+
if (peersContext && peersContext.peers.length > 0) {
|
|
182
|
+
const available = peersContext.peers.filter(p => p.card).length;
|
|
183
|
+
console.error(`[AWCP MCP] ${available}/${peersContext.peers.length} peers available`);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function printHelp() {
|
|
187
|
+
console.error(`AWCP MCP Server - Workspace Delegation Tools
|
|
41
188
|
|
|
42
|
-
Provides MCP tools for
|
|
43
|
-
- delegate: Delegate a
|
|
189
|
+
Provides MCP tools for AI agents to delegate work to remote Executors:
|
|
190
|
+
- delegate: Delegate a workspace to a remote Executor
|
|
44
191
|
- delegate_output: Get delegation status/results
|
|
45
192
|
- delegate_cancel: Cancel active delegations
|
|
46
193
|
|
|
194
|
+
The daemon is automatically started if not running.
|
|
195
|
+
|
|
47
196
|
Usage:
|
|
48
197
|
awcp-mcp [options]
|
|
49
198
|
|
|
50
|
-
Options:
|
|
51
|
-
--daemon-url URL
|
|
52
|
-
--
|
|
199
|
+
Daemon Options:
|
|
200
|
+
--daemon-url URL Use existing Delegator Daemon (skips auto-start)
|
|
201
|
+
--port PORT Port for daemon (default: 3100)
|
|
202
|
+
|
|
203
|
+
Export Options:
|
|
204
|
+
--exports-dir DIR Directory for exports (default: ~/.awcp/exports)
|
|
205
|
+
--export-strategy TYPE Strategy: symlink, bind, worktree (default: symlink)
|
|
53
206
|
|
|
54
|
-
|
|
55
|
-
|
|
207
|
+
Transport Options:
|
|
208
|
+
--transport TYPE Transport: archive, sshfs (default: archive)
|
|
56
209
|
|
|
57
|
-
|
|
210
|
+
Admission Control:
|
|
211
|
+
--max-total-bytes N Max workspace size in bytes (default: 100MB)
|
|
212
|
+
--max-file-count N Max number of files (default: 10000)
|
|
213
|
+
--max-single-file-bytes N Max single file size (default: 50MB)
|
|
214
|
+
|
|
215
|
+
Delegation Defaults:
|
|
216
|
+
--default-ttl SECONDS Default lease duration (default: 3600)
|
|
217
|
+
--default-access-mode MODE Default access: ro, rw (default: rw)
|
|
218
|
+
|
|
219
|
+
Archive Transport Options:
|
|
220
|
+
--temp-dir DIR Temp directory for archives (default: ~/.awcp/temp)
|
|
221
|
+
--public-base-url URL Public URL for cloud/proxy environments
|
|
222
|
+
--archive-server-port N Port for archive server (default: auto)
|
|
223
|
+
|
|
224
|
+
SSHFS Transport Options:
|
|
225
|
+
--ssh-ca-key PATH CA private key path (required for SSHFS)
|
|
226
|
+
--ssh-host HOST SSH server host (default: localhost)
|
|
227
|
+
--ssh-port PORT SSH server port (default: 22)
|
|
228
|
+
--ssh-user USER SSH username (default: current user)
|
|
229
|
+
--ssh-key-dir DIR SSH key directory (default: ~/.awcp/keys)
|
|
230
|
+
|
|
231
|
+
Peer Discovery:
|
|
232
|
+
--peers URL,... Comma-separated list of executor base URLs
|
|
233
|
+
|
|
234
|
+
Other:
|
|
235
|
+
--help, -h Show this help message
|
|
236
|
+
|
|
237
|
+
Examples:
|
|
238
|
+
# Basic usage with one peer
|
|
239
|
+
awcp-mcp --peers http://localhost:4001
|
|
240
|
+
|
|
241
|
+
# Multiple peers
|
|
242
|
+
awcp-mcp --peers http://agent1:4001,http://agent2:4002
|
|
243
|
+
|
|
244
|
+
# Custom admission limits
|
|
245
|
+
awcp-mcp --peers http://localhost:4001 --max-total-bytes 200000000
|
|
246
|
+
|
|
247
|
+
# Use SSHFS transport
|
|
248
|
+
awcp-mcp --peers http://localhost:4001 --transport sshfs --ssh-ca-key ~/.awcp/ca
|
|
249
|
+
|
|
250
|
+
# Cloud environment with public URL
|
|
251
|
+
awcp-mcp --peers http://executor.example.com --public-base-url https://delegator.example.com
|
|
252
|
+
|
|
253
|
+
Claude Desktop config (claude_desktop_config.json):
|
|
58
254
|
{
|
|
59
255
|
"mcpServers": {
|
|
60
256
|
"awcp": {
|
|
61
257
|
"command": "npx",
|
|
62
|
-
"args": ["awcp
|
|
258
|
+
"args": ["@awcp/mcp", "--peers", "http://localhost:4001"]
|
|
63
259
|
}
|
|
64
260
|
}
|
|
65
261
|
}
|
|
262
|
+
|
|
263
|
+
The --peers flag fetches A2A Agent Cards at startup to provide context
|
|
264
|
+
about available executors and their capabilities to the LLM.
|
|
66
265
|
`);
|
|
67
|
-
process.exit(0);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
// Create server
|
|
71
|
-
const server = createAwcpMcpServer({ daemonUrl });
|
|
72
|
-
// Connect via stdio
|
|
73
|
-
const transport = new StdioServerTransport();
|
|
74
|
-
await server.connect(transport);
|
|
75
|
-
// Log to stderr (stdout is for MCP protocol)
|
|
76
|
-
console.error(`[AWCP MCP] Server started, connected to daemon at ${daemonUrl}`);
|
|
77
266
|
}
|
|
78
267
|
main().catch((error) => {
|
|
79
268
|
console.error('[AWCP MCP] Fatal error:', error);
|
package/dist/bin/awcp-mcp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"awcp-mcp.js","sourceRoot":"","sources":["../../src/bin/awcp-mcp.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"awcp-mcp.js","sourceRoot":"","sources":["../../src/bin/awcp-mcp.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAA0B,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAqB,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAwCjF,SAAS,SAAS,CAAC,IAAc;IAC/B,MAAM,MAAM,GAAe;QACzB,IAAI,EAAE,IAAI;QACV,SAAS,EAAE,SAAS;QACpB,QAAQ,EAAE,EAAE;KACb,CAAC;IAEF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QAElC,QAAQ,GAAG,EAAE,CAAC;YACZ,OAAO;YACP,KAAK,QAAQ,CAAC;YACd,KAAK,IAAI;gBACP,SAAS,E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AAC;QAChE,OAAO,CAAC,KAAK,CAAC,cAAc,SAAS,IAAI,YAAY,CAAC,KAAK,CAAC,MAAM,kBAAkB,CAAC,CAAC;IACxF,CAAC;AACH,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Ef,CAAC,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Peer Discovery - Fetches A2A Agent Cards from configured peers
|
|
3
|
+
*
|
|
4
|
+
* Provides context to LLM about available executors and their capabilities.
|
|
5
|
+
*/
|
|
6
|
+
import type { AgentCard } from '@a2a-js/sdk';
|
|
7
|
+
export interface PeerInfo {
|
|
8
|
+
/** Base URL of the peer (e.g., http://localhost:4001) */
|
|
9
|
+
url: string;
|
|
10
|
+
/** AWCP endpoint URL (e.g., http://localhost:4001/awcp) */
|
|
11
|
+
awcpUrl: string;
|
|
12
|
+
card?: AgentCard;
|
|
13
|
+
error?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface PeersContext {
|
|
16
|
+
peers: PeerInfo[];
|
|
17
|
+
summary: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Discover all configured peers and fetch their Agent Cards
|
|
21
|
+
*/
|
|
22
|
+
export declare function discoverPeers(peerUrls: string[]): Promise<PeersContext>;
|
|
23
|
+
/**
|
|
24
|
+
* Format peers context for MCP resource
|
|
25
|
+
*/
|
|
26
|
+
export declare function formatPeersAsResource(context: PeersContext): string;
|
|
27
|
+
//# sourceMappingURL=peer-discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"peer-discovery.d.ts","sourceRoot":"","sources":["../src/peer-discovery.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,QAAQ;IACvB,yDAAyD;IACzD,GAAG,EAAE,MAAM,CAAC;IACZ,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAiDD;;GAEG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAyB7E;AA2CD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAEnE"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Peer Discovery - Fetches A2A Agent Cards from configured peers
|
|
3
|
+
*
|
|
4
|
+
* Provides context to LLM about available executors and their capabilities.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Fetch Agent Card from a peer URL
|
|
8
|
+
*
|
|
9
|
+
* Tries both /.well-known/agent-card.json and /.well-known/agent.json
|
|
10
|
+
* Returns the card and the normalized base URL
|
|
11
|
+
*/
|
|
12
|
+
async function fetchAgentCard(peerUrl) {
|
|
13
|
+
// Normalize URL (remove trailing slash, remove /awcp suffix)
|
|
14
|
+
let baseUrl = peerUrl.replace(/\/+$/, '');
|
|
15
|
+
if (baseUrl.endsWith('/awcp')) {
|
|
16
|
+
baseUrl = baseUrl.slice(0, -5);
|
|
17
|
+
}
|
|
18
|
+
// Try standard A2A paths
|
|
19
|
+
const paths = [
|
|
20
|
+
'/.well-known/agent-card.json',
|
|
21
|
+
'/.well-known/agent.json',
|
|
22
|
+
];
|
|
23
|
+
for (const path of paths) {
|
|
24
|
+
try {
|
|
25
|
+
const res = await fetch(`${baseUrl}${path}`, {
|
|
26
|
+
signal: AbortSignal.timeout(5000),
|
|
27
|
+
});
|
|
28
|
+
if (res.ok) {
|
|
29
|
+
const card = await res.json();
|
|
30
|
+
return { card, baseUrl };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
// Try next path
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Normalize peer URL to base URL (without /awcp suffix)
|
|
41
|
+
*/
|
|
42
|
+
function normalizeBaseUrl(peerUrl) {
|
|
43
|
+
let baseUrl = peerUrl.replace(/\/+$/, '');
|
|
44
|
+
if (baseUrl.endsWith('/awcp')) {
|
|
45
|
+
baseUrl = baseUrl.slice(0, -5);
|
|
46
|
+
}
|
|
47
|
+
return baseUrl;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Discover all configured peers and fetch their Agent Cards
|
|
51
|
+
*/
|
|
52
|
+
export async function discoverPeers(peerUrls) {
|
|
53
|
+
const peers = [];
|
|
54
|
+
for (const inputUrl of peerUrls) {
|
|
55
|
+
const baseUrl = normalizeBaseUrl(inputUrl);
|
|
56
|
+
const awcpUrl = `${baseUrl}/awcp`;
|
|
57
|
+
try {
|
|
58
|
+
const result = await fetchAgentCard(inputUrl);
|
|
59
|
+
if (result) {
|
|
60
|
+
peers.push({ url: result.baseUrl, awcpUrl, card: result.card });
|
|
61
|
+
console.error(`[AWCP] Discovered peer: ${result.card.name} at ${result.baseUrl}`);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
peers.push({ url: baseUrl, awcpUrl, error: 'Agent Card not found' });
|
|
65
|
+
console.error(`[AWCP] Peer ${baseUrl}: Agent Card not found`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
70
|
+
peers.push({ url: baseUrl, awcpUrl, error: msg });
|
|
71
|
+
console.error(`[AWCP] Peer ${baseUrl}: ${msg}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const summary = generatePeersSummary(peers);
|
|
75
|
+
return { peers, summary };
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Generate a human-readable summary of available peers
|
|
79
|
+
*/
|
|
80
|
+
function generatePeersSummary(peers) {
|
|
81
|
+
const availablePeers = peers.filter(p => p.card);
|
|
82
|
+
if (availablePeers.length === 0) {
|
|
83
|
+
return 'No executor peers available. Configure peers with --peers flag.';
|
|
84
|
+
}
|
|
85
|
+
const lines = [
|
|
86
|
+
`Available Executor Agents (${availablePeers.length}):`,
|
|
87
|
+
'',
|
|
88
|
+
];
|
|
89
|
+
for (const peer of availablePeers) {
|
|
90
|
+
const card = peer.card;
|
|
91
|
+
lines.push(`## ${card.name}`);
|
|
92
|
+
lines.push(`URL: ${peer.url}`);
|
|
93
|
+
if (card.description) {
|
|
94
|
+
lines.push(`Description: ${card.description}`);
|
|
95
|
+
}
|
|
96
|
+
if (card.skills && card.skills.length > 0) {
|
|
97
|
+
lines.push('Skills:');
|
|
98
|
+
for (const skill of card.skills) {
|
|
99
|
+
lines.push(` - ${skill.name}: ${skill.description}`);
|
|
100
|
+
if (skill.examples && skill.examples.length > 0) {
|
|
101
|
+
lines.push(` Examples: ${skill.examples.slice(0, 2).join('; ')}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
lines.push('');
|
|
106
|
+
}
|
|
107
|
+
lines.push('---');
|
|
108
|
+
lines.push('Use the `delegate` tool to delegate workspace tasks to these agents.');
|
|
109
|
+
return lines.join('\n');
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Format peers context for MCP resource
|
|
113
|
+
*/
|
|
114
|
+
export function formatPeersAsResource(context) {
|
|
115
|
+
return context.summary;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=peer-discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"peer-discovery.js","sourceRoot":"","sources":["../src/peer-discovery.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH;;;;;GAKG;AACH,KAAK,UAAU,cAAc,CAAC,OAAe;IAC3C,6DAA6D;IAC7D,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC1C,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAC9B,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;IAED,yBAAyB;IACzB,MAAM,KAAK,GAAG;QACZ,8BAA8B;QAC9B,yBAAyB;KAC1B,CAAC;IAEF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,OAAO,GAAG,IAAI,EAAE,EAAE;gBAC3C,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;aAClC,CAAC,CAAC;YACH,IAAI,GAAG,CAAC,EAAE,EAAE,CAAC;gBACX,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAe,CAAC;gBAC3C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;YAC3B,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,gBAAgB;QAClB,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CAAC,OAAe;IACvC,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC1C,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AW,EAAE,CAAC,CAAC;gBACtD,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAChD,KAAK,CAAC,IAAI,CAAC,iBAAiB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACvE,CAAC;YACH,CAAC;QACH,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,KAAK,CAAC,IAAI,CAAC,sEAAsE,CAAC,CAAC;IAEnF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAqB;IACzD,OAAO,OAAO,CAAC,OAAO,CAAC;AACzB,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* - delegate_cancel: Cancel active delegations
|
|
10
10
|
*/
|
|
11
11
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
12
|
+
import { type PeersContext } from './peer-discovery.js';
|
|
12
13
|
export interface AwcpMcpServerOptions {
|
|
13
14
|
/** URL of the Delegator Daemon (default: http://localhost:3100) */
|
|
14
15
|
daemonUrl?: string;
|
|
@@ -16,6 +17,8 @@ export interface AwcpMcpServerOptions {
|
|
|
16
17
|
timeout?: number;
|
|
17
18
|
/** Default TTL for delegations in seconds (default: 3600) */
|
|
18
19
|
defaultTtl?: number;
|
|
20
|
+
/** Discovered peers context (from --peers flag) */
|
|
21
|
+
peers?: PeersContext;
|
|
19
22
|
}
|
|
20
23
|
/**
|
|
21
24
|
* Create an AWCP MCP Server instance
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAmBpE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,oBAAoB;IACnC,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,oBAAyB,aA+LrE;AA2DD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
12
12
|
import { DelegatorDaemonClient } from '@awcp/sdk/delegator/client';
|
|
13
|
-
import { delegateSchema,
|
|
13
|
+
import { delegateSchema, generateDelegateDescription, } from './tools/delegate.js';
|
|
14
14
|
import { delegateOutputSchema, delegateOutputDescription, } from './tools/delegate-output.js';
|
|
15
15
|
import { delegateCancelSchema, delegateCancelDescription, } from './tools/delegate-cancel.js';
|
|
16
16
|
/**
|
|
@@ -33,6 +33,7 @@ export function createAwcpMcpServer(options = {}) {
|
|
|
33
33
|
const daemonUrl = options.daemonUrl ?? 'http://localhost:3100';
|
|
34
34
|
const timeout = options.timeout ?? 30000;
|
|
35
35
|
const defaultTtl = options.defaultTtl ?? 3600;
|
|
36
|
+
const peers = options.peers;
|
|
36
37
|
const client = new DelegatorDaemonClient(daemonUrl, { timeout });
|
|
37
38
|
const server = new McpServer({
|
|
38
39
|
name: 'awcp',
|
|
@@ -41,7 +42,7 @@ export function createAwcpMcpServer(options = {}) {
|
|
|
41
42
|
// ============================================
|
|
42
43
|
// Tool: delegate
|
|
43
44
|
// ============================================
|
|
44
|
-
server.tool('delegate',
|
|
45
|
+
server.tool('delegate', generateDelegateDescription(peers), delegateSchema.shape, async (params) => {
|
|
45
46
|
const { description, prompt, workspace_dir, peer_url, ttl_seconds, access_mode, background, } = params;
|
|
46
47
|
try {
|
|
47
48
|
const result = await client.delegate({
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,OAAO,EACL,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,OAAO,EACL,cAAc,EACd,2BAA2B,GAE5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,yBAAyB,GAE1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,yBAAyB,GAE1B,MAAM,4BAA4B,CAAC;AAcpC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAgC,EAAE;IACpE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,uBAAuB,CAAC;IA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AAK,EAAE,CAAC;QAC5D,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,eAAe,EAAE,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1D,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YAC1B,KAAK,CAAC,IAAI,CAAC,SAAS,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;SAAM,IAAI,UAAU,CAAC,KAAK,KAAK,WAAW,EAAE,CAAC;QAC5C,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,2BAA2B,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* delegate_cancel tool - Cancel
|
|
3
|
-
*
|
|
4
|
-
* This will terminate the delegation, unmount the remote filesystem,
|
|
5
|
-
* revoke credentials, and clean up resources.
|
|
2
|
+
* delegate_cancel tool - Cancel background delegations
|
|
6
3
|
*/
|
|
7
4
|
import { z } from 'zod';
|
|
8
5
|
export declare const delegateCancelSchema: z.ZodObject<{
|
|
@@ -16,5 +13,5 @@ export declare const delegateCancelSchema: z.ZodObject<{
|
|
|
16
13
|
all?: boolean | undefined;
|
|
17
14
|
}>;
|
|
18
15
|
export type DelegateCancelParams = z.infer<typeof delegateCancelSchema>;
|
|
19
|
-
export declare const delegateCancelDescription
|
|
16
|
+
export declare const delegateCancelDescription: string;
|
|
20
17
|
//# sourceMappingURL=delegate-cancel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate-cancel.d.ts","sourceRoot":"","sources":["../../src/tools/delegate-cancel.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"delegate-cancel.d.ts","sourceRoot":"","sources":["../../src/tools/delegate-cancel.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,oBAAoB;;;;;;;;;EAS/B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,eAAO,MAAM,yBAAyB,QAGrC,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* delegate_cancel tool - Cancel
|
|
3
|
-
*
|
|
4
|
-
* This will terminate the delegation, unmount the remote filesystem,
|
|
5
|
-
* revoke credentials, and clean up resources.
|
|
2
|
+
* delegate_cancel tool - Cancel background delegations
|
|
6
3
|
*/
|
|
7
4
|
import { z } from 'zod';
|
|
5
|
+
import { readFileSync } from 'node:fs';
|
|
6
|
+
import { dirname, join } from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
9
|
export const delegateCancelSchema = z.object({
|
|
9
10
|
delegation_id: z
|
|
10
11
|
.string()
|
|
@@ -13,27 +14,7 @@ export const delegateCancelSchema = z.object({
|
|
|
13
14
|
all: z
|
|
14
15
|
.boolean()
|
|
15
16
|
.optional()
|
|
16
|
-
.describe('Cancel all
|
|
17
|
+
.describe('Cancel all running delegations'),
|
|
17
18
|
});
|
|
18
|
-
export const delegateCancelDescription =
|
|
19
|
-
|
|
20
|
-
## Parameters
|
|
21
|
-
- **delegation_id** (optional): Specific delegation ID to cancel
|
|
22
|
-
- **all** (optional): Cancel all active delegations
|
|
23
|
-
|
|
24
|
-
## Usage
|
|
25
|
-
Cancel a specific delegation:
|
|
26
|
-
\`\`\`
|
|
27
|
-
delegate_cancel(delegation_id: "dlg_abc123")
|
|
28
|
-
\`\`\`
|
|
29
|
-
|
|
30
|
-
Cancel all active delegations:
|
|
31
|
-
\`\`\`
|
|
32
|
-
delegate_cancel(all: true)
|
|
33
|
-
\`\`\`
|
|
34
|
-
|
|
35
|
-
## Notes
|
|
36
|
-
- Cancellation triggers cleanup: unmount, credential revocation, export removal
|
|
37
|
-
- The Executor will receive a cancellation signal
|
|
38
|
-
`;
|
|
19
|
+
export const delegateCancelDescription = readFileSync(join(__dirname, 'delegate-cancel.txt'), 'utf-8');
|
|
39
20
|
//# sourceMappingURL=delegate-cancel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate-cancel.js","sourceRoot":"","sources":["../../src/tools/delegate-cancel.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"delegate-cancel.js","sourceRoot":"","sources":["../../src/tools/delegate-cancel.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,aAAa,EAAE,CAAC;SACb,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,kCAAkC,CAAC;IAC/C,GAAG,EAAE,CAAC;SACH,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CAAC,gCAAgC,CAAC;CAC9C,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,yBAAyB,GAAG,YAAY,CACnD,IAAI,CAAC,SAAS,EAAE,qBAAqB,CAAC,EACtC,OAAO,CACR,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Cancel background delegations.
|
|
2
|
+
|
|
3
|
+
## Parameters
|
|
4
|
+
- **delegation_id** (optional): Specific delegation ID to cancel
|
|
5
|
+
- **all** (optional): Cancel all running delegations
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
Cancel a specific delegation:
|
|
9
|
+
```
|
|
10
|
+
delegate_cancel(delegation_id: "dlg_abc123")
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Cancel all running delegations:
|
|
14
|
+
```
|
|
15
|
+
delegate_cancel(all: true)
|
|
16
|
+
```
|
|
@@ -18,5 +18,5 @@ export declare const delegateOutputSchema: z.ZodObject<{
|
|
|
18
18
|
timeout?: number | undefined;
|
|
19
19
|
}>;
|
|
20
20
|
export type DelegateOutputParams = z.infer<typeof delegateOutputSchema>;
|
|
21
|
-
export declare const delegateOutputDescription
|
|
21
|
+
export declare const delegateOutputDescription: string;
|
|
22
22
|
//# sourceMappingURL=delegate-output.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate-output.d.ts","sourceRoot":"","sources":["../../src/tools/delegate-output.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"delegate-output.d.ts","sourceRoot":"","sources":["../../src/tools/delegate-output.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAc/B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,eAAO,MAAM,yBAAyB,QAGrC,CAAC"}
|
|
@@ -4,10 +4,14 @@
|
|
|
4
4
|
* Use this to check status or get results from a background delegation.
|
|
5
5
|
*/
|
|
6
6
|
import { z } from 'zod';
|
|
7
|
+
import { readFileSync } from 'node:fs';
|
|
8
|
+
import { dirname, join } from 'node:path';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
10
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
11
|
export const delegateOutputSchema = z.object({
|
|
8
12
|
delegation_id: z
|
|
9
13
|
.string()
|
|
10
|
-
.describe('
|
|
14
|
+
.describe('Delegation ID from the background delegation launch'),
|
|
11
15
|
block: z
|
|
12
16
|
.boolean()
|
|
13
17
|
.optional()
|
|
@@ -17,29 +21,7 @@ export const delegateOutputSchema = z.object({
|
|
|
17
21
|
.int()
|
|
18
22
|
.positive()
|
|
19
23
|
.optional()
|
|
20
|
-
.describe('
|
|
24
|
+
.describe('Max seconds to wait (default: 60)'),
|
|
21
25
|
});
|
|
22
|
-
export const delegateOutputDescription =
|
|
23
|
-
|
|
24
|
-
## Parameters
|
|
25
|
-
- **delegation_id** (required): Delegation ID from delegate()
|
|
26
|
-
- **block** (optional): Wait for completion if still running
|
|
27
|
-
- **timeout** (optional): Maximum seconds to wait (default: 60)
|
|
28
|
-
|
|
29
|
-
## Usage
|
|
30
|
-
After launching a background delegation:
|
|
31
|
-
\`\`\`
|
|
32
|
-
delegate(background: true, ...) → "Delegation ID: dlg_abc123..."
|
|
33
|
-
\`\`\`
|
|
34
|
-
|
|
35
|
-
Check or retrieve results:
|
|
36
|
-
\`\`\`
|
|
37
|
-
delegate_output(delegation_id: "dlg_abc123")
|
|
38
|
-
\`\`\`
|
|
39
|
-
|
|
40
|
-
Wait for completion:
|
|
41
|
-
\`\`\`
|
|
42
|
-
delegate_output(delegation_id: "dlg_abc123", block: true, timeout: 120)
|
|
43
|
-
\`\`\`
|
|
44
|
-
`;
|
|
26
|
+
export const delegateOutputDescription = readFileSync(join(__dirname, 'delegate-output.txt'), 'utf-8');
|
|
45
27
|
//# sourceMappingURL=delegate-output.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate-output.js","sourceRoot":"","sources":["../../src/tools/delegate-output.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"delegate-output.js","sourceRoot":"","sources":["../../src/tools/delegate-output.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,aAAa,EAAE,CAAC;SACb,MAAM,EAAE;SACR,QAAQ,CAAC,qDAAqD,CAAC;IAClE,KAAK,EAAE,CAAC;SACL,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CAAC,sCAAsC,CAAC;IACnD,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,QAAQ,CAAC,mCAAmC,CAAC;CACjD,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,yBAAyB,GAAG,YAAY,CACnD,IAAI,CAAC,SAAS,EAAE,qBAAqB,CAAC,EACtC,OAAO,CACR,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Retrieve output from a background delegation.
|
|
2
|
+
|
|
3
|
+
## Parameters
|
|
4
|
+
- **delegation_id** (required): Delegation ID from the background delegation launch
|
|
5
|
+
- **block** (optional): Wait for completion if still running
|
|
6
|
+
- **timeout** (optional): Maximum seconds to wait (default: 60)
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
After launching a background delegation:
|
|
10
|
+
```
|
|
11
|
+
delegate(background: true, ...) → "Delegation ID: dlg_abc123..."
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Check or retrieve results:
|
|
15
|
+
```
|
|
16
|
+
delegate_output(delegation_id: "dlg_abc123")
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Wait for completion:
|
|
20
|
+
```
|
|
21
|
+
delegate_output(delegation_id: "dlg_abc123", block: true, timeout: 120)
|
|
22
|
+
```
|
package/dist/tools/delegate.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Executor agent for collaborative task execution.
|
|
6
6
|
*/
|
|
7
7
|
import { z } from 'zod';
|
|
8
|
+
import type { PeersContext } from '../peer-discovery.js';
|
|
8
9
|
export declare const delegateSchema: z.ZodObject<{
|
|
9
10
|
description: z.ZodString;
|
|
10
11
|
prompt: z.ZodString;
|
|
@@ -31,5 +32,9 @@ export declare const delegateSchema: z.ZodObject<{
|
|
|
31
32
|
background?: boolean | undefined;
|
|
32
33
|
}>;
|
|
33
34
|
export type DelegateParams = z.infer<typeof delegateSchema>;
|
|
34
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Generate delegate tool description with available executors info
|
|
37
|
+
*/
|
|
38
|
+
export declare function generateDelegateDescription(peers?: PeersContext): string;
|
|
39
|
+
export declare const delegateDescription: string;
|
|
35
40
|
//# sourceMappingURL=delegate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../src/tools/delegate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../src/tools/delegate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAKzD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;EA+BzB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,CAAC,EAAE,YAAY,GAAG,MAAM,CA6BxE;AAGD,eAAO,MAAM,mBAAmB,QAAgC,CAAC"}
|
package/dist/tools/delegate.js
CHANGED
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
* Executor agent for collaborative task execution.
|
|
6
6
|
*/
|
|
7
7
|
import { z } from 'zod';
|
|
8
|
+
import { readFileSync } from 'node:fs';
|
|
9
|
+
import { dirname, join } from 'node:path';
|
|
10
|
+
import { fileURLToPath } from 'node:url';
|
|
11
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const DESCRIPTION_TEMPLATE = readFileSync(join(__dirname, 'delegate.txt'), 'utf-8');
|
|
8
13
|
export const delegateSchema = z.object({
|
|
9
14
|
description: z
|
|
10
15
|
.string()
|
|
@@ -35,30 +40,33 @@ export const delegateSchema = z.object({
|
|
|
35
40
|
.describe('If true, returns immediately with delegation_id. ' +
|
|
36
41
|
'If false (default), waits for task completion.'),
|
|
37
42
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
- **
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Generate delegate tool description with available executors info
|
|
45
|
+
*/
|
|
46
|
+
export function generateDelegateDescription(peers) {
|
|
47
|
+
let executorsSection = '';
|
|
48
|
+
// Add available executors section if peers are configured
|
|
49
|
+
if (peers && peers.peers.length > 0) {
|
|
50
|
+
const availablePeers = peers.peers.filter(p => p.card);
|
|
51
|
+
if (availablePeers.length > 0) {
|
|
52
|
+
executorsSection = '## Available Executors';
|
|
53
|
+
for (const peer of availablePeers) {
|
|
54
|
+
const card = peer.card;
|
|
55
|
+
executorsSection += `\n\n### ${card.name}`;
|
|
56
|
+
executorsSection += `\n- **URL**: \`${peer.awcpUrl}\``;
|
|
57
|
+
if (card.description) {
|
|
58
|
+
executorsSection += `\n- **Description**: ${card.description}`;
|
|
59
|
+
}
|
|
60
|
+
if (card.skills && card.skills.length > 0) {
|
|
61
|
+
const skillNames = card.skills.map(s => s.name).join(', ');
|
|
62
|
+
executorsSection += `\n- **Skills**: ${skillNames}`;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// Replace {executors} placeholder with actual content
|
|
68
|
+
return DESCRIPTION_TEMPLATE.replace('{executors}', executorsSection);
|
|
69
|
+
}
|
|
70
|
+
// For backward compatibility - static description without peers
|
|
71
|
+
export const delegateDescription = generateDelegateDescription();
|
|
64
72
|
//# sourceMappingURL=delegate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate.js","sourceRoot":"","sources":["../../src/tools/delegate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"delegate.js","sourceRoot":"","sources":["../../src/tools/delegate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,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CAAC;QAEvD,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9B,gBAAgB,GAAG,wBAAwB,CAAC;YAE5C,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;gBAClC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAK,CAAC;gBACxB,gBAAgB,IAAI,WAAW,IAAI,CAAC,IAAI,EAAE,CAAC;gBAC3C,gBAAgB,IAAI,kBAAkB,IAAI,CAAC,OAAO,IAAI,CAAC;gBAEvD,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;oBACrB,gBAAgB,IAAI,wBAAwB,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjE,CAAC;gBAED,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC1C,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAC3D,gBAAgB,IAAI,mBAAmB,UAAU,EAAE,CAAC;gBACtD,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,sDAAsD;IACtD,OAAO,oBAAoB,CAAC,OAAO,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;AACvE,CAAC;AAED,gEAAgE;AAChE,MAAM,CAAC,MAAM,mBAAmB,GAAG,2BAA2B,EAAE,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Delegate a workspace to a remote Executor for collaborative task execution.
|
|
2
|
+
|
|
3
|
+
## When to use
|
|
4
|
+
|
|
5
|
+
Use delegation when:
|
|
6
|
+
- Task requires a different environment or specialized toolset
|
|
7
|
+
- You want to parallelize work across multiple agents
|
|
8
|
+
- The remote agent has capabilities you lack (e.g., browser, GPU, specific SDKs)
|
|
9
|
+
|
|
10
|
+
Do NOT use when:
|
|
11
|
+
- Task is trivial and can be done locally
|
|
12
|
+
- You need real-time back-and-forth interaction during execution
|
|
13
|
+
|
|
14
|
+
## Background mode
|
|
15
|
+
|
|
16
|
+
**Prefer background=true by default.** This lets you launch multiple delegations in parallel and continue working.
|
|
17
|
+
|
|
18
|
+
Use background=false only when you cannot proceed without the result.
|
|
19
|
+
|
|
20
|
+
## Writing effective prompts
|
|
21
|
+
|
|
22
|
+
Structure your prompt with:
|
|
23
|
+
- **What to do**: Clear, specific goal
|
|
24
|
+
- **Expected outcome**: What success looks like
|
|
25
|
+
- **Context**: Relevant file paths, patterns, constraints
|
|
26
|
+
- **What NOT to do**: Scope boundaries to prevent over-engineering
|
|
27
|
+
|
|
28
|
+
{executors}
|
|
29
|
+
|
|
30
|
+
## Examples
|
|
31
|
+
|
|
32
|
+
### Parallel tasks
|
|
33
|
+
```
|
|
34
|
+
delegate(background: true, description: "Fix linting errors", prompt: "...", workspace_dir: "/project", peer_url: "...")
|
|
35
|
+
delegate(background: true, description: "Add unit tests", prompt: "...", workspace_dir: "/project", peer_url: "...")
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Synchronous (when result needed immediately)
|
|
39
|
+
```
|
|
40
|
+
delegate(background: false, description: "Generate config", prompt: "Create tsconfig.json for...", workspace_dir: "/project", peer_url: "...")
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Read-only analysis
|
|
44
|
+
```
|
|
45
|
+
delegate(description: "Code review", prompt: "Review the code for security issues...", workspace_dir: "/project", peer_url: "...", access_mode: "ro")
|
|
46
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awcp/mcp",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-202601310648",
|
|
4
4
|
"description": "MCP tools for AWCP delegation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,14 +15,17 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
|
-
"build": "tsc",
|
|
18
|
+
"build": "tsc && cp src/tools/*.txt dist/tools/",
|
|
19
19
|
"dev": "tsc --watch",
|
|
20
20
|
"test": "vitest run",
|
|
21
21
|
"test:watch": "vitest"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@awcp/sdk": "0.0.0-dev-
|
|
25
|
-
"@awcp/core": "0.0.0-dev-
|
|
24
|
+
"@awcp/sdk": "0.0.0-dev-202601310648",
|
|
25
|
+
"@awcp/core": "0.0.0-dev-202601310648",
|
|
26
|
+
"@awcp/transport-archive": "0.0.0-dev-202601310648",
|
|
27
|
+
"@awcp/transport-sshfs": "0.0.0-dev-202601310648",
|
|
28
|
+
"@a2a-js/sdk": "^0.3.5",
|
|
26
29
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
27
30
|
"zod": "^3.23.0"
|
|
28
31
|
},
|