@awcp/mcp 0.0.7 → 0.0.8
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/tools/delegate-cancel.txt +14 -5
- package/dist/tools/delegate-output.txt +34 -10
- package/dist/tools/delegate.txt +38 -18
- package/package.json +5 -5
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
Cancel
|
|
1
|
+
Cancel active delegations.
|
|
2
|
+
|
|
3
|
+
## When to use
|
|
4
|
+
|
|
5
|
+
- The delegation is taking longer than expected
|
|
6
|
+
- You no longer need the result (e.g., found an alternative solution)
|
|
7
|
+
- You want to abort and try a different approach
|
|
8
|
+
|
|
9
|
+
Cancellation frees up remote executor resources promptly.
|
|
2
10
|
|
|
3
11
|
## Parameters
|
|
4
12
|
- **delegation_id** (optional): Specific delegation ID to cancel
|
|
5
|
-
- **all** (optional): Cancel all running delegations
|
|
13
|
+
- **all** (optional): Cancel all running delegations for this session
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
6
16
|
|
|
7
|
-
|
|
8
|
-
Cancel a specific delegation:
|
|
17
|
+
### Cancel a specific delegation
|
|
9
18
|
```
|
|
10
19
|
delegate_cancel(delegation_id: "dlg_abc123")
|
|
11
20
|
```
|
|
12
21
|
|
|
13
|
-
Cancel all running delegations
|
|
22
|
+
### Cancel all running delegations
|
|
14
23
|
```
|
|
15
24
|
delegate_cancel(all: true)
|
|
16
25
|
```
|
|
@@ -1,22 +1,46 @@
|
|
|
1
|
-
Retrieve
|
|
1
|
+
Retrieve status or results from a background delegation.
|
|
2
|
+
|
|
3
|
+
This is your primary tool for getting results after launching `delegate(background: true)`.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- **Check progress**: See if a delegation is still running or has completed
|
|
8
|
+
- **Retrieve results**: Get the final output once the task is done
|
|
9
|
+
- **Wait for completion**: Block until the delegation finishes (use with `block: true`)
|
|
2
10
|
|
|
3
11
|
## Parameters
|
|
4
|
-
- **delegation_id** (required):
|
|
5
|
-
- **block** (optional):
|
|
6
|
-
- **timeout** (optional): Maximum seconds to wait (default: 60)
|
|
12
|
+
- **delegation_id** (required): The ID returned from `delegate(background: true)`
|
|
13
|
+
- **block** (optional): If true, waits for the delegation to complete before returning
|
|
14
|
+
- **timeout** (optional): Maximum seconds to wait when blocking (default: 60)
|
|
15
|
+
|
|
16
|
+
## Recommended usage
|
|
17
|
+
|
|
18
|
+
After launching background delegations and completing other work, use `block: true` to wait for results:
|
|
7
19
|
|
|
8
|
-
## Usage
|
|
9
|
-
After launching a background delegation:
|
|
10
20
|
```
|
|
11
|
-
|
|
21
|
+
# Earlier: launched delegation
|
|
22
|
+
delegate(background: true, ...) → "dlg_abc123"
|
|
23
|
+
|
|
24
|
+
# Now: ready for the result
|
|
25
|
+
delegate_output(delegation_id: "dlg_abc123", block: true, timeout: 300)
|
|
12
26
|
```
|
|
13
27
|
|
|
14
|
-
|
|
28
|
+
For long-running tasks, increase the timeout accordingly.
|
|
29
|
+
|
|
30
|
+
## Examples
|
|
31
|
+
|
|
32
|
+
### Wait for result (most common)
|
|
33
|
+
```
|
|
34
|
+
delegate_output(delegation_id: "dlg_abc123", block: true, timeout: 120)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Quick status check (non-blocking)
|
|
15
38
|
```
|
|
16
39
|
delegate_output(delegation_id: "dlg_abc123")
|
|
17
40
|
```
|
|
18
41
|
|
|
19
|
-
|
|
42
|
+
### Collect multiple results
|
|
20
43
|
```
|
|
21
|
-
delegate_output(delegation_id: "
|
|
44
|
+
delegate_output(delegation_id: "dlg_1", block: true)
|
|
45
|
+
delegate_output(delegation_id: "dlg_2", block: true)
|
|
22
46
|
```
|
package/dist/tools/delegate.txt
CHANGED
|
@@ -1,21 +1,36 @@
|
|
|
1
|
-
Delegate a workspace to a remote Executor for
|
|
1
|
+
Delegate a workspace to a remote Executor for task execution.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Delegation enables **parallel execution** — while the Executor works on one task, you can continue with other work or launch more delegations. This dramatically improves throughput compared to doing everything sequentially.
|
|
4
4
|
|
|
5
|
-
|
|
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)
|
|
5
|
+
## Why delegate
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
7
|
+
- **Parallelism**: Run multiple tasks simultaneously instead of one-by-one
|
|
8
|
+
- **Depth**: Executor can focus deeply on one task while you handle others
|
|
9
|
+
- **Specialization**: Remote agents may have different tools, environments, or expertise
|
|
10
|
+
- **Efficiency**: Offload substantial work and stay productive
|
|
11
|
+
|
|
12
|
+
Consider delegating any task that would take significant time — tests, refactoring, code review, implementation of independent features, documentation, etc.
|
|
13
|
+
|
|
14
|
+
## When NOT to delegate
|
|
15
|
+
|
|
16
|
+
- Task requires real-time back-and-forth with the user
|
|
13
17
|
|
|
14
18
|
## Background mode
|
|
15
19
|
|
|
16
|
-
**
|
|
20
|
+
**Always prefer background=true.** This returns immediately with a delegation_id, letting you:
|
|
21
|
+
- Launch multiple delegations in parallel
|
|
22
|
+
- Continue with other work while waiting
|
|
23
|
+
- Retrieve results later with `delegate_output`
|
|
24
|
+
|
|
25
|
+
Use background=false **only** when you have nothing else to do and must wait for this result.
|
|
26
|
+
|
|
27
|
+
## Typical workflow
|
|
28
|
+
|
|
29
|
+
1. Launch delegation with `background: true`
|
|
30
|
+
2. Continue with other independent work (local tasks, more delegations, etc.)
|
|
31
|
+
3. When ready for results, call `delegate_output(delegation_id, block: true, timeout: ...)`
|
|
17
32
|
|
|
18
|
-
|
|
33
|
+
This pattern maximizes parallelism and avoids idle waiting.
|
|
19
34
|
|
|
20
35
|
## Writing effective prompts
|
|
21
36
|
|
|
@@ -29,18 +44,23 @@ Structure your prompt with:
|
|
|
29
44
|
|
|
30
45
|
## Examples
|
|
31
46
|
|
|
32
|
-
###
|
|
47
|
+
### Launch and continue working
|
|
33
48
|
```
|
|
34
|
-
delegate(background: true, description: "
|
|
35
|
-
|
|
49
|
+
delegate(background: true, description: "Add unit tests", ...) → delegation_id: "dlg_abc"
|
|
50
|
+
# ... do other work locally ...
|
|
51
|
+
delegate_output(delegation_id: "dlg_abc", block: true, timeout: 300)
|
|
36
52
|
```
|
|
37
53
|
|
|
38
|
-
###
|
|
54
|
+
### Parallel delegations
|
|
39
55
|
```
|
|
40
|
-
delegate(background:
|
|
56
|
+
delegate(background: true, description: "Fix linting errors", ...) → "dlg_1"
|
|
57
|
+
delegate(background: true, description: "Add unit tests", ...) → "dlg_2"
|
|
58
|
+
# ... do other work ...
|
|
59
|
+
delegate_output(delegation_id: "dlg_1", block: true)
|
|
60
|
+
delegate_output(delegation_id: "dlg_2", block: true)
|
|
41
61
|
```
|
|
42
62
|
|
|
43
|
-
###
|
|
63
|
+
### Synchronous (only when nothing else to do)
|
|
44
64
|
```
|
|
45
|
-
delegate(
|
|
65
|
+
delegate(background: false, description: "Generate config", ...)
|
|
46
66
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awcp/mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "MCP tools for AWCP delegation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -21,10 +21,10 @@
|
|
|
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.
|
|
24
|
+
"@awcp/sdk": "^0.0.8",
|
|
25
|
+
"@awcp/core": "^0.0.8",
|
|
26
|
+
"@awcp/transport-archive": "^0.0.8",
|
|
27
|
+
"@awcp/transport-sshfs": "^0.0.8",
|
|
28
28
|
"@a2a-js/sdk": "^0.3.5",
|
|
29
29
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
30
30
|
"zod": "^3.23.0"
|