@awcp/mcp 0.0.12 → 0.0.13
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 +7 -34
- package/dist/auto-daemon.d.ts.map +1 -1
- package/dist/auto-daemon.js +17 -32
- package/dist/auto-daemon.js.map +1 -1
- package/dist/bin/awcp-mcp.d.ts +0 -5
- package/dist/bin/awcp-mcp.d.ts.map +1 -1
- package/dist/bin/awcp-mcp.js +53 -16
- package/dist/bin/awcp-mcp.js.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +6 -20
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +216 -69
- package/dist/server.js.map +1 -1
- package/dist/tools/delegate-apply-snapshot.d.ts +17 -0
- package/dist/tools/delegate-apply-snapshot.d.ts.map +1 -0
- package/dist/tools/delegate-apply-snapshot.js +34 -0
- package/dist/tools/delegate-apply-snapshot.js.map +1 -0
- package/dist/tools/delegate-discard-snapshot.d.ts +17 -0
- package/dist/tools/delegate-discard-snapshot.d.ts.map +1 -0
- package/dist/tools/delegate-discard-snapshot.js +30 -0
- package/dist/tools/delegate-discard-snapshot.js.map +1 -0
- package/dist/tools/delegate-recover.d.ts +17 -0
- package/dist/tools/delegate-recover.d.ts.map +1 -0
- package/dist/tools/delegate-recover.js +35 -0
- package/dist/tools/delegate-recover.js.map +1 -0
- package/dist/tools/delegate-snapshots.d.ts +14 -0
- package/dist/tools/delegate-snapshots.d.ts.map +1 -0
- package/dist/tools/delegate-snapshots.js +36 -0
- package/dist/tools/delegate-snapshots.js.map +1 -0
- package/dist/tools/delegate.d.ts +35 -10
- package/dist/tools/delegate.d.ts.map +1 -1
- package/dist/tools/delegate.js +25 -13
- package/dist/tools/delegate.js.map +1 -1
- package/dist/tools/delegate.txt +40 -0
- package/package.json +6 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegate-snapshots.d.ts","sourceRoot":"","sources":["../../src/tools/delegate-snapshots.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB;;;;;;EAIlC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E,eAAO,MAAM,4BAA4B,yzBAyBxC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* delegate_snapshots tool - List snapshots for a delegation
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export const delegateSnapshotsSchema = z.object({
|
|
6
|
+
delegation_id: z
|
|
7
|
+
.string()
|
|
8
|
+
.describe('Delegation ID to list snapshots for'),
|
|
9
|
+
});
|
|
10
|
+
export const delegateSnapshotsDescription = `List all snapshots received from a delegation.
|
|
11
|
+
|
|
12
|
+
Returns snapshot metadata including:
|
|
13
|
+
- Snapshot ID, summary, and highlights
|
|
14
|
+
- Status: pending (awaiting decision), applied, or discarded
|
|
15
|
+
- Whether the executor recommends this snapshot
|
|
16
|
+
- File count and size statistics
|
|
17
|
+
|
|
18
|
+
Use this to review available snapshots before applying or discarding them.
|
|
19
|
+
|
|
20
|
+
## When to use
|
|
21
|
+
|
|
22
|
+
- After a delegation completes with snapshot_mode='staged'
|
|
23
|
+
- To check which snapshot was auto-applied (snapshot_mode='auto')
|
|
24
|
+
- To review multiple snapshots and decide which to apply
|
|
25
|
+
|
|
26
|
+
## Example
|
|
27
|
+
|
|
28
|
+
\`\`\`
|
|
29
|
+
delegate_snapshots(delegation_id: "dlg_abc123")
|
|
30
|
+
→ [
|
|
31
|
+
{ id: "snap_1", summary: "Fixed auth bug", status: "pending", recommended: true },
|
|
32
|
+
{ id: "snap_2", summary: "Also updated tests", status: "pending" }
|
|
33
|
+
]
|
|
34
|
+
\`\`\`
|
|
35
|
+
`;
|
|
36
|
+
//# sourceMappingURL=delegate-snapshots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegate-snapshots.js","sourceRoot":"","sources":["../../src/tools/delegate-snapshots.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,aAAa,EAAE,CAAC;SACb,MAAM,EAAE;SACR,QAAQ,CAAC,qCAAqC,CAAC;CACnD,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,4BAA4B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;CAyB3C,CAAC"}
|
package/dist/tools/delegate.d.ts
CHANGED
|
@@ -1,43 +1,68 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* delegate tool - Initiate a workspace delegation to a remote Executor
|
|
3
|
-
*
|
|
4
|
-
* This tool allows an AI agent to delegate a local directory to a remote
|
|
5
|
-
* Executor agent for collaborative task execution.
|
|
6
3
|
*/
|
|
7
4
|
import { z } from 'zod';
|
|
8
5
|
import type { PeersContext } from '../peer-discovery.js';
|
|
9
6
|
export declare const delegateSchema: z.ZodObject<{
|
|
10
7
|
description: z.ZodString;
|
|
11
8
|
prompt: z.ZodString;
|
|
12
|
-
workspace_dir: z.ZodString
|
|
9
|
+
workspace_dir: z.ZodOptional<z.ZodString>;
|
|
10
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
path: z.ZodString;
|
|
13
|
+
mode: z.ZodOptional<z.ZodEnum<["ro", "rw"]>>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
name: string;
|
|
16
|
+
path: string;
|
|
17
|
+
mode?: "ro" | "rw" | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
name: string;
|
|
20
|
+
path: string;
|
|
21
|
+
mode?: "ro" | "rw" | undefined;
|
|
22
|
+
}>, "many">>;
|
|
13
23
|
cwd: z.ZodOptional<z.ZodString>;
|
|
14
24
|
peer_url: z.ZodString;
|
|
15
25
|
ttl_seconds: z.ZodOptional<z.ZodNumber>;
|
|
16
26
|
access_mode: z.ZodOptional<z.ZodEnum<["ro", "rw"]>>;
|
|
27
|
+
snapshot_mode: z.ZodOptional<z.ZodEnum<["auto", "staged", "discard"]>>;
|
|
28
|
+
auth_type: z.ZodOptional<z.ZodEnum<["api_key", "bearer", "oauth2"]>>;
|
|
29
|
+
auth_credential: z.ZodOptional<z.ZodString>;
|
|
17
30
|
background: z.ZodOptional<z.ZodBoolean>;
|
|
18
31
|
}, "strip", z.ZodTypeAny, {
|
|
19
32
|
description: string;
|
|
20
33
|
prompt: string;
|
|
21
|
-
workspace_dir: string;
|
|
22
34
|
peer_url: string;
|
|
35
|
+
workspace_dir?: string | undefined;
|
|
36
|
+
resources?: {
|
|
37
|
+
name: string;
|
|
38
|
+
path: string;
|
|
39
|
+
mode?: "ro" | "rw" | undefined;
|
|
40
|
+
}[] | undefined;
|
|
23
41
|
cwd?: string | undefined;
|
|
24
42
|
ttl_seconds?: number | undefined;
|
|
25
43
|
access_mode?: "ro" | "rw" | undefined;
|
|
44
|
+
snapshot_mode?: "auto" | "staged" | "discard" | undefined;
|
|
45
|
+
auth_type?: "api_key" | "bearer" | "oauth2" | undefined;
|
|
46
|
+
auth_credential?: string | undefined;
|
|
26
47
|
background?: boolean | undefined;
|
|
27
48
|
}, {
|
|
28
49
|
description: string;
|
|
29
50
|
prompt: string;
|
|
30
|
-
workspace_dir: string;
|
|
31
51
|
peer_url: string;
|
|
52
|
+
workspace_dir?: string | undefined;
|
|
53
|
+
resources?: {
|
|
54
|
+
name: string;
|
|
55
|
+
path: string;
|
|
56
|
+
mode?: "ro" | "rw" | undefined;
|
|
57
|
+
}[] | undefined;
|
|
32
58
|
cwd?: string | undefined;
|
|
33
59
|
ttl_seconds?: number | undefined;
|
|
34
60
|
access_mode?: "ro" | "rw" | undefined;
|
|
61
|
+
snapshot_mode?: "auto" | "staged" | "discard" | undefined;
|
|
62
|
+
auth_type?: "api_key" | "bearer" | "oauth2" | undefined;
|
|
63
|
+
auth_credential?: string | undefined;
|
|
35
64
|
background?: boolean | undefined;
|
|
36
65
|
}>;
|
|
37
66
|
export type DelegateParams = z.infer<typeof delegateSchema>;
|
|
38
|
-
/**
|
|
39
|
-
* Generate delegate tool description with available executors info
|
|
40
|
-
*/
|
|
41
67
|
export declare function generateDelegateDescription(peers?: PeersContext): string;
|
|
42
|
-
export declare const delegateDescription: string;
|
|
43
68
|
//# sourceMappingURL=delegate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../src/tools/delegate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../src/tools/delegate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAWzD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDzB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,wBAAgB,2BAA2B,CAAC,KAAK,CAAC,EAAE,YAAY,GAAG,MAAM,CA2BxE"}
|
package/dist/tools/delegate.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* delegate tool - Initiate a workspace delegation to a remote Executor
|
|
3
|
-
*
|
|
4
|
-
* This tool allows an AI agent to delegate a local directory to a remote
|
|
5
|
-
* Executor agent for collaborative task execution.
|
|
6
3
|
*/
|
|
7
4
|
import { z } from 'zod';
|
|
8
5
|
import { readFileSync } from 'node:fs';
|
|
@@ -10,6 +7,11 @@ import { dirname, join } from 'node:path';
|
|
|
10
7
|
import { fileURLToPath } from 'node:url';
|
|
11
8
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
9
|
const DESCRIPTION_TEMPLATE = readFileSync(join(__dirname, 'delegate.txt'), 'utf-8');
|
|
10
|
+
const resourceSchema = z.object({
|
|
11
|
+
name: z.string().describe('Resource name (e.g., "src", "data")'),
|
|
12
|
+
path: z.string().describe('Local directory path'),
|
|
13
|
+
mode: z.enum(['ro', 'rw']).optional().describe('Access mode (default: rw)'),
|
|
14
|
+
});
|
|
13
15
|
export const delegateSchema = z.object({
|
|
14
16
|
description: z
|
|
15
17
|
.string()
|
|
@@ -19,11 +21,16 @@ export const delegateSchema = z.object({
|
|
|
19
21
|
.describe('Full task instructions including goals and constraints'),
|
|
20
22
|
workspace_dir: z
|
|
21
23
|
.string()
|
|
22
|
-
.
|
|
24
|
+
.optional()
|
|
25
|
+
.describe('Local directory path to delegate (for single-resource delegation)'),
|
|
26
|
+
resources: z
|
|
27
|
+
.array(resourceSchema)
|
|
28
|
+
.optional()
|
|
29
|
+
.describe('Multiple resources to delegate (alternative to workspace_dir)'),
|
|
23
30
|
cwd: z
|
|
24
31
|
.string()
|
|
25
32
|
.optional()
|
|
26
|
-
.describe('
|
|
33
|
+
.describe('Working directory for resolving relative paths'),
|
|
27
34
|
peer_url: z
|
|
28
35
|
.string()
|
|
29
36
|
.url()
|
|
@@ -37,19 +44,27 @@ export const delegateSchema = z.object({
|
|
|
37
44
|
access_mode: z
|
|
38
45
|
.enum(['ro', 'rw'])
|
|
39
46
|
.optional()
|
|
40
|
-
.describe('
|
|
47
|
+
.describe('Default access mode: ro (read-only) or rw (read-write, default)'),
|
|
48
|
+
snapshot_mode: z
|
|
49
|
+
.enum(['auto', 'staged', 'discard'])
|
|
50
|
+
.optional()
|
|
51
|
+
.describe('Snapshot handling: auto (apply immediately), staged (require manual apply), discard (ignore)'),
|
|
52
|
+
auth_type: z
|
|
53
|
+
.enum(['api_key', 'bearer', 'oauth2'])
|
|
54
|
+
.optional()
|
|
55
|
+
.describe('Authentication type for the Executor'),
|
|
56
|
+
auth_credential: z
|
|
57
|
+
.string()
|
|
58
|
+
.optional()
|
|
59
|
+
.describe('Authentication credential (API key, bearer token, etc.)'),
|
|
41
60
|
background: z
|
|
42
61
|
.boolean()
|
|
43
62
|
.optional()
|
|
44
63
|
.describe('If true, returns immediately with delegation_id. ' +
|
|
45
64
|
'If false (default), waits for task completion.'),
|
|
46
65
|
});
|
|
47
|
-
/**
|
|
48
|
-
* Generate delegate tool description with available executors info
|
|
49
|
-
*/
|
|
50
66
|
export function generateDelegateDescription(peers) {
|
|
51
67
|
let executorsSection = '';
|
|
52
|
-
// Add available executors section if peers are configured
|
|
53
68
|
if (peers && peers.peers.length > 0) {
|
|
54
69
|
const availablePeers = peers.peers.filter(p => p.card);
|
|
55
70
|
if (availablePeers.length > 0) {
|
|
@@ -68,9 +83,6 @@ export function generateDelegateDescription(peers) {
|
|
|
68
83
|
}
|
|
69
84
|
}
|
|
70
85
|
}
|
|
71
|
-
// Replace {executors} placeholder with actual content
|
|
72
86
|
return DESCRIPTION_TEMPLATE.replace('{executors}', executorsSection);
|
|
73
87
|
}
|
|
74
|
-
// For backward compatibility - static description without peers
|
|
75
|
-
export const delegateDescription = generateDelegateDescription();
|
|
76
88
|
//# sourceMappingURL=delegate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate.js","sourceRoot":"","sources":["../../src/tools/delegate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"delegate.js","sourceRoot":"","sources":["../../src/tools/delegate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OA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,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,OAAO,oBAAoB,CAAC,OAAO,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;AACvE,CAAC"}
|
package/dist/tools/delegate.txt
CHANGED
|
@@ -24,11 +24,42 @@ Consider delegating any task that would take significant time — tests, refacto
|
|
|
24
24
|
|
|
25
25
|
Use background=false **only** when you have nothing else to do and must wait for this result.
|
|
26
26
|
|
|
27
|
+
## Snapshot modes
|
|
28
|
+
|
|
29
|
+
- **auto** (default): Executor's changes are automatically applied to your workspace
|
|
30
|
+
- **staged**: Changes are saved but require manual review and apply via `delegate_snapshots` and `delegate_apply_snapshot`
|
|
31
|
+
- **discard**: Changes are not saved (useful for read-only analysis tasks)
|
|
32
|
+
|
|
33
|
+
Use `staged` when you want to review the executor's work before accepting it.
|
|
34
|
+
|
|
35
|
+
## Multi-resource support
|
|
36
|
+
|
|
37
|
+
You can delegate multiple directories with different access modes:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
delegate(
|
|
41
|
+
resources: [
|
|
42
|
+
{ name: "src", path: "/project/src", mode: "rw" },
|
|
43
|
+
{ name: "data", path: "/project/data", mode: "ro" },
|
|
44
|
+
],
|
|
45
|
+
...
|
|
46
|
+
)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Or use the simpler `workspace_dir` for single-directory delegations.
|
|
50
|
+
|
|
51
|
+
## Authentication
|
|
52
|
+
|
|
53
|
+
If the executor requires authentication, provide:
|
|
54
|
+
- `auth_type`: "api_key", "bearer", or "oauth2"
|
|
55
|
+
- `auth_credential`: The actual token or key
|
|
56
|
+
|
|
27
57
|
## Typical workflow
|
|
28
58
|
|
|
29
59
|
1. Launch delegation with `background: true`
|
|
30
60
|
2. Continue with other independent work (local tasks, more delegations, etc.)
|
|
31
61
|
3. When ready for results, call `delegate_output(delegation_id, block: true, timeout: ...)`
|
|
62
|
+
4. If using `snapshot_mode: "staged"`, review with `delegate_snapshots` then apply or discard
|
|
32
63
|
|
|
33
64
|
This pattern maximizes parallelism and avoids idle waiting.
|
|
34
65
|
|
|
@@ -60,6 +91,15 @@ delegate_output(delegation_id: "dlg_1", block: true)
|
|
|
60
91
|
delegate_output(delegation_id: "dlg_2", block: true)
|
|
61
92
|
```
|
|
62
93
|
|
|
94
|
+
### Staged snapshot workflow
|
|
95
|
+
```
|
|
96
|
+
delegate(background: true, snapshot_mode: "staged", description: "Refactor auth", ...) → "dlg_abc"
|
|
97
|
+
# ... wait for completion ...
|
|
98
|
+
delegate_snapshots(delegation_id: "dlg_abc")
|
|
99
|
+
# Review the snapshots, then:
|
|
100
|
+
delegate_apply_snapshot(delegation_id: "dlg_abc", snapshot_id: "snap_1")
|
|
101
|
+
```
|
|
102
|
+
|
|
63
103
|
### Synchronous (only when nothing else to do)
|
|
64
104
|
```
|
|
65
105
|
delegate(background: false, description: "Generate config", ...)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awcp/mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "MCP tools for AWCP delegation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"test:watch": "vitest"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@awcp/sdk": "^0.0.
|
|
25
|
-
"@awcp/core": "^0.0.
|
|
26
|
-
"@awcp/transport-archive": "^0.0.
|
|
27
|
-
"@awcp/transport-sshfs": "^0.0.
|
|
28
|
-
"@awcp/transport-git": "^0.0.
|
|
24
|
+
"@awcp/sdk": "^0.0.13",
|
|
25
|
+
"@awcp/core": "^0.0.13",
|
|
26
|
+
"@awcp/transport-archive": "^0.0.13",
|
|
27
|
+
"@awcp/transport-sshfs": "^0.0.13",
|
|
28
|
+
"@awcp/transport-git": "^0.0.13",
|
|
29
29
|
"@a2a-js/sdk": "^0.3.5",
|
|
30
30
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
31
31
|
"zod": "^3.23.0"
|